Last Updated: May 12, 2026
For this exercise, we will work with below data:
Write a query that returns the countries that appear in both the users.country column and the artists.country column. Exclude NULL countries.
Write a query that returns track_id values present in the tracks catalog but missing from playlist_tracks
Write a query using INTERSECT that returns user_id values for users who are currently on a premium plan (plan = 'premium' and end_date IS NULL) AND have created at least one public playlist.
Write a query that returns the country values that have a users row but no matching country value in the streams table.
Write a query using EXCEPT that returns the (user_id, artist_id) pairs from artist_follows where the user has NOT streamed any track by that artist. Tracks belong to albums which belong to artists.