A comprehensive SQL Exploratory Data Analysis (EDA) project that demonstrates how to explore, analyze, and derive insights from relational databases.
This project is designed for data analysts, BI professionals, and learners who want hands-on SQL practice.
The repository contains structured SQL scripts that cover:
- π Database exploration
- π Dimensions & attributes analysis
- π Date/time-based exploration
- π Measures & metrics calculations
- βοΈ Magnitude comparisons across categories
- π Ranking & performance analysis
This project is inspired by practical SQL workflows where data exploration leads to actionable insights.
It demonstrates three main types of SQL analytics projects:
- ποΈ Data Warehousing β Structuring and organizing raw data.
- π Exploratory Data Analysis (EDA) β Asking questions and uncovering patterns. (Focus of this repo)
- π Advanced Analytics β Business-driven queries (trends, comparisons, segmentation, reports).
To run this project, you can set up the database in SQL Server in three ways:
- β‘ Executing Scripts β Run
init_database.sqlto create schema & tables. - π Importing CSVs β Use SQL Serverβs Import Flat File wizard.
- πΎ Restoring Backup β Use the provided
.bakfile to restore the database.
Tables used:
- π€
DimCustomer(customer details, demographics, location) - π¦
DimProduct(product details, categories, cost) - π
FactSales(sales transactions, quantities, revenue, dates)
Understanding the dataset is easier if you separate fields into Dimensions vs Measures:
- π§© Dimensions β Descriptive attributes (Country, Category, Product, Dates, Gender).
- π’ Measures β Numeric values that can be aggregated (Sales Amount, Quantity, Cost, Age).
This classification is the foundation of almost every analytical query.
The project follows six structured steps for analysis:
- π Database Exploration β Inspect tables, columns, metadata.
- π§© Dimensions Exploration β Explore unique values (countries, categories, products).
- π Date Exploration β Identify time ranges (first/last orders, customer age).
- π Measures Exploration β Aggregate metrics (sales, quantities, averages).
- βοΈ Magnitude Analysis β Compare measures across dimensions (sales by category, revenue by country).
- π Ranking Analysis β Identify top/bottom performers (best products, loyal customers, worst sellers).
Here are some representative queries from the project:
- π List all tables in the database
SELECT * FROM information_schema.tables;