Skip to content

SQL scripts for sales, customer, and product performance analysis in a Data Warehouse environment.

Notifications You must be signed in to change notification settings

Feyzaavici/sql_data_analysis

Repository files navigation

SQL Data Analysis

This project contains SQL scripts designed to perform data analysis on sales and customer datasets within a Data Warehouse structure.
The main goal is to generate reports and metrics that can be used in Business Intelligence (BI) scenarios.


πŸ“‚ Project Structure

sql_data_analysis/ β”œβ”€β”€ category_sales_contribution.sql # Category-wise total sales and percentage contribution β”œβ”€β”€ customer_metrics_report.sql # Customer metrics, age groups, and segmentation analysis β”œβ”€β”€ customer_segments_by_spending.sql # Customer segmentation based on spending behavior β”œβ”€β”€ monthly_running_sales.sql # Monthly and cumulative sales report β”œβ”€β”€ monthly_sales_report.sql # Monthly sales summary β”œβ”€β”€ product_price_segments.sql # Number of products by price range β”œβ”€β”€ yearly_product_performance.sql # Yearly performance analysis of products └── datasets/ # Datasets used in the analysis


πŸ“Š Analysis & Reports

1. Sales Analysis

  • Monthly total sales
  • Cumulative sales trends
  • Sales contribution by category
  • Product distribution by price segments

2. Customer Analysis

  • Customer distribution by age group
  • VIP / Regular / New segmentation
  • Average Order Value (AOV) and average monthly spend

3. Product Performance Analysis

  • Year-over-year sales changes
  • Above/Below average sales classification
  • Annual performance comparisons

πŸ“‚ Dataset

  • Folder: datasets/
  • Example Data: Sales, customer, and product tables
  • Schema:
    • fact_sales: order details (date, product, customer, sales amount)
    • dim_products: product details (category, price, name)
    • dim_customers: customer details (age, name, customer number)

Note: No real data is used; analyses are performed on sample or synthetic datasets.


πŸš€ Usage

  1. Open the .sql files in SQL Server Management Studio (SSMS) or a compatible SQL editor.
  2. Run the queries on the respective database schema.
  3. Use the results for reporting, data visualization, or Business Intelligence dashboards.

About

SQL scripts for sales, customer, and product performance analysis in a Data Warehouse environment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages