aiotestking uk

70-461 Exam Questions - Online Test


70-461 Premium VCE File

Learn More 100% Pass Guarantee - Dumps Verified - Instant Download
150 Lectures, 20 Hours

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

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 

Answer:

Q2. CORRECT TEXT 

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. 

Answer:  

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

The view has the following definition: 

You need to ensure that users can update only the phone numbers by using this view. 

What should you do? 

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. 

Answer:

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

Which Transact-SQL operator should you use? 

A. CROSS JOIN 

B. UNPIVOT 

C. PIVOT 

D. CROSS APPLY 

Answer:

Q5. You develop a Microsoft SQL Server 2012 database that contains tables named Customers and Orders. The tables are related by a column named CustomerId. 

You need to create a query that meets the following requirements: 

. Returns the CustomerName for all customers and the OrderDate for any orders that they have placed. . Results must not include customers who have not placed any orders. 

Which Transact-SQL query should you use? 

A. SELECT CustomerName, OrderDate FROM Customers LEFT OUTER JOIN Orders ON Customers.CuscomerlD = Orders.CustomerId 

B. SELECT CustomerName, OrderDate FROM Customers RIGHT OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerId 

C. SELECT CustomerName, OrderDate FROM Customers CROSS JOIN Orders ON Customers.CustomerId = Orders.CustomerId 

D. SELECT CustomerName, OrderDate FROM Customers JOIN Orders ON Customers.CustomerId = Orders.CustomerId 

Answer:

Q6. You are developing a database application by using Microsoft SQL Server 2012. 

An application that uses a database begins to run slowly. 

Your investigation shows the root cause is a query against a read-only table that has a 

clustered index. 

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 

You need to optimize the statement. 

What should you do? 

A. Add a HASH hint to 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 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. 

Answer:

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

A. Create an INSTEAD OF trigger on the view. 

B. Create an AFTER trigger on the view. 

C. Modify the view to use the WITH VIEW_METADATA clause. 

D. Create a clustered index on the view. 

Answer:

Q8. CORRECT TEXT 

You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.) 

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

Answer:  

Q9. You support a database structure shown in the exhibit. (Click the Exhibit button.) 

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 

Which Transact-SQL query should you use? 

A. SELECT SalesPerson.Name, Country, City, 

DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 

FROM Sale INNER JOIN SalesPerson 

ON Sale.SalesPersonID = SalesPerson.SalesPersonID 

GROUP BY GROUPING SETS((SalesPerson.Name, Country, City, DatePart(yyyy, 

SaleDate)), (Country, City), (Country), ()) 

B. SELECT SalesPerson.Name, Country, City, 

DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 

FROM Sale INNER JOIN SalesPerson 

ON Sale.SalesPersonID = SalesPerson.SalesPersonID 

GROUP BY CUBE(SalesPerson.Name, Country, City, DatePart(yyyy, SaleDate)) 

C. SELECT SalesPerson.Name, Country, City, 

DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 

FROM Sale INNER JOIN SalesPerson 

ON Sale.SalesPersonID = SalesPerson.SalesPersonID 

GROUP BY CUBE(SalesPerson.Name, DatePart(yyyy, SaleDate), City, Country) 

D. SELECT SalesPerson.Name, Country, City, DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total FROM Sale INNER JOIN SalesPerson ON Sale.SalesPersonID = SalesPerson.SalesPersonID GROUP BY ROLLUP(SalesPerson.Name, DatePart(yyyy, SaleDate), City, Country) 

Answer:

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

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. 

Answer: D,E