AnalystPath

Most-Voted Book of the Month

SQLMediumMid level~15 min

Problem

Table: `Book`

```text
+--------+---------+
| Column | Type |
+--------+---------+
| book_id| int |
| title | varchar |
+--------+---------+
book_id is the primary key.
```

Table: `Ballot`

```text
+----------+--------+
| Column | Type |
+----------+--------+
| ballot_id| int |
| book_id | int |
+----------+--------+
ballot_id is the primary key; each row is one member's vote for a book.
```

Report the `title` of the book that received the most votes. Exactly one book wins.

Tables

Example rows — the live problem includes the full dataset.

Book
book_idtitle
1Tidewrack
2Glasswing
3Saltmarch
Ballot
ballot_idbook_id
102
112
121

Expected output

Your answer should return 1 row with the columns title.

Starter code (SQL)

SELECT *
FROM Book;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions