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

Orphan Order Lines

Return the line ids whose order_id does not exist in Orders.

Table schema

Orders(id INT PRIMARY KEY)
OrderLines(id INT PRIMARY KEY, order_id INT)

Sample data

Orders
id
1
2

OrderLines
id | order_id
10 | 1
11 | 2
12 | 3
13 | 4

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.