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

Find Rows Violating a Business Rule

Return the ids of orders whose ship_date is earlier than their order_date. Order by id.

Table schema

Orders(id INT PRIMARY KEY, order_date DATE, ship_date DATE)

Sample data

id | order_date | ship_date
1 | 2026-01-01 | 2026-01-03
2 | 2026-01-05 | 2026-01-04
3 | 2026-01-10 | 2026-01-10

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.