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

Popular categories

Callimachus wants to see only the crowded shelves. Group the books by category and keep only the groups that have more than 3 books.

Task

Write a query that selects kategoria_id and COUNT(*) from the ksiazki table, groups by kategoria_id, and shows only groups with a book count greater than 3 (HAVING).