Changes between Version 1 and Version 2 of P6


Ignore:
Timestamp:
01/13/26 00:08:50 (8 days ago)
Author:
213087
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • P6

    v1 v2  
    1 = Phase P6
     1= Database Normalization – Wedding Planner System =
    22
    3 == Content
    4 To be defined.
     3This page describes the normalization process of the ''Wedding Planner'' database system.
     4The goal is to transform an initial denormalized structure into a fully normalized relational schema that is lossless, dependency-preserving, and aligned with the ER diagram and SQL implementation.
     5
     6
     7== Denormalized Form (UNF) ==
     8
     9The denormalized form represents a structure where all data related to users, weddings, events, guests, venues, and service providers are stored in a single table, without enforcing normalization rules.
     10This form contains repeating groups, redundancy, and multiple anomalies.
     11
     12=== Denormalized Table ===
     13
     14|| user_id || first_name || last_name || email || wedding_id || wedding_date || wedding_budget || event_id || event_type || event_date || start_time || end_time ||guest_id || guest_first_name || guest_last_name || rsvp_status || attendance_status || venue_name || venue_type || photographer_name || band_name ||
     15|| 1 || Ana || Trajkovska || ana.trajkovska@gmail.com || 1 || 2026-06-20 || 8500 || 1 || Church Ceremony || 2026-06-20 || 12:00 || 13:00 || 1 || Ana || Markovska || accepted || attending || Lakeside Garden Venue || Outdoor Garden || Luna Studio || The Wedding Vibes ||
     16|| 1 || Ana || Trajkovska || ana.trajkovska@gmail.com || 1 || 2026-06-20 || 8500 || 2 || Reception || 2026-06-20 || 16:00 || 23:00 || 2 || Daniel || Stojanov || accepted || attending || Lakeside Garden Venue || Outdoor Garden || Luna Studio || The Wedding Vibes ||
     17
     18
     19
     20
     21=== Functional Dependencies (UNF) ===
     22
     23{user_id} → {first_name, last_name, email}
     24
     25{wedding_id} → {wedding_date, wedding_budget}
     26
     27{event_id} → {event_type, event_date, start_time, end_time}
     28
     29{guest_id} → {guest_first_name, guest_last_name}
     30
     31{venue_name} → {venue_type}
     32
     33=== Problems in UNF ===
     34
     35*Massive data redundancy
     36
     37
     38
     39*Repeating groups (events, guests, services)
     40
     41
     42
     43*Update anomalies
     44
     45
     46*Insertion anomalies
     47
     48
     49*Deletion anomalies
     50
     51== First Normal Form (1NF) ==
     52
     53The database is in First Normal Form when:
     54
     55All attributes contain atomic values
     56
     57There are no repeating groups
     58
     59Each row is uniquely identifiable
     60
     61A composite primary key is assumed to uniquely identify each row in the initial relation.
     62
     63=== 1NF Relation ===
     64
     65R(
     66user_id, first_name, last_name, email,
     67wedding_id, wedding_date, wedding_budget,
     68event_id, event_type, event_date, start_time, end_time,
     69guest_id, guest_first_name, guest_last_name,
     70rsvp_status, attendance_status,
     71venue_name, venue_type,
     72photographer_name, band_name
     73)
     74
     75Primary Key:
     76(user_id, wedding_id, event_id, guest_id)
     77
     78== Second Normal Form (2NF) ==
     79
     80Second Normal Form removes partial dependencies.
     81Attributes that depend only on part of the composite key are separated into new relations.
     82
     83=== Decomposition ===
     84
     85=== USER ===
     86
     87|| user_id || first_name || last_name || email ||
     88|| 1 || Ana || Trajkovska || ana.trajkovska@gmail.com||
     89
     90FD:
     91{user_id} → {first_name, last_name, email}
     92
     93=== WEDDING ===
     94
     95|| wedding_id || date || budget || user_id ||
     96|| 1 || 2026-06-20 || 8500 || 1 ||
     97
     98FD:
     99{wedding_id} → {wedding_date, wedding_budget, user_id}
     100
     101=== EVENT ===
     102
     103|| event_id || event_type || date || start_time || end_time || wedding_id ||
     104|| 1 || Church Ceremony || 2026-06-20 || 12:00 || 13:00 || 1 ||
     105|| 2 || Reception || 2026-06-20 || 16:00 || 23:00 || 1 ||
     106
     107FD:
     108{event_id} → {event_type, event_date, start_time, end_time, wedding_id}
     109
     110=== GUEST ===
     111
     112|| guest_id || first_name || last_name || wedding_id ||
     113|| 1 || Ana || Markovska || 1 ||
     114|| 2 || Daniel || Stojanov || 1 ||
     115
     116FD:
     117{guest_id} → {first_name, last_name, wedding_id}
     118
     119=== Lossless Join Test (2NF) ===
     120
     121Since the intersection of decomposed relations contains primary keys that determine all attributes of the smaller relations, the decomposition is lossless.
     122
     123== Third Normal Form (3NF) ==
     124
     125Third Normal Form removes transitive dependencies.
     126
     127=== Venue Separation ===
     128
     129=== VENUE_TYPE ===
     130
     131|| type_id || type_name ||
     132|| 3 || Outdoor Garden ||
     133
     134FD:
     135{type_id} → {type_name}
     136
     137=== VENUE ===
     138
     139|| venue_id || name || location || city || capacity || price_per_guest || type_id ||
     140|| 1 || Lakeside Garden Venue || Matka || Skopje || 200 || 35 || 3 ||
     141
     142FD:
     143{venue_id} → {name, location, city, capacity, price_per_guest, type_id}
     144
     145=== EVENT RSVP ===
     146
     147|| response_id || guest_id || event_id || status || response_date ||
     148|| 1 || 1 || 1 || accepted || 2026-05-15 ||
     149|| 2 || 2 || 2 || accepted || 2026-05-15 ||
     150
     151Composite uniqueness:
     152(guest_id, event_id)
     153
     154=== Attendance ===
     155
     156|| attendance_id || guest_id || event_id || status || table_number || role ||
     157|| 1 || 1 || 1 || attending || 5 || Guest ||
     158|| 2 || 2 || 2 || attending || 10 || Guest ||
     159
     160== Final Normalized Schema (3NF / BCNF) ==
     161
     162USER(user_id, first_name, last_name, email)
     163
     164WEDDING(wedding_id, date, budget, user_id)
     165
     166EVENT(event_id, event_type, date, start_time, end_time, wedding_id)
     167
     168GUEST(guest_id, first_name, last_name, wedding_id)
     169
     170EVENT_RSVP(response_id, guest_id, event_id, status, response_date)
     171
     172ATTENDANCE(attendance_id, guest_id, event_id, status, table_number, role)
     173
     174VENUE(venue_id, name, location, city, capacity, price_per_guest, type_id)
     175
     176VENUE_TYPE(type_id, type_name)
     177
     178PHOTOGRAPHER(photographer_id, name, price_per_hour)
     179
     180BAND(band_id, band_name, price_per_hour)
     181
     182== Conclusion ==
     183
     184The normalization process eliminates redundancy, prevents anomalies, and produces a clean relational schema fully aligned with the ER diagram and SQL implementation.
     185The final design is lossless, dependency-preserving, and in BCNF, making it suitable for a real-world wedding planner system.