Question #295153

SELECT customername FROM customer c, mobile m, purchase p WHERE p.mobileidm.mobileid AND c.customerid = p.customerid AND p.customerid IN (SELECT customerid FROM purchase GROUP BY customerid HAVING #SPACE1=(SELECT #SPACE2 FROM purchase GROUP BY customerid)) AND price> 40000;




8




9




11




What should be written at #SPACE1 and #SPACE2 respectively in the query given above to get John, Jack and Maria in the output?

Expert's answer

SELECT customer_id,MAX(purch_amt) 
FROM orders 
WHERE customer_id BETWEEN 3002 and 3007 
GROUP BY customer_id 
HAVING MAX(purch_amt)>1000;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS