Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Window functions and GROUP BY
Summary and Review


Okay. The best way to correctly create queries with window functions and GROUP BY is as follows: first, create the query with GROUP BY, but without window functions. Run the query (in SQL Server or in your head). Now, the columns you see in the result are the only columns you can use in your window functions.


Group the auctions by the Country. Show the country, its minimal number of participants in an auction and the average minimal number of participants across all countries. Name the last columns MinParticipants and AvgMinParticipants.

Stuck? Here's a hint!


AVG(MIN(Participants)) OVER()

as your window function.