CHECK Constraint on Date Range
Create the table Bookings(id, start_date, end_date) so that end_date can never be earlier than start_date.
Table schema
Columns: id INT, start_date DATE, end_date DATESample data
INSERT (1, '2026-01-10', '2026-01-05') must fail; INSERT (2, '2026-01-05', '2026-01-10') must succeed.
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.