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.)
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
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.
Also the Group By clause should precede the CREATE UNIQUE CLUSTERED INDEX statement.
I think also group by have to be used to sum the total of the customer , also in combination with clustered index for the best performance
https://technet.microsoft.com/en-us/library/ms190639%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396
Yeah, you’re right. If the SQL snippets were numbered, the correct answer would be formed by 2,3,4 and 5 snippets.