0% found this document useful (0 votes)
2 views2 pages

Adv Introduction

Akshay Rathod presents his SQL data analysis project, detailing the steps taken to clean and analyze sales data using various SQL queries. Key tasks include creating a unified sales view, performing lookups for product and customer data, calculating sales amounts and profits, and generating visualizations like pivot tables and charts. The project culminates in the creation of executive KPIs to identify top performers in sales.

Uploaded by

Akshay Rathod
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Adv Introduction

Akshay Rathod presents his SQL data analysis project, detailing the steps taken to clean and analyze sales data using various SQL queries. Key tasks include creating a unified sales view, performing lookups for product and customer data, calculating sales amounts and profits, and generating visualizations like pivot tables and charts. The project culminates in the creation of executive KPIs to identify top performers in sales.

Uploaded by

Akshay Rathod
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introductory Note: "Hello everyone, I'm Akshay Rathod.

Today I'll be walking you through


my SQL data analysis group project. As you can see here in my SQL Workbench, I have
structured my queries to clean, consolidate, and aggregate our sales data step-by-step."
 0. Union (Combined View): "First, you'll see I created a View called v_UnionedSales
using UNION ALL. This combines our historical and new sales tables into one central
dataset, which I'll be querying from for the rest of the tasks."
 1. Product Lookup: "Here, I'm using a JOIN to connect our sales view with the
product dimension table. This replaces the raw ProductKey with the actual English
product names so the data is readable."
 2. Customer & Price Lookup: "In this query, I brought in the customer data. No ce
how I used CONCAT and COALESCE to handle poten al null values in the middle
name, crea ng one clean CustomerFullName string."
 3. Date Fields Calcula on: "Our original dates were stored as integers. Here, I used
STR_TO_DATE to convert them, and then extracted various me components like Year,
Month, Quarter, and even custom Financial periods for repor ng."
 4. Sales Amount: "To get the actual revenue, this query mul plies the Unit Price by
the Order Quan ty, dynamically subtrac ng any applied discount percentage."
 5. Produc on Cost: "This is a straigh orward calcula on: I'm mul plying the Product
Standard Cost by the Order Quan ty to determine the baseline expense for each
order."
 6. Profit: "By combining the logic from the last two steps, this query calculates net
profit. It takes the total calculated sales amount and subtracts the total produc on
cost."
 7. Pivot Table (Month & Sales): "To replicate a pivot table, I used a WHERE clause to
filter the data specifically for the year 2010. Then, I grouped the total sales by month
and ordered them chronologically."
 8. Bar Chart (Year-wise Sales): "This query formats the data for a high-level bar chart
by grouping the total sales strictly by the Order Year to show macro growth."
 9. Line Chart (Month-wise Sales): "For a con nuous trend line, I forma ed the date
into a 'Year-Month' string and grouped the total sales to plot performance over me."
 10. Pie Chart (Quarter-wise Sales): "To visualize how revenue is distributed
throughout the year, this query aggregates total sales into quarters (Q1, Q2, etc.)."
 11. Combo Chart (Sales vs. Cost): "This query prepares data for a combina on chart.
It groups both Total Sales and Total Produc on Cost side-by-side by Year-Month,
which is perfect for visualizing our profit margins."
 12. KPIs (Top Performers): "Finally, I built three execu ve KPIs. By grouping by
Product, Customer, and Region, and adding an ORDER BY DESC with a LIMIT 10, these
queries instantly generate our top 10 performance leaderboards."

You might also like