Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Refer to the tables. The Product's Quantity column stores the stockroom's product quantity before any products are sold. Which products are selected by the query

Refer to the tables. The Product's Quantity column stores the stockroom's product quantity before any products are sold. Which products are selected by the query below?
The Product table has columns ProductID, ProductName, Size, and Quantity. Product has 5 rows: 1, Onesies set, 3-6M,202, Sunsuit, 3-6M,103, Romper, 9-12M,54, Pajama set, 24M,205, Shorts set, 18M,8 The Sales table has columns OrderID, CustomerID, ProductID, OrderDate, and Quantity. Sales has 10 rows: 1,5,2,2020-03-15,32,3,1,2020-03-22,13,4,5,2020-05-30,24,5,3,2020-03-16,85,5,4,2020-03-16,56,12,4,2020-06-16,17,12,1,2020-06-16,18,7,1,2020-06-17,49,7,5,2020-06-17,410,2,5,2020-06-20,2
SELECT ProductName
FROM Product P
WHERE Quantity >
(SELECT SUM(Quantity)
FROM Sales
WHERE ProductID = P.ProductID);

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_2

Step: 3

blur-text-image_3

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

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions