70-464 Exam - Developing Microsoft SQL Server 2012 Databases

certleader.com

Q1. Topic 8) 

Your network contains a server named Server1 that runs SQL Server 2012. Server1 contains an instance named Instance1. Instance1 contains a database named ContentDatabase. 

ContentDatabase uses transaction log backups. 

The recovery model of ContentDatabase is set to FULL. 

You need to shrink the ContentDatabase_Log log file to 10 MB. The solution must ensure that you can continue to back up the transaction log. 

Which three code segments should you execute? 

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:  

Q2. You need to add a new column named Confirmed to the Attendees table. 

The solution must meet the following requirements: 

. Have a default value of false. 

. Minimize the amount of disk space used. 

Which code block should you use? 

A. ALTER TABLE Attendees 

ADD Confirmed bit DEFAULT 0; 

B. ALTER TABLE Attendees 

ADD Confirmed char(l) DEFAULT '1' 

C. ALTER TABLE Attendees 

ADD Confirmed bit DEFAULT 1; 

D. ALTER TABLE Attendees 

ADD Confirmed char(l) DEFAULT ‘1’; 

Answer:

Explanation: 

http://msdn.microsoft.com/en-us/library/ms177603.aspx 

Q3. You discover that usp.SelectSpeakersByName executes slowly if usp_UpdateSpeakerName executes simultaneously. 

You need to minimize the execution time of usp.SelectSpeakersByName. The solution must not affect the performance of the other stored procedures. 

What should you update? 

A. Usp_UpdateSpeakerName to use the NOLOCK query hint 

B. Usp_UpdateSpeakerName to use snapshot isolation 

C. Usp_SelectSpeakersByName to use the NOLOCK query hint 

D. Usp_SelectSpeakersByName to use snapshot isolation 

Answer:

Explanation: NOLOCK 

Is equivalent to READUNCOMMITTED. 

READUNCOMMITTED 

Specifies that dirty reads are allowed. 

Q4. You need to convert the functionality of Legacy.sql to use a stored procedure. Which code segment should the stored procedure contain? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: 

http://msdn.microsoft.com/en-us/library/ms187926.aspx http://msdn.microsoft.com/en-us/library/ms190782.aspx http://msdn.microsoft.com/en-us/library/bb669091.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms709342.aspx http://msdn.microsoft.com/en-us/library/ms188001.aspx 

Q5. 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:

Q6. Developers report that usp_UpdateSessionRoom periodically returns error 3960. 

You need to prevent the error from occurring. The solution must ensure that the stored procedure returns the original values to all of the updated rows. 

What should you configure in Procedures.sql? 

A. Replace line 46 with the following code: 

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE 

B. Replace line 46 with the following code: 

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ 

C. Move the SELECT statement at line 49 to line 57. 

D. Move the SET statement at line 46 to line 53. 

Answer:

Topic 3, Scenario 3 

Application Information 

You have two servers named SQL1 and SQL2. SQL1 has SQL Server 2012 Enterprise installed. SQL2 has SQL Server 2008 Standard installed. 

You have an application that is used to manage employees and office space. Users report that the application has many errors and is very slow. 

You are updating the application to resolve the issues. You plan to create a new database on SQL1 to support the application. The script that you plan to use to create the tables for the new database is shown in Tables.sql. The script that you plan to use to create the stored procedures for the new database is shown in StoredProcedures.sql. The script that you plan to use to create the indexes for the new database is shown in Indexes.sql. A database named DB2 resides on SQL2. DB2 has a table named EmployeeAudit that will audit changes to a table named Employees. 

A stored procedure named usp_UpdateEmployeeName will be executed only by other stored procedures. The stored procedures executing usp_UpdateEmp!oyeeName will always handle transactions. 

A stored procedure named usp_SelectEmployeesByName will be used to retrieve the names of employees. Usp_SelectEmployeesByName can read uncommitted data. 

A stored procedure named usp_GetFutureOfficeAssignments will be used to retrieve office assignments that will occur in the future. 

StoredProcedures.sql 

Indexes.sql Tables.sql 

Q7. 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:

Q8. You have a Microsoft SQL Azure database that contains a table named Customers. 

You have a table-valued function named TopCustomers that returns a list of all the customers that have purchased items during the last 12 months. The ID of the customer is passed as an argument to the TopCustomers function. 

You need to create a query that returns a list of all the Customer names and the purchase dates. 

The solution must return only customers that have purchased an item during the last 12 months. 

What should you add to the query? 

A. OUTER JOIN 

B. CROSS JOIN 

C. CROSS APPLY 

D. OUTER APPLY 

Answer:

Q9. 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:

Explanation: 

http://msdn.microsoft.com/en-us/library/ms191320.aspx http://msdn.microsoft.com/en-us/library/ms186755.aspx 

Q10. You need to implement a change to usp_ExportOpenings that meets the integration requirements. 

What should you modify in usp_ExportOpenings? (Each correct answer presents part of the solution. Choose all that apply?) 

A. To the end of line 04, add [Opening]. 

B. To the end of line 05, add [Opening! title]. 

C. To line 10, add FOR XML RAW. 

D. To line 10, add FOR XMLEXPLICIT. 

E. To line 10, add FOR XML AUTO. 

F. To the end of line 04, add [Opening!ELEMENT]. 

G. To the end of line 06, add [Opening!salary!ELEMENT]. 

H. To the end of line 05, add [Opening!title!ELEMENT]. 

I. To the end of line 06, add [Opening! salary]. 

Answer: A,B,E,I 

Explanation: 

The AUTO mode generates nesting in the resulting XML by using heuristics based on the way the SELECT statement is specified. You have minimal control over the shape of the XML generated. The nested FOR XML queries can be written to generate XML hierarchy beyond the XML shape that is generated by AUTO mode heuristics.