PrepAway - Latest Free Exam Questions & Answers

Tag: Exam 70-461

Exam 70-461: Querying Microsoft SQL Server 2012

Which Transact-SQL statement should you use?

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. Which
Transact-SQL statement should you use?

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

You have three tables that contain data for dentists, psychiatrists, and physicians. You create a viewthat is
used to look up their email addresses and phone numbers. The view has the following definition:

You need to ensure that users can update only the phone numbers and email addresses by using this view.
What should you do?

Which code segment should you use?

You have a database that contains the tables as shown in the exhibit. (Refer to the Exhibit.)

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 thatthey are defined in the table.
PriceRank must appear last.
Which code segment should you use?
To answer, type the correct code in the answer area.

Which code segment should you use?

You have a database that contains the tables shown in the exhibit. (Refer to the Exhibit.)

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

Which SELECT statement should you use?

You have a database that contains the tables as shown below:

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

Which code segment should you use?

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.


Page 13 of 21« First...1112131415...20...Last »