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.