Skip to content

SQL-based analysis of monthly revenue and order volume using SQLite. Includes date formatting, joins, and aggregate functions to uncover sales trends from an online orders dataset. Task completed as part of the Elevate Labs Data Analyst Internship under the Ministry of MSME, Govt. of India.

Notifications You must be signed in to change notification settings

upal04/Sales-Trend-Analysis-SQL-Aggregations-Elevate-Labs-Internship-Task-6-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📊 Task 6: Sales Trend Analysis Using Aggregations (ELEVATE LABBS INTERNSHIP)

🧠 Objective

Analyze monthly revenue and order volume trends using SQL aggregations on an online sales dataset.

🛠️ Tools Used

  • SQLite (via strftime() for date extraction and formatting)
  • SQL for data manipulation and aggregation
  • Dataset:
  • Orders.csv: Contains Order_ID, Order_Date (in DD-MM-YYYY format)
  • Details.csv: Contains Order_ID, Sales

📁 Files Included

  • task6_sales_trend.sql: SQL script with all steps
  • Orders.csv, Details.csv: Sample datasets
  • screenshots/: screenshots of query results
  • README.md: This documentation

📌 Key Steps & Logic

  1. 📅 Date Conversion Converted Order_Date from DD-MM-YYYY to YYYY-MM-DD using string manipulation for compatibility with strftime().
Taks 6 A
  1. 📆 Monthly & Yearly Grouping Used strftime('%Y') and strftime('%m') to extract year and month from formatted dates.
Task 6 B
  1. 💰 Monthly Revenue Joined Orders and Details tables on Order_ID, then used SUM(Sales) to calculate monthly revenue.
Task 6 C
  1. 📦 Monthly Order Volume Grouped orders by month and year, using COUNT(DISTINCT Order_ID) to get unique order volume.
Task 6 D
  1. 📈 Combined Revenue & Volume Merged revenue and volume metrics by month/year to analyze trends and sort results chronologically.
Task 6 E
  1. ⏳ Time Filtering Applied filters to limit results to specific time periods for focused analysis.
Task 6 F

❓ Interview Prep Highlights

  • Difference between COUNT(*) vs COUNT(DISTINCT col)
  • Handling NULL values in aggregates
  • Role of GROUP BY vs ORDER BY
  • Extracting top 3 months by revenue using ORDER BY SUM(Sales) DESC LIMIT 3

##✅ Outcome

  • Learned how to group data by time dimensions
  • Practiced SQL joins, aggregations, and filtering
  • Built a reusable script for sales trend analysis

About

SQL-based analysis of monthly revenue and order volume using SQLite. Includes date formatting, joins, and aggregate functions to uncover sales trends from an online orders dataset. Task completed as part of the Elevate Labs Data Analyst Internship under the Ministry of MSME, Govt. of India.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published