Act now and download your Microsoft 70-464 test today! Do not waste time for the worthless Microsoft 70-464 tutorials. Download Most up-to-date Microsoft Developing Microsoft SQL Server 2012 Databases exam with real questions and answers and begin to learn Microsoft 70-464 with a classic professional.
Q1. You review a query that runs slowly. The query accesses data in a table named Schema1.Table1.
The following is the relevant portion of the execution plan for the query: You need to create the missing index.
Which code segment should you execute?
A. CREATE NONCLUSTERED INDEX IX1 on Schema1.Table1 (Column1) INCLUDE (Column4) WHERE Column2 <> Column3
B. CREATE NONCLUSTERED INDEX IX1 on Schema1.Table1 (Column1)
C. CREATE NONCLUSTERED INDEX IX1 on Schema1.Table1 (Column1, Column2, Column3) INCLUDE (Column4)
D. CREATE NONCLUSTERED INDEX IX1 on schema1.Table1 (Column1) INCLUDE (Column4)
Answer: C
Q2. Which data type should you use for ProductType?
A. varchar(11)
B. nvarchar(11)
C. char(11)
D. bigint
Answer: C
Topic 5, Litware, Inc
Overview
General Overview
You are a database developer for a company named Litware, Inc. Litware has a main office in Miami.
Litware has a job posting web application named WebApp1. WebApp1 uses a database named DB1. DB1 is hosted on a server named Server1. The database design of DB1 is shown in the exhibit. (Click the Exhibit button.)
WebApp1 allows a user to log on as a job poster or a job seeker. Candidates can search for job openings based on keywords, apply to an opening, view their application, and load their resume in Microsoft Word format. Companies can add a job opening, view the list of candidates who applied to an opening, and mark an application as denied.
Users and Roles
DB1 has five database users named Company, CompanyWeb, Candidate, CandidateWeb, and Administrator.
DB1 has three user-defined database roles. The roles are configured as shown in the following table.
Keyword Search
The keyword searches for the job openings are performed by using the following stored procedure named usp_GetOpenings:
Opening Update
Updates to the Openings table are performed by using the following stored procedure named usp_UpdateOpening:
Problems and Reported Issues
Concurrency Problems
You discover that deadlocks frequently occur.
You identify that a stored procedure named usp_AcceptCandidate and a stored procedure named usp_UpdateCandidate generate deadlocks. The following is the code for usp_AcceptCandidate:
Salary Query Issues
Users report that when they perform a search for job openings without specifying a minimum salary, only job openings that specify a minimum salary are displayed.
Log File Growth Issues
The current log file for DB1 grows constantly. The log file fails to shrink even when the daily SQL Server Agent Shrink Database task runs.
Performance Issues
You discover that a stored procedure named usp_ExportOpenings takes a long time to run and executes a table scan when it runs.
You also discover that the usp_GetOpenings stored procedure takes a long time to run and that the non-clustered index on the Description column is not being used.
Page Split Issues
On DB1, many page splits per second spike every few minutes.
Requirements
Security and Application Requirements
Litware identifies the following security and application requirements: . Only the Administrator, Company, and CompanyWeb database users must be able to execute the usp_UpdateOpening stored procedure. . Changes made to the database must not affect WebApp1.
Locking Requirements
Litware identifies the following locking requirements: . The usp_GetOpenings stored procedure must not be blocked by the usp_UpdateOpening stored procedure. . If a row is locked in the Openings table, usp_GetOpenings must retrieve the latest
version of the row, even if the row was not committed yet.
Integration Requirements
Litware exports its job openings to an external company as XML data. The XML data uses the following format:
A stored procedure named usp_ExportOpenings will be used to generate the XML data. The following is the code for usp_ExportOpenings:
The stored procedure will be executed by a SQL Server Integration Services (SSIS) package named Package1.
The XML data will be written to a secured folder named Folder1. Only a dedicated Active Directory account named Account1 is assigned the permissions to read from or write to Folder1.
Refactoring Requirements
Litware identifies the following refactoring requirements: . New code must be written by reusing the following query:
. The results from the query must be able to be joined to other queries.
Upload Requirements
Litware requires users to upload their job experience in a Word file by using WebApp1. WebApp1 will send the Word file to DB1 as a stream of bytes. DB1 will then convert the Word file to text before the contents of the Word file is saved to the Candidates table.
A database developer creates an assembly named Conversions that contains the following:
. A class named Convert in the SqlConversions namespace
. A method named ConvertToText in the Convert class that converts Word files to
text
The ConvertToText method accepts a stream of bytes and returns text. The method is used in the following stored procedure:
Job Application Requirements
A candidate can only apply to each job opening once.
Data Recovery Requirements
All changes to the database are performed by using stored procedures. WebApp1 generates a unique transaction ID for every stored procedure call that the application makes to the database.
If a server fails, you must be able to restore data to a specified transaction.
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: C
Explanation: NOLOCK
Is equivalent to READUNCOMMITTED.
READUNCOMMITTED
Specifies that dirty reads are allowed.
Q4. 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/
Q5. You are creating a table named Orders.
You need to ensure that every time a new row is added to the Orders table, a user-defined function is called to validate the row before the row is added to the table.
What should you use?
More than one answer choice may achieve the goal. Select the BEST answer.
A. A data manipulation language (DML) trigger
B. A DEFAULT constraint
C. A Data Definition Language (DDL) trigger
D. A CHECK constraint
E. A FOREIGN KEY constraint
Answer: D
Explanation:
http://www.techrepublic.com/blog/programming-and-development/comparing-sql-serverconstraints-and-dmltriggers/402 http://msdn.microsoft.com/en-us/library/ms178110.aspx
Q6. You need to monitor the health of your tables and indexes in order to implement the required index maintenance strategy.
What should you do?
A. Query system DMVs to monitor avg_chain_length and max_chain_length. Create alerts to notify you when these values converge.
B. Create a SQL Agent alert when the File Table: Avg time per file I/O request value is increasing.
C. Query system DMVs to monitor total_bucket_count. Create alerts to notify you when this value increases.
D. Query system DMVs to monitor total_bucket_count. Create alerts to notify you when this value decreases.
Answer: A
Explanation: From scenario:
*
You need to anticipate when POSTransaction table will need index maintenance.
*
The index maintenance strategy for the UserActivity table must provide the optimal structure for both maintainability and query performance.
Q7. 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:
Q8. You need to ensure that usp_AddXMLOrder can be used to validate the XML input from the retailers.
Which parameters should you add to usp_AddXMLOrder on line 04 and line 05? (Each correct answer presents part of the solution. Choose all that apply.)
A. @schema varbinary(100).
B. @items varchar(max).
C. @schema sysname.
D. @items varbinary(max).
E. @items xml.
F. @schema xml.
Answer: C,E
Q9. You need to modify the usp_DetectSuspiciousActivity stored procedure.
Which two actions should you perform? Each correct answer presents part of the solution. Choose two.
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F
Answer: D,E
Explanation:
Note:
* Move micropayments to dbo.POSException table by using a stored procedure named ups_DetectSuspiciousActivity.
Q10. You need to modify usp_SelectSpeakersByName to support server-side paging. The solution must minimize the amount of development effort required.
What should you add to usp_SelectSpeakersByName?
A. A table variable
B. An OFFSET-FETCH clause
C. The ROWNUMBER keyword
D. A recursive common table expression
Answer: B
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/