This project demonstrates SQL-based data analysis using an e-commerce sales dataset. The objective is to extract meaningful business insights by writing SQL queries to retrieve, filter, sort, group, and aggregate data.
The project was completed as part of the DecodeLabs Industrial Training Kit – Data Analytics Project 3, focusing on SQL fundamentals and data analysis.
-
Create and manage a relational database using MySQL.
-
Import an e-commerce dataset into MySQL.
-
Analyze data using SQL queries.
-
Practice SQL concepts including:
SELECTWHEREORDER BYGROUP BYHAVINGCOUNT()SUM()AVG()MAX()MIN()LIMIT
-
Generate business insights from transactional data.
- MySQL Server
- MySQL Workbench
- Microsoft Excel
- Visual Studio Code
- Git
- GitHub
The dataset contains 1,200 e-commerce order records.
- OrderID
- Date
- CustomerID
- Product
- Quantity
- UnitPrice
- ShippingAddress
- PaymentMethod
- OrderStatus
- TrackingNumber
- ItemsInCart
- CouponCode
- ReferralSource
- TotalPrice
SQL-Data-Analysis-Project
│
├── dataset/
│ └── Orders.csv
│
├── sql/
│ ├── 01_Create_Database.sql
│ ├── 02_Create_Table.sql
│ ├── 03_Basic_Queries.sql
│ ├── 04_Filtering.sql
│ ├── 05_GroupBy.sql
│ ├── 06_Aggregations.sql
│ └── 07_Advanced.sql
│
├── screenshots/
│
└── README.md
CREATE DATABASE DataAnalyticsProject;
USE DataAnalyticsProject;CREATE TABLE Orders(
OrderID VARCHAR(20),
Date DATE,
CustomerID VARCHAR(20),
Product VARCHAR(100),
Quantity INT,
UnitPrice DECIMAL(10,2),
ShippingAddress VARCHAR(255),
PaymentMethod VARCHAR(50),
OrderStatus VARCHAR(50),
TrackingNumber VARCHAR(50),
ItemsInCart INT,
CouponCode VARCHAR(50),
ReferralSource VARCHAR(50),
TotalPrice DECIMAL(10,2)
);- Display all records
- Retrieve selected columns
- Display unique products
- Filter orders using
WHERE - Filter by payment method
- Filter by order status
- Sort orders by total price
- Sort orders by date
- Count total orders
- Calculate total sales
- Calculate average order value
- Find maximum order value
- Find minimum order value
- Sales by product
- Orders by payment method
- Orders by referral source
- Orders by order status
HAVINGclause- Top 10 highest-value orders
The SQL analysis helps answer questions such as:
- How many total orders are in the dataset?
- What is the total revenue?
- What is the average order value?
- Which products generate the highest sales?
- Which payment methods are most frequently used?
- Which referral sources bring the most customers?
- Which orders have the highest value?
The screenshots folder contains images of:
- Database creation
- Table creation
- Dataset import
- SQL query execution
- Query results
These screenshots demonstrate the successful completion of each SQL task.
- SELECT
- DISTINCT
- WHERE
- ORDER BY
- GROUP BY
- HAVING
- COUNT()
- SUM()
- AVG()
- MAX()
- MIN()
- LIMIT
Through this project, I learned how to:
- Create and manage databases using MySQL.
- Import CSV data into a relational database.
- Write SQL queries for data analysis.
- Apply filtering, sorting, grouping, and aggregation techniques.
- Extract business insights from real-world data.
- Organize a SQL project using Git and GitHub.
- Visualize results using Power BI or Tableau.
- Perform advanced SQL analysis with JOINs and Subqueries.
- Automate data processing using Python.
- Create SQL Views and Stored Procedures.
Vaishnav R L
SQL Data Analytics
This project is intended for educational and portfolio purposes.