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

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) = (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#);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Oracle 12c SQL

ISBN: 978-1305251038

3rd edition

Authors: Joan Casteel

Question Posted: