Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

Prepare a table like the one below and record your observations.

Answered: 1 week ago

Question

Are my points each supported by at least two subpoints?

Answered: 1 week ago