wiki:ddl

Version 4 (modified by 221046, 8 hours ago) ( diff )

--

Track ( track_id, name, album_id* (Album), media_type_id* (MediaType), genre_id* (Genre), composer, milliseconds, bytes )

Album ( album_id, title, artist_id* (Artist) )

Artist ( artist_id, name )

Genre ( genre_id, name )

MediaType ( media_type_id, name )

Price ( price_id, value, date, track_id* (Track) )

InvoiceLine ( invoice_line_id, invoice_id* (Invoice), track_id* (Track), quantity )

Invoice ( invoice_id, customer_id* (Customer), invoice_date, billing_address, billing_city, billing_state, billing_country, billing_postal_code, total )

Customer ( customer_id, first_name, last_name, company, support_rep_id* (Employee), personal_info_id* (AddressInfo), contact_id* (Contact) )

Employee ( employee_id, first_name, last_name, title, reports_to* (Employee), birth_date, hire_date, personal_info_id* (AddressInfo), contact_id* (Contact) )

AddressInfo ( address_info_id, address, city, state, country, postal_code )

Contact ( contact_id, phone, fax, email )

Playlist ( playlist_id, name )

PlaylistTrack ( playlist_track_id, playlist_id* (Playlist), track_id* (Track) )

Track

  • track_id (PK)
  • name (NOT NULL)
  • album_id* (FK → Album)
  • media_type_id* (FK → MediaType)
  • genre_id* (FK → Genre)
  • composer
  • milliseconds (NOT NULL)
  • bytes (NOT NULL)

Album

  • album_id (PK)
  • title (NOT NULL)
  • artist_id* (FK → Artist)

Artist

  • artist_id (PK)
  • name (NOT NULL)

Genre

  • genre_id (PK)
  • name (NOT NULL)

MediaType

  • media_type_id (PK)
  • name (NOT NULL)

Price

  • price_id (PK)
  • value (NOT NULL)
  • date (NOT NULL)
  • track_id* (FK → Track)

InvoiceLine

  • invoice_line_id (PK)
  • invoice_id* (FK → Invoice)
  • track_id* (FK → Track)
  • quantity (NOT NULL)

Invoice

  • invoice_id (PK)
  • customer_id* (FK → Customer)
  • invoice_date (NOT NULL)
  • billing_address
  • billing_city
  • billing_state
  • billing_country
  • billing_postal_code
  • total (NOT NULL)

Customer

  • customer_id (PK)
  • first_name (NOT NULL)
  • last_name (NOT NULL)
  • company
  • support_rep_id* (FK → Employee)
  • personal_info_id* (FK → AddressInfo)
  • contact_id* (FK → Contact)

Employee

  • employee_id (PK)
  • first_name (NOT NULL)
  • last_name (NOT NULL)
  • title (NOT NULL)
  • reports_to* (FK → Employee)
  • birth_date (NOT NULL)
  • hire_date (NOT NULL)
  • personal_info_id* (FK → AddressInfo)
  • contact_id* (FK → Contact)

AddressInfo

  • address_info_id (PK)
  • address (NOT NULL)
  • city (NOT NULL)
  • state
  • country (NOT NULL)
  • postal_code (NOT NULL)

Contact

  • contact_id (PK)
  • phone (NOT NULL)
  • fax
  • email (NOT NULL)

Playlist

  • playlist_id (PK)
  • name (NOT NULL)

PlaylistTrack

  • playlist_track_id (PK)
  • playlist_id* (FK → Playlist)
  • track_id* (FK → Track)

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.