Creators With Year-Over-Year Growth
Problem
A video platform pays creators per upload. The `Upload` table stores one row per paid upload with the date it ran and the `payout` it earned.
For each creator, consider the calendar years from the year of their first upload to the year of their last upload, inclusive. Sum the payouts within each of those years. If a creator had no uploads in some year inside that range, that year's total counts as 0.
Write a query that returns the `creator_id` of every creator whose yearly total strictly increased every year across that full range (each year strictly greater than the previous year). A creator who uploaded in only a single year trivially qualifies.
Return the result in any order. The only column is `creator_id`.
Tables
Example rows — the live problem includes the full dataset.
| upload_id | creator_id | run_date | payout |
|---|---|---|---|
| 1 | 1 | 2019-07-01 | 1100 |
| 2 | 1 | 2019-11-01 | 1200 |
| 3 | 1 | 2020-05-26 | 3000 |
Expected output
Your answer should return 1 row with the columns creator_id.
Starter code (SQL)
SELECT *
FROM Upload;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