0% found this document useful (0 votes)
7 views7 pages

Assesment 4 21bci0351

The document is an assignment for a DBMS lab focused on aggregate functions such as MIN, MAX, SUM, and AVG. It includes a database schema for an online retail store and poses several questions requiring SQL queries to analyze product prices, sales, customer orders, and reviews. The assignment aims to assess the understanding of these aggregate functions through practical SQL applications.

Uploaded by

nnaja1991
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)
7 views7 pages

Assesment 4 21bci0351

The document is an assignment for a DBMS lab focused on aggregate functions such as MIN, MAX, SUM, and AVG. It includes a database schema for an online retail store and poses several questions requiring SQL queries to analyze product prices, sales, customer orders, and reviews. The assignment aims to assess the understanding of these aggregate functions through practical SQL applications.

Uploaded by

nnaja1991
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
You are on page 1/ 7

Name - Amaan khan

Reg nnumber - 21BCI0351


Subject - DBMS LAB

ASSIGNMENT-4
Objective: This assignment aims to test your
understanding of aggregate functions in DBMS,
specifically focusing on MIN, MAX, SUM, and AVG
functions. Answer the following questions using SQL
queries.
Database Schema:
Consider the following database schema for an
online retail store:
Tables:
Products(ProductID, ProductName, Category, Price,
Stock)
Orders(OrderID, ProductID, Quantity, OrderDate)
Customers(CustomerID, CustomerName, City,
Country)
OrderDetails(OrderDetailID, OrderID, ProductID,
Quantity, Price)
Reviews(ReviewID, ProductID, CustomerID, Rating,
ReviewDate)
Questions:
1.What is the minimum, maximum, and average
price of products in the 'Electronics' category?
Solution

SQL Queries:

1. Minimum Price:

Maximum Price:

Average Price:
2.Calculate the total sales amount for all orders.
Solutions
3.Which customer has placed the highest number of
orders?

4.What is the average rating for each product based


on customer reviews?
Solution

5.What are the minimum and maximum quantities


ordered for each product?
Solution
6.What is the total stock value for each category of
products?
Solution

7.Which product has the highest total sales quantity?


Solution
8.What is the average number of orders placed per
customer?
Solution

9.Which product has the highest average rating


based on customer reviews?
Solution

10.How many different products has each customer


reviewed?
Solution

You might also like