| | 1 | === Step 0: Initial Unnormalized Relation (UNF) === |
| | 2 | |
| | 3 | The system initially stores all information in a single relation: |
| | 4 | |
| | 5 | USER_WEDDING_VENUE(user_id, user_first_name, user_last_name, user_email, wedding_id, wedding_date, wedding_budget, venue_id, venue_name, venue_type, venue_capacity, booking_id, booking_date, start_time, end_time) |
| | 6 | |
| | 7 | This relation contains attributes describing multiple entities (User, Wedding, Venue, Booking). |
| | 8 | Storing all data together leads to redundancy and update anomalies. |
| | 9 | |
| | 10 | Identified Functional Dependencies (FDs): |
| | 11 | |
| | 12 | -user_id → user_first_name, user_last_name, user_email |
| | 13 | -wedding_id → wedding_date, wedding_budget, user_id |
| | 14 | -venue_id → venue_name, venue_type, venue_capacity |
| | 15 | -booking_id → venue_id, wedding_id, booking_date, start_time, end_time |
| | 16 | |
| | 17 | === Step 1: Decomposition to 1NF (First Normal Form) === |
| | 18 | |
| | 19 | Definition of 1NF: |
| | 20 | |
| | 21 | -A relation is in 1NF if all attributes contain atomic values |
| | 22 | -No repeating groups or multivalued attributes exist |
| | 23 | -Each row is uniquely identifiable by a key |
| | 24 | |
| | 25 | The relation is decomposed based on entity responsibility while preserving all data. |
| | 26 | |
| | 27 | === R1: USER === |
| | 28 | |
| | 29 | || Table || Attributes || |
| | 30 | || R1 || user_id, user_first_name, user_last_name, user_email || |
| | 31 | |
| | 32 | Primary Key: |
| | 33 | -user_id |
| | 34 | |
| | 35 | Functional Dependency: |
| | 36 | -user_id → user_first_name, user_last_name, user_email |
| | 37 | |
| | 38 | Justification: |
| | 39 | -All attributes are atomic |
| | 40 | -All attributes depend only on user_id |
| | 41 | -user_id uniquely identifies a system user |
| | 42 | -No repeating groups exist |
| | 43 | |
| | 44 | Conclusion: |
| | 45 | -R1 satisfies 1NF |
| | 46 | |
| | 47 | === R2: WEDDING === |
| | 48 | |
| | 49 | || Table || Attributes || |
| | 50 | || R2 || wedding_id, wedding_date, wedding_budget, user_id || |
| | 51 | |
| | 52 | Primary Key: |
| | 53 | -wedding_id |
| | 54 | |
| | 55 | Foreign Key: |
| | 56 | -user_id → USER(user_id) |
| | 57 | |
| | 58 | Functional Dependency: |
| | 59 | -wedding_id → wedding_date, wedding_budget, user_id |
| | 60 | |
| | 61 | Justification: |
| | 62 | -Each wedding is uniquely identified by wedding_id |
| | 63 | -user_id represents ownership of the wedding |
| | 64 | -All non-key attributes depend solely on wedding_id |
| | 65 | |
| | 66 | Conclusion: |
| | 67 | -R2 satisfies 1NF |
| | 68 | |
| | 69 | === R3: VENUE === |
| | 70 | |
| | 71 | || Table || Attributes || |
| | 72 | || R3 || venue_id, venue_name, venue_type, venue_capacity || |
| | 73 | |
| | 74 | Primary Key: |
| | 75 | -venue_id |
| | 76 | |
| | 77 | Functional Dependency: |
| | 78 | -venue_id → venue_name, venue_type, venue_capacity |
| | 79 | |
| | 80 | Justification: |
| | 81 | -Venue attributes describe a single independent entity |
| | 82 | -Attributes are static and not dependent on other relations |
| | 83 | -venue_id uniquely identifies a venue |
| | 84 | |
| | 85 | Conclusion: |
| | 86 | -R3 satisfies 1NF |
| | 87 | |
| | 88 | === R4: VENUE_BOOKING === |
| | 89 | |
| | 90 | || Table || Attributes || |
| | 91 | || R4 || booking_id, venue_id, wedding_id, booking_date, start_time, end_time || |
| | 92 | |
| | 93 | Primary Key: |
| | 94 | -booking_id |
| | 95 | |
| | 96 | Foreign Keys: |
| | 97 | -venue_id → VENUE(venue_id) |
| | 98 | -wedding_id → WEDDING(wedding_id) |
| | 99 | |
| | 100 | Functional Dependency: |
| | 101 | -booking_id → venue_id, wedding_id, booking_date, start_time, end_time |
| | 102 | |
| | 103 | Justification: |
| | 104 | -A booking represents a reservation of a venue for a specific wedding |
| | 105 | -booking_id uniquely identifies each reservation |
| | 106 | -All attributes depend directly on booking_id |
| | 107 | |
| | 108 | Conclusion: |
| | 109 | -R4 satisfies 1NF |
| | 110 | |