Coding task · SQL and MySQL course · Module 6: Aggregation and grouping

Expensive categories

Show only the categories where the average book price exceeds 50. Filter the groups with the HAVING clause.

Task

Write a query that selects kategoria_id and AVG(cena) from the ksiazki table, groups by kategoria_id, and keeps only the groups where AVG(cena) is greater than 50.