Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume we are given a shop's database containing two tables named Products and Orders. The Products table consists of four columns, namely ProductID ProductName, SupplierID,
Assume we are given a shop's database containing two tables named Products and Orders. The Products table consists of four columns, namely ProductID ProductName, SupplierID, and Price. The second table consists of three columns, namely OrderID, ProductID, and Quantity. The column Quantity shows how many quantities of ProductID exist in the relevant OrderID. Examples of these two tables are shown below.
i Write a SQL query to find the product IDs with maximum and minimum prices.
ii Write a SQL query to find the product name with the highest number of quantities ordered.
iii. Write SQL queries to find the order ID that has the highest total price To calculate the total price of each order, you need to multiply the price of each product in that order by its quantity, repeat this process for all products in that order, and sum the results
Products
tableProductIDProductName,SupplierID,PriceNameNameNameNameName
Orders
tableOrderIDProductID,Quanity
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started