AnalystPath

Poll Participation Rate

SQLEasyJunior level~15 min

Problem

A community app runs polls. `Resident` lists everyone who could vote, and `Ballot` records which residents voted in which poll.

`Resident`:
- `resident_id` (int), `resident_name` (varchar)

`Ballot`:
- `poll_id` (int), `resident_id` (int) — together unique

For each poll, report what share of all residents voted in it, as a value out of 100 rounded to **two decimals**. Order by `participation` descending; break ties by `poll_id` ascending.

Tables

Example rows — the live problem includes the full dataset.

Resident
resident_idresident_name
6Noor
2Bram
7Kiana
Ballot
poll_idresident_id
3156
3092
3082

Expected output

Your answer should return 5 rows with the columns poll_id, participation.

Starter code (SQL)

SELECT *
FROM Resident;

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