GROUP BY multiple fields
GROUP BY becomes more powerful when used across multiple fields or combined with ORDER BY and LIMIT.
Perhaps you're interested in learning about budget changes throughout the years in individual countries. You'll use grouping in this exercise to look at the maximum budget for each country in each year there is data available.
Latihan ini merupakan bagian dari kursus
Intermediate SQL
Instruksi latihan
- Select the
release_year,country, and the maximumbudgetaliased asmax_budgetfor each year and each country; sort your results byrelease_yearandcountry.
Latihan interaktif langsung praktik
Cobalah latihan ini dengan melengkapi kode contoh ini.
-- Find the release_year, country, and max_budget, then group and order by release_year and country
___