Out of stock everywhere
SQLHard14 min
Your task
Find items that are out of stock in every warehouse that carries them, and items no warehouse carries. Return sku, alphabetically.
Tables
warehouse| idINTEGER | cityTEXT | countryTEXT |
|---|
| 1 | Rotterdam | NL |
| 2 | Memphis | US |
| 3 | Osaka | JP |
item| idINTEGER | skuTEXT | nameTEXT | unit_centsINTEGER |
|---|
| 1 | KB-1 | Keyboard | 4900 |
| 2 | MS-2 | Mouse | 2500 |
| 3 | MN-3 | Monitor | 19900 |
| 4 | CB-4 | Cable | 900 |
| 5 | HD-5 | Headset | 5900 |
stock| warehouse_idINTEGER | item_idINTEGER | quantityINTEGER |
|---|
| 1 | 1 | 40 |
| 1 | 2 | 0 |
| 1 | 3 | 12 |
| 2 | 1 | 5 |
| 2 | 4 | 300 |
| 3 | 3 | 7 |
More rows not shown Model answerRun