0% found this document useful (0 votes)
41 views5 pages

Data Dictionary - Chinook

The Chinook database is a sample relational database designed for teaching database management and SQL queries, modeling a digital media store with tables for albums, artists, customers, invoices, and more. Each table includes primary keys for unique identification and foreign keys to establish relationships between tables. The document details the structure and constraints of various tables, including Albums, Artists, Customers, Invoices, and others.

Uploaded by

tessamuel91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Data Dictionary - Chinook

The Chinook database is a sample relational database designed for teaching database management and SQL queries, modeling a digital media store with tables for albums, artists, customers, invoices, and more. Each table includes primary keys for unique identification and foreign keys to establish relationships between tables. The document details the structure and constraints of various tables, including Albums, Artists, Customers, Invoices, and others.

Uploaded by

tessamuel91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Chinook | Data dictionary

Background
The Chinook database is a sample database used for teaching and practising database management
concepts and SQL queries. It models a digital media store, containing tables related to music albums,
artists, customers, invoices, and more.

Data model
The Chinook database follows a relational data model, with structured tables representing various
entities related to a digital music store, as seen in Figure 1. Here are some key characteristics and
observations about the data model of the Chinook database:

● Tables: The database is organised into multiple tables, each representing a specific entity or
concept, such as albums, artists, customers, invoices, and tracks. This conforms to the
principles of a relational data model, where data is stored in structured tables.

● Primary keys: Each table typically has a primary key column (e.g., AlbumId, ArtistId, CustomerId)
that uniquely identifies each record within that table. Primary keys are used to establish
relationships between tables.

● Foreign keys: Relationships between tables are established using foreign key columns (e.g.,
ArtistId in the Albums table), which reference the primary key columns in related tables. These
foreign keys create associations between records in different tables, allowing for data retrieval
and analysis across tables.

The data model, including the column names, data types, feature descriptions, and their constraints, is
included in Table 1.

Figure 1: The ERD for the Chinook database.


Table 1: The data model for the Chinook database.

Albums table

This table stores information about music albums, including their titles and associated artists.

Column name Data type Feature description Constraints

AlbumId INT Unique identifier for each album. Primary key

Title VARCHAR(160) The title of the album. NOT NULL

Identifier linking the album to a specific Foreign key


ArtistId INT
artist. (Artists)

Artists table

This table contains details about music artists or performers.

Column name Data type Feature description Constraints

ArtistId INT Unique identifier for each artist. Primary key

Name VARCHAR(120) The name of the artist. NOT NULL

Customers table

This table stores information about customers who purchase music from the store.

Column name Data type Feature description Constraints

CustomerId INT Unique identifier for each customer. Primary key

VARCHAR(40)
FirstName The customer's first name. NOT NULL

LastName VARCHAR(20) The customer's last name. NOT NULL

The name of the customer's company


Company VARCHAR(80)
(if applicable).

Address VARCHAR(70) The customer's street address.

City VARCHAR(40) The city where the customer is located.

The state or region where the customer


State VARCHAR(40)
is located.
The country where the customer is
Country VARCHAR(40)
located.

The postal or ZIP code associated with


PostalCode VARCHAR(10)
the customer's address.

Phone VARCHAR(24) The customer's contact phone number.

The facsimile (fax) number for the


Fax VARCHAR(24)
customer.

Email VARCHAR(60) The customer's email address.

Identifier linking the customer to a Foreign key


SupportRepId INT
support representative. (Employees)

Invoices table

This table contains records of customer invoices, including details about purchases made.

Column name Data type Feature description Constraints

InvoiceId INT Unique identifier for each invoice. Primary key

Identifier linking the invoice to a Foreign key


CustomerId INT
specific customer. (Customers)

InvoiceDate DATETIME The date when the invoice was issued. NOT NULL

BillingAddress VARCHAR(70) The billing address for the invoice.

BillingCity VARCHAR(40) The billing city for the invoice.

The billing state or region for the


BillingState VARCHAR(40)
invoice.

BillingCountry VARCHAR(40) The billing country for the invoice.

The billing postal or ZIP code for the


BillingPostalCode VARCHAR(10)
invoice.

Total NUMERIC(10, 2) The total amount of the invoice.

InvoiceItems table

This table stores details about individual items (tracks) within each invoice.
Column name Data type Feature description Constraints

InvoiceLineId INT Unique identifier for each invoice item. Primary key

Identifier linking the invoice item to a Foreign key


InvoiceId INT
specific invoice. (Invoices)

Identifier linking the invoice item to a Foreign key


TrackId INT
specific music track. (Tracks)

The unit price of the track at the time


UnitPrice NUMERIC(10, 2) NOT NULL
of the purchase.

Quantity INT The quantity of the track purchased. NOT NULL

MediaTypes table

This table contains information about different media types used for music tracks.

Column name Data type Feature description Constraints

MediaTypeId INT Unique identifier for each media type. Primary key

Name VARCHAR(120) The name of the media type. NOT NULL

Tracks table

This table stores information about individual music tracks, including their titles, associated albums,
media types, genres, composers, durations, sizes, and prices.

Column name Data type Feature description Constraints

TrackId INT Unique identifier for each track. Primary key

Name VARCHAR(200) The name of the track. NOT NULL

Identifier linking the track to a specific Foreign key


AlbumId INT
album. (Albums)

Identifier linking the track to a specific Foreign key


MediaTypeId INT
media type. (MediaTypes)

Identifier linking the track to a specific Foreign key


GenreId INT
genre. (Genres)

The composer or songwriter of the


Composer VARCHAR(220)
track.

Milliseconds INT The duration of the track in


milliseconds.

Bytes INT The size of the track in bytes.

UnitPrice NUMERIC(10, 2) The price of the track. NOT NULL

Playlists table

This table contains records of playlists created by users, storing the names of the playlists for
organising and grouping music tracks.

Column name Data type Feature description Constraints

PlaylistId INT Unique identifier for each playlist. Primary key

Name VARCHAR(120) The name of the playlist. NOT NULL

Playlist_track table

This table serves as a junction between playlists and tracks, storing associations between playlists
and the specific tracks they contain.

Column name Data type Feature description Constraints

Identifier linking the playlist to a Foreign key


PlaylistId INT
specific playlist. (Playlists)

Identifier linking the playlist to a Foreign key


TrackId INT
specific track. (Tracks)

Genres table

This table holds information about music genres, providing a list of distinct musical categories for
categorising and organising tracks based on their genre.

Column name Data type Feature description Constraints

GenreId INT Unique identifier for each genre. Primary key

Name VARCHAR(120) The name of the genre. NOT NULL

You might also like