Which of the following queries selects the name of the supplier, corresponding order number, and total ordered
Question:
Which of the following queries selects the name of the supplier, corresponding order number, and total ordered quantity of the order that has the maximum total quantity ordered.
Transcribed Image Text:
a. SELECT R1.SUPNAME, POL1.PONR, SUM(POL1.QUANTITY) FROM SUPPLIER R1, PURCHASE_ORDER PO1, PO_LINE POL1 WHERE R1.SUPNR = PO1.SUPNR AND PO1.PONR= POL1.PONR GROUP BY POL1.PONR HAVING SUM(POL1.QUANTITY) >= ANY (SELECT SUM(POL2.QUANTITY) FROM SUPPLIER R2, PURCHASE_ORDER PO2, PO_LINE POL2 WHERE R2.SUPNR = PO2.SUPNR AND PO2.PONR= POL2.PONR GROUP BY POL2.PONR) b. SELECT R1.SUPNAME, POL1.PONR, SUM(POL1.QUANTITY) FROM SUPPLIER R1, PURCHASE_ORDER PO1, PO_LINE POL1 WHERE R1.SUPNR = PO1.SUPNR AND PO1.PONR= POL1.PONR GROUP BY POL1.PONR HAVING SUM(POL1.QUANTITY) <= ALL (SELECT SUM(POL2.QUANTITY) FROM SUPPLIER R2, PURCHASE_ORDER PO2, PO_LINE POL2 C. WHERE R2.SUPNR = PO2.SUPNR AND PO2.PONR= POL2.PONR d. GROUP BY POL2.PONR) SELECT R1.SUPNAME, POL1.PONR, SUM(POL1.QUANTITY) FROM SUPPLIER R1, PURCHASE_ORDER PO1, PO_LINE POL1 WHERE R1.SUPNR = PO1.SUPNR AND PO1.PONR= POL1.PONR GROUP BY POL1.PONR HAVING SUM(POL1.QUANTITY) >= ALL (SELECT SUM(POL2.QUANTITY) FROM SUPPLIER R2, PURCHASE_ORDER PO2, PO_LINE POL2 WHERE R2.SUPNR = PO2.SUPNR AND PO2.PONR= POL2.PONR GROUP BY POL2.PONR) SELECT R1.SUPNAME, POL1.PONR, SUM(POL1.QUANTITY) FROM SUPPLIER R1, PURCHASE_ORDER PO1, PO_LINE POL1 WHERE R1.SUPNR = PO1.SUPNR AND PO1.PONR= POL1.PONR GROUP BY POL1.PONR HAVING SUM(POL1.QUANTITY) <= ANY (SELECT SUM(POL2.QUANTITY) FROM SUPPLIER R2, PURCHASE_ORDER PO2, PO_LINE POL2 WHERE R2.SUPNR = PO2.SUPNR AND PO2.PONR= POL2.PONR GROUP BY POL2.PONR)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 50% (2 reviews)
Answered By
Omar ELmoursi
I'm Omar, I have Bachelor degree in Business and Finance, My unique approach is to help students with questions and assignments, I can teach Business, Math, Accounting, Managerial Accounting, Economy, Human resources management, organizational behavior, project management, I have experience dealing with different types of students and teach them how to deal with different types of exercises.
5.00+
4+ Reviews
10+ Question Solved
Related Book For
Principles Of Database Management The Practical Guide To Storing Managing And Analyzing Big And Small Data
ISBN: 9781107186125
1st Edition
Authors: Wilfried Lemahieu, Seppe Vanden Broucke, Bart Baesens
Question Posted:
Students also viewed these Computer science questions
-
To perform these assignments, refer to the tables in the JustLee Books database. Generate and test two SQL queries for each of the following tasks: a) the SQL statement needed to perform the stated...
-
We want to retrieve the available quantity of each ordered product of supplier Ad Fundum. Which of the following queries is correct? a. SELECT PRODNR, AVAILABLE_QUANTITY FROM PRODUCT WHERE PRODNR IN...
-
The RDC corporation is a manufacturer and seller of electronic testing equipment and sells direct to business and on the internet. Their supply chain, at a high level, is depicted below. Recently...
-
Cubitene is a diterpene present in the defense secretion of a species of African termite. What unusual feature characterizes the joining of isoprene units in cubitene?
-
Pat Corporation is the primary beneficiary in a VIE, even though Pat owns only 10 percent of the outstanding voting shares. In the year following the initial consolidation, the VIE earns net income...
-
What are the competitive strategies?
-
Hi-Cloud, Inc., is a start-up tech company. It is seeking a substantial line of credit from a federally insured commercial bank. Among other questions, the loan application requires disclosure of the...
-
Alchem (L) is the price leader in the polyglue market. All 10 other manufacturers (follower [F] firms) sell polyglue at the same price as Alchem. Alchem allows the other firms to sell as much as they...
-
12345678 7 9 10 Define Corporate Planning. What is Vision? What is Mission? Give an Example. What is Strategy? Define Environmental Scanning. List out elements of Internal Environment. List out...
-
Write a correlated SQL query to retrieve the number and status of all suppliers, except for the three suppliers with the lowest supplier status.
-
Consider the following query: Which of the following statements is not correct? a. The query retrieves the product number, product name, and available quantity of each product thanks to the left...
-
The WireOne Company manufactures high-quality coated electrical wire in two departments, Weaving and Coating. Materials are introduced at various points during work in the Weaving Department. After...
-
Henry was driving outside his home town of Oakland, California, when he was hit by a car driven by Tom who drove all the way from Portland, Oregon, his home, to see his father in San Francisco....
-
1. Over a decade ago, in 2009, a hard working lady in the news saved up her money over the years for a down payment to buy a house during a period when prices were at an all-time low. This was a...
-
As you think of all the ineffective leaders you have ever worked for or played on sports teams for, did they possess a common attribute that caused them to be ineffective?
-
National Telecomm is a corporation that has business offices in all 50 states. The corporation was incorporated in Delaware, has its main office in New York, and primary business in California. For...
-
As a shot put competitor, Sam throws an 8 kg ball straight upwards, giving it a constant upward acceleration of 35 m/s2 over 70.0 cm. He releases the ball and it leaves his hands 2.20 m above the...
-
Kweisi incurs the following employment-related expenses during the year: Airfare ...... $2,000 Lodging ..... 1,500 Meals ...... 1,200 Entertainment ... 800 Incidentals ..... 500 His employer...
-
2. Assume a person bends forward to lift a load "with his back" as shown in Figure P12.42a. The person's spine piv- ots mainly at the fifth lumbar vertebra, with the principal supporting force...
-
Describe how packet loss can occur at output ports. Can this loss he pre vented by increasing the switch fabric speed?
-
Consider the topology shown in Figure 4.20. Denote the three subnets with hosts (starting clockwise at 12:00) as Networks A, D, and C. Denote the subnets without hosts as Networks D, E, and F. a....
-
Three types of switching fabrics are discussed in Section 4.2. List and briefly describe each type. Which if any, can send multiple packets across the fabric in parallel?
-
11. Mr. Bautista aims to have his investment grow to Php. 500.000 in 4 years. How much should he invest in an account that pays 5% compound annually? 12. How long will it take Php. 1,000 to earn...
-
The biggest part of this class for me was the financial concepts and models. I already knew that finances play an integral part of a company's success, but I didn't fully understand how finances were...
-
Fred is very generous. During the current year he made gifts as described below. In the case of each gift, state whether any portion of the gift constitutes a present interest for purposes of ...
Study smarter with the SolutionInn App