...Our CEO is more interested to gift PMP training lab to all customers whose order total exceeds $500.
....
Whic query to achieve this?
A. SELECT c FROM Customer c WHERE (SELECT o.price FROM c.orders o) > '500'
B. SELECT c From Customer c WHERE (SELECT AVG(o.price) FROM c.orders o) > 500
C. SELECT c FROM Customer c WHERE (SELECT AVG(o.price) FROM c.orders o)>'500'
Given answer: B
First of all, the question does not ask for average price > 500, it is asking for total > 500
None of the query is correct.
It should be :
SELECT c FROM Customer c WHERE (SELECT SUM(o.price) FROM c.orders o) > 500