A good ORM will mostly get out of the way and let you write something like
return Cars
.query()
.select(avg('price'))
.where( { brand: "BMW" })
.groupBy('year')
.orderBy('year')