0% found this document useful (0 votes)
3 views23 pages

Sales Data Analysis Using MySQL (ClassicModels Database)

The project analyzes sales, customer, and order data using MySQL with the ClassicModels database to extract insights such as total revenue, monthly sales trends, and top customers. Key findings indicate that a small number of customers contribute significantly to revenue, and certain products drive most sales. The analysis also highlights variations in monthly sales, identifying potential marketing targets among customers who have not placed orders.

Uploaded by

083 -Sathvika
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views23 pages

Sales Data Analysis Using MySQL (ClassicModels Database)

The project analyzes sales, customer, and order data using MySQL with the ClassicModels database to extract insights such as total revenue, monthly sales trends, and top customers. Key findings indicate that a small number of customers contribute significantly to revenue, and certain products drive most sales. The analysis also highlights variations in monthly sales, identifying potential marketing targets among customers who have not placed orders.

Uploaded by

083 -Sathvika
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Title: Sales Data Analysis Using MySQL (ClassicModels)

Name: Akshada Kumbhar


Tools: MySQL
Date: March 2026

Project Overview
This project focuses on analyzing sales, customer, and order data using MySQL and the
ClassicModels database. The objective of this project is to extract meaningful business insights
such as total revenue, monthly sales trends, top customers, best-selling products, and country-
wise sales performance. The analysis helps understand customer behavior, product
performance, and overall business sales trends.

Database Used
Database: ClassicModels
Tables Used:

Customers – Contains customer information

Orders – Contains order details

OrderDetails – Contains product order quantity and price

Payments – Contains customer payment information

Products – Contains product information

Tools Used
• MySQL – For writing SQL queries

Problem Statements
1. Find the total number of customers in the database.
2. Show all customers from the USA.
3. Find the top 5 customers with the highest credit limit.
4. Display the number of customers in each country.
5. Find customers whose credit limit is greater than 50,000.
6. Find the total number of orders placed.
7. Show the number of orders placed by each customer.
8. Find the latest order date in the dataset.
9. Display customers who have not placed any orders.
10. Find the top 5 customers with the highest number of orders.
11. Calculate the total revenue generated.
12. Find the total sales for each product.
13. Find the top 10 best-selling products.
14. Calculate total sales by product line.
15. Find the average product price.
16. Display customer name and order number.
17. Show product name and quantity ordered.
18. Find total sales by each customer.
19. Display customer name, order number, and product ordered.
20. Find customers who made payments greater than 100,000.
21. Find the customer who generated the highest revenue.
22. Find the most ordered product.
23. Find the country generating the highest sales.
24. Find customers with payments greater than the average payment.
25. Analyze monthly sales trend.

SQL Queries
[Link] the total number of customers in the database.

select count(*) as total_customers

from customers;

output:

[Link] all customers from USA.

select * from customers

where country = 'USA';

output:
[Link] the top 5 customers with the highest credit limit.

select * from customers

order by creditlimit desc

limit 5;

output:

[Link] the number of customers in each country.

select country,count(customernumber) as total_customers

from customers

group by country;

output:
[Link] customers whose credit limit is greater than 50,000.

select customernumber,city,state,country,creditlimit from customers

where creditlimit > 50000;

output:
[Link] the total number of orders placed.

select count(ordernumber) as total_orders

from orders;

output:
7. Show the number of orders placed by each customer.

select customernumber,

count(ordernumber) as total_orders

from orders

group by customernumber;

output:
[Link] the latest order date in the dataset.

select max(orderdate) as latest_order

from orders;

output:
[Link] customers who have not placed any orders.

select customernumber from customers

left join orders

using(customernumber)

where ordernumber is null;

output:
[Link] the top 5 customers with the highest number of orders.

select customernumber,count(ordernumber) as total_orders from customers

inner join orders

using(customernumber)

group by customernumber

order by total_orders desc

limit 5;
output:

[Link] the total revenue generated.

select sum(quantityordered * priceeach) as total_sales

from orderdetails;

output:

