Data & Analytics free courses

Master the TrickFoundationFree

SQL Reporting Practice

Practice filtering, joins and grouped reporting with a small fictional order dataset.

3 reading lessons · about 30 min ·written by MTT

The idea

SELECT chooses columns and WHERE filters rows. SQL treats NULL as missing or unknown, not as zero or an empty string. Use IS NULL to test for missing values; equality with NULL does not work like an ordinary comparison. State which rows belong in a report before writing a query, and keep examples away from production databases.

Worked example

A fictional orders table contains order_id, status and total. SELECT order_id, total FROM orders WHERE status = 'completed' returns completed orders. A missing total needs a separate check using total IS NULL. Silently replacing every unknown total with zero could make the sales report look complete while understating its value.

Try it

Draw five order rows, including two completed orders and one missing total. Work out the result of the completed-order filter by hand. Write a separate missing-total query and explain whether the unknown amount belongs in a revenue total. Use fictional values only.

Lesson 1 of 3 · About 10 min

Select and filter records

Check your understanding

Course quiz

Finish the course to unlock the quiz

Complete all 3 lessons and 5 questions open up here. You have 3 to go.

What you will learn

  • Filter rows and handle missing values
  • Join related tables without double-counting
  • Explain grouped totals and acceptance checks

Before you start

Prerequisites
Basic table familiarity. Exercises can be worked on paper or in a local SQL practice database.
Cost
Free introductory reading lessons, exercises and quiz. Optional third-party tools, hosting or AI subscriptions may cost money.

Original introductory lessons and assessment by Master the Trick. Estimated times include the suggested exercises.