Skip to main content
Shivateja Buildsshivatejabuilds.com
Data & BI/SQL Case Study · Featured

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.

Schematic · Relational Music Store ERDConceptual Diagram
CUSTOMERPK customer_idcountry · cityINVOICEPK invoice_idFK customer_idINVOICE_LINEFK invoice_idFK track_idARTISTartist_id · nameALBUMFK artist_idTRACK · GENREFK album_id

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, and Genre before 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.