What is group by 1 doing
AS a means your call the result table of subquery is ‘a’
a.sale_price means you access to a’s (sale_price column)
and avg() is average of it.
AS is Alias clause to set a fake name for an query for you to access it later(like you do with avg clause)
select column_1, column_2, column_3,…
from…
instead you type group by column_1, or column_2,…
you can use
group by 1(means column_1) or 2(for column_2),…
multi group is available to, group by 1,2,3…