| 1 | | Normalization |
| 2 | | De-normalized database form |
| 3 | | Functional dependencies |
| 4 | | Candidate keys and primary key |
| 5 | | 1NF decomposition |
| | 1 | = Normalization |
| | 2 | |
| | 3 | == De-normalized database form |
| | 4 | |
| | 5 | First, we combine every attribute in the entire model into one single relation - **Universal Relation R**. |
| | 6 | |
| | 7 | {{{ |
| | 8 | R( |
| | 9 | user_id, |
| | 10 | email, |
| | 11 | username, |
| | 12 | password, |
| | 13 | date_created, |
| | 14 | shipping_address, |
| | 15 | telephone_number, |
| | 16 | admin_type, |
| | 17 | discount_percentage, |
| | 18 | points_collected, |
| | 19 | artist_id, |
| | 20 | artist_name, |
| | 21 | artist_description, |
| | 22 | artist_photo, |
| | 23 | release_id, |
| | 24 | title, |
| | 25 | record_label, |
| | 26 | genre, |
| | 27 | release_date, |
| | 28 | cover_photo, |
| | 29 | duration, |
| | 30 | song_id, |
| | 31 | song_name, |
| | 32 | song_duration, |
| | 33 | product_id, |
| | 34 | format, |
| | 35 | price, |
| | 36 | product_description, |
| | 37 | stock, |
| | 38 | order_id, |
| | 39 | payment_method, |
| | 40 | purchase_date, |
| | 41 | points_earned, |
| | 42 | points_used, |
| | 43 | status, |
| | 44 | modification_id, |
| | 45 | date_modified, |
| | 46 | type_of_modification, |
| | 47 | discount, |
| | 48 | wishlist_id, |
| | 49 | quantity, |
| | 50 | price_at_purchase, |
| | 51 | added_at, |
| | 52 | release_ordinal, |
| | 53 | type, |
| | 54 | song_ordinal |
| | 55 | ) |
| | 56 | }}} |
| | 57 | |
| | 58 | == Functional dependencies |
| | 59 | |
| | 60 | {{{ |
| | 61 | FD01: user_id → email, username, password, date_created, shipping_address, telephone_number |
| | 62 | FD02: email → user_id |
| | 63 | FD03: username → user_id |
| | 64 | FD04: user_id → admin_type, discount_percentage |
| | 65 | FD05: user_id → points_collected |
| | 66 | FD06: artist_id → artist_name, artist_description, artist_photo |
| | 67 | FD07: release_id → title, record_label, genre, release_date, cover_photo, duration |
| | 68 | FD08: song_id → song_name, song_duration |
| | 69 | FD09: product_id → release_id, format, price, product_description, stock |
| | 70 | FD10: order_id → user_id, payment_method, purchase_date, points_earned, points_used, status |
| | 71 | FD11: modification_id → admin_id, date_modified, type_of_modification, discount |
| | 72 | FD12: wishlist_id → user_id |
| | 73 | FD13: user_id → wishlist_id |
| | 74 | FD14: (order_id, product_id) → price_at_purchase, quantity |
| | 75 | FD15: (wishlist_id, product_id) → added_at |
| | 76 | FD16: (release_id, artist_id) → release_ordinal, release_artist_type |
| | 77 | FD17: (song_id, artist_id) → song_ordinal |
| | 78 | }}} |
| | 79 | |
| | 80 | == Candidate keys and primary key |
| | 81 | |
| | 82 | |
| | 83 | |
| | 84 | == 1NF decomposition |