Last Updated: May 10, 2026
For this exercise, we will work with below data:
Write a query that returns the title and duration_seconds of every track in the tracks table.
From the artists table, return each artist's name aliased as artist_name and country aliased as country_code.
Write a query against the tracks table that returns the title and a computed column duration_minutes showing duration in minutes as a decimal (use 60.0 to avoid integer division).
Return every column from the albums table.
From the artists table, return each artist's name and a computed column display_label that combines the name and country in the format "Name (CC)". Show 'Unknown' when country is NULL.
From the tracks table, return track_id, title, and a computed column catalog_code equal to album_id * 1000 + track_number. Order by catalog_code ascending.
From the tracks table, return the title and a computed column duration_text that converts duration_seconds to a string by concatenating it with the literal ' seconds' (for example, '237 seconds').
From the tracks table, return title, duration_seconds, integer minutes (duration_seconds / 60 aliased as minutes_int), and decimal minutes rounded to 2 decimal places (duration_seconds / 60.0 aliased as minutes_decimal). Order by duration_seconds ascending.