Changes between Version 15 and Version 16 of P2


Ignore:
Timestamp:
02/04/26 20:35:55 (5 days ago)
Author:
193284
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • P2

    v15 v16  
    1 = Logical and Physical Design
     1= Phase P2: Logical and Physical Design (DDL & DML)
    22
    3 == Relational Schema (Mapping Transformation)
     3== Relational Schema
    44
    5 == Diagram
     5The relational schema was derived directly from the ER model using standard
     6ER-to-relational mapping rules.
     7
     8Each strong entity is mapped to a separate table.
     9Each relationship is mapped based on its cardinality.
     10Associative tables are introduced for all many-to-many relationships.
     11
     12The resulting schema consists of the following relations:
     13
     14USER(user_id, first_name, last_name, email, phone_number, gender, birthday)
     15
     16WEDDING(wedding_id, date, budget, notes, type, status, user_id*)
     17
     18EVENT(event_id, event_type, date, start_time, end_time, status, wedding_id*)
     19
     20GUEST(guest_id, first_name, last_name, email, wedding_id*)
     21
     22EVENT_RSVP(response_id, status, response_date, guest_id*, event_id*)
     23
     24ATTENDANCE(attendance_id, status, table_number, role, guest_id*, event_id*)
     25
     26VENUE_TYPE(type_id, type_name)
     27
     28VENUE(venue_id, name, location, city, address, capacity, menu,
     29      phone_number, price_per_guest, type_id*)
     30
     31VENUE_BOOKING(booking_id, date, start_time, end_time, status, price,
     32              venue_id*, wedding_id*)
     33
     34PHOTOGRAPHER(photographer_id, name, email, phone_number, price_per_hour)
     35
     36PHOTOGRAPHER_BOOKING(booking_id, date, start_time, end_time, status,
     37                     photographer_id*, wedding_id*)
     38
     39BAND(band_id, band_name, genre, equipment, phone_number, price_per_hour)
     40
     41BAND_BOOKING(booking_id, date, start_time, end_time, status,
     42             band_id*, wedding_id*)
     43
     44CHURCH(church_id, name, location, contact, wedding_id*)
     45
     46PRIEST(priest_id, name, contact, church_id*)
     47
     48REGISTRAR(registrar_id, name, contact, location, working_hours)
     49
     50REGISTRAR_BOOKING(booking_id, date, start_time, end_time, status, registrar_id*)
     51
     52(* denotes foreign keys)
     53
     54== Relational Diagram
     55
     56The relational diagram was generated directly from the implemented database schema
     57using DBeaver, ensuring full consistency with the DDL implementation.
     58
    659[[Image(final_version.png, width=100%)]]
    760
    8 === Notation
     61== DDL Script
    962
    10 * primary keys – **bold and underlined**
    11 * NOT NULL attributes – **bold**
    12 * foreign keys – marked with * after the attribute name and the referenced table in parentheses
    13 * other attributes – no special marking
     63The DDL script defines the complete database structure, including all tables,
     64primary keys, foreign keys, and integrity constraints.
    1465
    15 === Tables
     66[[attachment:schema_creation.sql]]
    1667
    17 * USER (**__user_id__**, **first_name**, **last_name**, **email**, phone_number, gender, birthday)
     68== DML Script
    1869
    19 * WEDDING (**__wedding_id__**, **date**, budget, notes, type, status, **user_id*** (USER))
     70The DML script populates the database with sample data that respects all defined
     71constraints and demonstrates correct relationships between entities.
    2072
    21 * CHURCH (**__church_id__**, **name**, **location**, **contact**, wedding_id* (WEDDING))
    22 
    23 * PRIEST (**__priest_id__**, **name**, **contact**, **church_id*** (CHURCH))
    24 
    25 * EVENT (**__event_id__**, **event_type**, **date**, **start_time**, **end_time**, **status**, **wedding_id*** (WEDDING))
    26 
    27 * GUEST (**__guest_id__**, **first_name**, **last_name**, email, **wedding_id*** (WEDDING))
    28 
    29 * EVENT_RSVP (**__response_id__**, **status**, **response_date**, **guest_id*** (GUEST), **event_id*** (EVENT))
    30 
    31 * ATTENDANCE (**__attendance_id__**, **status**, table_number, **role**, **guest_id*** (GUEST), **event_id*** (EVENT))
    32 
    33 * VENUE_TYPE (**__type_id__**, **type_name**)
    34 
    35 * VENUE (**__venue_id__**, **name**, **location**, **city**, **address**, **capacity**, menu, phone_number, **price_per_guest**, **type_id*** (VENUE_TYPE))
    36 
    37 * VENUE_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **price**, **venue_id*** (VENUE), **wedding_id*** (WEDDING))
    38 
    39 * PHOTOGRAPHER (**__photographer_id__**, **name**, **email**, **phone_number**, **price_per_hour**)
    40 
    41 * PHOTOGRAPHER_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **photographer_id*** (PHOTOGRAPHER), **wedding_id*** (WEDDING))
    42 
    43 * BAND (**__band_id__**, **band_name**, **genre**, equipment, **phone_number**, **price_per_hour**)
    44 
    45 * BAND_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **band_id*** (BAND), **wedding_id*** (WEDDING))
    46 
    47 * REGISTRAR (**__registrar_id__**, **name**, contact, location, working_hours)
    48 
    49 * REGISTRAR_BOOKING (**__booking_id__**, **date**, **start_time**, **end_time**, **status**, **registrar_id*** (REGISTRAR))
    50 
    51 == DDL Script for Table Creation and Deletion
    52 
    53 The DDL script implements the relational schema described above.
    54 It defines all tables, primary and foreign keys, as well as constraints required to ensure data integrity.
    55 
    56 [[Attachment(schema_creation.sql)]]
    57 
    58 == DML Script for Data Population
    59 
    60 The DML script contains sample data used for testing the system and demonstrating the relationships between the tables.
    61 
    62 [[Attachment(data_load.sql)]]
     73[[attachment:data_load.sql]]