Answer to day2 homework, question 2.
This query uses generate_series instead of a temp table.