PrepAway - Latest Free Exam Questions & Answers

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.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
http://msdn.microsoft.com/en-us/library/ms191432.aspx
Read all restrictions for indexed views.
Also read this useful

http://stackoverflow.com/questions/12419330/how-to-create-indexed-view-with-select-distinctstatement-insql-2005

7 Comments on “Which four T-SQL statements should you use?

  1. Tony says:

    I think the answer is wrong.
    When you apply aggregation functions (SUM and COUNTBIG) you have to include the remaining columns (CustomerID and CustomerName) in the GROUP BY clause.
    I would also only use the CREATE UNIQUE CLUSTERED INDEX statement at the end.

    What do you guys think (and why)?




    0



    0

Leave a Reply