In this task, I performed a Sales Trend Analysis using SQL on a dataset named online_sales.
The goal was to uncover key sales insights and trends from an e-commerce-like dataset of 100 orders.
- File Name:
online_sales_100.xlsx - Imported Table:
online_sales - Database Name:
task6_sales - Total Records: 100 rows
- SQL (MySQL Workbench)
- Excel (for initial dataset cleaning)
- GitHub (for version control and submission)
- Word (for screenshots and documentation)
The main aim of this task was to perform:
- Sales trend analysis
- Revenue aggregation by month, product, and category
- Customer behavior patterns
- And extract actionable insights
| # | Query Title | Description |
|---|---|---|
| 1οΈβ£ | Total Sales Amount | Calculates total revenue from all orders |
| 2οΈβ£ | Total Orders | Counts the total unique order IDs |
| 3οΈβ£ | Total Quantity Sold | Sums up all quantities sold |
| 4οΈβ£ | Sales by Product | Shows revenue per product |
| 5οΈβ£ | Sales by Category | Summarizes revenue per category |
| 6οΈβ£ | Monthly Sales Trend | Extracts month-wise revenue trends |
| 7οΈβ£ | Orders per Day | Number of orders placed per day |
| 8οΈβ£ | Monthly Revenue Summary | Revenue by month using EXTRACT() |
| 9οΈβ£ | Top Performing Month | Highest revenue-generating month |
π· All screenshots of these queries + outputs are included in the Word file:
Task 6 Screenshots of Queries.docx
- Top Product: The highest earning product was
XYZ(from sales query). - Peak Month: Most revenue was generated in April 2023.
- Sales Trend: A steady increase in revenue was observed over the first 4 months of 2023.
- Category Comparison: Electronics had the maximum share in total revenue.
task6_sales_analysis.sqlβ All SQL queries used in this taskonline_sales_100.xlsxβ Dataset with 100 rowsTask 6 Screenshots of Queries.docxβ Screenshots of each query + outputREADME.mdβ This file (for GitHub)- Interview Q/A
This task helped strengthen my SQL skills in real-world business analysis.
It also gave me hands-on experience in:
- Writing optimized aggregation queries
- Extracting date-based patterns
- Summarizing performance insights for decision making
Thanks for reading! π
Feel free to explore the queries or reach out for any suggestions.