Skip to main content

Introduction to the Project_analytics

Welcome to the Advanced Data Analytics Project

Welcome to the SQL Advanced Data Analytics Project — the next step in your SQL journey. In the previous project (Exploratory Data Analysis), you learned how to explore and understand a dataset. Now, we move beyond exploration and into actionable analytics.

In this project, you will learn how to write SQL queries that answer real business questions using advanced analytical techniques. By the end, you will have built two comprehensive business reports and documented your work professionally.

What is Advanced Data Analytics?

Advanced data analytics goes beyond simple aggregations (totals, counts, averages) and explores deeper patterns in the data. It answers questions like:

  • How are things changing over time? — Are sales growing or declining month over month?
  • What is the cumulative picture? — How much total revenue have we earned so far this year?
  • How does performance compare? — Is a product performing above or below its average?
  • What is the contribution of each part? — Which product category makes up the largest share of total sales?
  • How can we group entities meaningfully? — Which customers are VIPs versus new customers?

These are the types of questions that businesses ask every day, and SQL is one of the most powerful tools for answering them.

Advanced analytics project overview: 5 analysis techniques (time series, cumulative, performance, part-to-whole, segmentation)
Advanced analytics project overview: 5 analysis techniques (time series, cumulative, performance, part-to-whole, segmentation)

Project Overview

This project is divided into the following analytical modules:

ModuleTechniqueBusiness Question
1Change Over TimeHow are sales, customers, and quantities trending over months and years?
2Cumulative AnalysisWhat is the running total of sales over time?
3Performance AnalysisHow does each product compare to its average and previous year?
4Part-to-Whole AnalysisWhat percentage of total sales does each category contribute?
5Data SegmentationHow can we group products by cost and customers by spending behavior?
6Customer ReportHow do we build a comprehensive view of customer metrics and KPIs?
7Product ReportHow do we build a comprehensive view of product metrics and KPIs?
8DocumentationHow do we organize and version our SQL work using GIT?

Each module builds on the SQL skills you already have and introduces new analytical patterns.

The Data We Are Working With

We continue working with the Gold layer of our data warehouse — the clean, business-ready tables created in the previous project. Our three main tables are:

gold.dim_customers

Contains customer information:

  • customer_key — Surrogate key (unique identifier)
  • customer_number — Business identifier
  • first_name, last_name — Customer name
  • country — Country of residence
  • gender — Gender
  • birthdate — Date of birth
  • create_date — When the customer record was created

gold.dim_products

Contains product information:

  • product_key — Surrogate key
  • product_name — Name of the product
  • category, subcategory — Product classification
  • cost — Product cost
  • product_line — Product line grouping
  • start_date — When the product became available

gold.fact_sales

Contains transactional sales data:

  • order_number — Unique order identifier
  • product_key, customer_key — Foreign keys to dimensions
  • order_date, shipping_date, due_date — Key dates
  • sales_amount — Revenue from the sale
  • quantity — Number of items sold
  • price — Unit price

SQL Techniques You Will Use

Throughout this project, you will use a variety of SQL techniques:

TechniqueSQL FeatureUsed In
Date ExtractionYEAR(), MONTH(), DATETRUNC(), FORMAT()Change Over Time
Window FunctionsSUM() OVER(), AVG() OVER()Cumulative Analysis, Performance
Lag/LeadLAG()Performance Analysis (Year-over-Year)
Percentage CalculationsCAST(), SUM() OVER()Part-to-Whole Analysis
Conditional LogicCASE WHENData Segmentation, Reports
CTEsWITH ... ASAll modules
AggregationsSUM(), COUNT(), AVG(), MIN(), MAX()All modules
Date ArithmeticDATEDIFF()Customer and Product Reports

If any of these feel unfamiliar, do not worry — each module explains the technique step by step before applying it.

How to Approach This Project

Here are some tips to get the most out of this project:

  1. Follow the order — Each module builds on concepts from the previous one
  2. Run every query — Do not just read the SQL, execute it and examine the results
  3. Experiment — After understanding each query, modify it (change the date granularity, switch the dimension, add a filter) to deepen your understanding
  4. Take notes — Write down interesting findings as you go
  5. Think about the business — For each query, ask yourself: "What business decision could this help with?"

Let's get started with our first analytical technique: Change Over Time Analysis.