Q1. Topic 8)
You plan to create a custom aggregation function named Median.
You plan to deploy Median to a SQL Server 2014 server named Server1.
You need to ensure that Median can access a web service named WebApp1. The solution
must minimize the number of changes made to the database.
You create a Microsoft .NET Framework class that contains the definition of Median.
You upload a certificate to Server1.
What three tasks should you perform next?
To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Answer:
Q2. You need to implement security for the restore and audit process. What should you do?
A. Grant the COFFECORP\Auditors group ALTER ANY CONNECTION and SELECT ALL USER SECURABLES permissions. Grant the COFFECORP\StoreAgent group ALTER ANY CONNECTION and IMPERSONATE ANY LOGIN permissions.
B. Grant the COFFECORP\Auditors group CONNECT ANY DATABASE and IMPERSONATE ANY LOGIN permissions. Grant the COFFECORP\StoreAgent group CONNECT ANY DATABASE and SELECT ALL USER SECURABLES permissions.
C. Grant the COFFECORP\Auditors group ALTER ANY CONNECTION and IMPERSONATE ANY LOGIN permissions. Grant the COFFECORP\StoreAgent group ALTER ANY CONNECTION and SELECT ALL USER SECURABLES permissions.
D. Grant the COFFECORP\Auditors group CONNECT ANY DATABASE and SELECT ALL USER SECURABLES permissions. Grant the COFFECORP\StoreAgent group CONNECT ANY DATABASE and IMPERSONATE ANY LOGIN permissions.
Answer: A
Q3. Topic 8)
You are a SQL Server 2014 Developer. A database that you work on contains two tables that are defined as follows:
Product is an important table that has sensitive audit requirements.
You need to create a trigger that supports the following requirements:
1.
Every row that is inserted or updated in Product will reflect its actual LastUpdatedDate and LastUpdatedBy values in the Product table.
2.
Any row that is updated or deleted must write a new record reflecting the OLD values into the ProductAudit table.
3.
Any error that occurs during the course of the trigger's execution must prevent the changes from happening.
Develop the solution by selecting and arranging the required code blocks in the correct order.
You may not need all of the code blocks.
Answer:
Q4. You need to prepare the database to use the .NET Framework ProcessProducts component.
Which code segments should you execute? (Each correct answer presents part of the solution. Choose all that apply.)
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F
G. Option G
Answer: A,C,D,E
Explanation:
http://msdn.microsoft.com/en-us/library/ms131048.aspx http://msdn.microsoft.com/en-us/library/ms131052.aspx http://msdn.microsoft.com/en-us/library/ms189524.aspx http://msdn.microsoft.com/en-us/library/ms345106.aspx http://msdn.microsoft.com/en-us/library/ms131107.aspx
Q5. Topic 8)
You create a disk-based table that contains the following script:
You need to prevent duplicate values in the SKU field.
Which five code segments should you use?
To answer, move the appropriate code segments from the list of code segments to the
answer area and arrange them in the correct order.
Answer:
Q6. You plan to create a new table that has the following requirements:
...
Uses a GUID data type as the primary key. Uses a clustered index as the primary key. Minimizes fragmentation.
You need to recommend which option to include in the CREATE statement.
Which option should you include?
More than one answer choice may achieve the goal. Select the BEST answer.
A. NEWID
B. @@IDENTITY
C. NEWSEQUENTIALID
D. IDENTITY
Answer: C
Q7. You need to modify usp_SelectEmployeesByName to support server-side paging. The solution must minimize the amount of development effort required.
What should you add to usp_SelectEmployeesByName?
A. A table variable
B. The ROWNUMBER keyword
C. An OFFSET-FETCH clause
D. A recursive common table expression
Answer: C
Explanation:
http://www.mssqltips.com/sqlservertip/2696/comparing-performance-for-different-sql-serverpaging-methods/ http://msdn.microsoft.com/en-us/library/ms188385.aspx http://msdn.microsoft.com/en-us/library/ms180152.aspx http://msdn.microsoft.com/en-us/library/ms186243.aspx http://msdn.microsoft.com/en-us/library/ms186734.aspx http://www.sqlserver-training.com/how-to-use-offset-fetch-option-in-sql-server-order-byclause/-http://www.sqlservercentral.com/blogs/juggling_with_sql/2011/11/30/using-offset-and-fetch/
Q8. You are evaluating the table design.
You need to recommend a change to Tables.sql that reduces the amount of time it takes for usp_AttendeesReport to execute.
What should you add at line 14 of Tables.sql?
A. FullName nvarchar(100) NOT NULL CONSTRAINT DF_FuIlName DEFAULT (dbo.CreateFullName (FirstName, LastName)),
B. FullName AS (FirstName +‘ ’+ LastName),
C. FullName nvarchar(100) NOT NULL DEFAULT (dbo.CreateFullName (FirstName, LastName)).
D. FullName AS (FirstName +‘ ’+ LastName) PERSISTED,
Answer: D
Explanation:
http://msdn.microsoft.com/en-us/library/ms188300.aspx http://msdn.microsoft.com/en-us/library/ms191250.aspx
Q9. You have a database named Database1. You execute the following code:
You have the following query. (Line numbers are included for reference only.)
Users report that the query takes a long time to complete.
You create a full-text index for the Notes column.
You need to recommend changes to the query to reduce the amount of time it takes for the query to complete.
Which code segment should you use to replace line 03?
A. WHERE FREETEXT(notes, '%call%') AND
B. INNER JOIN FREETEXTTABLE(dbo.table1, notes, 'call') AS t2 ON dbo.table1.ID = t2.key WHERE
C. WHERE CONTAINS(notes, 'call*') AND
D. WHERE CONTAINS(notes,*%call%'> AND
Answer: A
Q10. You execute the following code: The execution plan for the query is shown in the exhibit. (Click the Exhibit button.)
You need to prevent the key lookup. What should you modify?
More than one answer choice may achieve the goal. Select the BEST answer.
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q11. You execute the following code:
You have a stored procedure that includes the following SELECT statement:
You need to create a covering index on UserInfo. Which code segment should you execute?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q12. You need to resolve the performance issues of the usp_ExportOpenings stored procedure. The solution must minimize the amount of hard disk space used.
Which statement should you execute on DB1?
A. EXEC sp_dboption 'DB1', 'auto create statistics', 'TRUE'
B. CREATE INDEX IX_Exp_Openings ON Openings(PostDate, FilledDate) INCLUDE
(Description, Title, Salary);
C. CREATE INDEX IX_Exp_Openings ON Openings(PostDate) INCLUDE (Description,
Title,
Salary) WHERE FilledDate IS NULL;
D. EXEC sp_recompile 'usp_ExportOpenings'
Answer: C
Q13. Which code segment should you use to define the ProductDetails column?
A. ProductDetails xml (DOCUMENT Production.ProductDetailsSchema) NULL
B. ProductDetails xml NULL
C. ProductDetails xml (CONTENT Production.ProductDetailsSchema) NULL
D. ProductDetails varchar(MAX) NULL
Answer: D
Q14. You discover that the usp_GetOrdersAndItems stored procedure takes a long time to complete while usp_AddOrder or usp_AddXMLOrder run.
You need to ensure that usp_GetOrdersAndItems completes as quickly as possible.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)
A. Set the isolation level of the usp_GetOrdersAndItems stored procedure to SERIALIZABLE.
B. Execute the ALTER DATABASE Sales SET ALLOW_SNAPSHOT_ISOLATION ON statement.
C. Set the isolation level of the usp_AddOrder stored procedure to SERIALIZABLE.
D. Set the isolation level of the usp_GetOrdersAndItems stored procedure to SNAPSHOT.
E. Set the isolation level of the usp_AddOrder stored procedure to SNAPSHOT.
F. Execute the ALTER DATABASE Sales SET ALLOW_SNAPSHOT_ISOLATION OFF statement.
Answer: B,D
Q15. Topic 8)
You are planning two stored procedures named SProc1 and SProc2. You identify the following requirements:
. SProc1 must return a table.
. SProc2 must return a status code.
You need to identify which options must be implemented to meet each stored procedure requirement.
Which options should you identify?
To answer, drag the appropriate option to the correct requirement in the answer area. (Answer choices may be used once, more than once, or not at all.)
Answer:
Q16. You need to create the object used by the parameter of usp_InsertSessions.
Which statement should you use?
A. CREATE SCHEMA SessionDataTable
B. CREATE TYPE SessionDataTable AS Table
C. CREATE TABLE SessionDataTable
D. CREATE XML SCHEMA COLLECTION SessionDataTable
Answer: A
Q17. You need to create a function that will use a SELECT statement in ProductsByProductType.sql.
Which code segment should you use to complete the function?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Explanation:
http://msdn.microsoft.com/en-us/library/ms191320.aspx http://msdn.microsoft.com/en-us/library/ms186755.aspx