seo-asif / Solving-Real-Life-Business-Problems-using-SQL

This assignment presents a series of real-world business problems that can be solved using SQL queries. The provided database contains information about customers, orders, products, categories, and order items. The tasks involve extracting relevant information from the database and answering specific questions related to the business operations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Solving Real-Life Business Problems using SQL

##Objective:

This assignment presents a series of real-world business problems that can be solved using SQL queries. The provided database contains information about customers, orders, products, categories, and order items. The tasks involve extracting relevant information from the database and answering specific questions related to the business operations.

##Database Schema The database consists of the following tables:

Customers: Stores customer information, including customer ID, name, email, and location.

Orders: Holds details about placed orders, including order ID, customer ID, order date, and total amount.

Products: Contains information about available products, including product ID, name, description, and price.

Categories: Stores information about product categories, including category ID and name.

Order_Items: Provides details about individual items within orders, including order item ID, order ID, product ID, quantity, and unit price.

##Tasks:

  1. Write a SQL query to retrieve all the customer information along with the total number of orders placed by each customer. Display the result in descending order of the number of orders.

  2. Write a SQL query to retrieve the product name, quantity, and total amount for each order item. Display the result in ascending order of the order ID.

  3. Write a SQL query to retrieve the total revenue generated by each product category. Display the category name along with the total revenue in descending order of the revenue.

  4. Write a SQL query to retrieve the top 5 customers who have made the highest total purchase amount. Display the customer name along with the total purchase amount in descending order of the purchase amount.

About

This assignment presents a series of real-world business problems that can be solved using SQL queries. The provided database contains information about customers, orders, products, categories, and order items. The tasks involve extracting relevant information from the database and answering specific questions related to the business operations