GitHunt
MI

mi7773/advanced_sql_data_analytics_project

A hands-on SQL project simulating data analysis using fact and dimension tables, covering trends over time, cumulative metrics, performance breakdowns, segmentation, and reporting via SQL.

SQL Data Analysis Portfolio Project

This project is based on the YouTube tutorial
๐ŸŽฅ SQL Data Analyst Portfolio Project | Like I Do in My Real Projects

It simulates a real-world SQL data analysis scenario, covering different types of analysis and reporting.


๐Ÿ“Œ Objectives

The project demonstrates how to:

  • Analyze data over time
  • Perform cumulative and performance analysis
  • Execute part-to-whole and segmentation analysis
  • Generate actionable insights through SQL reports

๐Ÿ” Analysis Types

  • ๐Ÿ“ˆ Changes Over Time
  • ๐Ÿ“Š Cumulative Analysis
  • ๐Ÿš€ Performance Analysis
  • ๐Ÿงฉ Part-to-Whole Analysis
  • ๐Ÿ” Data Segmentation

๐Ÿ“‹ Final Deliverables

Two comprehensive reports saved as SQL views:

  • Customer Report โ†’ 08_customer_report.sql
  • Product Report โ†’ 09_report_customers_view.sql

๐Ÿ› ๏ธ SQL Techniques Used

  • Basic SQL: SELECT, FROM, WHERE, GROUP BY, ORDER BY
  • Intermediate: CASE WHEN, JOINS
  • Advanced: Window Functions, CTEs, Subqueries

๐Ÿ“‚ Files

scripts/ โ€” SQL Analysis & Reporting Scripts

File Description
00_init_database.sql Initializes database schema and tables
01_changes_over_time_analysis_month.sql Analyzes sales trends on a monthly basis
02_changes_over_time_analysis_year.sql Analyzes sales trends on a yearly basis
03_cumulative_analysis.sql Calculates cumulative metrics over time
04_performance_analysis.sql Evaluates sales performance across dimensions
05_part_to_whole_analysis.sql Analyzes sales contribution by segments
06_data_segmentation_cost.sql Segments data based on cost-related criteria
07_data_segmentation_customer.sql Segments data by customer characteristics
08_customer_report.sql Constructs customer report logic
09_report_customers_view.sql Creates a view for the customer report
10_product_report.sql Constructs and saves the product report as a view

dataset/ โ€” Source Data Tables

File Description
gold.fact_sales.csv Fact table containing transactional sales data
gold.report_customers.csv Dimension table for customer information
gold.report_products.csv Dimension table for product information

๐Ÿ’ฌ Feedback

If you have suggestions for improvements or feedback, feel free to connect on LinkedIn.


๐Ÿ“Ž Credits

Inspired by the tutorial:
SQL Data Analyst Portfolio Project | Like I Do in My Real Projects