COUNT and GROUP BY
One row per author, with how many books that author has in the table.
The numbers stay in this browser tab. Nothing you type is uploaded. Ads on this site are served by Google and may use cookies. Privacy policy.
SELECT author, COUNT(*) AS books FROM books GROUP BY author;
01
How this number is made
One row per author, with how many books that author has in the table. The names books, authors, title, year and id are examples. Point them at your own tables. This page does not connect to a database.
02
Questions
Which SQL dialect is this?
The statements here are ordinary SQL that PostgreSQL, SQLite and MySQL all accept in this simple form. Quoting rules differ once names have spaces.
03