Music Store SQL Analysis
Relational database investigation of a digital music store using structured SQL queries, joins, aggregations, and CTEs to answer commercial and catalog questions.
Overview
The Music Store SQL Analysis explores a normalized multi-table retail database—spanning customers, invoices, invoice line items, tracks, albums, artists, and genres—to answer commercial, catalog, and regional questions directly inside SQL.
Missing Details Notice: The exact SQL engine/dialect, query result figures, and exported schema screenshots are withheld until verified details are provided.
Problem & Objective
Normalized transactional schemas separate customer identity, billing records, and product hierarchy across many linked tables. The objective of this project was to write clear, maintainable SQL queries capable of answering practical business questions directly at the database layer without exporting intermediate spreadsheets.
Methodology & Technical Approach
- Schema Mapping: Tracing primary and foreign key paths connecting
Customer,Invoice,InvoiceLine,Track,Album,Artist, andGenrebefore writing analytical queries. - Multi-Table Joins & Aggregations: Combining invoice totals with catalog metadata to evaluate spending distribution by geography, artist, and genre.
- CTEs & Window Logic: Breaking multi-step analytical questions into readable Common Table Expressions (CTEs) and ranking functions so top performers and segmented cohorts remain easy to audit.
Observations & Learnings
- Mapping key cardinalities before joining invoice line items prevents double-counting totals across multi-join queries.
- Structuring complex queries with CTEs rather than deeply nested subqueries makes business logic substantially easier to verify and extend.
- Confirmed SQL dialect notes, sample query excerpts, and verified output figures will be added once supplied.