SQLServer2012認證70-461題庫一

? ? ? ? ? ? ? ? ? ? ? ? ?ProductQuestions:144?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Version:13


Question 1:

You develop a Microsoft SQL Server 2012 server database that supports an application.The application contains a table that has the following definitions:

CREATE TABLE Inventory

( ItemID int NOT NULL PRIMARY KEY,

ItemslnStore int NOT NULL,

ItemslnWarehouse int NOT NULL)

You need to create a computed cloumn that returns the sum total of the ItemslnStore and ItemslnWarehouse values for each row.

Which Transact-SQL statement should you use?

A. ALTER TABLE Inventory ADD totalItems AS ItemslnStore + ItemslnWarehouse

B. ALTER TABLE Inventory ADD ItemslnStore - ItemslnWarehouse = TotalItems

C. ALTER TABLE Inventory ADD TotalItems = ItemslnStore + ItemslnWarehouse

D. ALTER TABLE Inventory ADD TotalItems AS SUM(ItemslnStore,ItemslnWarehouse);

Answer: A

Question: 2

You develop a Microsoft SQL Server 2012 database. You create a view from the Orders and OrderDetails tables by using the following definition.

CREATE VIEW vOrders

WITH SCHEMABINDING

AS

SELECT o.ProductID, o.OrderDate,SUM(od.UnitPrice * od.OrderQty) AS Amount FROM OrderDetails AS od INNER JOIN Order AS o ON od.OrderID = o.OrderID WHERE ?od.SalesOrderID = o.SalesOrderID GROUP BY o.OrderDate, o.ProductID

GO

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: D

Question: 3

You develop a database for a traval application. You need to design tables and other database object.?

You create the Airline_Schedules table.

You need to store the departure and arrival dates and times of flights along wiht time zone information.

What should you do?

A. Use the CAST function.

B. Use the DATE data type.

C. Use the FORMAT function.

D. Use an appropriate collation.

E. Use a user-defined table type.

F. Use the VARBINARY date type.

G. use the DATETIME data type.

H. Use the DATATIME2 data type.

I. Use the DATATIMEOFFSET data type.

J. Use the TODAYETIMEOFFSET function.

Answer: I

Question: 4

You develop a database for a travel application. You need to desgin 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?

A. Use the CAST function.

B. Use the DATE data type.

C. Use the FORMAT function.

D. Use an appropriate collation.

E. Use a user-defined table type.

F. Use the VARBINARY data type.

G. Use the DATETIME data type.

H. Use the DATETIME2 data type.

I. Use the DATETIMEOFFSET data type.

J. Use the TODAYTIMEOFFSET function.

Answer: E

Question: 5

CORRECT TEXT

You have a view that was created by using the following code:

CREATE VIEW Sales.OrdersByTerritory

AS

SELECT OrderID,OrderDate,SalesTerrityorID,TotalDue FROM Sales.Orders;

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 uesd in OrderByTerritoryView.

Which code segment should you use?

To answer, type the correct code in the answer area.

Answer: Please review the explanation part for this answer

CREATE FUNCTION Sales.fn_OrderByTerritory(@T int)

RETURNS TABLE

AS

RETURN

(

SELECT OrderID, OrderDate, SaleTerritoryID, TotalDue FROM Sales.OrdersByTerritory WHERE SalesTerritoryID = @T

)

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容