Put all your Module 2 skills to the test by building a comprehensive sales report from scratch. No new concepts — just pure practice combining JOINs, aggregation, subqueries, CASE WHEN, and everything else you've learned, with explicit attention to result grain.
Before writing the report, take a quick look at the tables you'll be joining. Understand the shape of the data.
SELECT COUNT(*) AS total_orders FROM orders WHERE status != 'cancelled';SELECT COUNT(*) AS total_items FROM order_items;SELECT COUNT(*) AS total_products FROM products;SELECT COUNT(DISTINCT category_id) AS category_count FROM products;Every report starts with understanding your data. These quick counts tell you the volume you're working with. The sales report will join orders, order_items, products, and categories — so confirming these tables have data is step one. Knowing the category count helps you anticipate how many rows your final report will have.
Four counts giving you the size of each table. You'll know roughly how many non-cancelled orders, line items, products, and categories exist in the database.