= Logical and Physical Design == Relational Schema (Mapping Transformation) == Diagram [[Image(final_version.png, width=100%)]] === Notation * primary keys – **bold and underlined** * NOT NULL attributes – **bold** * foreign keys – marked with * after the attribute name and the referenced table in parentheses * other attributes – no special marking === Tables * USER (**__user_id__**, **first_name**, **last_name**, **email**, phone_number, gender, birthday) * WEDDING (**__wedding_id__**, **date**, budget, notes, type, status, **user_id*** (USER)) * CHURCH (**__church_id__**, **name**, **location**, **contact**, wedding_id* (WEDDING)) * PRIEST (**__priest_id__**, **name**, **contact**, **church_id*** (CHURCH)) * EVENT (**__event_id__**, **event_type**, **date**, **start_time**, **end_time**, **status**, **wedding_id*** (WEDDING)) * GUEST (**__guest_id__**, **first_name**, **last_name**, email, **wedding_id*** (WEDDING)) * EVENT_RSVP (**__response_id__**, **status**, **response_date**, **guest_id*** (GUEST), **event_id*** (EVENT)) * ATTENDANCE (**__attendance_id__**, **status**, table_number, **role**, **guest_id*** (GUEST), **event_id*** (EVENT)) * VENUE_TYPE (**__type_id__**, **type_name**) * VENUE (**__venue_id__**, **name**, **location**, **city**, **address**, **capacity**, menu, phone_number, **price_per_guest**, **type_id*** (VENUE_TYPE)) * VENUE_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **price**, **venue_id*** (VENUE), **wedding_id*** (WEDDING)) * PHOTOGRAPHER (**__photographer_id__**, **name**, **email**, **phone_number**, **price_per_hour**) * PHOTOGRAPHER_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **photographer_id*** (PHOTOGRAPHER), **wedding_id*** (WEDDING)) * BAND (**__band_id__**, **band_name**, **genre**, equipment, **phone_number**, **price_per_hour**) * BAND_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **band_id*** (BAND), **wedding_id*** (WEDDING)) * REGISTRAR (**__registrar_id__**, **name**, contact, location, working_hours) * REGISTRAR_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **registrar_id*** (REGISTRAR)) == DDL Script for Table Creation and Deletion The DDL script implements the relational schema described above. It defines all tables, primary and foreign keys, as well as constraints required to ensure data integrity. [[Attachment(schema_creation.sql)]] == DML Script for Data Population The DML script contains sample data used for testing the system and demonstrating the relationships between the tables. [[Attachment(data_load.sql)]]