SQL Data Analytics Project
This project demonstrates how SQL can be used beyond simple querying to perform structured business analysis directly inside the database. Built in SQL Server using the Gold layer dataset from the warehouse project, it focuses on analytical SQL techniques for reporting, trend analysis, ranking, segmentation, and reusable reporting views.
Exploratory Analysis
Database, dimensions, and date exploration
Advanced SQL Queries
Ranking, trends, cumulative analysis
Customer & Product Reports
Reusable SQL reporting views
Business Insights
Metrics, segmentation, and performance analysis
SQL Analysis Areas
Measures & KPI Exploration
Total sales, total quantity, average price, total orders, total customers, and product counts.
Ranking Analysis
Top-performing and lowest-performing products, highest-revenue customers, and lowest-order customers using ranking logic.
Change Over Time Analysis
Monthly sales trends, customer activity trends, and quantity trends using date-based SQL grouping.
Segmentation Analysis
Customer and product segmentation using CASE logic, spending behavior, lifespan, and cost ranges.
Sample Query Logic
Ranking Query
Ranks top products by total revenue using aggregate functions and window functions.
Customer Segmentation Query
Groups customers into VIP, Regular, and New segments based on spending and lifespan.
Product Reporting Query
Builds a reusable product report with recency, total sales, total orders, average selling price, and monthly revenue.
Reusable SQL Reports
The project includes report-focused SQL views that consolidate customer and product metrics into reusable outputs for business analysis.
Customer Report includes:
- customer name and age
- age group
- customer segment
- recency
- total orders
- total sales
- total quantity
- total products
- life span
- average order value
- average monthly spend
Product Report includes:
- product name, category, subcategory
- cost
- recency in months
- product segment
- total orders
- Total sales
- Total quantity
- Total customers
- average selling price
- Average order revenue
- Average monthly revenue
Key Outcomes & Deliverables
Analytical SQL Skills
Applied SQL for KPI calculation, ranking, trend analysis, and segmentation.
Business Reporting Logic
Built reusable queries and views for customer and product reporting.
Structured Query Design
Organized SQL work into clear analytical modules for exploration, reporting, and performance analysis.
Business Insight Generation
Turned warehouse data into usable reporting outputs and decision-support insights.
