runtime
10 / 88

task Missing relationships / anti-joins · easy

Items nobody has ordered

Return the id and name of catalog items that appear on no order line.

what to return

Columns
idname in this order
Rows
1 row · any order
Watch for
Any order line counts, whatever the order's status.
Skill
Find rows with no match in another table. Refresher: Keep unmatched rows →

expected result

Your query should return exactly these columns and values. Run it and compare.

expected result1 row · any order
idname
13Wall Clock

all 1 rows

data you can query

Sample rows from each table. Each column shows its type underneath; → marks a link to another table.

catalog_items4 columns · 13 rows
idinteger · keynametextcategorytextpricereal
1Desk LampLighting39
2Floor lampLighting89
3String LightsLighting19.5
4Chef KnifeKitchen59
5Cast Iron PanKitchen45

showing 5 of 13 rows

order_lines4 columns · 48 rows
order_idinteger → sales_ordersitem_idinteger → catalog_itemsquantityintegerunit_pricereal
1011139
1013219.5
1024159
1035145
10310312

showing 5 of 48 rows

solution.sql
 

Hints and the answer are always available. Using them counts the question as solved with help.