Wonderful, @name! You have passed through the Hall of Numbers and learned to look at data like a true steward of the Library - from a bird's eye view. Here is your scroll of knowledge:
HAVING COUNT(*) > 3).The clauses must always appear in this order:
1SELECT column, COUNT(*)
2FROM table
3WHERE row_condition
4GROUP BY column
5HAVING aggregate_condition
6ORDER BY COUNT(*) DESC;1SELECT kategoria_id, COUNT(*), AVG(cena)
2FROM ksiazki
3WHERE dostepna = 1
4GROUP BY kategoria_id
5HAVING COUNT(*) > 5
6ORDER BY AVG(cena) DESC;"For available books, show the categories with more than 5 titles, give their count and average price, and sort the result from the most expensive."
In the next location you will learn to connect shelves - you will meet JOINs, which let you combine books with their authors and categories into one coherent catalog. The abacus is set aside - time for bridges between tables!