| | 1 | = Testing and Validation = |
| | 2 | |
| | 3 | == Description == |
| | 4 | |
| | 5 | This section contains SQL scenarios used for testing trigger behavior and advanced database validation. |
| | 6 | |
| | 7 | == 1. Venue Booking Conflict Test == |
| | 8 | |
| | 9 | {{{ |
| | 10 | INSERT INTO venue_booking( |
| | 11 | "date", |
| | 12 | start_time, |
| | 13 | end_time, |
| | 14 | status, |
| | 15 | price, |
| | 16 | venue_id, |
| | 17 | wedding_id |
| | 18 | ) |
| | 19 | VALUES ( |
| | 20 | '2026-06-20', |
| | 21 | '18:00', |
| | 22 | '22:00', |
| | 23 | 'confirmed', |
| | 24 | 5000, |
| | 25 | 1, |
| | 26 | 1 |
| | 27 | ); |
| | 28 | }}} |
| | 29 | |
| | 30 | Expected Result: |
| | 31 | The trigger prevents overlapping bookings. |
| | 32 | |
| | 33 | == 2. RSVP Validation Test == |
| | 34 | |
| | 35 | {{{ |
| | 36 | INSERT INTO attendance( |
| | 37 | status, |
| | 38 | table_number, |
| | 39 | role, |
| | 40 | guest_id, |
| | 41 | event_id |
| | 42 | ) |
| | 43 | VALUES ( |
| | 44 | 'attending', |
| | 45 | 3, |
| | 46 | 'Guest', |
| | 47 | 1, |
| | 48 | 1 |
| | 49 | ); |
| | 50 | }}} |
| | 51 | |
| | 52 | Expected Result: |
| | 53 | Guests who declined RSVP cannot be marked as attending. |