Interview Practice

Data skills · 12 exercises

Explore a business with SQL

Query a fictional retailer’s customers, orders and returns in a real browser-based SQLite database.
← All project labs
SQL runs locally in a Web Worker using SQLite through the existing Pyodide runtime. Only read operations are allowed; each run starts with fresh data. Results are limited to 200 rows and execution is bounded. No server executes your SQL.

Exercise 1 / 12

Read the order book

Return order_id and amount for all orders, ordered by order_id.

Expected result

order_idamount
101120
102500
10380
104200
105300
106100

Column names and order must match. Row order is ignored; duplicate rows still count.

Schema & seed data

customers.customer_id → orders.customer_id; orders.order_id → returns.order_id. A return can be partial; pending refunds have NULL days_to_refund. SQL uses SQLite syntax.

customers (5 rows)

customer_id INTEGER · name TEXT · segment TEXT

customer_idnamesegment
1AshaRetail
2BenCorporate
3ChenRetail
4DinaCorporate
5EliRetail
orders (6 rows)

order_id INTEGER · customer_id INTEGER · amount REAL · ordered_at TEXT

order_idcustomer_idamountordered_at
10111202026-01-05
10225002026-01-10
1031802026-02-01
10432002026-02-08
10543002026-02-12
10621002026-02-18
returns (5 rows)

return_id INTEGER · order_id INTEGER · reason TEXT · refund REAL · days_to_refund INTEGER · status TEXT

return_idorder_idreasonrefunddays_to_refundstatus
1101Damaged1203Paid
2102Wrong item2507Paid
3104Damaged200NULLPending
4105Changed mind1005Paid
5106Damaged1002Paid