Coding task · SQL and MySQL course · Module 11: Capstone project

Categories with many books

Combine GROUP BY with HAVING to find groups meeting a count condition.

Task

Write a query that groups the rows of the ksiazki table by kategoria_id and shows kategoria_id and the number of books as liczba, but ONLY for categories with more than 5 books. Use GROUP BY and HAVING.