Practice questions
Warm-up · 8
- 01Customer list, not started
- 02Products priced from 10 to 25, not started
- 03Kitchen catalog from most to least expensive, not started
- 04Products with no description, not started
- 05The three cheapest products, not started
- 06Rename a product and price five of them, not started
- 07Countries customers come from, not started
- 08Orders from 15 December 2010, not started
Easy · 21
- 09Orders by country and type, not started
- 10Providers with no encounters, not started
- 11Frequent customers, not started
- 122011 net sales by department, not started
- 13Users created in March 2025, not started
- 14People invited by several workspaces, not started
- 15Developers and their teams, not started
- 16Every developer, with a team label, not started
- 17Find the lamps, not started
- 18Spring orders from France and Germany, not started
- 19Average price by category, not started
- 20Price bands, not started
- 21Active buyers per month, not started
- 22How long did delivery take?, not started
- 23Create a wishlist table, not started
- 24Reprice the garden range, not started
- 72Predict: patients with and without missed appointments, not started
- 73Predict: unknown prices in a filter, not started
- 78Debug: find products with no description, not started
- 82Debug: February flights at the boundary, not started
- 138Predict: which trips are in January?, not started
Medium · 61
- 25Big spenders for their state, not started
- 26Monthly sales after cancellations, not started
- 27Bestsellers within each category, not started
- 28Seven-day rolling high temperature, not started
- 29More pull requests than their manager, not started
- 30Days with no orders, not started
- 31First and latest order per customer, not started
- 32Orders whose payments don’t match, not started
- 33Flight outcomes by origin state, not started
- 34Loyal customers who never returned anything, not started
- 35Average order value by month, not started
- 36Deployments versus incidents, not started
- 37Keep one invitation per person, not started
- 38A covering index for unit totals, not started
- 39A reusable customer totals view, not started
- 40Second-highest home-run total per team, not started
- 51Make the event-day filter searchable, not started
- 54Abandoned checkouts, not started
- 55Audit duplicate scans, not started
- 61Products bought together, not started
- 64Parse tracking numbers, not started
- 65Normalize invitee emails, not started
- 67Upgrade review 1: the daily pricing audience, not started
- 74Predict: count rows or known values?, not started
- 75Predict: positions and shared ranks, not started
- 77Predict: the previous leg of the same aircraft, not started
- 79Debug: keep carriers without next-day shipments, not started
- 80Debug: count zero projects correctly, not started
- 81Debug: the second-best win total, not started
- 84Grid review 1: regional demand on a peak day, not started
- 85Grid review 2: missing demand hours, not started
- 89Three New York stations side by side, not started
- 90Observation coverage by station, not started
- 91Signed invoice totals, not started
- 94Repeat reviews, distinct pull requests, not started
- 95Two measures, one stream, not started
- 98Reliability bands, not started
- 101Predict: integer and decimal ratios, not started
- 102Predict: missing passenger counts in an average, not started
- 103Predict: a recursive team path, not started
- 104Predict: dates across midnight, not started
- 105Predict: duplicate values in a set, not started
- 106Predict: NOT IN with an unknown alternative, not started
- 107Debug: observable tip rate, not started
- 108Debug: delay among operated flights, not started
- 109Debug: forecast accuracy, not started
- 110Debug: teams without active repositories, not started
- 111Debug: visits after joining observations, not started
- 112Debug: a duplicate scan is not another delivery, not started
- 114Teams that hosted each other, not started
- 119When did devices go silent?, not started
- 121Back-to-back failed deliveries, not started
- 122Each patient’s latest systolic reading, not started
- 123Purchases far above a card’s norm, not started
- 127A histogram of daily highs, not started
- 128How far do taxi trips go?, not started
- 132Developers who review each other, not started
- 133Routes flown in one direction only, not started
- 135Encounters that overlap in time, not started
- 136Predict: payments after joining line items, not started
- 137Debug: redelivered events, not started
Hard · 49
- 41Next-month retention by signup cohort, not started
- 42Longest winning streak, not started
- 43Customer segment at order time, not started
- 44Overlapping prescription fills, not started
- 45Management chain for every developer, not started
- 46Median home attendance per team, not started
- 47Build a country history from invoices, not started
- 48Settlements, refunds and disputes, not started
- 49Design a flight lookup index, not started
- 50Cover the export query, not started
- 52Latest failed deliveries without a sort, not started
- 53An ordered upgrade funnel, not started
- 56Sessionize retries and exact boundaries, not started
- 57Paid conversion by acquisition channel, not started
- 58A replay-safe ledger load, not started
- 59Enforce delivery-slot rules, not started
- 60Recover a partially failed transfer, not started
- 62Customers who bought from every Home category, not started
- 63Department audience overlap, not started
- 66Parse statement amounts into cents, not started
- 68Upgrade review 2: where the funnel drops, not started
- 69Upgrade review 3: time from checkout to subscription, not started
- 70Upgrade review 4: abandoned checkouts that came back, not started
- 71Upgrade review 5: which channels to fix first, not started
- 76Predict: a frame that includes peers, not started
- 83Debug: each account’s last posted amount, not started
- 86Grid review 3: June peak hours and ties, not started
- 87Grid review 4: does demand balance?, not started
- 88Grid review 5: monthly forecast error, not started
- 92What actually moved money?, not started
- 93Has the whole shipment arrived?, not started
- 96Last known daily maximum, not started
- 97Everyone below a director, not started
- 99State as known at an operational cutoff, not started
- 100Merge overlapping incident windows, not started
- 113Sustained warm intervals in cold storage, not started
- 115Device status at the end of each day, not started
- 116Carry the last good reading forward, not started
- 117Merged maintenance downtime, not started
- 118Continuous medication coverage, not started
- 120Three late legs in a row, not started
- 124Reviewers who cover every team repository, not started
- 125Headcount of each team tree, not started
- 126Direct and total reports, not started
- 129Median and 90th-percentile arrival delay, not started
- 130Fork families, not started
- 131Who is within two reviews?, not started
- 134Retried authorization requests, not started
- 139Debug: sessions and events per workspace, not started
task IN / EXISTS / NOT EXISTS · hard
Has the whole shipment arrived?
Find those where every package has a delivered scan in multi-package shipments created in February 2025. Return shipment_id and packages.
what to return
- Columns
shipment_idpackagesin this order- Rows
- 508 rows · any order
- Skill
- Require every child to meet a condition. Refresher: Ask whether a row exists →
expected result
expected result508 rows · any order
| shipment_id | packages |
|---|---|
| 38 | 2 |
| 52 | 2 |
| 59 | 4 |
first 3 of 508 rows
data you can query
shipments12 columns · 8,200 rows
| shipment_idnumber · unique id | order_referencetext | shipper_nametext | origin_warehouse_idnumber · links to warehouses | destination_citytext | destination_statetext | destination_postal_codetext | service_level_idnumber · links to service_levels | carrier_idnumber · links to carriers | created_atdate & time | promised_delivery_datedate | declared_valuedecimal |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ORD-643450 | Delta Robotics | 4 | Orlando | FL | 33457 | 3 | 3 | 2025-01-19 21:43:15 | 2025-01-22 | 44.17 |
| 2 | ORD-102115 | Crest Outfitters | 3 | Raleigh | NC | 27481 | 7 | 1 | 2025-04-09 00:16:31 | 2025-04-15 | 114.7 |
| 3 | ORD-926480 | Arbor Systems | 3 | Charlotte | NC | 27558 | 7 | 7 | 2025-03-06 19:19:35 | 2025-03-13 | 50.37 |
| 4 | ORD-651018 | Timber Robotics | 6 | Miami | FL | 33122 | 1 | 12 | 2025-04-05 00:31:02 | 2025-04-11 | 1181.62 |
| 5 | ORD-901762 | APEX ANALYTICS | 4 | San Diego | CA | 97949 | 2 | 3 | 2025-01-20 04:30:44 | 2025-01-29 | 91.96 |
| 6 | ORD-832022 | Nimbus Outfitters | 3 | New York | NY | 10050 | 6 | 5 | 2025-04-03 15:09:38 | 2025-04-11 | 166.67 |
| 7 | ORD-579029 | Atlas Networks | 4 | Las Vegas | NV | 89309 | 1 | 12 | 2025-03-19 00:49:20 | 2025-03-26 | 157.75 |
| 8 | ORD-948815 | Crest Logistics | 5 | Los Angeles | CA | 98905 | 2 | 3 | 2025-01-27 01:46:32 | 2025-02-05 | 80.06 |
| 9 | ORD-654855 | NIMBUS OUTFITTERS | 6 | San Diego | CA | 92755-3782 | 7 | 1 | 2025-04-12 15:36:42 | 2025-04-17 | 37.28 |
| 10 | ORD-345314 | Arbor Energy | 2 | Houston | TX | 77738 | 3 | 10 | 2025-01-23 13:45:39 | 2025-01-27 | 54.76 |
- shipment_idnumber · unique id
- 1
- order_referencetext
- ORD-643450
- shipper_nametext
- Delta Robotics
- origin_warehouse_idnumber · links to warehouses
- 4
- destination_citytext
- Orlando
- destination_statetext
- FL
- destination_postal_codetext
- 33457
- service_level_idnumber · links to service_levels
- 3
- carrier_idnumber · links to carriers
- 3
- created_atdate & time
- 2025-01-19 21:43:15
- promised_delivery_datedate
- 2025-01-22
- declared_valuedecimal
- 44.17
- shipment_idnumber · unique id
- 2
- order_referencetext
- ORD-102115
- shipper_nametext
- Crest Outfitters
- origin_warehouse_idnumber · links to warehouses
- 3
- destination_citytext
- Raleigh
- destination_statetext
- NC
- destination_postal_codetext
- 27481
- service_level_idnumber · links to service_levels
- 7
- carrier_idnumber · links to carriers
- 1
- created_atdate & time
- 2025-04-09 00:16:31
- promised_delivery_datedate
- 2025-04-15
- declared_valuedecimal
- 114.7
- shipment_idnumber · unique id
- 3
- order_referencetext
- ORD-926480
- shipper_nametext
- Arbor Systems
- origin_warehouse_idnumber · links to warehouses
- 3
- destination_citytext
- Charlotte
- destination_statetext
- NC
- destination_postal_codetext
- 27558
- service_level_idnumber · links to service_levels
- 7
- carrier_idnumber · links to carriers
- 7
- created_atdate & time
- 2025-03-06 19:19:35
- promised_delivery_datedate
- 2025-03-13
- declared_valuedecimal
- 50.37
- shipment_idnumber · unique id
- 4
- order_referencetext
- ORD-651018
- shipper_nametext
- Timber Robotics
- origin_warehouse_idnumber · links to warehouses
- 6
- destination_citytext
- Miami
- destination_statetext
- FL
- destination_postal_codetext
- 33122
- service_level_idnumber · links to service_levels
- 1
- carrier_idnumber · links to carriers
- 12
- created_atdate & time
- 2025-04-05 00:31:02
- promised_delivery_datedate
- 2025-04-11
- declared_valuedecimal
- 1181.62
- shipment_idnumber · unique id
- 5
- order_referencetext
- ORD-901762
- shipper_nametext
- APEX ANALYTICS
- origin_warehouse_idnumber · links to warehouses
- 4
- destination_citytext
- San Diego
- destination_statetext
- CA
- destination_postal_codetext
- 97949
- service_level_idnumber · links to service_levels
- 2
- carrier_idnumber · links to carriers
- 3
- created_atdate & time
- 2025-01-20 04:30:44
- promised_delivery_datedate
- 2025-01-29
- declared_valuedecimal
- 91.96
- shipment_idnumber · unique id
- 6
- order_referencetext
- ORD-832022
- shipper_nametext
- Nimbus Outfitters
- origin_warehouse_idnumber · links to warehouses
- 3
- destination_citytext
- New York
- destination_statetext
- NY
- destination_postal_codetext
- 10050
- service_level_idnumber · links to service_levels
- 6
- carrier_idnumber · links to carriers
- 5
- created_atdate & time
- 2025-04-03 15:09:38
- promised_delivery_datedate
- 2025-04-11
- declared_valuedecimal
- 166.67
- shipment_idnumber · unique id
- 7
- order_referencetext
- ORD-579029
- shipper_nametext
- Atlas Networks
- origin_warehouse_idnumber · links to warehouses
- 4
- destination_citytext
- Las Vegas
- destination_statetext
- NV
- destination_postal_codetext
- 89309
- service_level_idnumber · links to service_levels
- 1
- carrier_idnumber · links to carriers
- 12
- created_atdate & time
- 2025-03-19 00:49:20
- promised_delivery_datedate
- 2025-03-26
- declared_valuedecimal
- 157.75
- shipment_idnumber · unique id
- 8
- order_referencetext
- ORD-948815
- shipper_nametext
- Crest Logistics
- origin_warehouse_idnumber · links to warehouses
- 5
- destination_citytext
- Los Angeles
- destination_statetext
- CA
- destination_postal_codetext
- 98905
- service_level_idnumber · links to service_levels
- 2
- carrier_idnumber · links to carriers
- 3
- created_atdate & time
- 2025-01-27 01:46:32
- promised_delivery_datedate
- 2025-02-05
- declared_valuedecimal
- 80.06
- shipment_idnumber · unique id
- 9
- order_referencetext
- ORD-654855
- shipper_nametext
- NIMBUS OUTFITTERS
- origin_warehouse_idnumber · links to warehouses
- 6
- destination_citytext
- San Diego
- destination_statetext
- CA
- destination_postal_codetext
- 92755-3782
- service_level_idnumber · links to service_levels
- 7
- carrier_idnumber · links to carriers
- 1
- created_atdate & time
- 2025-04-12 15:36:42
- promised_delivery_datedate
- 2025-04-17
- declared_valuedecimal
- 37.28
- shipment_idnumber · unique id
- 10
- order_referencetext
- ORD-345314
- shipper_nametext
- Arbor Energy
- origin_warehouse_idnumber · links to warehouses
- 2
- destination_citytext
- Houston
- destination_statetext
- TX
- destination_postal_codetext
- 77738
- service_level_idnumber · links to service_levels
- 3
- carrier_idnumber · links to carriers
- 10
- created_atdate & time
- 2025-01-23 13:45:39
- promised_delivery_datedate
- 2025-01-27
- declared_valuedecimal
- 54.76
first 10 of 8,200 rows · your queries use all of them
packages8 columns · 11,505 rows
| package_idnumber · unique id | shipment_idnumber · links to shipments | tracking_numbertext | package_typetext | weight_kgdecimal | length_cmnumber | width_cmnumber | height_cmnumber |
|---|---|---|---|---|---|---|---|
| 1 | 1 | RT100007919B | box | 2.85 | 52 | 15 | 30 |
| 2 | 1 | RT100015838C | box | 1.1 | 69 | 45 | 24 |
| 3 | 2 | RT10 0023 757D | envelope | 0.49 | 32 | 24 | 2 |
| 4 | 3 | RT100031676E | box | 2.93 | 51 | 35 | 5 |
| 5 | 4 | RT100039595F | envelope | 0.38 | 32 | 24 | 3 |
| 6 | 5 | RT100047514G | box | 1.9 | 30 | 27 | 25 |
| 7 | 6 | RT100055433H | pallet | 446.69 | 120 | 100 | 148 |
| 8 | 6 | RT100063352I | pallet | 180.11 | 120 | 100 | 166 |
| 9 | 6 | rt100071271j | pallet | 337.09 | 120 | 100 | 89 |
| 10 | 6 | RT100079190K | pallet | 291.19 | 120 | 100 | 122 |
- package_idnumber · unique id
- 1
- shipment_idnumber · links to shipments
- 1
- tracking_numbertext
- RT100007919B
- package_typetext
- box
- weight_kgdecimal
- 2.85
- length_cmnumber
- 52
- width_cmnumber
- 15
- height_cmnumber
- 30
- package_idnumber · unique id
- 2
- shipment_idnumber · links to shipments
- 1
- tracking_numbertext
- RT100015838C
- package_typetext
- box
- weight_kgdecimal
- 1.1
- length_cmnumber
- 69
- width_cmnumber
- 45
- height_cmnumber
- 24
- package_idnumber · unique id
- 3
- shipment_idnumber · links to shipments
- 2
- tracking_numbertext
- RT10 0023 757D
- package_typetext
- envelope
- weight_kgdecimal
- 0.49
- length_cmnumber
- 32
- width_cmnumber
- 24
- height_cmnumber
- 2
- package_idnumber · unique id
- 4
- shipment_idnumber · links to shipments
- 3
- tracking_numbertext
- RT100031676E
- package_typetext
- box
- weight_kgdecimal
- 2.93
- length_cmnumber
- 51
- width_cmnumber
- 35
- height_cmnumber
- 5
- package_idnumber · unique id
- 5
- shipment_idnumber · links to shipments
- 4
- tracking_numbertext
- RT100039595F
- package_typetext
- envelope
- weight_kgdecimal
- 0.38
- length_cmnumber
- 32
- width_cmnumber
- 24
- height_cmnumber
- 3
- package_idnumber · unique id
- 6
- shipment_idnumber · links to shipments
- 5
- tracking_numbertext
- RT100047514G
- package_typetext
- box
- weight_kgdecimal
- 1.9
- length_cmnumber
- 30
- width_cmnumber
- 27
- height_cmnumber
- 25
- package_idnumber · unique id
- 7
- shipment_idnumber · links to shipments
- 6
- tracking_numbertext
- RT100055433H
- package_typetext
- pallet
- weight_kgdecimal
- 446.69
- length_cmnumber
- 120
- width_cmnumber
- 100
- height_cmnumber
- 148
- package_idnumber · unique id
- 8
- shipment_idnumber · links to shipments
- 6
- tracking_numbertext
- RT100063352I
- package_typetext
- pallet
- weight_kgdecimal
- 180.11
- length_cmnumber
- 120
- width_cmnumber
- 100
- height_cmnumber
- 166
- package_idnumber · unique id
- 9
- shipment_idnumber · links to shipments
- 6
- tracking_numbertext
- rt100071271j
- package_typetext
- pallet
- weight_kgdecimal
- 337.09
- length_cmnumber
- 120
- width_cmnumber
- 100
- height_cmnumber
- 89
- package_idnumber · unique id
- 10
- shipment_idnumber · links to shipments
- 6
- tracking_numbertext
- RT100079190K
- package_typetext
- pallet
- weight_kgdecimal
- 291.19
- length_cmnumber
- 120
- width_cmnumber
- 100
- height_cmnumber
- 122
first 10 of 11,505 rows · your queries use all of them
tracking_events9 columns · 100,515 rows
| event_idnumber · unique id | package_idnumber · links to packages | event_typetext | event_atdate & time | recorded_atdate & time | warehouse_idnumber · links to warehouses | event_sourcetext | exception_codetext | driver_idnumber |
|---|---|---|---|---|---|---|---|---|
| 1 | 6359 | created | 2025-01-01 00:03:46 | 2025-01-01 00:04:36 | NULL | manual | NULL | NULL |
| 2 | 10950 | created | 2025-01-01 00:33:12 | 2025-01-01 00:35:16 | NULL | manual | NULL | NULL |
| 3 | 2045 | created | 2025-01-01 00:35:00 | 2025-01-01 00:37:08 | NULL | manual | NULL | NULL |
| 4 | 5977 | created | 2025-01-01 00:47:34 | 2025-01-01 00:48:13 | NULL | manual | NULL | NULL |
| 5 | 4930 | created | 2025-01-01 00:55:09 | 2025-01-01 00:57:10 | NULL | manual | NULL | NULL |
| 6 | 6331 | created | 2025-01-01 01:34:23 | 2025-01-01 01:35:30 | NULL | manual | NULL | NULL |
| 7 | 2983 | created | 2025-01-01 01:57:14 | 2025-01-01 01:58:01 | NULL | manual | NULL | NULL |
| 8 | 5075 | created | 2025-01-01 02:37:47 | 2025-01-01 02:37:56 | NULL | manual | NULL | NULL |
| 9 | 11260 | created | 2025-01-01 02:53:07 | 2025-01-01 02:54:45 | NULL | manual | NULL | NULL |
| 10 | 1016 | created | 2025-01-01 03:23:13 | 2025-01-01 03:27:04 | NULL | manual | NULL | NULL |
- event_idnumber · unique id
- 1
- package_idnumber · links to packages
- 6359
- event_typetext
- created
- event_atdate & time
- 2025-01-01 00:03:46
- recorded_atdate & time
- 2025-01-01 00:04:36
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 2
- package_idnumber · links to packages
- 10950
- event_typetext
- created
- event_atdate & time
- 2025-01-01 00:33:12
- recorded_atdate & time
- 2025-01-01 00:35:16
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 3
- package_idnumber · links to packages
- 2045
- event_typetext
- created
- event_atdate & time
- 2025-01-01 00:35:00
- recorded_atdate & time
- 2025-01-01 00:37:08
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 4
- package_idnumber · links to packages
- 5977
- event_typetext
- created
- event_atdate & time
- 2025-01-01 00:47:34
- recorded_atdate & time
- 2025-01-01 00:48:13
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 5
- package_idnumber · links to packages
- 4930
- event_typetext
- created
- event_atdate & time
- 2025-01-01 00:55:09
- recorded_atdate & time
- 2025-01-01 00:57:10
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 6
- package_idnumber · links to packages
- 6331
- event_typetext
- created
- event_atdate & time
- 2025-01-01 01:34:23
- recorded_atdate & time
- 2025-01-01 01:35:30
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 7
- package_idnumber · links to packages
- 2983
- event_typetext
- created
- event_atdate & time
- 2025-01-01 01:57:14
- recorded_atdate & time
- 2025-01-01 01:58:01
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 8
- package_idnumber · links to packages
- 5075
- event_typetext
- created
- event_atdate & time
- 2025-01-01 02:37:47
- recorded_atdate & time
- 2025-01-01 02:37:56
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 9
- package_idnumber · links to packages
- 11260
- event_typetext
- created
- event_atdate & time
- 2025-01-01 02:53:07
- recorded_atdate & time
- 2025-01-01 02:54:45
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
- event_idnumber · unique id
- 10
- package_idnumber · links to packages
- 1016
- event_typetext
- created
- event_atdate & time
- 2025-01-01 03:23:13
- recorded_atdate & time
- 2025-01-01 03:27:04
- warehouse_idnumber · links to warehouses
- NULL
- event_sourcetext
- manual
- exception_codetext
- NULL
- driver_idnumber
- NULL
first 10 of 100,515 rows · your queries use all of them
solution.sql
Output
Hints and the answer are always available. Using them counts the question as solved with help.