最新的Microsoft Querying Microsoft SQL Server 2012/2014 - 70-461免費考試真題
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?
You need to invoke a table-valued function for each row returned by a query.
Which Transact-SQL operator should you use?
正確答案: A
說明:(僅 Fast2test 成員可見)
You use a Microsoft SQL Server 2012 database.
You want to create a table to store Microsoft Word documents.
You need to ensure that the documents must only be accessible via Transact-SQL queries.
Which Transact-SQL statement should you use?
You want to create a table to store Microsoft Word documents.
You need to ensure that the documents must only be accessible via Transact-SQL queries.
Which Transact-SQL statement should you use?
正確答案: B
說明:(僅 Fast2test 成員可見)
You create a view based on the following statement:

You grant the Select permission to User1.
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 Transact-SQL statement should you use?


You grant the Select permission to User1.
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 Transact-SQL statement should you use?

正確答案: C
You administer a SQL Server database that tracks sales that are made by sales persons. The database contains a table that is defined by the following Transact-SQL statements:

You have the following requirements:
* accept a datetime value for the query month
* return a list of salespeople IDs who have sales in the query month or before the query month
* compare sales with sales quota for salespeople who have a sales quota
* display year-to-date sales for salespeople that do not have a sales quota How should you complete the stored procedure? To answer, drag the appropriate Transact-SQL segments to the correct locations. Each Transact-SQL segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.


You have the following requirements:
* accept a datetime value for the query month
* return a list of salespeople IDs who have sales in the query month or before the query month
* compare sales with sales quota for salespeople who have a sales quota
* display year-to-date sales for salespeople that do not have a sales quota How should you complete the stored procedure? To answer, drag the appropriate Transact-SQL segments to the correct locations. Each Transact-SQL segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

正確答案:

Explanation:
Box 1: IIF ..
The IIF logical function returns one of two values, depending on whether the Boolean expression evaluates to true or false in SQL Server.
Syntax: IIF ( boolean_expression, true_value, false_value )
Box 2: [LastSzale] < EOMONTH(@queryMonth)
The EOMONTH function returns the last day of the month containing a specified date, with an optional offset.
References:
https://docs.microsoft.com/en-us/sql/t-sql/functions/logical-functions-iif-transact-sql?view=sql-server-2017
https://docs.microsoft.com/en-us/sql/t-sql/functions/eomonth-transact-sql?view=sql-server-2017
You have a database named Sales that contains the tables as shown in the exhibit. (Click the Exhibit button.)

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.


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.

正確答案: A
You are developing a Microsoft SQL Server 2012 database for a company. The database contains a table that is defined by the following Transact-SQL statement:

You use the following Transact-SQL script to insert new employee data into the table. Line numbers are included for reference only.

If an error occurs, you must report the error message and line number at which the error occurred and continue processing errors.
You need to complete the Transact-SQL script.
Which Transact-SQL segment should you insert at line 06?

You use the following Transact-SQL script to insert new employee data into the table. Line numbers are included for reference only.

If an error occurs, you must report the error message and line number at which the error occurred and continue processing errors.
You need to complete the Transact-SQL script.
Which Transact-SQL segment should you insert at line 06?
正確答案: D
說明:(僅 Fast2test 成員可見)
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.)

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

正確答案:

You have a SQL Server database named CUSTOMERS.
You need to sign a stored procedure named SelectCustomers in the CUSTOMERS database.
Which four statements should you execute in sequence? To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.

You need to sign a stored procedure named SelectCustomers in the CUSTOMERS database.
Which four statements should you execute in sequence? To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.

正確答案:

Explanation:
There are four steps involved in signing a module:
References:https://msdn.microsoft.com/en-us/library/bb669102(v=vs.110).aspx
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.)
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.)
正確答案: B,C
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.)
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.)
正確答案: E,F
You are developing an SQL Server database. The database contains two tables and a function that are defined by the following Transact-SQL statements.

You need to create a query to determine the total number of products that are sold each day for the live top-selling products on that particular day.
How should you complete the relevant Transact-SQL script? To answer, select the appropriate Transact-SQL statements from each list in the answer area.


You need to create a query to determine the total number of products that are sold each day for the live top-selling products on that particular day.
How should you complete the relevant Transact-SQL script? To answer, select the appropriate Transact-SQL statements from each list in the answer area.

正確答案:

Explanation:
The APPLY operator allows you to invoke a table-valued function for each row returned by an outer table expression of a query. T There are two forms of APPLY: CROSS APPLY and OUTER APPLY. CROSS APPLY returns only rows from the outer table that produce a result set from the table-valued function. OUTER APPLY returns both rows that produce a result set, and rows that do not, with NULL values in the columns produced by the table-valued function.
Reference:
https://technet.microsoft.com/en-us/library/ms175156(v=sql.105).aspx
You use a Microsoft SQL Server database.
You want to create a table to store files.
You need to ensure that the following requirements are met:
* The files must include information about the directory structure.
* The files must be accessible in SQL Server.
* The files must be in a folder that is accessible directly by using Windows Explorer.
Which Transact-SQL statement should you run?
You want to create a table to store files.
You need to ensure that the following requirements are met:
* The files must include information about the directory structure.
* The files must be accessible in SQL Server.
* The files must be in a folder that is accessible directly by using Windows Explorer.
Which Transact-SQL statement should you run?
正確答案: C
說明:(僅 Fast2test 成員可見)
You develop a Microsoft SQL Server database. The database contains a table defined by the following Transact-SQL statement:

All regions have more than one employee.
You need to write a query to find the employee with the highest SalesYTD in each region with the following result set:
* First Name
* Last Name
* Region
* Sales YTD
Which Transact-SQL query should you run?

All regions have more than one employee.
You need to write a query to find the employee with the highest SalesYTD in each region with the following result set:
* First Name
* Last Name
* Region
* Sales YTD
Which Transact-SQL query should you run?
正確答案: D
說明:(僅 Fast2test 成員可見)