- Google Colab
- SQLite
- Python (Pandas)
Superstore Sales Dataset (CSV)
The objective of this task is to practice basic SQL operations such as filtering, sorting, grouping, aggregation, and exporting results using a real-world sales dataset.
- Display all records from the sales table
SELECT * FROM sales;Meaning: This query retrieves all rows and columns from the sales table to understand the dataset.
- Filter products belonging to the Technology category
SELECT * FROM sales
WHERE Category = 'Technology';Meaning: This query filters the data and shows only those records where the product category is Technology.
- Sort all records by Sales in descending order
SELECT * FROM sales
ORDER BY Sales DESC;Meaning: This query sorts the data from highest to lowest sales.
- Calculate total sales for each category
SELECT Category, SUM(Sales) AS Total_Sales
FROM sales
GROUP BY Category;Meaning: This query groups the data by category and calculates total sales for each category.
- Count number of orders in each region
SELECT Region, COUNT(*) AS Total_Orders
FROM sales
GROUP BY Region;Meaning: This query counts how many orders were placed in each region.
- Show categories where total sales is greater than 100000
SELECT Category, SUM(Sales) AS Total_Sales
FROM sales
GROUP BY Category
HAVING SUM(Sales) > 100000;Meaning: This query filters grouped results to show only categories with high total sales.
- Find customers whose name starts with the letter A
SELECT * FROM sales
WHERE "Customer Name" LIKE 'A%';Meaning: This query retrieves records where the customer name starts with the letter A.
- Find top 5 customers by total sales
SELECT "Customer Name", SUM(Sales) AS Total_Spend
FROM sales
GROUP BY "Customer Name"
ORDER BY Total_Spend DESC
LIMIT 5;Meaning: This query finds the top 5 customers who spent the most.
- sales_summary.csv contains category-wise total sales.
This task helped me understand how to use SQL for filtering, sorting, grouping, and analyzing real-world sales data.