Free interactive SQL course
Learn SQL by writing real queries.
QueryCraft SQL is a free, practical SQL course for beginners and refreshers. Practice SQL online free with checked exercises, hints, answer review, exams, and one consistent training database.
SELECT c.customer_name, SUM(oi.quantity * oi.unit_price) AS revenue
FROM customers c
JOIN orders o ON o.customer_id = c.customer_id
JOIN order_items oi ON oi.order_id = o.order_id
GROUP BY c.customer_name
ORDER BY revenue DESC;
Correct. 8 rows returned.
Course schema
One realistic database across the course
The full schema includes hubs, neighborhoods, customers, staff, suppliers, categories, products, inventory, promotions, orders, order items, payments, deliveries, reviews, and support tickets.