Example schema · SQLite · 11 tables · 11 relationships

Chinook database ER diagram

The digital media store sample — artists, albums, tracks, playlists and invoices — rendered straight from the official schema file.

SQL input — CREATE TABLE · DDL · dumpsqlite
sqliteSample: · · · · ·
Diagram11 tables · 11 foreign keys
Chinook ER diagram — 11 tables, 11 relationshipsON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONON DELETE NO ACTIONAlbumTABLEAlbumIdPKNNintegerTitleNNtext(160)ArtistIdFKNNintegerArtistTABLEArtistIdPKNNintegerNametext(120)CustomerTABLECustomer…PKNNinteg…FirstNameNNtext(40)LastNameNNtext(20)Companytext(80)Addresstext(70)Citytext(40)Statetext(40)Countrytext(40)+ 5 more columnsEmployeeTABLEEmployee…PKNNinteg…LastNameNNtext(20)FirstNameNNtext(20)Titletext(30)ReportsToFKintegerBirthDatedatetimeHireDatedatetimeAddresstext(70)+ 7 more columnsGenreTABLEGenreIdPKNNintegerNametext(120)InvoiceTABLEInvoiceIdPKNNintegerCustomer…FKNNinteg…InvoiceDateNNdatetimeBillingAddresstext(70)BillingCitytext(40)BillingStatetext(40)BillingCountrytext(40)BillingPostalC…text…+ 1 more columnsInvoiceLineTABLEInvoiceLin…PKNNint…InvoiceIdFKNNintegerTrackIdFKNNintegerUnitPriceNNreal(10, 2)QuantityNNintegerMediaTypeTABLEMediaTyp…PKNNint…Nametext(120)PlaylistTABLEPlaylist…PKNNinteg…Nametext(120)PlaylistTrackTABLEPlaylis…PKFKNNint…TrackIdPKFKNNintegerTrackTABLETrackIdPKNNintegerNameNNtext(200)AlbumIdFKintegerMediaTyp…FKNNint…GenreIdFKintegerComposertext(220)MillisecondsNNintegerBytesinteger+ 1 more columns
About the schema

What you're looking at

Chinook models an iTunes-style digital music store: artists release albums, albums carry tracks, customers buy them through invoices, and playlists mix tracks across albums. It packs the classic shapes into just 11 tables — two many-to-many junctions (PlaylistTrack and InvoiceLine), a self-referencing Employee table for the support-rep hierarchy, and the bracket-quoted SQLite dialect this page renders in.

Nothing above is hand-drawn — the diagram is generated from the official schema file, the same SQL you would paste into the SQL to ER diagram converter.

Working in SQLite? The SQLite to ER diagram converter takes any SQLite DDL — schema dump files, hand-written DDL, or a single CREATE TABLE.

Credits

Where the schema comes from

  • Source: lerocha/chinook-database
  • License: MIT
  • The schema belongs to its original authors; the diagram above was generated by erd.yizuolab.com.
FAQ

Questions, answered

What is the Chinook database?

Chinook is an open-sample database that simulates a digital music store — a well-known replacement for the old Northwind sample, used across SQLite, PostgreSQL and SQL Server tutorials. It ships in several dialects; this page renders the SQLite one.

Is this the full Chinook schema?

Yes — all 11 tables: Album, Artist, Customer, Employee, Genre, Invoice, InvoiceLine, MediaType, Playlist, PlaylistTrack and Track. The sample data (thousands of INSERT rows) is not shown; the diagram is about structure.

Can I paste my own SQL instead?

Yes — this page is a live converter with a locked dialect. Switch to the full SQL to ER diagram converter to paste your own DDL, auto-detect the dialect, and export SVG, PNG or a Mermaid text block.

What license is the Chinook schema under?

MIT. The schema belongs to its original authors (github.com/lerocha/chinook-database); the diagram above was simply generated from their file.

More examples

Other real schemas