wiki:Additional Integrity Constraints

Version 3 (modified by 193284, 2 weeks ago) ( diff )

--

Additional Integrity Constraints

Description

This section documents additional CHECK and UNIQUE constraints implemented during the advanced database development phase.

SQL Code

<pre> ALTER TABLE event_rsvp ADD CONSTRAINT chk_rsvp_status CHECK (status IN ('accepted', 'declined', 'pending'));

ALTER TABLE attendance ADD CONSTRAINT chk_attendance_status CHECK (status IN ('attending', 'absent'));

ALTER TABLE event_rsvp ADD CONSTRAINT uq_guest_event_rsvp UNIQUE (guest_id, event_id);

ALTER TABLE attendance ADD CONSTRAINT uq_guest_event_attendance UNIQUE (guest_id, event_id); </pre>

Note: See TracWiki for help on using the wiki.