Your question is SQL Join and Aggregation. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Cotality's Knowledge Library stores authors and their published books in separate tables. Write a PostgreSQL query that reports how many books each author has written.
| Column | Type | Description |
|---|---|---|
| author_idPK | INTEGER | Unique author identifier |
| author_name | VARCHAR(100) | Author's display name |
| Column | Type | Description |
|---|---|---|
| book_idPK | INTEGER | Unique book identifier |
| author_id | INTEGER | Reference to authors.author_id; NULL indicates no assigned author |
| book_title | VARCHAR(200) | Title of the book |