Changes between Version 1 and Version 2 of Additional Integrity Constraints


Ignore:
Timestamp:
05/12/26 01:57:58 (2 weeks ago)
Author:
193284
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Additional Integrity Constraints

    v1 v2  
    55This section documents additional CHECK and UNIQUE constraints implemented during the advanced database development phase.
    66
    7 == SQL Code ==
     7=== SQL Code ===
    88
    9 {{{
    10 ALTER TABLE event_rsvp
    11 ADD CONSTRAINT chk_rsvp_status
    12 CHECK (status IN ('accepted', 'declined', 'pending'));
    13 
    14 ALTER TABLE attendance
    15 ADD CONSTRAINT chk_attendance_status
    16 CHECK (status IN ('attending', 'absent'));
    17 
    18 ALTER TABLE event_rsvp
    19 ADD CONSTRAINT uq_guest_event_rsvp
    20 UNIQUE (guest_id, event_id);
    21 
    22 ALTER TABLE attendance
    23 ADD CONSTRAINT uq_guest_event_attendance
    24 UNIQUE (guest_id, event_id);
    25 }}}
     9{{collapse(View SQL Code)
     10<syntaxhighlight lang="sql">
     11PASTE SQL FROM advanced_constraints.sql
     12</syntaxhighlight>
     13}}