12. Find the total sales for each product.

select productname,sum(quantityordered * priceeach) as total_sales

from orderdetails

inner join products

using(productcode)

group by productname;

output:
[Link] the top 10 best-selling products.

select productname, sum(quantityordered * priceeach) as total_sales

from products

inner join orderdetails

using(productcode)

group by productname

order by total_sales desc


limit 10;

output:

[Link] total sales by product line.

select productline,sum(quantityordered * priceeach) as total_sales

from orderdetails

inner join products

using(productcode)

group by productline;

output:
[Link] the average product price.

select avg(buyprice) as avgprice from products;

output:

[Link] customer name and order number.

select customername,ordernumber from customers

inner join orders

using(customernumber);

output:
[Link] product name and quantity ordered.

select productname,quantityordered from orderdetails

join products

using(productcode);

output:
[Link] total sales by each customer.

select customername, sum(quantityordered * priceeach) as total_sales

from customers

inner join orders

using(customernumber)

inner join orderdetails

using (ordernumber)
group by customername

order by total_sales desc;

output:

[Link] customer name, order number, and product ordered.

select customername,ordernumber,productname

from customers

inner join orders


using(customernumber)

inner join orderdetails

using(ordernumber)

inner join products

using(productcode);

output:
20. Find customers who made payments greater than 100000.

select customername,amount from customers

inner join payments

using(customernumber)

where amount > 100000;

output:

[Link] the customer who generated the highest revenue.

select customername, sum(quantityordered * priceeach) as total_sales

from customers

inner join orders

using(customernumber)

inner join orderdetails

using(ordernumber)

group by customername

order by total_sales desc

limit 1;

output:
[Link] the most ordered product.

select productname,sum(quantityordered) as total_quantity

from products

inner join orderdetails

using(productcode)

group by productname

order by total_quantity desc

limit 1;

output:

23. Find the country generating the highest sales.

select country,sum(quantityordered * priceeach) as total_sales

from customers

inner join orders

using(customernumber)

inner join orderdetails

using(ordernumber)

group by country

order by total_sales desc

limit 1;
output:

[Link] customers with payments greater than the average payment.

select customername,amount from customers

inner join payments

using(customernumber)

where amount >

(select avg(amount) from payments)

order by amount desc;

output:
25. Find monthly sales trend.

SELECT

YEAR(orderdate) AS year,

MONTH(orderdate) AS month,

SUM(quantityordered * priceeach) AS total_sales

FROM orders

JOIN orderdetails USING(ordernumber)


GROUP BY YEAR(orderdate), MONTH(orderdate)

ORDER BY YEAR(orderdate), MONTH(orderdate);

output:

Key Insights
• A small number of customers contribute a large portion of total revenue (high-value
customers).
• Certain products (like top-selling items) generate the majority of sales.
• The country with the highest sales contributes significantly to overall revenue.
• Monthly sales analysis shows variation in revenue across different months, helping
identify peak sales periods.
• Some customers have not placed any orders, indicating potential targets for marketing
campaigns.
• Customers with higher credit limits tend to generate more revenue.
• Identifying top customers helps businesses focus on customer retention strategies.
Skills Demonstrated:
• SQL Joins

• Group By

• Aggregate Functions

• Subqueries

• Data Analysis

• Business Insight Generation

Conclusion
In this project, SQL was used to analyze customer, order, and sales data from the ClassicModels
database. The analysis helped identify top customers, best-selling products, and high-revenue
generating countries. Monthly sales trend analysis helped understand sales performance over
time. The project demonstrates the use of SQL joins, aggregate functions, group by, and
subqueries to extract business insights and support data-driven decision-making.

About This Project


This project was created as part of my Data Analyst portfolio to demonstrate SQL skills, data
analysis, and business insight generation using the ClassicModels database. The project focuses
on analyzing sales performance, customer behavior, and product performance using MySQL.

Thank you for reviewing my SQL project.


Tools Used: MySQL
Created by: Akshada Kumbhar

You might also like