70-464 Exam - Developing Microsoft SQL Server 2012 Databases

certleader.com

Q1. Topic 8) 

You have a SQL Server 2014 database. 

You plan to create a stored procedure that will retrieve the following information: 

. The XML content of the query plans that is stored in memory . The number of times each query plan is used 

You need to identify which dynamic management objects must be used to retrieve the required information for the stored procedure. 

Which dynamic management objects should you identify? 

To answer, drag the appropriate dynamic management object to the correct requirement in the answer area. 

Answer:  

Q2. You are planning the ManufacturingSteps table. 

You need to define the ProductID column in the CREATE TABLE statement. 

Which code segment should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Explanation: 

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

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

Q3. 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 scalar value. You need to identify which option must be implemented for each stored procedure to return the desired data. 

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:  

Q4. You need to create a function that filters invoices by CustomerID. The SELECT statement for the function is contained in InvoicesByCustomer.sql. 

Which code segment should you use to complete the function? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q5. You execute IndexManagement.sql and you receive the following error message: "Msg 512, Level 16, State 1, Line 12 

Subquery returned more than 1 value. This is not permitted when the subquery follows =,! 

=, <, <= ,>, > = or when the subquery is used as an expression." 

You need to ensure that IndexManagement.sql executes properly. 

Which WHILE statement should you use at line 18? 

A. WHILE SUM(@RowNumber) < (SELECT @counter FROM @indextable) 

B. WHILE @counter < (SELECT COUNT(RowNumber) FROM @indextable) 

C. WHILE COUNT(@RowNumber) < (SELECT @counter FROM @indextable) 

D. WHILE @counter < (SELECT SUM(RowNumber) FROM @indextabie) 

Answer:

Q6. You use SQL Server 2012 to maintain the data used by the applications at your company. 

You plan to create a table named Table1 by using the following statement. (Line numbers are included for reference only.) 

... 

You need to ensure that Table1 contains a column named UserName. The UserName column will: 

Store string values in any language. 

Accept a maximum of 200 characters. 

Be case-insensitive and accent-insensitive. 

Which code segment should you add at line 03? 

A. UserName nvarchar(200) COLLATE Latin1_General_CS_AS NOT NULL, 

B. UserName varchar(200) COLLATE Latin1_General_CI_AI NOT NULL, 

C. UserName varchar(200) COLLATE Latin 1_General_CS_AS NOT NULL, 

D. UserName nvarchar(200) COLLATE Latin1_General_CI_AI NOT NULL, 

Answer:

161. You plan to modify a procedure that contains hundreds of lines of code. 

The modification must support the following guidelines: 

. Use only tables that are not persistent in the database. 

. Minimize the amount of time required to execute and recompile procedures. 

You need to identify which type of table must be used to support the planned modification. 

Which type of table should you identify? 

A. A system table 

B. A partitioned table 

C. A table variable 

D. A temporary table 

Q7. Topic 8) 

You have a SQL Azure database named Database1. You need to design the schema for a table named table1. 

Table1 will have less than one million rows. Table1 will contain the following information for each row: 

The solution must minimize the amount of space used to store each row. Which data types 

should you recommend for each column? To answer, drag the appropriate data type to the correct column in the answer area. 

Answer:  

137. Topic 8) 

You administer a SQL Server 2014 instance. 

You have been assigned to determine the cause of frequent long-running transactions that have been tracked to the dbo.Account table, where there are many cases of blocking and deadlocks. The dbo.Account table contains more than one million rows. 

Users and processes frequently search for and update data by using the AccountId column, and less frequently the AccountNumber and GovernmentId columns, all of which contain only unique values. Users frequently get lists of AccountNumber values by searching on Last Name and then First Name. 

You need to modify the structure of the dbo.Account table to alleviate the issues. 

How should you complete the table definition to reduce contention on the table structure? To answer, drag the appropriate code snippets to the correct locations in the CREATE TABLE statement. Each code snippet may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. 

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

Q9. You use SQL Server 2014. The physical server is a dedicated database server that has 120GB of RAM available. There is approximately 50GB of storage space available on a 

slow local disk. 

You create a new stored procedure. You decide you need to temporarily hold approximately 300,000 rows from two tables, from which you will compute two complex business scores. 

The stored procedure will use temporary storage defined as follows: 

The code will make several passes through the data, applying complex calculations before writing the data to a permanent disk-based table in the same database from which it reads the data. 

For this stored procedure, you need to deal with temporary data in the most efficient way to minimize physical disk pressure. 

What should you do? 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:

Explanation: * You must specify a value for the BUCKET_COUNT parameter when you create the memory-optimized table. In most cases the bucket count should be between 1 and 2 times the number of distinct values in the index key. If the index key contains a lot of duplicate values, on average there are more than 10 rows for each index key value, use a nonclustered index instead You may not always be able to predict how many values a particular index key may have or will have. Performance should be acceptable if the BUCKET_COUNT value is within 5 times of the actual number of key values. 

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