Question
Write PL/SQL query for: Customer(CustomerId, FirstName, LastName, Address, PhoneNo, Age) Supplier(SupplierId, FirstName, LastName, Address, PhoneNo) Product(ProductId, ProductName, Category, SupplierId, ProductDescription) Inventory(ProductId, TotalStock, LastUpdatedOn) Orders(OrderId, CustomerId,
Write PL/SQL query for:
Customer(CustomerId, FirstName, LastName, Address, PhoneNo, Age)
Supplier(SupplierId, FirstName, LastName, Address, PhoneNo)
Product(ProductId, ProductName, Category, SupplierId, ProductDescription)
Inventory(ProductId, TotalStock, LastUpdatedOn)
Orders(OrderId, CustomerId, OrderDate, Status)
OrderItems(OrderId, ProductId, Quantity, UnitPrice, Discount)
Pro_category_info: Generate a report to display the details about each category. These details include the number of units of that category ordered, the average unit price of the products in that category, the average discounted amounts given. Notice that the discounts given in the data is in percentage while the report wants the average discount in whole amount. The average prices and average discounts should be formatted to 2 decimal places. Order the result by the total units sold in descending order. The computation of the averages should take the quantity into account.
CATEGORY REPORT CATEGORY TOTAL_UNITS AVG_PRICE AVG_DISCOUNT
Clothing 130 98.00 6.45
Electronics 32 459.00 45.00
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