Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Urgent, Please Help! simple SQL problem Q1: Write the SQL Query based on the dataset. How many items of each product finish are available in

Urgent, Please Help! simple SQL problem
Q1:
Write the SQL Query based on the dataset.
How many items of each product finish are available in the product catalog? Show the result in descending order of the number of items.
image text in transcribed
image text in transcribed
INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (1, 'End Table', 'Cherry', 175); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (2, 'Coffee Table', 'Natural Ash', 200); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (3, 'Computer Desk', 'Natural Ash', 375); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (4, 'Entertainment Center', 'Natural Maple', 650); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (5, 'Writers Desk', 'Cherry', 325); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (6, '8-Drawer Desk', 'White Ash', 750); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (7, 'Dining Table', 'Natural Ash', 800); INSERT INTO Product_T (ProductID, Product Description, ProductFinish, Product StandardPrice) VALUES (8, 'Computer Desk', 'Walnut', 250); CREATE TABLE Order_T (OrderID NUMBER (11,0) NOT NULL, CustomerID NUMBER (11,0) OrderDate DATE DEFAULT SYSDATE CONSTRAINT Order_PK PRIMARY KEY (OrderID), CONSTRAINT Order_FK1 FOREIGN KEY (CustomerID) REFERENCES Customer_T(CustomerID)); CREATE TABLE Product_T (ProductID NUMBER (11,0) NOT NULL, Product Description VARCHAR2(50) ProductFinish VARCHAR2 (20) Product StandardPrice DECIMAL (6,2) CONSTRAINT Product_PK PRIMARY KEY (ProductID)); CREATE TABLE OrderLine_T (OrderID NUMBER(11,0) NOT NULL, ProductID NUMBER (11,0) NOT NULL, OrderedQuantity NUMBER (11,0) CONSTRAINT OrderLine_PK PRIMARY KEY (OrderID, ProductID), CONSTRAINT OrderLine_FK1 FOREIGN KEY (OrderID) REFERENCES Order_T(OrderID), CONSTRAINT OrderLine_FK2 FOREIGN KEY (ProductID) REFERENCES Product_T(ProductID)); 1

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

More Books

Students also viewed these Databases questions

Question

=+free to pirate employees from competitors?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago