AnalystPath

Solar Installer Working Percentage (2021)

SQLHardSenior level~15 min

Problem

Using the same solar dataset (`Installers`, `Requests`, `Bookings`), report, for **each month of 2021** (1..12), the percentage of active installers who actually worked that month.

- An installer is **active** in month m if onboarded on or before the end of month m (prior-year joiners count in every month).
- An installer **worked** in month m if they have a booking whose request was made in that month of 2021.
- `worked_pct` = round(distinct working installers * 100 / active installers, 2); report 0 when there are no active installers.

Every month 1..12 appears. Rows may be in any order.

Tables

Example rows — the live problem includes the full dataset.

Installers
installer_idonboarded_on
102020-12-10
82021-01-13
52021-02-16
Requests
request_idhousehold_idrequested_on
6752020-12-09
1542021-02-09
10632021-03-04
Bookings
request_idinstaller_idpanel_countjob_minutes
10106338
13107396
7810028

Expected output

Your answer should return 12 rows with the columns month, worked_pct.

Starter code (SQL)

SELECT *
FROM Installers;

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