Last Updated: May 12, 2026
For this exercise, we will work with below data:
Generate the integers 1 through 10 using a recursive CTE. Return one row per integer in column n.
Find all sub-genres under Electronic (genre_id 2), including Electronic itself. Return only the name column ordered by genre_id.
Generate every date from 2024-03-01 to 2024-03-04 using a recursive CTE, and show the number of streams on each date. Return columns stream_date and stream_count, ordered by stream_date.
For every genre, return its name and the name of its top-level (root) ancestor. A root genre is its own root. Order by genre_id.