Changes between Version 2 and Version 3 of Additional Integrity Constraints


Ignore:
Timestamp:
05/12/26 02:32:43 (2 weeks ago)
Author:
193284
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Additional Integrity Constraints

    v2 v3  
    77=== SQL Code ===
    88
    9 {{collapse(View SQL Code)
    10 <syntaxhighlight lang="sql">
    11 PASTE SQL FROM advanced_constraints.sql
    12 </syntaxhighlight>
    13 }}
     9<pre>
     10ALTER TABLE event_rsvp
     11ADD CONSTRAINT chk_rsvp_status
     12CHECK (status IN ('accepted', 'declined', 'pending'));
     13
     14ALTER TABLE attendance
     15ADD CONSTRAINT chk_attendance_status
     16CHECK (status IN ('attending', 'absent'));
     17
     18ALTER TABLE event_rsvp
     19ADD CONSTRAINT uq_guest_event_rsvp
     20UNIQUE (guest_id, event_id);
     21
     22ALTER TABLE attendance
     23ADD CONSTRAINT uq_guest_event_attendance
     24UNIQUE (guest_id, event_id);
     25</pre>