-
Notifications
You must be signed in to change notification settings - Fork 2
Sample chinook database 2.0.1
lastlink edited this page Sep 17, 2022
·
4 revisions
flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
erDiagram
artists {
INTEGER ArtistId
NVARCHAR Name
}
employees {
INTEGER EmployeeId PK "'Employee Id' NULL"
NVARCHAR LastName PK "alias'Last Name' NULL"
NVARCHAR20 FirstName
NVARCHAR Title
INTEGER ReportsTo
DATETIME BirthDate
DATETIME HireDate
NVARCHAR Address
NVARCHAR City
NVARCHAR State
NVARCHAR Country
NVARCHAR PostalCode
NVARCHAR Phone
NVARCHAR Fax
NVARCHAR Email
}
genres {
INTEGER GenreId
NVARCHAR Name
}
media_types {
INTEGER MediaTypeId
NVARCHAR Name
}
playlists {
INTEGER PlaylistId
NVARCHAR Name
}
albums {
INTEGER AlbumId
NVARCHAR Title
INTEGER ArtistId
}
customers {
INTEGER CustomerId
NVARCHAR FirstName
NVARCHAR LastName
NVARCHAR Company
NVARCHAR Address
NVARCHAR City
NVARCHAR State
NVARCHAR Country
NVARCHAR PostalCode
NVARCHAR Phone
NVARCHAR Fax
NVARCHAR Email
INTEGER SupportRepId
}
invoices {
INTEGER InvoiceId
INTEGER CustomerId
DATETIME InvoiceDate
NVARCHAR BillingAddress
NVARCHAR BillingCity
NVARCHAR BillingState
NVARCHAR BillingCountry
NVARCHAR BillingPostalCode
NUMERIC Total
}
tracks {
INTEGER TrackId
NVARCHAR Name
INTEGER AlbumId
INTEGER MediaTypeId
INTEGER GenreId
NVARCHAR Composer
INTEGER Milliseconds
INTEGER Bytes
NUMERIC UnitPrice
}
invoice_items {
INTEGER InvoiceLineId
INTEGER InvoiceId
INTEGER TrackId
NUMERIC UnitPrice
INTEGER Quantity
}
playlist_track {
INTEGER PlaylistId
INTEGER TrackId
}
artists ||--o{ albums : "foreign key"
employees ||--o{ customers : "foreign key"
employees ||--o{ employees : "foreign key"
genres ||--o{ tracks : "foreign key"
media_types ||--o{ tracks : "foreign key"
playlists ||--o{ playlist_track : "foreign key"
albums ||--o{ tracks : "foreign key"
customers ||--o{ invoices : "foreign key"
invoices ||--o{ invoice_items : "foreign key"
tracks ||--o{ invoice_items : "foreign key"
tracks ||--o{ playlist_track : "foreign key"