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 LAG / LEAD · medium
When did devices go silent?
Find every gap between consecutive readings that is longer than three times the device’s reporting_interval_minutes. Return device_id, last_seen, next_seen and silent_minutes.
what to return
- Columns
device_idlast_seennext_seensilent_minutesin this order- Rows
- 84 rows · any order
- Skill
- Find gaps longer than expected between consecutive events. Refresher: FIRST_VALUE, LAST_VALUE & frames →
expected result
expected result84 rows · any order
| device_id | last_seen | next_seen | silent_minutes |
|---|---|---|---|
| 1 | 2025-03-13 08:38:00 | 2025-03-13 20:38:00 | 720 |
| 3 | 2025-04-23 14:54:00 | 2025-04-23 18:54:00 | 240 |
| 5 | 2025-03-15 06:06:00 | 2025-03-15 20:06:00 | 840 |
first 3 of 84 rows
data you can query
sensor_readings10 columns · 150,425 rows
| reading_idnumber · unique id | device_idnumber · links to devices | sequence_numbernumber | recorded_atdate & time | received_atdate & time | valuedecimal | battery_pctnumber | gateway_idnumber | signal_rssi_dbmnumber | quality_flagtext |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 17 | 16458 | 2025-03-01 00:00:00 | 2025-03-01 00:00:12 | 18.38 | NULL | NULL | NULL | ok |
| 2 | 7 | 25230 | 2025-03-01 00:00:00 | 2025-03-01 00:00:42 | 5.22 | 67 | 22 | -81 | ok |
| 3 | 169 | 56856 | 2025-03-01 00:02:00 | 2025-03-01 00:02:53 | 40.03 | NULL | NULL | NULL | ok |
| 4 | 12 | 50947 | 2025-03-01 00:03:00 | 2025-03-01 00:03:17 | 36.84 | NULL | NULL | NULL | ok |
| 5 | 34 | 50357 | 2025-03-01 00:02:00 | 2025-03-01 00:03:17 | 40.22 | NULL | NULL | NULL | ok |
| 6 | 123 | 32417 | 2025-03-01 00:03:00 | 2025-03-01 00:03:32 | 38.37 | NULL | NULL | NULL | ok |
| 7 | 150 | 67813 | 2025-03-01 00:04:00 | 2025-03-01 00:04:27 | 38.17 | NULL | NULL | NULL | ok |
| 8 | 46 | 28128 | 2025-03-01 00:04:00 | 2025-03-01 00:04:30 | 18.66 | NULL | NULL | NULL | ok |
| 9 | 5 | 49051 | 2025-03-01 00:06:00 | 2025-03-01 00:06:13 | 39.79 | NULL | NULL | NULL | ok |
| 10 | 5 | 49051 | 2025-03-01 00:06:00 | 2025-03-01 00:10:53 | 39.79 | NULL | NULL | NULL | ok |
- reading_idnumber · unique id
- 1
- device_idnumber · links to devices
- 17
- sequence_numbernumber
- 16458
- recorded_atdate & time
- 2025-03-01 00:00:00
- received_atdate & time
- 2025-03-01 00:00:12
- valuedecimal
- 18.38
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 2
- device_idnumber · links to devices
- 7
- sequence_numbernumber
- 25230
- recorded_atdate & time
- 2025-03-01 00:00:00
- received_atdate & time
- 2025-03-01 00:00:42
- valuedecimal
- 5.22
- battery_pctnumber
- 67
- gateway_idnumber
- 22
- signal_rssi_dbmnumber
- -81
- quality_flagtext
- ok
- reading_idnumber · unique id
- 3
- device_idnumber · links to devices
- 169
- sequence_numbernumber
- 56856
- recorded_atdate & time
- 2025-03-01 00:02:00
- received_atdate & time
- 2025-03-01 00:02:53
- valuedecimal
- 40.03
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 4
- device_idnumber · links to devices
- 12
- sequence_numbernumber
- 50947
- recorded_atdate & time
- 2025-03-01 00:03:00
- received_atdate & time
- 2025-03-01 00:03:17
- valuedecimal
- 36.84
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 5
- device_idnumber · links to devices
- 34
- sequence_numbernumber
- 50357
- recorded_atdate & time
- 2025-03-01 00:02:00
- received_atdate & time
- 2025-03-01 00:03:17
- valuedecimal
- 40.22
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 6
- device_idnumber · links to devices
- 123
- sequence_numbernumber
- 32417
- recorded_atdate & time
- 2025-03-01 00:03:00
- received_atdate & time
- 2025-03-01 00:03:32
- valuedecimal
- 38.37
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 7
- device_idnumber · links to devices
- 150
- sequence_numbernumber
- 67813
- recorded_atdate & time
- 2025-03-01 00:04:00
- received_atdate & time
- 2025-03-01 00:04:27
- valuedecimal
- 38.17
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 8
- device_idnumber · links to devices
- 46
- sequence_numbernumber
- 28128
- recorded_atdate & time
- 2025-03-01 00:04:00
- received_atdate & time
- 2025-03-01 00:04:30
- valuedecimal
- 18.66
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 9
- device_idnumber · links to devices
- 5
- sequence_numbernumber
- 49051
- recorded_atdate & time
- 2025-03-01 00:06:00
- received_atdate & time
- 2025-03-01 00:06:13
- valuedecimal
- 39.79
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
- reading_idnumber · unique id
- 10
- device_idnumber · links to devices
- 5
- sequence_numbernumber
- 49051
- recorded_atdate & time
- 2025-03-01 00:06:00
- received_atdate & time
- 2025-03-01 00:10:53
- valuedecimal
- 39.79
- battery_pctnumber
- NULL
- gateway_idnumber
- NULL
- signal_rssi_dbmnumber
- NULL
- quality_flagtext
- ok
first 10 of 150,425 rows · your queries use all of them
devices9 columns · 186 rows
| device_idnumber · unique id | serial_numbertext | sensor_type_idnumber · links to sensor_types | location_idnumber · links to locations | modeltext | firmware_versiontext | reporting_interval_minutesnumber | installed_atdate & time | retired_attext |
|---|---|---|---|---|---|---|---|---|
| 1 | SN-0107919 | 1 | 1 | ColdSense 400 | 2.4.2 | 60 | 2023-09-13 00:00:00 | NULL |
| 2 | SN-0115838 | 1 | 1 | ColdSense 400 | 2.4.2 | 60 | 2024-06-30 00:00:00 | NULL |
| 3 | SN-0123757 | 1 | 1 | ThermoTag T2 | 3.0.1 | 60 | 2024-09-11 00:00:00 | NULL |
| 4 | SN-0131676 | 1 | 1 | ThermoTag T2 | 2.4.2 | 60 | 2024-05-31 00:00:00 | NULL |
| 5 | SN-0339595 | 3 | 1 | EnviroNode E1 | 2.4.0 | 120 | 2024-09-09 00:00:00 | NULL |
| 6 | SN-0347514 | 3 | 1 | HygroPro | 2.4.2 | 120 | 2023-07-26 00:00:00 | NULL |
| 7 | SN-0155433 | 1 | 2 | ColdSense 400 | 2.4.2 | 60 | 2024-06-05 00:00:00 | NULL |
| 8 | SN-0163352 | 1 | 2 | ColdSense 400 | 2.4.0 | 60 | 2024-04-25 00:00:00 | NULL |
| 9 | SN-0171271 | 1 | 2 | ThermoTag T2 | 2.4.0 | 60 | 2022-12-08 00:00:00 | NULL |
| 10 | SN-0179190 | 1 | 2 | ThermoTag T2 | 2.4.2 | 60 | 2024-11-28 00:00:00 | NULL |
- device_idnumber · unique id
- 1
- serial_numbertext
- SN-0107919
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 1
- modeltext
- ColdSense 400
- firmware_versiontext
- 2.4.2
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2023-09-13 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 2
- serial_numbertext
- SN-0115838
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 1
- modeltext
- ColdSense 400
- firmware_versiontext
- 2.4.2
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2024-06-30 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 3
- serial_numbertext
- SN-0123757
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 1
- modeltext
- ThermoTag T2
- firmware_versiontext
- 3.0.1
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2024-09-11 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 4
- serial_numbertext
- SN-0131676
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 1
- modeltext
- ThermoTag T2
- firmware_versiontext
- 2.4.2
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2024-05-31 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 5
- serial_numbertext
- SN-0339595
- sensor_type_idnumber · links to sensor_types
- 3
- location_idnumber · links to locations
- 1
- modeltext
- EnviroNode E1
- firmware_versiontext
- 2.4.0
- reporting_interval_minutesnumber
- 120
- installed_atdate & time
- 2024-09-09 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 6
- serial_numbertext
- SN-0347514
- sensor_type_idnumber · links to sensor_types
- 3
- location_idnumber · links to locations
- 1
- modeltext
- HygroPro
- firmware_versiontext
- 2.4.2
- reporting_interval_minutesnumber
- 120
- installed_atdate & time
- 2023-07-26 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 7
- serial_numbertext
- SN-0155433
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 2
- modeltext
- ColdSense 400
- firmware_versiontext
- 2.4.2
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2024-06-05 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 8
- serial_numbertext
- SN-0163352
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 2
- modeltext
- ColdSense 400
- firmware_versiontext
- 2.4.0
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2024-04-25 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 9
- serial_numbertext
- SN-0171271
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 2
- modeltext
- ThermoTag T2
- firmware_versiontext
- 2.4.0
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2022-12-08 00:00:00
- retired_attext
- NULL
- device_idnumber · unique id
- 10
- serial_numbertext
- SN-0179190
- sensor_type_idnumber · links to sensor_types
- 1
- location_idnumber · links to locations
- 2
- modeltext
- ThermoTag T2
- firmware_versiontext
- 2.4.2
- reporting_interval_minutesnumber
- 60
- installed_atdate & time
- 2024-11-28 00:00:00
- retired_attext
- NULL
first 10 of 186 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.