Question: Which query determines the customers who have ordered themost books from JustLee Books? a. SELECT customer# FROM orders JOIN orderitems USING (order#) HAVING SUM (quantity)

Which query determines the customers who have ordered themost books from JustLee Books?
a. SELECT customer# FROM orders

JOIN orderitems USING (order#)
HAVING SUM (quantity) = (SELECT
MAX (SUM (quantity)) FROM orders
JOIN orderitems USING (order#)
GROUP BY customer#) GROUP BY customer#;

b. SELECT customer# FROM orders

JOIN orderitems USING (order#)
WHERE SUM (quantity) = (SELECT
MAX (SUM (quantity)) FROM orderitems
GROUP BY customer#);

c. SELECT customer# FROM orders

WHERE MAX (SUM (quantity)) = (SELECT
MAX (SUM (quantity) FROM orderitems
GROUP BY order#);

d. SELECT customer# FROM orders

HAVING quantity = (SELECT MAX (SUM (quantity))
FROM orderitems
GROUP BY customer#);

Step by Step Solution

3.45 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a SELECT customer FROM orders JOIN ord... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

1803_60b8c1212a754_716713.pdf

180 KBs PDF File

Word file Icon

1803_60b8c1212a754_716713.docx

120 KBs Word File

Students Have Also Explored These Related Oracle 12c SQL Questions!