Microsoft SQL Test
Microsoft SQL Test
135Questions
Number: 70-461
Passing Score: 800
Time Limit: 120 min
File Version: 8.0
Excellent Questions, I pass with 90% with these questions. Guys just read this only.
I have corrected few questions and now score will be 95% above Guaranteed.
Best stuff I have ever used for my exam preparation. I love Examcollection guys.
Added Explanations and Exhibits most of the questions.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Exam A
QUESTION 1
You develop a Microsoft SQL Server 2012 database that contains a table named Products. The Products table has the following definition:
You need to create an audit record only when either the RetailPrice or WholeSalePrice column is updated.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/bb510663.aspx Reference: http://msdn.microsoft.com/en-us/library/ms186329.aspx
QUESTION 2
A table named Profits stores the total profit made each year within a territory. The Profits table has columns named Territory, Year, and Profit.
You need to create a report that displays the profits made by each territory for each year and its previous year.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/hh231256.aspx Reference: http://msdn.microsoft.com/en-us/library/hh213125.aspx
QUESTION 3
You use Microsoft SQL Server 2012 database to develop a shopping cart application. You need to rotate the unique values of the ProductName field of a table-
valued expression into multiple columns in the output.
A. CROSS JOIN
B. CROSS APPLY
C. PIVOT
D. UNPIVOT
Correct Answer: C
Section: (none)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation
Explanation/Reference:
Explanation:
http://technet.microsoft.com/en-us/library/ms177634.aspx
QUESTION 4
You administer a Microsoft SQL Server database that supports a shopping application.
You need to retrieve a list of customers who live in territories that do not have a sales person.
Which Transact- SQL query or queries should you use? (Each correct answer presents a complete solution. Choose all that apply.)
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 5
You support a database structure shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to write a query that displays the following details:
Total sales made by sales people, year, city, and country
Sub totals only at the city level and country level
A grand total of the sales amount
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation:
Be careful with this question,because on exam can be different options for answer. And none of them is correct : D You should report this question. Reference:
http://www.grapefruitmoon.net/diving-into-t-sql-grouping-sets/ Reference: http://msdn.microsoft.com/en-us/library/ms177673.aspx
QUESTION 6
You are developing a database that will contain price information. You need to store the prices that include a fixed precision and a scale of six digits. Which data
type should you use?
A. Float
B. Money
C. Smallmoney
D. Numeric
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Numeric is the only one in the list that can give a fixed precision and scale. Reference: http://msdn.microsoft.com/en-us/library/ms179882.aspx
QUESTION 7
You administer a Microsoft SQL Server database that supports a banking transaction management application.
You need to retrieve a list of account holders who live in cities that do not have a branch location.
Which Transact-SQL query or queries should you use? (Each correct answer presents a complete solution. Choose all that apply.)
A. SELECT AccountHolderID
FROM AccountHolder
WHERE CityID NOT IN (SELECT CityID FROM BranchMaster)
B. SELECT AccountHolderID
FROM AccountHolder
WHERE CityID <> ALL (SELECT CityID FROM BranchMaster)
C. SELECT AccountHolderlD
FROM AccountHolder
WHERE CityID <> SOME (SELECT CityID FROM BranchMaster)
D. SELECT AccountHolderID
FROM AccountHolder
WHERE CityID <> ANY (SELECT CityID FROM BranchMaster)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Verified the answers as correct.
Reference: http://msdn.microsoft.com/en-us/library/ms188047.aspx Reference: http://msdn.microsoft.com/en-us/library/ms177682.aspx Reference: http://
msdn.microsoft.com/en-us/library/ms173545.aspx
QUESTION 8
You administer a Microsoft SQL Server 2012 database. The database contains a table named Employee. Part of the Employee table is shown in the exhibit. (Click
the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Confidential information about the employees is stored in a separate table named EmployeeData. One record exists within EmployeeData for each record in the
Employee table. You need to assign the appropriate constraints and table properties to ensure data integrity and visibility. On which column in the Employee table
should you a create a unique constraint?
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
A. DateHired
B. DepartmentID
C. EmployeelD
D. EmployeeNum
E. FirstName
F. JobTitle
G. LastName
H. MiddleName
I. ReportsToID
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 9
You administer a Microsoft SQL Server 2012 database. The database contains a table named Employee. Part of the Employee table is shown in the exhibit. (Click
the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Unless stated above, no columns in the Employee table reference other tables.
Confidential information about the employees is stored in a separate table named EmployeeData. One record exists within EmployeeData for each record in the
Employee table.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.
On which column in the Employee table should you use an identity specification to include a seed of 1,000 and an increment of 1?
A. DateHired
B. DepartmentID
C. EmployeeID
D. EmployeeNum
E. FirstName
F. JobTitle
G. LastName
H. MiddleName
I. ReportsToID
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 10
You administer a Microsoft SQL Server 2012 database that includes a table named Products. The Products table has columns named Productld, ProductName,
and CreatedDateTime.
The table contains a unique constraint on the combination of ProductName and CreatedDateTime.
You need to modify the Products table to meet the following requirements:
Remove all duplicates of the Products table based on the ProductName column.
Retain only the newest Products row.
A. WITH CTEDupRecords
AS
(
SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products
GROUP BY ProductName
HAVING COUNT(*) > 1
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
)
DELETE p
FROM Products p
JOIN CTEDupRecords cte ON
B. ProductName = cte.ProductName
AND p.CreatedDateTime > cte.CreatedDateTime
C. WITH CTEDupRecords
AS
(
SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products
GROUP BY ProductName
HAVING COUNT(*) > 1
)
DELETE p
FROM Products p
JOIN CTEDupRecords cte ON
cte.ProductName = p.ProductName
AND cte.CreatedDateTime > p.CreatedDateTime
D. WITH CTEDupRecords
AS
(
SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products
GROUP BY ProductName
)
DELETE p
FROM Products p
JOIN CTEDupRecords cte ON
E. ProductName = cte.ProductName
F. WITH CTEDupRecords
AS
(
SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products
GROUP BY ProductName
HAVING COUNT(*) > 1
)
DELETE p
FROM Products p
JOIN CTEDupRecords cte ON
G. ProductName = cte.ProductName
Correct Answer: B
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
QUESTION 11
You develop three Microsoft SQL Server 2012 databases named Database1, Database2, and Database3.
You have permissions on both Database1 and Database2. You plan to write and deploy a stored procedure named dbo.usp_InsertEvent in Database3.
dbo.usp_InsertEvent must execute other stored procedures in the other databases.
You need to ensure that callers that do not have permissions on Database1 or Database2 can execute the stored procedure.
A. USE Database2
B. EXECUTE AS OWNER
C. USE Database1
D. EXECUTE AS CALLER
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188354.aspx Reference: http://blog.sqlauthority.com/2007/10/06/sql-server-executing-remote-stored-
procedure- callingstored-procedure-on-linked-server/
QUESTION 12
You administer a Microsoft SQL Server 2012 database that has multiple tables in the Sales schema. Some users must be prevented from deleting records in any of
the tables in the Sales schema. You need to manage users who are prevented from deleting records in the Sales schema.
You need to achieve this goal by using the minimum amount of administrative effort. What should you do?
A. Create a custom database role that includes the users. Deny Delete permissions on the Sales schema for the custom database role.
B. Include the Sales schema as an owned schema for the db_denydatawriter role. Add the users to the
db_denydatawriter role.
C. Deny Delete permissions on each table in the Sales schema for each user.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
D. Create a custom database role that includes the users. Deny Delete permissions on each table in the Sales schema for the custom database role.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 13
You administer a Microsoft SQL Server 2012 database. The database contains a Product table created by using the following definition:
You need to ensure that the minimum amount of disk space is used to store the data in the Product table.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/cc280449.aspx Reference: http://msdn.microsoft.com/en-us/library/cc280464.aspx Reference: http://
msdn.microsoft.com/en-us/library/cc280576.aspx Reference: http://msdn.microsoft.com/en-us/library/ee240835.aspx
QUESTION 14
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You use Microsoft SQL Server 2012 to create a stored procedure as shown in the following code segment. (Line numbers are included for reference only.)
You need to ensure that when the DELETE statement from the HumanResourcesJobCandidate table succeeds, the modification is retained even if the insert into
the Audit.Log table fails.
A. IF @@TRANCOUNT = 0
B. IF (XACT_STATE ( ) ) = 0
C. IF (XACT_STATE ( ) ) = 1
D. IF @@TRANCOUNT = l
Correct Answer: C
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms189797.aspx Reference: http://msdn.microsoft.com/en-us/library/ms187967.aspx
QUESTION 15
A table named Profits stores the total profit made each year within a territory. The Profits table has columns named Territory, Year, and Profit. You need to create a
report that displays the profits made by each territory for each year and its preceding year. Which Transact-SQL query should you use?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/hh231256.aspx Reference: http://msdn.microsoft.com/en-us/library/hh213125.aspx
QUESTION 16
You use Microsoft SQL Server 2012 to develop a database application.
You need to write a Transact-SQL statement that will find out the success of a cast to a decimal (36,9).
A. BEGIN TRY
SELECT convert(decimal(36,9), @var) AS Value, 'True' AS BadCast END TRY
BEGIN CATCH
SELECT convert(decimal(36,9), @var) AS Value, 'False' AS BadCast END CATCH
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
B. TRY(
SELECT convert(decimal(36,9), @var)
SELECT 'True' AS BadCast
)
CATCH(
SELECT 'False' AS BadCast
)
C. SELECT
CASE
WHEN convert(decimal(36,9), @var) IS NULL
THEN 'True'
ELSE 'False'
END
AS BadCast
D. SELECT
IIF(TRY_PARSE(@var AS decimal(36,9)) IS NULL, 'True', 'False') AS BadCast
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/hh213126.aspx
QUESTION 17
You are writing a set of queries against a FILESTREAM-enabled database.
You create a stored procedure that will update multiple tables within a transaction.
You need to ensure that if the stored procedure raises a runtime error, the entire transaction is terminated and rolled back.
Which Transact-SQL statement should you include at the beginning of the stored procedure?
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188792.aspx
QUESTION 18
You develop a Microsoft SQL Server 2012 database. The database is used by two web applications that access a table named Products.
You want to create an object that will prevent the applications from accessing the table directly while still providing access to the required data.
You need to achieve this goal by using the minimum amount of changes to the applications.
A. Synonyms
B. Common table expressions
C. Views
D. Temporary tables
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms190174.aspx
QUESTION 19
You are developing a database application by using Microsoft SQL Server 2012.
Your investigation shows the root cause is a query against a read-only table that has a clustered index.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
The query returns the following six columns:
One column in its WHERE clause contained in a non-clustered index
Four additional columns
One COUNT (*) column based on a grouping of the four additional columns
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
QUESTION 20
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to display rows from the Orders table for the Customers row having the CustomerId value set to 1 in the following XML format.
A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers-CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW
B. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers=CustomerId = 1
FOR XML RAW, ELEMENTS
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
C. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML AUTO
D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId - Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO
F. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId=
Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId, OrderDate, Amount FROM Orders
INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
QUESTION 21
You use Microsoft SQL Server 2012 to develop a database application.
You need to implement a computed column that references a lookup table by using an INNER JOIN against another table.
Correct Answer: A
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
QUESTION 22
You administer a Microsoft SQL Server 2012 database named ContosoDb. The database contains a table named Suppliers and a column named IsActive in the
Purchases schema. You create a new user named ContosoUser in ContosoDb. ContosoUser has no permissions to the Suppliers table. You need to ensure that
ContosoUser can delete rows that are not active from Suppliers. You also need to grant ContosoUser only the minimum required permissions. Which Transact-SQL
statement should you use?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188354.aspx Reference: http://msdn.microsoft.com/en-us/library/ms187926.aspx
QUESTION 23
You administer a Microsoft SQL Server 2012 server. You plan to deploy new features to an application. You need to evaluate existing and potential clustered and
non-clustered indexes that will improve performance.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
B. Query the sys.dm_db_missing_index_details DMV.
C. Use the Database Engine Tuning Advisor.
D. Query the sys.dm_db_missing_index_columns DMV.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 24
You administer a Microsoft SQL Server database named Sales. The database is 3 terabytes in size. The Sales database is configured as shown in the following
table.
You discover that Sales_2.ndf is corrupt. You need to recover the corrupted data in the minimum amount of time. What should you do?
Correct Answer: A
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
QUESTION 25
Your database contains a table named SalesOrders. The table includes a DATETIME column named OrderTime that stores the date and time each order is placed.
There is a non-clustered index on the OrderTime column.
The business team wants a report that displays the total number of orders placed on the current day.
You need to write a query that will return the correct results in the most efficient manner.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 26
Your application contains a stored procedure for each country. Each stored procedure accepts an employee identification number through the @EmpID parameter.
You plan to build a single process for each employee that will execute the stored procedure based on the country of residence.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
C. An UPDATE statement that includes CASE
D. Cursor
E. The foreach SQLCLR statement
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 27
You use Microsoft SQL Server 2012 to develop a database application.
You create a stored procedure named dbo.ModifyData that can modify rows.
You need to ensure that when the transaction fails, dbo.ModifyData meets the following requirements:
Does not return an error
Closes all opened transactions
A. BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@ TRANCOUNT = 0
ROLLBACK TRANSACTION;
END CATCH
B. BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@ERROR != 0
ROLLBACK TRANSACTION;
THROW;
END CATCH
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
C. BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@TRANCOUNT = 0
ROLLBACK TRANSACTION;
THROW;
END CATCH
D. BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@ERROR != 0
ROLLBACK TRANSACTION;
END CATCH
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 28
You are developing a database application by using Microsoft SQL Server 2012.
An application that uses a database begins to run slowly. You discover that during reads, the transaction experiences blocking from concurrent updates.
You need to ensure that throughout the transaction the data maintains the original version.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
E. Add a FORCESCAN hint to the Attach query.
F. Add a columnstore index to cover the query.
G. Enable the optimize for ad hoc workloads option.
H. Cover the unique clustered index with a columnstore index.
I. Include a SET FORCEPLAN ON statement before you run the query.
J. Include a SET STATISTICS PROFILE ON statement before you run the query.
K. Include a SET STATISTICS SHOWPLAN_XML ON statement before you run the query.
L. Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before you run the query.
M. Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run the query.
N. Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you run the query.
Correct Answer: M
Section: (none)
Explanation
Explanation/Reference:
QUESTION 29
You are developing a database application by using Microsoft SQL Server 2012.
You need to capture execution plans that will include detailed information on missing indexes recommended by the query optimizer.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
K. Include a SET STATISTICS SHOWPLAN_XML ON statement before you run the query.
L. Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before you run the query.
M. Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run the query.
N. Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you run the query.
Correct Answer: K
Section: (none)
Explanation
Explanation/Reference:
QUESTION 30
You are developing a database application by using Microsoft SQL Server 2012.
You discover that a large amount of memory is consumed by single-use dynamic queries.
You need to reduce procedure cache usage from these statements without creating any additional indexes.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: G
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/cc645587.aspx
QUESTION 31
You use Microsoft SQL Server 2012 database to develop a shopping cart application.
You need to invoke a table-valued function for each row returned by a query.
A. CROSS JOIN
B. UNPIVOT
C. PIVOT
D. CROSS APPLY
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms175156.aspx
QUESTION 32
You develop a Microsoft SQL Server 2012 database. The database is used by two web applications that access a table named Products.
You want to create an object that will prevent the applications from accessing the table directly while still providing access to the required data.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
A. table partitions
B. views
C. table-valued functions
D. stored procedures
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 33
Your database contains a table named Customer that has columns named CustomerID and Name.
You want to write a query that retrieves data from the Customer table sorted by Name listing 20 rows at a time.
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: B
Section: (none)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation
Explanation/Reference:
QUESTION 34
You are developing a database that will contain price information.
You need to store the prices that include a fixed precision and a scale of six digits.
A. Real
B. Small money
C. Money
D. Decimal
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 35
You develop a database application. You create four tables. Each table stores different categories of products.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
E. Create a TIMESTAMP column.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 36
Your application contains a stored procedure for each country. Each stored procedure accepts an employee identification number through the @EmplD parameter.
You need to build a single process for each employee that will execute the appropriate stored procedure based on the country of residence.
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
SQL Server user-defined functions are routines that accept parameters, perform an action, such as a complex calculation, and return the result of that action as a
value. The return value can either be a single scalar value or a result set.
QUESTION 37
You are developing a database application by using Microsoft SQL Server 2012.
You discover that the root cause is a query against a frequently updated table that has a clustered index. The query returns four columns: three columns in its
WHERE clause contained in a non- clustered index and one additional column.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
A. Add a HASH hint lo the query.
B. Add a LOOP hint to the query.
C. Add a FORCESEEK hint to the query.
D. Add an INCLUDE clause to the index.
E. Add a FORCESCAN hint to the Attach query.
F. Add a FORCESCAN hint to the Attach query.
G. Add a columnstore index to cover the query.
H. Enable theoptimize for ad hoc workloads option.
I. Cover the unique clustered index with a columnstore index. Include a SET FORCEPLAN ON statement before you run the query.
J. Include a SET STATISTICS PROFILE ON statement before you run the query.
K. Include a SET STATISTICS SHOWPLAN.XML ON statement before you run the query.
L. Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before you run the query.
M. Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run the query.
N. Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you run the query.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 38
You administer a Microsoft SQL Server 2012 database.
The database contains a table named Employee. Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Unless stated above, no columns in the Employee table reference other tables. Confidential information about the employees is stored in a separate table named
EmployeeData. One record exists within EmployeeData for each record in the Employee table.
You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.
On which column in the Employee table should you create a Foreign Key constraint that references a different table in the database?
A. DateHired
B. Departments
C. EmployeeID
D. EmployeeNum
E. FirstName
F. JobTitle
G. LastName
H. MiddleName
I. ReportsToID
C
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
Section: (none)
Explanation
Explanation/Reference:
Use the EmployeeID, which would be used as a primary key in the Employee table, when defining a foreign key constraint from another table in the database.
QUESTION 39
You administer a Microsoft SQL Server 2012 database.
The database contains a table named Employee. Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)
Unless stated above, no columns in the Employee table reference other tables.
Confidential information about the employees is stored in a separate table named EmployeeData. One record exists within EmployeeData for each record in the
Employee table.
You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
On which column in the Employee table should you create a Primary Key constraint for this table?
A. DateHired
B. Departments
C. EmployeeID
D. EmployeeNum
E. FirstName
F. JobTitle
G. LastName
H. MiddleName
I. ReportsToID
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 40
You create a view based on the following statement:
You need to change the view so that it displays only the records that were processed in the month prior to the current month. You need to ensure that after the
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
changes, the view functions correctly for User1.
A. Option A
B. Option B
C. Option C
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
D. Option D
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 41
You have a view that was created by using the following code:
You need to create an inline table-valued function named Sales.fn_OrdersByTerritory, which must meet the following requirements:
Accept the @T integer parameter.
Use one-part names to reference columns.
Filter the query results by SalesTerritoryID.
Return the columns in the same order as the order used in OrdersByTerritoryView.
Which code segment should you use? To answer, type the correct code in the answer area.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE FUNCTION Sales.fn_OrdersByTerritory (@T int) RETURNS TABLE AS RETURN ( SELECT OrderID,OrderDate,SalesTerrirotyID,TotalDue
FROM Sales.OrdersByTerritory WHERE SalesTerritoryID = @T )
QUESTION 42
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You deploy a new server that has SQL Server 2012 installed. You need to create a table named Sales.OrderDetails on the new server. Sales.OrderDetails must
meet the following requirements:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Write the results to a disk.
Contain a new column named LineItemTotal that stores the product of ListPrice and Quantity for each row.
The code must NOT use any object delimiters.
The solution must ensure that LineItemTotal is stored as the last column in the table. Which code segment should you use? To answer, type the correct code in the
answer area.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE TABLE Sales.OrderDetails ( ListPrice money not null, Quantity int not null, LineItemTotal as (ListPrice * Quantity) PERSISTED) Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms174979.aspx
Reference: http://technet.microsoft.com/en-us/library/ms188300.aspx
QUESTION 43
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a view named uv_CustomerFullName to meet the following requirements:
The code must NOT include object delimiters.
The view must be created in the Sales schema.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Columns must only be referenced by using one-part names.
The view must return the first name and the last name of all customers.
The view must prevent the underlying structure of the customer table from being changed.
The view must be able to resolve all referenced objects, regardless of the user's default schema.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE VIEW Sales.uv_CustomerFullName WITH SCHEMABINDING AS SELECT FirstName, LastName FROM Sales.Customers Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx
QUESTION 44
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a query that calculates the total sales of each OrderId from the Sales.Details table. The solution must meet the following requirements:
Use one-part names to reference columns.
Sort the order of the results from OrderId.
NOT depend on the default schema of a user.
Use an alias of TotalSales for the calculated ExtendedAmount.
Display only the OrderId column and the calculated TotalSales column.
Which code segment should you use? To answer, type the correct code in the answer area.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: SELECT OrderID, SUM(ExtendedAmount) AS TotalSales FROM Sales.Details GROUP BY OrderID ORDER BY OrderID
QUESTION 45
You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You have the following query:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to recreate the query to meet the following requirements:
Reference columns by using one-part names only.
Sort aggregates by SalesTerritoryID, and then by ProductID.
Order the results in descending order from SalesTerritoryID to ProductID.
The solution must use the existing SELECT clause and FROM clause.
Which code segment should you use? To answer, type the correct code in the answer area.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: SELECT SalesTerritoryID, ProductID, AVG(UnitPrice), MAX(OrderQty), MAX(DiscountAmount) FROM Sales.Details GROUP BY SalesTerritoryID ,
ProductID ORDER BY SalesTerritoryID DESC, ProductID DESC
QUESTION 46
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button).
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a query for a report. The query must meet the following requirements:
NOT use object delimiters.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Return the most recent orders first.
Use the first initial of the table as an alias.
Return the most recent order date for each customer.
Retrieve the last name of the person who placed the order.
Return the order date in a column named MostRecentOrderDate that appears as the last column in the report.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: SELECT C.LastName, MAX(O.OrderDate) AS MostRecentOrderDate FROM Customers AS C INNER JOIN Orders AS O ON C.CustomerID =
O.CustomerID GROUP BY C.LastName ORDER BY MostRecentOrderDate DESC
QUESTION 47
You have an XML schema collection named Sales.InvoiceSchema. You need to declare a variable of the XML type named XML1. The solution must ensure that
XML1 is validated by using Sales.InvoiceSchema.
Which code segment should you use? To answer, type the correct code in the answer area.
Explanation/Reference:
QUESTION 48
You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a query that returns a list of products from Sales.ProductCatalog. The solution must meet the following requirements:
UnitPrice must be returned in descending order.
The query must use two-part names to reference the table.
The query must use the RANK function to calculate the results.
The query must return the ranking of rows in a column named PriceRank.
The list must display the columns in the order that they are defined in the table.
PriceRank must appear last.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Which code segment should you use? To answer, type the correct code in the answer area.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 49
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You have an application named Appl. You have a parameter named @Count that uses the int data type. App1 is configured to pass @Count to a stored procedure.
You need to create a stored
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
procedure named usp_Customers for Appl. Usp_Customers must meet the following requirements:
NOT use object delimiters.
Minimize sorting and counting.
Return only the last name of each customer in alphabetical order.
Return only the number of rows specified by the @Count parameter.
The solution must NOT use BEGIN and END statements.
Which code segment should you use? To answer, type the correct code in the answer area.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE PROCEDURE usp_Customers @Count int AS SELECT TOP(@Count) Customers.LastName FROM Customers ORDER BY
Customers.LastName
QUESTION 50
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You have a stored procedure named Procedure1. Procedure1 retrieves all order ids after a specific date. The rows for Procedure1 are not sorted. Procedure1 has a
single parameter named Parameter1. Parameter1 uses the varchar type and is configured to pass the specific date to Procedure1. A database administrator
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
discovers that OrderDate is not being compared correctly to Parameter1 after the data type of the column is changed to datetime. You need to update the SELECT
statement to meet the following requirements:
The code must NOT use aliases.
The code must NOT use object delimiters.
The objects called in Procedure1 must be able to be resolved by all users.
OrderDate must be compared to Parameter1 after the data type of Parameter1 is changed to datetime.
Which SELECT statement should you use? To answer, type the correct code in the answer area.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
QUESTION 51
You develop a database application for a university. You need to create a view that will be indexed that meets the following requirements:
Displays the details of only students from Canada.
Allows insertion of details of only students from Canada.
Which four Transact-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.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx
QUESTION 52
You create the following stored procedure. (Line numbers are included for reference only.) You need to ensure that the stored procedure performs the following
tasks:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
If a record exists, update the record.
If no record exists, insert a new record.
Which four Transact-SQL statements should you insert at line 07? (To answer, move the appropriate statements from the list of statements to the answer area and
arrange them in the correct order.)
Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation:
Reference: http://technet.microsoft.com/en-us/library/bb510625.aspx
QUESTION 53
You use Microsoft SQL Server 2012 to develop a database application. You create two tables by using the following table definitions.
Which six Transact-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.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
QUESTION 54
You use Microsoft SQL Server 2012 to develop a database application. You create a table by using the following definition: CREATE TABLE Prices ( PriceId int
IDENTITY(1,1) PRIMARY KEY, ActualPrice NUMERIC(16,9), PredictedPrice NUMERIC(16,9) ) You need to create a computed column based on a user-defined
function named udf_price_index. You also need to ensure that the column supports an index. Which three Transact-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.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
QUESTION 55
You use Microsoft SQL Server 2012 to develop a database that has two tables named Div1Cust and Div2Cust. Each table has columns named DivisionID and
CustomerId . None of the rows in Div1Cust exist in Div2Cust. You need to write a query that meets the following requirements:
The rows in Div1Cust must be combined with the rows in Div2Cust.
The result set must have columns named Division and Customer.
Duplicates must be retained.
Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange
them in the correct order.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
QUESTION 56
You grant the Select permission to User1 for this view. You need to change the view so that it displays only the records that were processed in the month prior to
the current month. You need to ensure that after the changes, the view functions correctly for User1. Which four Transact-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.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/hh213020.aspx
Reference: http://msdn.microsoft.com/en-us/library/ms186819.aspx
Reference: http://msdn.microsoft.com/en-us/library/ms173846.aspx
QUESTION 57
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.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms191432.aspx Read all restrictions for indexed views. Also read this useful question:
http://stackoverflow.com/questions/12419330/how-to-create-indexed-view-with-select-distinct-statement-insql-2005
QUESTION 58
You administer a Microsoft SQL Server 2012 database. You use an OrderDetail table that has the following definition:
You need to create a non-clustered index on the SalesOrderID column in the OrderDetail table to include only rows that contain a value in the SpecialOfferID
column. Which four Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and
arrange them in the correct order.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
QUESTION 59
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You want to add a new GUID column named BookGUID to a table named dbo.Book that already contains data. BookGUID will have a constraint to ensure that it
always has a value when new rows are inserted into dbo.Book. You need to ensure that the new column is assigned a GUID for existing rows. Which four Transact-
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.)
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Actually, in the real world, you don't have to use WITH VALUES at the end of the statement and it works just as well. But because the question specifically states
which FOUR TSQL statements to use, we have to include it.
Reference: http://msdn.microsoft.com/en-us/library/ms190273.aspx
QUESTION 60
You need to create a view named uv_CustomerFullNames. The view must prevent the underlying structure of the customer table from being changed. Part of the
correct T-SQL statement has been provided in the answer area. Provide the complete code.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE VIEW sales.uv_CustomerFullNames WITH SCHEMABINDING AS SELECT FirstName, LastName FROM Sales.Customers
QUESTION 61
You need to create a table named OrderDetails on a new server. OrderDetails must meet the following requirements:
Contain a new column named LineltemTotal that stores the product of ListPrice and Quantity for each row.
The calculation for a line item total must not be run every time the table is queried.
The code must NOT use any object delimiters.
The solution must ensure that LineItemTotal is stored as the last column in the table.
Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE TABLE OrderDetails ( ListPrice money NOT NULL, Quantity int NOT NULL, LineItemTotal AS (ListPrice * Quantity) PERSISTED )
QUESTION 62
You have a database named Sales that contains the tables shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You have an application named Appl. You have a parameter named @Count that uses the int data type. App1 is configured to pass @Count to a stored procedure.
You need to create a stored procedure named usp_Customers for App1 that returns only the number of rows specified by the @Count parameter. The solution
must NOT use BEGIN and END statements. Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE PROCEDURE usp_Customers @Count int SELECT TOP(@Count) Customers.LastName FROM Customers ORDER BY
Customers.LastName
QUESTION 63
You need to create a query that calculates the total sales of each OrderlD from a table named Sales.Details. The table contains two columns named OrderlD and
ExtendedAmount. The solution must meet the following requirements:
Use one-part names to reference columns.
Start the order of the results from OrderlD.
NOT depend on the default schema of a user.
Use an alias of TotalSales for the calculated ExtendedAmount.
Display only the OrderlD column and the calculated TotalSales column.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: SELECT OrderID, SUM(ExtendedAmount) AS TotalSales FROM Sales.Details GROUP BY OrderID ORDER BY OrderID
QUESTION 64
You have an XML schema collection named Sales.InvoiceSchema. You need to declare a variable of the XML type named invoice. The solution must ensure that
the invoice is validated by using Sales.InvoiceSchema. Provide the correct code in the answer area.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
QUESTION 65
You have a view that was created by using the following code:
You need to create an inline table-valued function named Sales.fn_OrdersByTerritory. Sales.fn_OrdersByTerritory must meet the following requirements:
Use one-part names to reference columns.
Return the columns in the same order as the order used in OrdersByTerritoryView.
Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: CREATE FUNCTION Sales.fn_OrdersByTerritory (@T int) RETURNS TABLE AS RETURN ( SELECT OrderID, OrderDate, SalesTerritoryID, TotalDue
FROM Sales.OrdersByTerritory WHERE SalesTerritoryID=@T )
QUESTION 66
You have a database named Sales that contains the tables as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a query that meets the following requirements:
References columns by using one-part names only.
Groups aggregates by SalesTerritorylD, and then by ProductlD.
Orders the results in descending order by SalesTerritorylD and then by ProductlD.
Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
ProductID, AVG(UnitPrice), MAX(OrderQty) MAX(DiscountAmount) FROM Sales.Details GROUP BY SalesTerritoryID, ProductID ORDER BY SalesTerritoryID
DESC, ProductID DESC
QUESTION 67
You have a database named Sales that contains the tables shown in the exhibit. (Click the Exhibit button).
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a query for a report. The query must meet the following requirements:
NOT use object delimiters.
Use the first initial of the table as an alias.
Return the most recent order date for each customer.
Retrieve the last name of the person who placed the order.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
The solution must support the ANSI SQL-99 standard. Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
Explanation: SELECT C.LastName, MAX(O.OrderDate) AS MostRecentOrderDate FROM Customers AS C INNER JOIN Orders AS O ON
C.CustomerID=O.CustomerID GROUP BY C.Lastname ORDER BY MAX (O.OrderDate) DESC
QUESTION 68
You have a database named Sales that contains the tables as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to create a query that returns a list of products from Sales.ProductCatalog. The solution must meet the following requirements:
UnitPrice must be returned in descending order.
The query must use two-part names to reference the table.
The query must use the RANK function to calculate the results.
The query must return the ranking of rows in a column named PriceRank.
The list must display the columns in the order that they are defined in the table. PriceRank must appear last.
Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: Answer: Please review the explanation part for this answer
Section: (none)
Explanation
Explanation/Reference:
QUESTION 69
You write the following SELECT statement to get the last order date for a particular customer.
You need to create the user-defined function to return the last order date for the specified customer. Which five Transact-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.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
Note: * First function header * Then declare that the function returns a datetime
* Thirdly begin the function body.
* Fourthly declare the return variable
* At last include the code that retrieves the required date.
QUESTION 70
You are using SQL Server Management Studio (SSMS) to configure the backup. You need to meet the technical requirements.
Correct Answer: BC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 71
You need to convert the Production, Sales, Customers and Human Resources databases to tabular BI Semantic Models (BISMs).
Which two of the following actions should you perform? (Choose two)
A. You should select the tabular mode option when upgrading the databases using the Database Synchronization Wizard.
B. You should select the tabular mode destination option when copying the databasesusing SQL Server Integration Services (SSIS).
C. You should select the tabular mode option during the installation of SQL Server Analysis Services.
D. You should redevelop the projects and deploy them using SQL Server Data Tools (SSDT).
Correct Answer: AD
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
QUESTION 72
Users have advised that they are not receiving report subscriptions from SQLReporting01. You confirm that the report subscriptions are not being delivered.
Which of the following actions should you perform to resolve the issue?
A. You should run the SQL Server 2012 Setup executable on SQLReporting01 to generate a configuration file.
B. You should reset the password of the SQL Server Service account.
C. You should manually fail over the SSAS cluster.
D. You should restore the ReportServer database on SQLReporting01.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 73
Users have advised that they are not receiving report subscriptions from SQLReporting01. You confirm that the report subscriptions are not being delivered.
Which of the following actions should you perform to resolve the issue?
A. You should run the SQL Server 2012 Upgrade Wizard to upgrade the active node of the SSAS cluster.
B. You should start the SQL Server Agent on the active node of the SSAS cluster.
C. You should restore the ReportServerTempDB database on SQLReporting01.
D. You should start the SQL Server Agent on SQLReporting01.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 74
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to make the SSAS databases available on SSAS2012 to enable testing from client applications. Your solution must minimize server downtime and
maximize database availability.
A. You should detach the databases from the SSAS cluster by using SQL Server Management Studio (SSMS) then attach the databases on SSAS2012.
B. You should copy the database files from the SSAS cluster to SSAS2012.
C. You should export the databases from the SSAS cluster by using SQL Server Management Studio (SSMS) then import the databases on SSAS2012.
D. You should restore a copy of the databases from the most recent backup.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 75
You need to create a BISM to meet the Reporting and Analysis requirements.
Which of the following should you include in your solution? (Choose all that apply)
Explanation/Reference:
QUESTION 76
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to configure the servers to meet the security requirements for SQLReporting01 connections to the SSAS cluster. Downtime must be minimized during the
configuration.
Which three of the following actions should you perform? (Choose three).
Explanation/Reference:
QUESTION 77
You modify the ReportingServicesService.exe.config file on the reporting servers to enable logging.
Which log contains the ClientIP and ServerPort fields to determine which IP address and port numbers are used to connect to the reports server?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 78
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
One of the cube requirements states that the cube should include aggregation designs.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 79
You need to configure the cube partitioning to manage the expected increase in size.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 80
You develop a Microsoft SQL Server 2012 server database that supports an application. The application contains a table that has the following definition:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
CREATE TABLE Inventory
(ItemID int NOT NULL PRIMARY KEY,
ItemsInStore int NOT NULL,
ItemsInWarehouse int NOT NULL)
You need to create a computed column that returns the sum total of the ItemsInStore and ItemsInWarehouse values for each row.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://technet.microsoft.com/en-us/library/ms190273.aspx
QUESTION 81
Your database contains two tables named DomesticSalesOrders and InternationalSalesOrders. Both tables contain more than 100 million rows. Each table has a
Primary Key column named SalesOrderId. The data in the two tables is distinct from one another.
Business users want a report that includes aggregate information about the total number of global sales and total sales amounts.
You need to ensure that your query executes in the minimum possible time.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
FROM InternationalSalesOrders
) AS p
B. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION
SELECT SalesOrderId, SalesAmount
FROM InternationalSalesOrders
) AS p
C. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM DomesticSalesOrders
UNION
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM InternationalSalesOrders
D. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM DomesticSalesOrders
UNION ALL
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM InternationalSalesOrders
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms180026.aspx Reference: http://blog.sqlauthority.com/2009/03/11/sql-server-difference-between-union-vs-
union-all- optimalperformance-comparison/
QUESTION 82
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid- year marks for students. The table has marks obtained by 50
students for various subjects.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
DENSE_RANK() OVER(ORDER BY Marks DESC) AS Rank
FROM StudentMarks
C. SELECT StudentCode as Code,
DENSE_RANK() OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
D. SELECT StudentCode as Code,
NTILE(2) OVER(ORDER BY AVG (Marks) DESC) AS Value
FROM StudentMarks
GROUP BY StudentCode
E. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
F. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
G. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANK() OVER(PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
H. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANXO OVER(PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms189798.aspx
QUESTION 83
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid- year marks for students. The table has marks obtained by 50
students for various subjects.
You need to retrieve the students who scored the highest marks for each subject along with the marks.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Which Transact-SQL query should you use?
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
QUESTION 84
You use a contained database named ContosoDb within a domain. You need to create a user who can log on to the ContosoDb database. You also need to ensure
that you can port the database to different database servers within the domain without additional user account configurations.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Which type of user should you create?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 85
You administer several Microsoft SQL Server 2012 database servers. Merge replication has been configured for an application that is distributed across offices
throughout a wide area network (WAN). Many of the tables involved in replication use the XML and varchar (max) data types. Occasionally, merge replication fails
due to timeout errors. You need to reduce the occurrence of these timeout errors. What should you do?
A. Set the Merge agent on the problem subscribers to use the slow link agent profile.
B. Create a snapshot publication, and reconfigure the problem subscribers to use the snapshot publication.
C. Change the Merge agent on the problem subscribers to run continuously.
D. Set the Remote Connection Timeout on the Publisher to 0.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 86
You administer a Microsoft SQL Server 2012 database that has Trustworthy set to On. You create a stored procedure that returns database-level information from
Dynamic Management Views. You grant User1 access to execute the stored procedure. You need to ensure that the stored procedure returns the required
information when User1 executes the stored procedure. You need to achieve this goal by granting the minimum permissions required. What should you do? (Each
correct answer presents a complete solution. Choose all that apply.)
A. Create a SQL Server login that has VIEW SERVER STATE permissions. Create an application role and a secured password for the role.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
B. Modify the stored procedure to include the EXECUTE AS OWNER statement. Grant VIEW SERVER STATE permissions to the owner of the stored procedure.
C. Create a SQL Server login that has VIEW SERVER STATE permissions. Modify the stored procedure to include the EXECUTE AS {newlogin} statement.
D. Grant the db_owner role on the database to User1.
E. Grant the sysadmin role on the database to User1.
Correct Answer: DE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 87
You develop a Microsoft SQL Server 2012 database that contains tables named Customers and Orders. The tables are related by a column named CustomerId.
Correct Answer: D
Section: (none)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms177634.aspx
QUESTION 88
You develop a database for a travel application. You need to design tables and other database objects.
Each media file is less than 1 MB in size. The media files will require fast access and will be retrieved frequently.
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188362.aspx
QUESTION 89
You develop a database for a travel application. You need to design tables and other database objects.
You create a view that displays the dates and times of the airline schedules on a report.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to display dates and times in several international formats.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/hh213505.aspx
QUESTION 90
You are a database developer of a Microsoft SQL Server 2012 database.
You are designing a table that will store Customer data from different sources. The table will include a column that contains the CustomerID from the source system
and a column that contains the SourceID.
A sample of this data is as shown in the following table.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to ensure that the table has no duplicate CustomerID within a SourceID. You also need to ensure that the data in the table is in the order of SourceID and
then CustomerID.
Correct Answer: D
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
QUESTION 91
You have three tables that contain data for vendors, customers, and agents. You create a view that is used to look up telephone numbers for these companies.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to ensure that users can update only the phone numbers by using this view.
A. Alter the view. Use the EXPAND VIEWS query hint along with each SELECT statement.
B. Drop the view. Re-create the view by using the SCHEMABINDING clause, and then create an index on the view.
C. Create an AFTER UPDATE trigger on the view.
D. Create an INSTEAD OF UPDATE trigger on the view.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx
QUESTION 92
You develop a Microsoft SQL Server 2012 database that contains tables named Employee and Person.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Users are able to use single INSERT statements or INSERT...SELECT statements into this view.
You need to ensure that users are able to use a single statement to insert records into both Employee and Person tables by using the VwEmployee view.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
D. CREATE TRIGGER TrgVwEmployee
ON VwEmployee
INSTEAD OF INSERT
AS
BEGIN
INSERT INTO Person(Id, FirstName, LastName)
SELECT Id, FirstName, LastName FROM VwEmployee
INSERT INTO Employee(PersonID, EmployeeNumber)
SELECT Id, EmployeeNumber FROM VwEmployee
End
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 93
You generate a daily report according to the following query:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to improve the performance of the query.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
SELECT s.OrderDate
FROM Sales.SalesOrder
WHERE s.OrderDate >DATEADD(DAY, -90, GETDATE())
AND s.CustomerID = c.CustomerID)
C. Drop the UDF and rewrite the report query as follows:
SELECT DISTINCT c.CustomerName
FROM Sales.Customer c
INNER JOIN Sales.SalesOrder s
ON c.CustomerID = s.CustomerID
WHERE s.OrderDate <DATEADD(DAY, -90, GETDATE())
D. Rewrite the report query as follows:
SELECT c.CustomerName
FROM Sales.Customer c
WHERE NOT EXISTS (SELECT OrderDate FROM Sales.ufnGetRecentOrders(c.CustomerID,
90))
Rewrite the UDF as follows:
CREATE FUNCTION Sales.ufnGetRecentOrders(@CustomerID int, @MaxAge datetime) RETURNS TABLE AS RETURN (
SELECT OrderDate
FROM Sales.SalesOrder
WHERE s.CustomerID = @CustomerID
AND s.OrderDate >DATEADD(DAY, -@MaxAge, GETDATE())
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 94
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to display rows from the Orders table for the Customers row having the CustomerId value set to 1 in the following XML format:
<row OrderId="1" OrderDate="2000-01-01T00:00:00" Amount="3400.00" Name="Customer A" Country="Australia" />
<row OrderId="2" OrderDate="2001-01-01T00:00:00" Amount="4300.00" Name="Customer A" Country="Australia" />
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/bb510464.aspx
QUESTION 95
You are developing a database that will contain price information.
You need to store the prices that include a fixed precision and a scale of six digits.
A. Float
B. Money
C. Smallmoney
D. Decimal
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Decimal is the only one in the list that can give a fixed precision and scale. Reference: http://msdn.microsoft.com/en-us/library/ms187746.aspx
QUESTION 96
You administer a Microsoft SQL Server 2012 database. The database contains a table named Employee.
Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Unless stated above, no columns in the Employee table reference other tables. Confidential information about the employees is stored in a separate table named
EmployeeData. One record exists within EmployeeData for each record in the Employee table.
You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
On which column in the Employee table should you a create a self-reference foreign key constraint?
A. DateHired
B. DepartmentID
C. EmployeelD
D. EmployeeNum
E. FirstName
F. JobTitle
G. LastName
H. MiddleName
I. ReportsToID
Correct Answer: I
Section: (none)
Explanation
Explanation/Reference:
QUESTION 97
You use a Microsoft SQL Server 2012 database that contains a table named BlogEntry that has the following columns:
You need to append the "This is in a draft stage" string to the Summary column of the recent 10 entries based on the values in EntryDateTime.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
A. UPDATE TOP(10) BlogEntry
SET Summary.WRITE(N' This is in a draft stage', NULL, 0)
B. UPDATE BlogEntry
SET Summary = CAST(N' This is in a draft stage' as nvarchar(max)) WHERE Id IN(SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC)
C. UPDATE BlogEntry
SET Summary.WRITE(N' This is in a draft stage', NULL, 0) FROM ( SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC) AS s WHERE
BlogEntry.Id = s.ID
D. UPDATE BlogEntry
SET Summary.WRITE(N' This is in a draft stage', 0, 0) WHERE Id IN(SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC)
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 98
You use Microsoft SQL Server 2012 to develop a database application.
You need to ensure that if DeleteJobCandidate encounters an error, the execution of the stored procedure reports the error number.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
N', Rows Deleted = ' + CAST(@@ROWCOUNT AS NVARCHAR(8)); GO
D. EXEC DeleteJobCandidate
PRINT N'Error = ' + CAST(@@ERROR AS NVARCHAR(8)) +
N', Rows Deleted = ' + CAST(@@ROWCOUNT AS NVARCHAR(8)); GO
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 99
You work as a Database Administrator (DBA) at ABC.com. The company uses a Microsoft SQL Server 2012 environment and has recently deployed SQL Server
2012 Reporting Services (SSRS).
The company will eventually use hundreds of SSRS reports. All the reports will use the standard corporate branding, fonts and text styles. Many of the reports will
also use common functions that will be coded by developers.
You need to recommend a reporting strategy that enables all reports to use the corporate branding and fonts and the function code. You need to be able to modify
the corporate branding and function code if required without recreating all the reports.
Where should the corporate branding, fonts and text styles and the function code should be stored?
A. The corporate branding, fonts and text styles and the function code should be stored in a SQL Server database.
B. The corporate branding, fonts and text styles and the function code should be stored in a web service.
C. The corporate branding, fonts and text styles and the function code should be stored in an assembly on an SSRS server.
D. The corporate branding, fonts and text styles and the function code should be stored in a report template.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 100
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You work as a Database Administrator (DBA) at ABC.com. The company uses a Microsoft SQL Server 2012 infrastructure.
A Windows Server 2012 server named ABC-SSRS01 runs SQL Server 2012 Reporting Services (SSRS). SSRS is configured to run in native mode.
You are evaluating the SSRS predefined roles to determine which users should be assigned to the roles.
Company security policy states that all users must be assigned the minimum permissions to perform their required tasks.
Which role should users be assigned to to enable them to view basic information about the report server such as the schedule information in a shared schedule?
A. Content Manager
B. Publisher
C. Browser
D. Report Builder
E. My Reports
F. System Administrator
G. System User
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
QUESTION 101
You work as a Database Administrator (DBA) at ABC.com. The company uses a Microsoft SQL Server 2012 environment and has recently deployed SQL Server
2012 Reporting Services (SSRS).
The company will eventually use hundreds of SSRS reports. All the reports will use the standard corporate branding, fonts and text styles. Many of the reports will
also use common functions that will be coded by developers.
You need to recommend a reporting strategy that enables all reports to use the corporate branding and fonts and the function code. You need to be able to modify
the corporate branding and function code if required without recreating all the reports.
Where should the corporate branding, fonts and text styles and the function code should be stored?
A. The corporate branding, fonts and text styles and the function code should be stored in a SQL Server database
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
B. The corporate branding, fonts and text styles and the function code should be stored in a web service.
C. The corporate branding, fonts and text styles and the function code should be stored in an assembly on an SSRS server.
D. The corporate branding, fonts and text styles and the function code should be stored in a report template.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 102
You work as a Database Administrator (DBA) at ABC.com. The company uses a Microsoft SQL Server 2012 infrastructure.
A Windows Server 2012 server named ABC-SSRS01 runs SQL Server 2012 Reporting Services (SSRS). SSRS is configured to run in native mode.
You are evaluating the SSRS predefined roles to determine which users should be assigned to the roles.
Company security policy states that all users must be assigned the minimum permissions to perform their required tasks.
Which role should users be assigned to to enable them to view basic information about the report server such as the schedule information in a shared schedule?
A. Content Manager
B. Publisher
C. Browser
D. Report Builder
E. My Reports
F. System Administrator
G. System User
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
QUESTION 103
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You work as a Database Administrator (DBA) at ABC.com. The company uses a Microsoft SQL Server 2012 infrastructure.
A Windows Server 2012 server named ABC-SSRS01 runs SQL Server 2012 Reporting Services (SSRS). SSRS is configured to run in native mode.
You are evaluating the SSRS predefined roles to determine which users should be assigned to the roles.
Company security policy states that all users must be assigned the minimum permissions to perform their required tasks.
Which role should users be assigned to to give them full permission to manage report server content, including the ability to grant permissions to other users, and to
define the folder structure for storing reports and other items.?
A. Content Manager
B. Publisher
C. Browser
D. Report Builder
E. My Reports
F. System Administrator
G. System User
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 104
You are a database developer at an independent software vendor. You create stored procedures that contain proprietary code.
You need to protect the code from being viewed by your customers.
A. ENCRYPTBYKEY
B. ENCRYPTION
C. ENCRYPTBYPASSPHRASE
D. ENCRYPTBYCERT
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://technet.microsoft.com/en-us/library/bb510663.aspx Reference: http://technet.microsoft.com/en-us/library/ms174361.aspx Reference: http://
msdn.microsoft.com/en-us/library/ms187926.aspx Reference: http://technet.microsoft.com/en-us/library/ms190357.aspx Reference: http://technet.microsoft.com/
en-us/library/ms188061.aspx
QUESTION 105
You use a Microsoft SQL Server 2012 database.
You need to ensure that the documents must only be accessible via Transact-SQL queries.
Correct Answer: A
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/gg471497.aspx Reference: http://msdn.microsoft.com/en-us/library/ff929144.aspx
QUESTION 106
You administer a Microsoft SQL Server 2012 database that contains a table named OrderDetail. You discover that the NCI_OrderDetail_CustomerID non-clustered
index is fragmented. You need to reduce fragmentation.
You need to achieve this goal without taking the index offline. Which Transact-SQL batch should you use?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188388.aspx
QUESTION 107
You develop a Microsoft SQL Server 2012 database. The database is used by two web applications that access a table named Products.
You want to create an object that will prevent the applications from accessing the table directly while still providing access to the required data.
A. views
B. table partitions
C. table-valued functions
D. stored procedures
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 108
You develop a Microsoft SQL Server 2012 database.
You need to create a batch process that meets the following requirements:
Returns a result set based on supplied parameters.
Enables the returned result set to perform a join with a table.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 109
You develop a Microsoft SQL Server 2012 database.
You need to create and call a stored procedure that meets the following requirements:
Accepts a single input parameter for CustomerID.
Returns a single integer to the calling application.
Which Transact-SQL statement or statements should you use? (Each correct answer presents part of the solution. Choose all that apply.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
SET NOCOUNT ON SELECT @CustomerRating = CustomerOrders/CustomerValue FROM Customers WHERE CustomerID = @CustomerID
RETURN
GO
B. EXECUTE dbo.GetCustomerRatIng 1745
C. DECLARE @customerRatingBycustomer INT
DECLARE @Result INT
EXECUTE @Result = dbo.GetCustomerRating
, @CustomerRatingSyCustomer
D. CREATE PROCEDURE dbo.GetCustomerRating @CustomerID INT, @CustomerRating INT OUTPUT
AS
SET NOCOUNT ON
SELECT @Result = CustomerOrders/CustomerValue
FROM Customers WHERE CustomerID = @CustomeriD
RETURN @Result
GO
E. DECLARE @CustomerRatIngByCustcmer INT
EXECUTE dbo.GetCustomerRating @CustomerID = 1745,
@CustomerRating = @CustomerRatingByCustomer OUTPUT
F. CREATE PROCEDURE dbo.GetCustomerRating
@CustomerID INT
AS
DECLARE @Result INT
SET NOCOUNT ON
SELECT @Result = CustomerOrders/CustomerVaLue
FROM Customers
WHERE Customer= = @CustomerID
RETURNS @Result
Correct Answer: AE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 110
You develop a Microsoft SQL Server 2012 database that contains a heap named OrdersHistoncal.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to optimize transaction logging and locking for the statement. Which table hint should you use?
A. HOLDLOCK
B. ROWLOCK
C. XLOCK
D. UPDLOCK
E. TABLOCK
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://technet.microsoft.com/en-us/library/ms189857.aspx Reference: http://msdn.microsoft.com/en-us/library/ms187373.aspx
QUESTION 111
You use a Microsoft SQL Server 2012 database that contains two tables named SalesOrderHeader and SalesOrderDetail. The indexes on the tables are as shown
in the exhibit.
(Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You write the following Transact-SQL query:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You discover that the performance of the query is slow. Analysis of the query plan shows table scans where the estimated rows do not match the actual rows for
SalesOrderHeader by using an unexpected index on SalesOrderDetail.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
References: http://msdn.microsoft.com/en-us/library/ms187348.aspx
QUESTION 112
Your database contains a table named Purchases. The table includes a DATETIME column named PurchaseTime that stores the date and time each purchase is
made. There is a non- clustered index on the PurchaseTime column.
The business team wants a report that displays the total number of purchases made on the current day.
You need to write a query that will return the correct results in the most efficient manner.
A. SELECT COUNT(*)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
FROM Purchases
WHERE PurchaseTime = CONVERT(DATE, GETDATE())
B. SELECT COUNT(*)
FROM Purchases
WHERE PurchaseTime = GETDATE()
C. SELECT COUNT(*)
FROM Purchases
WHERE CONVERT(VARCHAR, PurchaseTime, 112) = CONVERT(VARCHAR, GETDATE(), 112)
D. SELECT COUNT(*)
FROM Purchases
WHERE PurchaseTime >= CONVERT(DATE, GETDATE())
AND PurchaseTime <DATEADD(DAY, 1, CONVERT(DATE, GETDATE()))
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Two answers will return the correct results (the "WHERE CONVERT..." and "WHERE ... AND ... " answers).
The correct answer for Microsoft would be the answer that is most "efficient". Anybody have a clue as to which is most efficient? In the execution plan, the one that
I've selected as the correct answer is the query with the shortest duration. Also, the query answer with "WHERE CONVERT..." threw warnings in the execution
plan...something about affecting CardinalityEstimate and SeekPlan.
I also found this article, which leads me to believe that I have the correct answer:
http://technet.microsoft.com/en-us/library/ms181034.aspx
QUESTION 113
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to display rows from the Orders table for the Customers row having the Customerld value set to 1 in the following XML format.
A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers-CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW
B. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW, ELEMENTS
C. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML AUTO
D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN Customers ON Orders.CustomerId - Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO
F. SELECT Name, Country, Crderld, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId=
Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId, OrderDate, Amount FROM Orders
INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Correct Answer: G
Section: (none)
Explanation
Explanation/Reference:
QUESTION 114
You use Microsoft SQL Server 2012 to write code for a transaction that contains several statements.
There is high contention between readers and writers on several tables used by your transaction.
You need to minimize the use of the tempdb space. You also need to prevent reading queries from blocking writing queries.
A. SERIALIZABLE
B. SNAPSHOT
C. READ COMMITTED SNAPSHOT
D. REPEATABLE READ
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms173763.aspx
QUESTION 115
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid- year marks for students. The table has marks obtained by 50
students for various subjects. You need to ensure that the top half of the students arranged by their average marks must be given a rank of 1 and the remaining
students must be given a rank of 2. Which Transact-SQL query should you use?
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
FROM StudentMarks
GROUP BY StudentCode
B. SELECT Id, Name, Marks,
DENSE_RANK() OVER (ORDER BY Marks DESC) AS Rank
FROM StudentMarks
C. SELECT StudentCode as Code,
DENSE_RANK() OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
D. SELECT StudentCode as Code,
NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
E. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANK() OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
F. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANK() OVER (PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
G. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
H. SELECT StudentCode AS Code,Marks AS Value FROM (
SELECT StudentCode, Marks AS Marks,
RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 116
You develop a Microsoft SQL Server 2012 database. You need to create a batch process that meets the following requirements:
Status information must be logged to a status table.
If the status table does not exist at the beginning of the batch, it must be created.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Which object should you use?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms186755.aspx
QUESTION 117
You administer a database that includes a table named Customers that contains more than 750 rows. You create a new column named PartitionNumber of the int
type in the table.
You need to assign a PartitionNumber for each record in the Customers table.You also need to ensure that the PartitionNumber satisfies the following conditions:
Always starts with 1.
Starts again from 1 after it reaches 100.
Which Transact-SQL statement should you use?
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
MINVALUE 1
MAXVALUE 100
UPDATE Customers SET PartitionNumber = NEXT VALUE FOR CustomerSequence + 1 DROP SEQUENCE CustomerSequence
D. CREATE SEQUENCE CustomerSequence AS int
START WITH 1
INCREMENT BY 1
MINVALUE 0
MAXVALUE 100
CYCLE
UPTATE Customers SET PartitionNumber = NEXT VALUE FOR CustomerSequence DROP SEQUENCE CustomerSequence
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ff878091.aspx
QUESTION 118
You use Microsoft SQL Server 2012 to develop a database application.
A. Scalar-valued function
B. Inline function
C. User-defined data type
D. Stored procedure
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
QUESTION 119
You are a database developer for an application hosted on a Microsoft SQL Server 2012 server.
The database contains two tables that have the following definitions:
You need to view the country from which each customer has placed the most orders.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
C. SELECT c.CustomerID, c.CustomerName, o.ShippingCountry FROM Customer c
INNER JOIN
(SELECT CustomerID, ShippingCountry,
RANK() OVER (PARTITION BY CustomerID
ORDER BY OrderAmount DESC) AS Rnk
FROM Orders
GROUP BY CustomerID, ShippingCountry) AS o
ON c.CustomerID = o.CustomerID
WHERE o.Rnk = 1
D. SELECT c.CustomerID, c.CustomerName, o.ShippingCountry FROM Customer c
INNER JOIN
(SELECT CustomerID, ShippingCountry,
COUNT(OrderAmount) DESC) AS OrderAmount
FROM Orders
GROUP BY CustomerID, ShippingCountry) AS o
ON c.CustomerID = o.CustomerID
ORDER BY OrderAmount DESC
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 120
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the CustomerIdvalue set to 1 in the following XML format.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Which Transact-SQL query should you use?
Correct Answer: C
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188273.aspx
QUESTION 121
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the CustomerId value set to 1 in the following XML format.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
FOR XML AUTO
F. SELECT Name, Country, Orderld, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId=
Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
QUESTION 122
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the CustomerId value set to 1 in the following XML format.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Which Transact-SQL query should you use?
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
FOR XML AUTO
F. SELECT Name, Country, Orderld, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId=
Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 123
You develop a Microsoft SQL Server 2012 server database that supports an application.
You need to create a computed column that returns the sum total of the ItemsInStore and ItemsInWarehouse values for each row.
The new column is expected to be queried heavily, and you need to be able to index the column.
Which Transact-SQL statement should you use?
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse)
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms174979.aspx
QUESTION 124
You develop a Microsoft SQL Server 2012 database that contains a table named Customers. The Customers table has the following definition:
You need to create an audit record only when either the MobileNumber or HomeNumber column is updated.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
EXISTS (SELECT MobileNumber FROM inserted)
- - Create Audit Records
C. CREATE TRIGGER TrgPhoneNumberChange
ON Customers FOR UPDATE
AS
IF COLUMNS_CHANGED (HomeNumber, MobileNumber)
- - Create Audit Records
D. CREATE TRIGGER TrgPhoneNumberChange
ON Customers FOR UPDATE
AS
IF UPDATE (HomeNumber) OR UPDATE (MobileNumber)
- - Create Audit Records
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/bb510663.aspx Reference: http://msdn.microsoft.com/en-us/library/ms186329.aspx
QUESTION 125
You develop a Microsoft SQL Server 2012 database that has two tables named SavingAccounts and LoanAccounts. Both tables have a column named
AccountNumber of the nvarchar data type.
You use a third table named Transactions that has columns named TransactionId AccountNumber, Amount, and TransactionDate.
You need to ensure that when multiple records are inserted in the Transactions table, only the records that have a valid AccountNumber in the SavingAccounts or
LoanAccounts are inserted.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
END
B. CREATE TRIGGER TrgValidateAccountNumber
ON Transactions
FOR INSERT
AS
BEGIN
INSERT INTO Transactions
SELECT TransactionID,AccountNumber,Amount,TransactionDate FROM inserted WHERE AccountNumber IN
(SELECT AccountNumber FROM LoanAccounts
UNION SELECT AccountNumber FROM SavingAccounts))
END
C. CREATE TRIGGER TrgValidateAccountNumber
ON Transactions
INSTEAD OF INSERT
AS
BEGIN
IF EXISTS (
SELECT AccountNumber FROM inserted EXCEPT
(SELECT AccountNumber FROM LoanAccounts
UNION SELECT AccountNumber FROM SavingAccounts))
BEGIN
ROLLBACK TRAN
END
END
D. CREATE TRIGGER TrgValidateAccountNumber
ON Transactions
FOR INSERT
AS
BEGIN
IF EXISTS (
SELECT AccountNumber FROM inserted EXCEPT
(SELECT AccountNumber FROM LoanAccounts
UNION SELECT AccountNumber FROM SavingAccounts))
BEGIN
ROLLBACK TRAN
END
END
Correct Answer: A
Section: (none)
Explanation
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation/Reference:
QUESTION 126
You develop a Microsoft SQL Server 2012 database. You create a view that performs the following tasks:
Joins 8 tables that contain up to 500,000 records each.
Performs aggregations on 5 fields.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms191432.aspx
QUESTION 127
You are a database developer of a Microsoft SQL Server 2012 database. The database contains a table named Customers that has the following definition:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to ensure that the CustomerId column in the Orders table contains only values that exist in the CustomerId column of the Customer table.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms189049.aspx
QUESTION 128
You have three tables that contain data for dentists, psychiatrists, and physicians. You create a view that is used to look up their email addresses and phone
numbers.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
You need to ensure that users can update only the phone numbers and email addresses by using this view.
A. Alter the view. Use the EXPAND VIEWS query hint along with each SELECT statement.
B. Create an INSTEAD OF UPDATE trigger on the view.
C. Drop the view. Re-create the view by using the SCHEMABINDING clause, and then create an index on the view.
D. Create an AFTER UPDATE trigger on the view.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx
QUESTION 129
You develop a Microsoft SQL Server 2012 database. You create a view from the Orders and OrderDetails tables by using the following definition.
You need to ensure that users are able to modify data by using the view.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
A. Create an AFTER trigger on the view.
B. Modify the view to use the WITH VIEW_METADATA clause.
C. Create an INSTEAD OF trigger on the view.
D. Modify the view to an indexed view.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx
QUESTION 130
Your database contains tables named Products and ProductsPriceLog. The Products table contains columns named ProductCode and Price. The
ProductsPriceLog table contains columns named ProductCode, OldPrice, and NewPrice.
The ProductsPriceLog table stores the previous price in the OldPrice column and the new price in the NewPrice column.
You need to increase the values in the Price column of all products in the Products table by 5 percent. You also need to log the changes to the ProductsPriceLog
table.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms177564.aspx
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
QUESTION 131
You develop a Microsoft SQL Server 2012 database. You create a view from the Orders and OrderDetails tables by using the following definition.
You need to improve the performance of the view by persisting data to disk. What should you do?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms188783.aspx
QUESTION 132
You develop a database for a travel application. You need to design tables and other database objects.
You need to store the departure and arrival dates and times of flights along with time zone information.
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
What should you do?
Correct Answer: I
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ff848733.aspx Reference: http://msdn.microsoft.com/en-us/library/bb630289.aspx
QUESTION 133
You develop a database for a travel application. You need to design tables and other database objects. You create a stored procedure. You need to supply the
stored procedure with multiple event names and their dates as parameters. What should you do?
Correct Answer: E
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
Section: (none)
Explanation
Explanation/Reference:
QUESTION 134
You have a Microsoft SQL Server 2012 database that contains tables named Customers and Orders.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms177634.aspx
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn
QUESTION 135
You create a stored procedure that will update multiple tables within a transaction.
You need to ensure that if the stored procedure raises a run-time error, the entire transaction is terminated and rolled back.
Which Transact-SQL statement should you include at the beginning of the stored procedure?
A. SET XACT_ABORT ON
B. SET ARITHABORT ON
C. TRY
D. BEGIN
E. SET ARITHABORT OFF
F. SET XACT_ABORT OFF
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Reference: http://msdn.microsoft.com/en-us/library/ms190306.aspx Reference: http://msdn.microsoft.com/en-us/library/ms188792.aspx
www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn