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 Reconciliation & quality gates · hard
Settlements, refunds and disputes
Find settlements in Q1 2025 with any refund or credited chargeback. Return settlement_id, settled_cents, refunded_cents, disputed_cents (credited chargebacks) and status: 'double_recovery' when refunds plus credited disputes exceed the settlement, 'fully_recovered' when they equal it, otherwise 'partially_recovered'.
what to return
- Columns
settlement_idsettled_centsrefunded_centsdisputed_centsstatusin this order- Rows
- 523 rows · any order
- Skill
- Reconcile one amount against two kinds of recovery. Refresher: Revenue & payment reconciliation →
expected result
expected result523 rows · any order
| settlement_id | settled_cents | refunded_cents | disputed_cents | status |
|---|---|---|---|---|
| 18689 | 4372 | 4372 | 0 | fully_recovered |
| 7857 | 899 | 271 | 0 | partially_recovered |
| 34657 | 2499 | 0 | 2499 | fully_recovered |
first 3 of 523 rows
data you can query
settlements4 columns · 37,071 rows
| settlement_idnumber · unique id | authorization_idnumber · links to authorizations | settled_atdate & time | amount_centsnumber |
|---|---|---|---|
| 1 | 3 | 2025-01-23 01:12:53 | 7655 |
| 2 | 4 | 2025-01-30 13:04:51 | 6852 |
| 3 | 5 | 2025-01-30 17:41:21 | 5771 |
| 4 | 6 | 2025-02-11 06:57:34 | 3717 |
| 5 | 7 | 2025-02-11 19:25:53 | 4401 |
| 6 | 8 | 2025-02-20 03:08:18 | 9288 |
| 7 | 9 | 2025-03-02 17:28:41 | 6724 |
| 8 | 10 | 2025-03-30 06:36:29 | 9131 |
| 9 | 11 | 2025-04-02 19:51:05 | 16129 |
| 10 | 12 | 2025-04-04 01:55:52 | 25236 |
- settlement_idnumber · unique id
- 1
- authorization_idnumber · links to authorizations
- 3
- settled_atdate & time
- 2025-01-23 01:12:53
- amount_centsnumber
- 7655
- settlement_idnumber · unique id
- 2
- authorization_idnumber · links to authorizations
- 4
- settled_atdate & time
- 2025-01-30 13:04:51
- amount_centsnumber
- 6852
- settlement_idnumber · unique id
- 3
- authorization_idnumber · links to authorizations
- 5
- settled_atdate & time
- 2025-01-30 17:41:21
- amount_centsnumber
- 5771
- settlement_idnumber · unique id
- 4
- authorization_idnumber · links to authorizations
- 6
- settled_atdate & time
- 2025-02-11 06:57:34
- amount_centsnumber
- 3717
- settlement_idnumber · unique id
- 5
- authorization_idnumber · links to authorizations
- 7
- settled_atdate & time
- 2025-02-11 19:25:53
- amount_centsnumber
- 4401
- settlement_idnumber · unique id
- 6
- authorization_idnumber · links to authorizations
- 8
- settled_atdate & time
- 2025-02-20 03:08:18
- amount_centsnumber
- 9288
- settlement_idnumber · unique id
- 7
- authorization_idnumber · links to authorizations
- 9
- settled_atdate & time
- 2025-03-02 17:28:41
- amount_centsnumber
- 6724
- settlement_idnumber · unique id
- 8
- authorization_idnumber · links to authorizations
- 10
- settled_atdate & time
- 2025-03-30 06:36:29
- amount_centsnumber
- 9131
- settlement_idnumber · unique id
- 9
- authorization_idnumber · links to authorizations
- 11
- settled_atdate & time
- 2025-04-02 19:51:05
- amount_centsnumber
- 16129
- settlement_idnumber · unique id
- 10
- authorization_idnumber · links to authorizations
- 12
- settled_atdate & time
- 2025-04-04 01:55:52
- amount_centsnumber
- 25236
first 10 of 37,071 rows · your queries use all of them
refunds5 columns · 1,230 rows
| refund_idnumber · unique id | settlement_idnumber · links to settlements | refunded_atdate & time | amount_centsnumber | reasontext |
|---|---|---|---|---|
| 1 | 25 | 2025-02-12 02:56:32 | 2820 | returned_item |
| 2 | 27 | 2025-03-01 03:02:52 | 11883 | returned_item |
| 3 | 268 | 2025-03-01 07:28:00 | 367 | canceled_service |
| 4 | 313 | 2025-05-30 14:18:37 | 1601 | returned_item |
| 5 | 313 | 2025-06-15 14:18:37 | 2440 | canceled_service |
| 6 | 348 | 2025-05-11 19:21:17 | 19843 | price_adjustment |
| 7 | 370 | 2025-05-13 17:27:37 | 3055 | duplicate_charge |
| 8 | 370 | 2025-05-29 17:27:37 | 6604 | returned_item |
| 9 | 389 | 2025-02-15 19:14:51 | 1285 | returned_item |
| 10 | 394 | 2025-03-02 11:26:18 | 1351 | price_adjustment |
- refund_idnumber · unique id
- 1
- settlement_idnumber · links to settlements
- 25
- refunded_atdate & time
- 2025-02-12 02:56:32
- amount_centsnumber
- 2820
- reasontext
- returned_item
- refund_idnumber · unique id
- 2
- settlement_idnumber · links to settlements
- 27
- refunded_atdate & time
- 2025-03-01 03:02:52
- amount_centsnumber
- 11883
- reasontext
- returned_item
- refund_idnumber · unique id
- 3
- settlement_idnumber · links to settlements
- 268
- refunded_atdate & time
- 2025-03-01 07:28:00
- amount_centsnumber
- 367
- reasontext
- canceled_service
- refund_idnumber · unique id
- 4
- settlement_idnumber · links to settlements
- 313
- refunded_atdate & time
- 2025-05-30 14:18:37
- amount_centsnumber
- 1601
- reasontext
- returned_item
- refund_idnumber · unique id
- 5
- settlement_idnumber · links to settlements
- 313
- refunded_atdate & time
- 2025-06-15 14:18:37
- amount_centsnumber
- 2440
- reasontext
- canceled_service
- refund_idnumber · unique id
- 6
- settlement_idnumber · links to settlements
- 348
- refunded_atdate & time
- 2025-05-11 19:21:17
- amount_centsnumber
- 19843
- reasontext
- price_adjustment
- refund_idnumber · unique id
- 7
- settlement_idnumber · links to settlements
- 370
- refunded_atdate & time
- 2025-05-13 17:27:37
- amount_centsnumber
- 3055
- reasontext
- duplicate_charge
- refund_idnumber · unique id
- 8
- settlement_idnumber · links to settlements
- 370
- refunded_atdate & time
- 2025-05-29 17:27:37
- amount_centsnumber
- 6604
- reasontext
- returned_item
- refund_idnumber · unique id
- 9
- settlement_idnumber · links to settlements
- 389
- refunded_atdate & time
- 2025-02-15 19:14:51
- amount_centsnumber
- 1285
- reasontext
- returned_item
- refund_idnumber · unique id
- 10
- settlement_idnumber · links to settlements
- 394
- refunded_atdate & time
- 2025-03-02 11:26:18
- amount_centsnumber
- 1351
- reasontext
- price_adjustment
first 10 of 1,230 rows · your queries use all of them
chargebacks7 columns · 199 rows
| chargeback_idnumber · unique id | settlement_idnumber · links to settlements | opened_atdate & time | amount_centsnumber | reason_codetext | statustext | resolved_atdate & time |
|---|---|---|---|---|---|---|
| 1 | 55 | 2025-01-27 13:07:58 | 2791 | not_received | open | NULL |
| 2 | 84 | 2025-03-30 16:16:40 | 2854 | not_as_described | credited | 2025-04-21 16:16:40 |
| 3 | 274 | 2025-03-25 12:37:00 | 1549 | duplicate | rejected | 2025-04-17 12:37:00 |
| 4 | 391 | 2025-03-05 04:12:00 | 2499 | not_received | rejected | 2025-04-19 04:12:00 |
| 5 | 584 | 2025-03-22 18:26:08 | 3761 | not_received | credited | 2025-04-27 18:26:08 |
| 6 | 1029 | 2025-06-15 18:35:43 | 5569 | not_received | open | NULL |
| 7 | 1145 | 2025-03-30 21:11:51 | 1584 | duplicate | rejected | 2025-05-04 21:11:51 |
| 8 | 1579 | 2025-05-08 11:17:00 | 4999 | not_as_described | rejected | 2025-06-12 11:17:00 |
| 9 | 1647 | 2025-03-08 16:45:52 | 4751 | not_as_described | credited | 2025-04-14 16:45:52 |
| 10 | 1831 | 2025-06-10 10:51:00 | 1199 | fraud | open | NULL |
- chargeback_idnumber · unique id
- 1
- settlement_idnumber · links to settlements
- 55
- opened_atdate & time
- 2025-01-27 13:07:58
- amount_centsnumber
- 2791
- reason_codetext
- not_received
- statustext
- open
- resolved_atdate & time
- NULL
- chargeback_idnumber · unique id
- 2
- settlement_idnumber · links to settlements
- 84
- opened_atdate & time
- 2025-03-30 16:16:40
- amount_centsnumber
- 2854
- reason_codetext
- not_as_described
- statustext
- credited
- resolved_atdate & time
- 2025-04-21 16:16:40
- chargeback_idnumber · unique id
- 3
- settlement_idnumber · links to settlements
- 274
- opened_atdate & time
- 2025-03-25 12:37:00
- amount_centsnumber
- 1549
- reason_codetext
- duplicate
- statustext
- rejected
- resolved_atdate & time
- 2025-04-17 12:37:00
- chargeback_idnumber · unique id
- 4
- settlement_idnumber · links to settlements
- 391
- opened_atdate & time
- 2025-03-05 04:12:00
- amount_centsnumber
- 2499
- reason_codetext
- not_received
- statustext
- rejected
- resolved_atdate & time
- 2025-04-19 04:12:00
- chargeback_idnumber · unique id
- 5
- settlement_idnumber · links to settlements
- 584
- opened_atdate & time
- 2025-03-22 18:26:08
- amount_centsnumber
- 3761
- reason_codetext
- not_received
- statustext
- credited
- resolved_atdate & time
- 2025-04-27 18:26:08
- chargeback_idnumber · unique id
- 6
- settlement_idnumber · links to settlements
- 1029
- opened_atdate & time
- 2025-06-15 18:35:43
- amount_centsnumber
- 5569
- reason_codetext
- not_received
- statustext
- open
- resolved_atdate & time
- NULL
- chargeback_idnumber · unique id
- 7
- settlement_idnumber · links to settlements
- 1145
- opened_atdate & time
- 2025-03-30 21:11:51
- amount_centsnumber
- 1584
- reason_codetext
- duplicate
- statustext
- rejected
- resolved_atdate & time
- 2025-05-04 21:11:51
- chargeback_idnumber · unique id
- 8
- settlement_idnumber · links to settlements
- 1579
- opened_atdate & time
- 2025-05-08 11:17:00
- amount_centsnumber
- 4999
- reason_codetext
- not_as_described
- statustext
- rejected
- resolved_atdate & time
- 2025-06-12 11:17:00
- chargeback_idnumber · unique id
- 9
- settlement_idnumber · links to settlements
- 1647
- opened_atdate & time
- 2025-03-08 16:45:52
- amount_centsnumber
- 4751
- reason_codetext
- not_as_described
- statustext
- credited
- resolved_atdate & time
- 2025-04-14 16:45:52
- chargeback_idnumber · unique id
- 10
- settlement_idnumber · links to settlements
- 1831
- opened_atdate & time
- 2025-06-10 10:51:00
- amount_centsnumber
- 1199
- reason_codetext
- fraud
- statustext
- open
- resolved_atdate & time
- NULL
first 10 of 199 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.