AnalystPath

Genres Whose Tracks Echo the Genre Initial

SQLMediumMid level~15 min

Problem

A streaming catalog stores tracks grouped by genre. Find every genre that contains at least 3 tracks AND has at least one track whose title starts with the same letter as the genre name. For each such genre, list all of its track titles joined into a single comma-separated string in alphabetical order, and count how many of its tracks start with the genre's initial letter. Return genre, tracklist and initial_match_count, ordered by initial_match_count descending, then genre.

Tables

Example rows — the live problem includes the full dataset.

catalog
genretrack
Nu DiscoNeon Nights
Nu DiscoNova Pulse
Nu DiscoBassline Drift

Expected output

Your answer should return 3 rows with the columns genre, tracklist, initial_match_count.

Starter code (SQL)

SELECT *
FROM catalog;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions