Skip to content

lalitha-70436/Task_3-SQL-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Internship Task 3 – SQL Basics

Tools Used

  • Google Colab
  • SQLite
  • Python (Pandas)

Dataset Used

Superstore Sales Dataset (CSV)

Objective

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.

SQL Queries Used and Their Meaning

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

Exported Output

  • sales_summary.csv contains category-wise total sales.

Outcome

This task helped me understand how to use SQL for filtering, sorting, grouping, and analyzing real-world sales data.

About

SQL Internship Task 3: Performed basic SQL operations such as filtering, sorting, grouping, and aggregation on the Superstore dataset using SQLite and Google Colab.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors