wiki:ddl

Version 13 (modified by 221046, 7 hours ago) ( diff )

--

Релациска шема

  • примарни клучеви - болдирани и подвлечени
  • надворешни клучеви - * до името на надворешниот клуч и во заграда табелата кон која референцира
  • not null атрибути: bold
  • Останати атрибути: без ознака

Релации:

Track

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

Album

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

Artist

  • artist_id (PK)
  • name

Genre

  • genre_id (PK)
  • name

MediaType

  • media_type_id (PK)
  • name

Price

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

InvoiceLine

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

Invoice

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

Customer

  • customer_id (PK)
  • first_name
  • last_name
  • company
  • support_rep_id* (FK → Employee)
  • address
  • city
  • state
  • country
  • postal_code
  • contact_id (PK)
    • phone
    • fax

Employee

  • employee_id (PK)
  • first_name
  • last_name
  • title
  • reports_to* (FK → Employee)
  • birth_date
  • hire_date
  • address
  • city
  • state
  • country
  • postal_code
  • contact_id (PK)
    • phone
    • fax
    • email

Playlist

  • playlist_id (PK)
  • name

PlaylistTrack

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

DDL и DML скрипти:

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.