SQL Data Analytics โ€ข Lesson 20 โ€ข Final Project

Real-World SQL Analytics Project

Put everything together. Explore a realistic business dataset, connect tables, aggregate cleanly, filter the noise, and build an analytical report using SQL.

Your progress0%

0 of 8 concepts completed

Complete the activity and related MCQ to unlock the next concept.

Concept 1WHY PROJECT

Why Analysts Work in Projects

Real SQL work is not a single query. It is a workflow: understand the data, join related tables, aggregate by the right dimension, filter the noise, then turn numbers into a recommendation.

Interactive Data

Customers ยท Orders ยท Products

The three-table model used throughout this final project. Orders bridges Customers and Products.

6
CUSTOMERS
10
ORDERS
โ‚น1,56,000
REVENUE

Joined dataset

order_iddatecustomercityproductcategoryamount
50012026-01-12RahulDelhiLaptopElectronicsโ‚น50,000
50022026-01-18PriyaMumbaiOffice ChairFurnitureโ‚น8,000
50032026-02-05RahulDelhiKeyboardElectronicsโ‚น2,500
50042026-02-11AmitPuneDeskFurnitureโ‚น15,000
50052026-02-20NehaDelhiLaptopElectronicsโ‚น50,000
50062026-03-03PriyaMumbaiKeyboardElectronicsโ‚น2,500
50072026-03-10KavyaMumbaiOffice ChairFurnitureโ‚น8,000
50082026-03-18AmitPuneKeyboardElectronicsโ‚น2,500
50092026-03-25RahulDelhiDeskFurnitureโ‚น15,000
50102026-04-02NehaDelhiKeyboardElectronicsโ‚น2,500

Top Customer

Rahul

โ‚น67,500

Top Product

Laptop

โ‚น1,00,000

Top City

Delhi

โ‚น1,20,000

Filter the joined dataset

ORDERS
10
REVENUE
โ‚น1,56,000
AVG
โ‚น15,600

Learn by Seeing

Four-stage workflow

Explore โ†’ Join โ†’ Analyze โ†’ Report

Each stage uses a different set of skills from the whole course.

Click a stage to see what it involves:

Explore

Understand what tables exist, how they relate, and what questions they can answer.

Interactive Activity

What is the goal of a SQL analytics project?

Hint: It is not about the query, it is about the answer.

SQL Analyst Mindset

Real projects combine every skill

The final project is a JOIN + GROUP BY + CTE + window function, wrapped in a single query that answers a business question. That is what analytical SQL looks like in the real world.

01

Explore

Understand tables and keys.

02

Join

Bring related data together.

03

Analyze

Aggregate, rank and measure.

04

Report

Present a clear answer.

Frequently Asked Questions

Final Project โ€” FAQs

How do I decide which table to start the JOIN from?

Start from the fact table (Orders) and JOIN the dimension tables (Customers, Products) onto it. The fact table drives the row count.

Why use a CTE instead of a nested subquery?

CTEs read top-to-bottom like a pipeline โ€” easier to debug and extend. Nested subqueries read inside-out and grow harder to follow.

Can I add more dimensions without rewriting the query?

Yes. Add another INNER JOIN to the chain โ€” as long as the new table has a foreign key connecting it to an existing one.

How do I know my report answers the right question?

Restate the business question in plain words first, then check that each column in your SELECT directly supports that answer. If a column doesn't, drop it.

Lesson Summary

What you practiced

Three-table JOIN

Customers โ†” Orders โ†” Products via foreign keys.

Customer / Product / City reports

GROUP BY + SUM + ORDER BY for leaderboards.

CTE + RANK

Aggregate per entity, then rank the results.

% of total

SUM(x) OVER () for share of overall revenue.