Last Updated: May 12, 2026
For this exercise, we will work with below data:
Using CROSS JOIN, produce every combination of artist (artist name) and genre (genre name). Order by artist, then genre.
Using CROSS JOIN, list every artist paired with every distinct user country from users. Show artist and country. Order by artist, then country.
Using CROSS JOIN, build a grid of every (user, genre) pair and the user's stream count in that genre. Include zero-count cells. Show username, genre, streams_in_genre. Order by username, then genre.
Build a date-spine query that shows, for each day from 2024-03-01 to 2024-03-04, the cumulative count of streams up to and including that day. Use generate_series plus CROSS JOIN with streams, then filter in the ON or WHERE. Show day and cumulative_streams. Order by day.