Changes between Version 4 and Version 5 of RelationalDesign


Ignore:
Timestamp:
09/02/26 20:07:38 (4 days ago)
Author:
236024
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RelationalDesign

    v4 v5  
    11= Relational Design =
    22
    3 This page documents the relational design for BEST Skopje Hub, based on ERModel_v10. The design uses partial transformation from the ER model into a PostgreSQL relational schema. Strong entities are mapped directly to relations, weak entities include the primary keys of their owner entities, specializations are mapped with one relation for the supertype and one relation for each subtype, and M:N relationships are mapped as separate relations.
     3This page documents the relational design for BEST Skopje Hub, based on ERModel_v11. The design uses partial transformation from the ER model into a PostgreSQL relational schema. Strong entities are mapped directly to relations, weak entities include the primary keys of their owner entities, specializations are mapped with one relation for the supertype and one relation for each subtype, and M:N relationships are mapped as separate relations.
    44
    55== Descriptive representation of the relational schema ==
     
    132132)
    133133
     134event_function_types(
     135    eft_id, eft_name,
     136    PK(eft_id),
     137    UNIQUE(eft_name)
     138)
     139
    134140event_sessions(
    135141    ee_id, es_no, est_id, l_id, es_start_time, es_title, needed_no_volunteers,
     
    141147
    142148event_functions(
    143     ee_id, ef_no, ef_name,
     149    ee_id, ef_no, eft_id,
    144150    PK(ee_id, ef_no),
    145     FK(ee_id) -> event_editions(ee_id)
     151    FK(ee_id) -> event_editions(ee_id),
     152    FK(eft_id) -> event_function_types(eft_id)
    146153)
    147154
     
    155162)
    156163
     164holds_event_function(
     165    student_index, ee_id, ef_no,
     166    PK(student_index, ee_id, ef_no),
     167    FK(student_index) -> members(student_index),
     168    FK(ee_id, ef_no) -> event_functions(ee_id, ef_no)
     169)
     170
    157171participation(
    158172    student_index, as_id, rsvp_status, rsvp_at, attendance_status,
     
    162176)
    163177
     178required_attendance(
     179    student_index, as_id,
     180    PK(student_index, as_id),
     181    FK(student_index) -> members(student_index),
     182    FK(as_id) -> activity_sessions(as_id)
     183)
     184
    164185announces_absence(
    165186    student_index, as_id, reason, announced_at,
    166187    PK(student_index, as_id),
    167     FK(student_index) -> members(student_index),
    168     FK(as_id) -> activity_sessions(as_id)
     188    FK(student_index, as_id) -> required_attendance(student_index, as_id)
    169189)
    170190
     
    202222The specialization of students into members and then into observers, young members, full members, and alumni is represented through subtype tables whose primary keys are also foreign keys. `young_members` also contains `mentor_index`, which represents the mentorship relationship directly as a foreign key to `full_members`.
    203223
    204 The weak entities from ERModel_v10 are represented with composite primary keys where they still depend on an owner entity. `event_functions` uses `(ee_id, ef_no)`, and `event_sessions` uses `(ee_id, es_no)`. Other concrete entities such as `activity_sessions` and `event_editions` use their own numeric identifiers.
     224The weak entities from ERModel_v11 are represented with composite primary keys where they still depend on an owner entity. `event_functions` uses `(ee_id, ef_no)`, and `event_sessions` uses `(ee_id, es_no)`. Other concrete entities such as `activity_sessions` and `event_editions` use their own numeric identifiers.
    205225
    206226The Locations entity is represented with `locations`. The relationship between !EventEditions and Locations is represented with `event_edition_locations`.
    207227
    208 The relationships `has_stage`, `participation`, `announces_absence`, `responsible_for`, `volunteers`, `cooperation`, `related_to`, `holds_function`, and the event-edition location relationship are represented as relations because they either have M:N cardinality, their own attributes, or are clearer without nullable foreign-key columns. The relationship `related_to` is represented separately because only some activity sessions are connected to event editions. The relationship `applies_with` is represented with the foreign key `student_index` in `applications`, because each application belongs to one student. The N:1 relationships `for_function`, `for_participation`, `takes_place_at`, `held_at`, and `mentorship` are represented directly with foreign keys on the N-side relation.
     228The relationships `has_stage`, `participation`, `required_attendance`, `announces_absence`, `responsible_for`, `volunteers`, `cooperation`, `related_to`, `holds_function`, `holds_event_function`, and the event-edition location relationship are represented as relations because they either have M:N cardinality, their own attributes, or are clearer without nullable foreign-key columns. The relationship `related_to` is represented separately because only some activity sessions are connected to event editions. The relationship `applies_with` is represented with the foreign key `student_index` in `applications`, because each application belongs to one student. The N:1 relationships `for_function`, `for_participation`, `takes_place_at`, `held_at`, `is_of_function_type`, and `mentorship` are represented directly with foreign keys on the N-side relation.
    209229
    210230== DDL script for creating the database schema and objects ==
     
    216236== DML script for filling tables with data ==
    217237
    218 The DML script recreates realistic sample data for all relations. It clears the current contents of the tables and inserts connected sample data for students, members, membership stages, activity sessions, event-related activity links, event editions, event sessions, applications, companies, volunteering, mentorship, attendance/RSVP, announced absences, and organizational functions.
     238The DML script recreates realistic sample data for all relations. It clears the current contents of the tables and inserts connected sample data for students, members, membership stages, activity sessions, event-related activity links, event editions, event sessions, event function types, event function slots, actual event function holders, applications, companies, volunteering, mentorship, attendance/RSVP, required attendance, announced absences, and organizational functions.
    219239
    220240[attachment:data_load.sql data_load.sql]
     
    228248== AI Use ==
    229249
    230 AI was used during this phase as a consultation, drafting, and checking tool while preparing the relational design from the already completed ERModel_v10. The AI-assisted parts were reviewed against the existing ER model and project requirements before being included.
     250AI was used during this phase as a consultation, drafting, and checking tool while preparing the relational design from the already completed ERModel_v11. The AI-assisted parts were reviewed against the existing ER model and project requirements before being included.
    231251
    232252Full AI usage documentation: [wiki:RelationalDesignAIUsage RelationalDesignAIUsage].