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
a SELECT customer FROM orders JOIN ord... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
1803_60b8c1212a754_716713.pdf
180 KBs PDF File
1803_60b8c1212a754_716713.docx
120 KBs Word File
