← All coursesStart lesson →
SQL Analyst Starter
Write and run SQL queries to answer everyday business questions.
beginner · About 70 minutes · 4 lessons · 8 exercises + 1 project
Your finished work
Runnable queries, checked result tables and explanations for business edge cases.
All examples use fictional, synthetic business data. Practice standard: each exercise ≥70, final project ≥80.
The course
- Start lesson →
1. Filter with both conditions
Select paid orders strictly above a threshold.
- Start lesson →
2. Group without losing rows
Aggregate revenue by a declared grouping key.
- Start lesson →
3. Join and keep unmatched orders
Use a left join for a complete order list.
- Start lesson →
4. Treat NULL explicitly
Distinguish missing values from zero and blank text.
Final project
Build a checked paid-order report
Start the project →Preview the input
CREATE TABLE orders(order_id INTEGER, customer_id INTEGER, status TEXT, amount INTEGER, region TEXT, ordered_at TEXT);
INSERT INTO orders VALUES (1,1,'paid',120,'East','2026-09-01'),(2,2,'pending',140,'West','2026-09-02'),(3,1,'paid',100,'East','2026-09-03'),(4,3,'paid',180,'West','2026-09-03'),(5,99,'paid',80,'East','2026-09-04'),(6,NULL,'cancelled',0,NULL,'2026-09-04'),(7,2,'paid',120,'West','2026-09-05'),(8,4,'paid',30,'North','2026-09-06');
CREATE TABLE customers(customer_id INTEGER PRIMARY KEY,name TEXT,email TEXT);
INSERT INTO customers VALUES(1,'Avery','team@example.test'),(2,'Morgan','team@example.test'),(3,'Riley',NULL),(4,'Casey',''),(5,'Sky','sky@example.test');
CREATE TABLE returns(return_id INTEGER,order_id INTEGER,refund INTEGER);
INSERT INTO returns VALUES(1,1,20),(2,1,10),(3,4,180),(4,99,25);
CREATE TABLE inventory(sku TEXT,on_hand INTEGER,reorder_at INTEGER);
INSERT INTO inventory VALUES('PEN',5,10),('BOOK',20,10),('MUG',0,5),('BAG',NULL,4),('CARD',4,4);
CREATE TABLE events(event_id INTEGER,customer_id INTEGER,stage TEXT);
INSERT INTO events VALUES(1,1,'visit'),(2,1,'visit'),(3,1,'checkout'),(4,2,'visit'),(5,3,'visit'),(6,3,'checkout'),(7,4,'visit');