SQL test: free practice
Seven graded questions on four generated tables — customers, products, employees and orders — running in SQLite inside your browser. Write the query, run it, get graded on the result set (not on whether you typed the exact same SQL as the key).
Your test
You have four tables in SQLite: customers, products, employees, and orders (51 orders). Write SQL for each question and run it. Results are graded against the engine answer (column aliases OK; row order only matters when the question asks for ORDER BY / ranking).
| Aid | Bname | Cregion | Dcity | |
|---|---|---|---|---|
| 2 | 1 | Rosa Ibrahim | North | Tulsa |
| 3 | 2 | Grace Kowalski | East | Mesa |
| 4 | 3 | Rosa Foster | East | Dayton |
| 5 | 4 | Lucia Adeyemi | East | Omaha |
| 6 | 5 | Rosa Chen | West | Dayton |
| 7 | 6 | Priya Bennett | South | Mesa |
| 8 | 7 | Leila Lopez | East | Fresno |
| 9 | 8 | Yuki Reyes | East | Provo |
| 10 | 9 | Rosa Park | South | Dayton |
| 11 | 10 | Zara Shah | East | Reno |
| Aid | Bsku | Cname | Dprice | |
|---|---|---|---|---|
| 2 | 1 | P-160 | Whiteboard | 64.75 |
| 3 | 2 | P-150 | Filing cabinet | 214.00 |
| 4 | 3 | P-190 | Webcam | 72.25 |
| 5 | 4 | P-100 | Copy paper (case) | 42.50 |
| 6 | 5 | P-200 | Keyboard and mouse | 38.00 |
| 7 | 6 | P-120 | Desk chair | 159.00 |
| 8 | 7 | P-130 | Monitor 24in | 189.00 |
| Aid | Bname | Cdepartment | Dhire_date | |
|---|---|---|---|---|
| 2 | 1 | Jamal Silva | Customer Service | 2019-11-07 |
| 3 | 2 | Elena Delgado | Customer Service | 2020-12-19 |
| 4 | 3 | Tariq Kowalski | HR | 2024-12-18 |
| 5 | 4 | Hector Sullivan | Sales | 2021-01-12 |
| 6 | 5 | Leila Mendoza | Sales | 2020-02-23 |
| 7 | 6 | Isaac Kowalski | Marketing | 2023-05-07 |
| 8 | 7 | Liam Castillo | Sales | 2019-02-28 |
| 9 | 8 | Sofia Reyes | Marketing | 2024-10-05 |
| 10 | 9 | Zara Murphy | Operations | 2022-04-05 |
| Aid | Bcustomer_id | Cproduct_id | Demployee_id | Eorder_date | Fqty | Gamount | |
|---|---|---|---|---|---|---|---|
| 2 | 1001 | 5 | 7 | 1 | 2026-10-18 | 4 | 756.00 |
| 3 | 1002 | 9 | 7 | 8 | 2026-02-12 | 5 | 945.00 |
| 4 | 1003 | 6 | 7 | 7 | 2026-05-12 | 4 | 756.00 |
| 5 | 1004 | 9 | 5 | 7 | 2026-06-15 | 5 | 190.00 |
| 6 | 1005 | 7 | 1 | 3 | 2026-04-01 | 5 | 323.75 |
| 7 | 1006 | 8 | 3 | 7 | 2026-04-02 | 7 | 505.75 |
| 8 | 1007 | 5 | 7 | 1 | 2026-01-26 | 2 | 378.00 |
| 9 | 1008 | 5 | 6 | 7 | 2026-01-28 | 4 | 636.00 |
| 10 | 1009 | 6 | 7 | 5 | 2026-08-20 | 3 | 567.00 |
| 11 | 1010 | 7 | 6 | 2 | 2026-08-18 | 8 | 1272.00 |
| 12 | 1011 | 1 | 6 | 7 | 2026-04-15 | 1 | 159.00 |
| 13 | 1012 | 7 | 4 | 3 | 2026-05-21 | 7 | 297.50 |
| 14 | 1013 | 4 | 1 | 7 | 2026-04-27 | 2 | 129.50 |
| 15 | 1014 | 10 | 1 | 1 | 2026-07-04 | 1 | 64.75 |
| 16 | 1015 | 6 | 1 | 2 | 2026-03-03 | 7 | 453.25 |
| 17 | 1016 | 8 | 2 | 8 | 2026-10-23 | 5 | 1070.00 |
| 18 | 1017 | 3 | 2 | 9 | 2026-07-19 | 7 | 1498.00 |
| 19 | 1018 | 9 | 7 | 9 | 2026-03-27 | 6 | 1134.00 |
| 20 | 1019 | 6 | 4 | 2 | 2026-05-18 | 6 | 255.00 |
| 21 | 1020 | 5 | 6 | 4 | 2026-08-26 | 1 | 159.00 |
| 22 | 1021 | 8 | 4 | 1 | 2026-07-17 | 8 | 340.00 |
| 23 | 1022 | 10 | 1 | 4 | 2026-09-05 | 4 | 259.00 |
| 24 | 1023 | 10 | 1 | 6 | 2026-06-25 | 1 | 64.75 |
| 25 | 1024 | 3 | 5 | 1 | 2026-09-10 | 1 | 38.00 |
| 26 | 1025 | 3 | 1 | 4 | 2026-09-28 | 4 | 259.00 |
| 27 | 1026 | 8 | 1 | 8 | 2026-03-09 | 4 | 259.00 |
| 28 | 1027 | 8 | 1 | 6 | 2026-10-06 | 2 | 129.50 |
| 29 | 1028 | 8 | 1 | 7 | 2026-02-02 | 7 | 453.25 |
| 30 | 1029 | 3 | 6 | 7 | 2026-02-04 | 6 | 954.00 |
| 31 | 1030 | 3 | 7 | 5 | 2026-06-27 | 6 | 1134.00 |
| 32 | 1031 | 8 | 4 | 2 | 2026-10-14 | 5 | 212.50 |
| 33 | 1032 | 7 | 1 | 7 | 2026-05-01 | 1 | 64.75 |
| 34 | 1033 | 6 | 1 | 2 | 2026-03-04 | 4 | 259.00 |
| 35 | 1034 | 4 | 5 | 9 | 2026-01-13 | 6 | 228.00 |
| 36 | 1035 | 1 | 6 | 5 | 2026-04-03 | 8 | 1272.00 |
| 37 | 1036 | 8 | 5 | 5 | 2026-08-25 | 8 | 304.00 |
| 38 | 1037 | 9 | 4 | 4 | 2026-08-22 | 5 | 212.50 |
| 39 | 1038 | 8 | 6 | 2 | 2026-08-23 | 5 | 795.00 |
| 40 | 1039 | 4 | 6 | 9 | 2026-06-01 | 3 | 477.00 |
| 41 | 1040 | 3 | 5 | 6 | 2026-03-15 | 5 | 190.00 |
| 42 | 1041 | 8 | 1 | 1 | 2026-01-01 | 1 | 64.75 |
| 43 | 1042 | 2 | 2 | 8 | 2026-08-18 | 4 | 856.00 |
| 44 | 1043 | 5 | 3 | 4 | 2026-02-23 | 4 | 289.00 |
| 45 | 1044 | 10 | 7 | 8 | 2026-07-11 | 2 | 378.00 |
| 46 | 1045 | 4 | 5 | 5 | 2026-03-21 | 5 | 190.00 |
| 47 | 1046 | 3 | 4 | 3 | 2026-10-13 | 7 | 297.50 |
| 48 | 1047 | 6 | 1 | 8 | 2026-01-19 | 6 | 388.50 |
| 49 | 1048 | 2 | 1 | 7 | 2026-03-06 | 5 | 323.75 |
| 50 | 1049 | 4 | 6 | 4 | 2026-02-24 | 8 | 1272.00 |
| 51 | 1050 | 9 | 2 | 7 | 2026-09-21 | 5 | 1070.00 |
| 52 | 1051 | 2 | 4 | 9 | 2026-09-26 | 8 | 340.00 |
Tables are loaded into an in-browser SQLite database (sql.js). Write a query per question, press Run (or Check all). Only the result set is graded — aliases and extra whitespace are fine.
What this test covers
- SELECT / WHERE — filter orders by amount.
- GROUP BY / HAVING — region revenue with a threshold.
- JOINs — customer and product names for one order.
- Date filters — orders in a given month.
- Subquery / CTE — customers above average order count.
- Window functions — RANK by product revenue and a running total by date.
Short skill sets (one topic each) live on the SQL practice page. Analysts who also need spreadsheet work can browse Excel tests by topic or job.
Questions people ask
Is this an official SQL certification or vendor exam?
No. It is practice we write ourselves: generated tables and questions graded by comparing your query’s result set to the engine answer. We do not copy any employer or vendor exam.
What database runs in the browser?
SQLite via sql.js (WebAssembly), loaded only on SQL pages so the rest of the site stays light. Standard SELECT / JOIN / GROUP BY / CTE / window syntax that SQLite supports.
Does column order or alias names matter?
Column count must match. Aliases can differ; values are compared case-insensitively with money-style floats rounded to two decimals. Row order only matters when the question asks for ORDER BY or a ranked list.
How long should this take?
Seven questions, about 30 minutes. Re-run on new data until you can finish cleanly.
Keep practicing
SQL practice exercises
Short SQL skill sets: WHERE, JOIN, GROUP BY, RANK.
ExcelExcel assessment test
8 questions, about 25 minutes. Lookups, conditional sums, dates.
ExcelExcel interview test
6 interview-style questions on a shipments sheet.
ExcelAdministrative assistant Excel test
Dedupe clients, chase overdue invoices, total orders.
ExcelAccounts payable Excel test
Duplicate bills, PO mismatches, aging buckets.
ExcelExcel charts test
Column, line and pie: peak month, slice share, chart-type choices.
ExcelExcel regression test
SLOPE, INTERCEPT, RSQ, CORREL, FORECAST on noisy data.
ExcelBookkeeper Excel test
Bank reconciliation: uncleared items and amount mismatches.