Ask better questions of real tables.
Write live SQL queries against a Nigerian retail and training database (customers, products, orders and Paystack/POS payments), inspect query charts, or audit messy CSV files — completely inside your browser.
- SQL sandbox
- Nigerian dataset
- CSV cleaner + charts
Challenge · Starter
1. Filter by City
Find all customers located in 'Port Harcourt'. Return full_name and segment.
| full_name | segment |
|---|---|
| Chinedu Okafor | SME |
| Ngozi Eze | Student |
| Blessing Wike | SME |
Write SELECT first, think FROM first
Beginners often write SQL top-to-bottom without realising the database engine runs clauses in a different order: FROM and JOIN assemble the rows first, WHERE filters individual rows, GROUP BY collects buckets, HAVING filters those buckets, SELECT computes the columns, and ORDER BY / LIMIT sort and trim the final table.
That explains why an alias you create in SELECT (such as SUM(settled_ngn) AS total_settled) works in ORDER BY but should not be relied upon inside WHERE.
Real reconciliation workflow: try joining orders with payments and comparing total_ngn against settled_ngn — the gap reveals Paystack and POS transaction charges across Nigerian payment channels.
Three SQL bugs every Nigerian data analyst hits
Missing single quotes on text: write WHERE city = 'Port Harcourt', not WHERE city = Port Harcourt. Unquoted words are treated as column names.
WHERE vs HAVING confusion: use WHERE before grouping (e.g., order_status = 'paid') and HAVING after grouping (e.g., HAVING COUNT(*) >= 2).
INNER JOIN hides unpaid orders: if an order has no matching row in payments, an INNER JOIN drops it silently. Switch to LEFT JOIN ... WHERE p.payment_id IS NULL when auditing pending or refunded transactions.
Want full Excel, Power BI and SQL mentorship? See the Data Analytics course or test formulas in CEA Spreadsheet Lab.
Next step
Turn raw spreadsheets into business decisions.
CEA Data Analytics covers Excel, SQL, Python, Power BI and executive reporting using realistic Nigerian retail, fintech and operations datasets.
Admissions open · Two sessions a week · 24 Ebony Road, Port Harcourt