Thuta Learning
AdvancedData & Databasesbeginner

Mini Project

Relax. We'll talk through this in plain words — no textbook voice.

Mini Project: Simple Customer Order Report

What we'll build

We'll join the Customers and Orders tables to produce a report showing which customers have orders and which don't. This project shows you what SQL looks like when it's powering a real dashboard report.

Skills you will practice

• Understanding table relationships

LEFT JOIN usage

COUNT() for counting orders

GROUP BY to produce a per-customer summary

How it works

Customers table as the base, joined with the Orders table on CustomerID. Then it counts the number of orders for each customer.

sql
SELECT Customers.CustomerName,
       Customers.Country,
       COUNT(Orders.OrderID) AS TotalOrders
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID = Orders.CustomerID
GROUP BY Customers.CustomerID, Customers.CustomerName, Customers.Country
ORDER BY TotalOrders DESC;
You should see
+--------------------+---------+-------------+ | CustomerName | Country | TotalOrders | +--------------------+---------+-------------+ | Ana Trujillo | Mexico | 1 | | Antonio Moreno | Mexico | 1 | | Alfreds Futterkiste| Germany | 0 | | Around the Horn | UK | 0 | +--------------------+---------+-------------+ Expected behavior: Customers with orders show a count, and customers without any orders yet show 0. How to improve it later: Try adding a date filter to generate a monthly report. Practice adding a filter like WHERE Orders.OrderDate >= '2026-01-01'. Next learning suggestion: From here, going on to learn GROUP BY, HAVING, subqueries, indexes, and transactions will level up your backend/reporting skills even further.
Mini Project | Thuta Learning