Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

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 DATE

Sample 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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.