wiki:RelationalDesign

Version 4 (modified by 232012, 9 days ago) ( diff )

--

Relational Design

Notation:

  • Primary keys - underlined with bold lettering
  • Foreign keys - marked with a * after the key name
  • Required attributes - bold lettering

Tables

  1. USER (user_id, username, email, password, date_created, shipping_address, telephone_number)
  1. ADMIN (user_id*[USER], type, discount_percentage)
  1. CONSUMER (user_id*[USER], points_collected)
  1. WISHLIST (wishlist_id, user_id*[USER])
  1. PRODUCT (product_id, price, format, description, stock)
  1. RELEASE (release_id, title, release_date, genre, cover_photo, record_label)
  1. ALBUM (release_id*[RELEASE])
  1. SINGLE (release_id*[RELEASE], duration)
  1. SONG (song_id, song_name, duration)
  1. ORDER (order_id, user_id*[USER], purchase_date, status, payment_method, points_earned, points_used)
  1. ORDER_ITEM (order_id*[ORDER], product_id*[PRODUCT], quantity, price_at_purchase)
  1. ARTIST (artist_id, artist_name, photo, description)
  1. MODIFICATION (modification_id, user_id*[ADMIN], date_modified, type_of_modification, discount)

DDL script for creating the database schema and objects:

DML script for filling tables with data:

Relational diagram

Attachments (9)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.