You want to query the table OrderDetail to generate a list of product IDs for products that cost less than $100.00 that have an average order quantity greater than 10.

Which of the following T-SQL statements can you use to accomplish this goal?

 Posted by Rajkatie on 11/30/2012 | Category: Sql Server Interview questions | Views: 5401 | Points: 40
Select from following answers:
  1. SELECT ProductID FROM OrderDetail WHERE UnitPrice < 100.00 GROUP BY ProductID HAVING AVG(OrderQty) > 10 ORDER BY ProductID;
  2. SELECT ProductID FROM OrderDetail WHERE UnitPrice > 100.00 GROUP BY ProductID HAVING AVG(OrderQty) < 10 ORDER BY ProductID;
  3. SELECT ProductID FROM OrderDetail WHERE UnitPrice > 100.00 GROUP BY ProductID HAVING AVG(OrderQty) > 10 ORDER BY ProductID;
  4. All Above

Show Correct Answer


Source: Microsoft Press book | | Alert Moderator 

Comments or Responses

Login to post response