You need to create a subquery that retrieves one instance of each product in the from temp database when the product name includes Lumia and the ProductmodelNo numbers match in the Product and ProductModel tables.

Which of the following queries can you use to achieve this taks ?

 Posted by Rajkatie on 6/24/2013 | Category: Sql Server Interview questions | Views: 6012 | Points: 40
Select from following answers:
  1. SELECT DISTINCT Name FROM Product WHERE ProductModelNo IN (SELECT ProductModelNo FROM ProductModel WHERE Name LIKE 'Lumia%';
  2. SELECT Name FROM Product AS pp WHERE EXISTS (SELECT * FROM ProductModel AS pm WHERE pp.ProductModelNo = pm.ProductModelNo AND pm.Name LIKE 'Lumia')
  3. SELECT Name FROM Product WHERE ProductModelNo IN (SELECT ProductModelNo FROM ProductModel WHERE Name LIKE 'Lumia');
  4. All Above

Show Correct Answer


Asked In: measureup.com | Alert Moderator 

Comments or Responses

Login to post response