Which four T-SQL statements should you use?

DRAG DROP
You use a Microsoft SQL Server 2012 database.
You need to create an indexed view within the database for a report that displays Customer Name
and the total revenue for that customer.
Which four T-SQL statements should you use? (To answer, move the appropriate SQL statements
from the list of statements to the answer area and arrange them in the correct order.)

DRAG DROP
You use a Microsoft SQL Server 2012 database.
You need to create an indexed view within the database for a report that displays Customer Name
and the total revenue for that customer.
Which four T-SQL statements should you use? (To answer, move the appropriate SQL statements
from the list of statements to the answer area and arrange them in the correct order.)

Answer:

Explanation:
http://msdn.microsoft.com/en-us/library/ms191432.aspx
Read all restrictions for indexed views.
Also read this useful
question:
http://stackoverflow.com/questions/12419330/how-to-create-indexed-view-with-select-distinctstatement-insql-2005



Leave a Reply 4

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


Mr Meat

Mr Meat

I think that the provided answer is incorrect. The “Create Unique Index” should be replaced with the “Group By”.

The provided answer suggests that you create tow indexes with the same name and that you are also indexing the same column twice.

Egg_Head

Egg_Head

Also the Group By clause should precede the CREATE UNIQUE CLUSTERED INDEX statement.

Manuel

Manuel

Yeah, you’re right. If the SQL snippets were numbered, the correct answer would be formed by 2,3,4 and 5 snippets.