Which query should you use?

You have two tables named Customer and SalesOrder.
You need to identify all customers that have not yet made any purchases and those that have only
made
orders with an OrderTotal less than 100.
Which query should you use?

You have two tables named Customer and SalesOrder.
You need to identify all customers that have not yet made any purchases and those that have only
made
orders with an OrderTotal less than 100.
Which query should you use?

A.
SELECT *
FROM Customer
WHERE 100 > ALL (SELECT OrderTotal
FROM SalesOrder
WHERE Customer.CustomerID = SalesOrder.CustomerID)

B.
SELECT *
FROM Customer
WHERE 100 > SOME (SELECT OrderTotal
FROM SalesOrder
WHERE Customer.CustomerID = SalesOrder.CustomerID)

C.
SELECT *
FROM Customer
WHERE 100 > (SELECT MAX(OrderTotal)
FROM SalesOrder
WHERE Customer.CustomerID = SalesOrder.CustomerID)

D.
SELECT *
FROM Customer
WHERE EXISTS (SELECT SalesOrder.CustomerID
FROM SalesOrder
WHERE Customer.CustomerID = SalesOrder.CustomerID
AND SalesOrder.OrderTotal <= 100)



Leave a Reply 0

Your email address will not be published. Required fields are marked *