[Free] 2018(Aug) Dumps4cert Microsoft 70-461 Dumps with VCE and PDF Download 51-60

Dumps4cert.com : Latest Dumps with PDF and VCE Files
2018 Aug Microsoft Official New Released 70-461
100% Free Download! 100% Pass Guaranteed!

Querying Microsoft SQL Server 2012

Question No: 51

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

image

You need to ensure that users are able to modify data by using the view. What should you do?

  1. Create an AFTER trigger on the view.

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

  3. Create an INSTEAD OF trigger on the view.

  4. Modify the view to an indexed view.

Answer: C

Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx

Question No: 52 CORRECT TEXT

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

image

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.

image

Answer: Please review the explanation part for this answer

Explanation:

CREATE FUNCTION Sales.fn_OrdersByTerritory (@T int) RETURNS TABLE

AS RETURN ( SELECT

OrderID, OrderDate, SalesTerritoryID, TotalDue

FROM Sales.OrdersByTerritory WHERE SalesTerritoryID=@T

)

Question No: 53

You administer a Microsoft SQL Server 2012 database that includes a table named Products. The Products table has columns named ProductId, 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.

Which Transact-SQL query should you use?

  1. WITH CTEDupRecords AS

    (

    SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products

    GROUP BY ProductName HAVING COUNT(*) gt; 1

    )

    DELETE p

    FROM Products p

    JOIN CTEDupRecords cte ON

  2. ProductName = cte.ProductName

    AND p.CreatedDateTime gt; cte.CreatedDateTime

  3. WITH CTEDupRecords AS

    (

    SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products

    GROUP BY ProductName HAVING COUNT(*) gt; 1

    )

    DELETE p

    FROM Products p

    JOIN CTEDupRecords cte ON cte.ProductName = p.ProductName

    AND cte.CreatedDateTime gt; p.CreatedDateTime

  4. WITH CTEDupRecords AS

    (

    SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products

    GROUP BY ProductName

    )

    DELETE p

    FROM Products p

    JOIN CTEDupRecords cte ON

  5. ProductName = cte.ProductName

  6. WITH CTEDupRecords AS

    (

    SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName FROM Products

    GROUP BY ProductName HAVING COUNT(*) gt; 1

    )

    DELETE p

    FROM Products p

    JOIN CTEDupRecords cte ON

  7. ProductName = cte.ProductName

Answer: B

Question No: 54

You develop a database for a travel application. You need to design tables and other database objects.

You create the Airline_Schedules table.

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

What should you do?

  1. Use the CAST function.

  2. Use the DATE data type.

  3. Use the FORMAT function.

  4. Use an appropriate collation.

  5. Use a user-defined table type.

  6. Use the VARBINARY data type.

  7. Use the DATETIME data type.

  8. Use the DATETIME2 data type.

  9. Use the DATETIMEOFFSET data type.

  10. Use the TODATETIMEOFFSET function.

Answer: I

Reference: http://msdn.microsoft.com/en-us/library/ff848733.aspx Reference: http://msdn.microsoft.com/en-us/library/bb630289.aspx

Question No: 55

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?

  1. SELECT CustomerName, OrderDate FROM Customers

    LEFT OUTER JOIN Orders

    ON Customers.CustomerID = Orders.CustomerId

  2. SELECT CustomerName, OrderDate FROM Customers

    RIGHT OUTER JOIN Orders

    ON Customers.CustomerID = Orders.CustomerId

  3. SELECT CustomerName, OrderDate FROM Customers

    CROSS JOIN Orders

    ON Customers.CustomerId = Orders.CustomerId

  4. SELECT CustomerName, OrderDate FROM Customers

JOIN Orders

ON Customers.CustomerId = Orders.CustomerId

Answer: D

Reference: http://msdn.microsoft.com/en-us/library/ms177634.aspx

Question No: 56 CORRECT TEXT

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

image

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.

Answer: Please review the explanation part for this answer

Explanation:

SELECT OrderID, SUM(ExtendedAmount) AS TotalSales FROM Sales.Details

GROUP BY OrderID ORDER BY OrderID

Question No: 57

You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)

image

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.

lt;CUSTOMERS Name=quot;Customer Aquot; Country=quot;Australiaquot;gt;

lt;ORDERS OrderID=quot;1quot; OrderDate=quot;2001-01-01quot; Amount=quot;3400.00quot; /gt;

lt;ORDERS OrderID=quot;2quot; OrderDate=quot;2002-01-01quot; Amount=quot;4300.00quot; /gt;

lt;/CUSTOMERSgt;

Which Transact-SQL query should you use?

  1. SELECT OrderId, OrderDate, Amount, Name, Country

    FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML RAW

  2. SELECT OrderId, OrderDate, Amount, Name, Country

    FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML RAW, ELEMENTS

  3. SELECT OrderId, OrderDate, Amount, Name, Country

    FROM Orders INNER JOIN Customers ON Orders.CustomerId = Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML AUTO

  4. SELECT OrderId, OrderDate, Amount, Name, Country

    FROM Orders INNER JOIN Customers ON Orders.CustomerId – Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML AUTO, ELEMENTS

  5. SELECT Name, Country, OrderId, OrderDate, Amount

    FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML AUTO

  6. SELECT Name, Country, OrderId, OrderDate, Amount

    FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML AUTO, ELEMENTS

  7. SELECT Name AS #39;@Name#39;, Country AS #39;@Country#39;, OrderId, OrderDate, Amount FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId = 1

    FOR XML PATH (#39;Customers#39;)

  8. SELECT Name AS #39;Customers/Name#39;, Country AS #39;Customers/Country#39;, OrderId, OrderDate, Amount

FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId WHERE Customers.CustomerId = 1

FOR XML PATH (#39;Customers#39;)

Answer: E

Question No: 58 CORRECT TEXT

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

image

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: Please review the explanation part for this answer

Explanation:

CREATE FUNCTION Sales.fn_OrdersByTerritory (@T int) RETURNS TABLE

AS RETURN (

SELECT OrderID,OrderDate,SalesTerrirotyID,TotalDue FROM Sales.OrdersByTerritory

WHERE SalesTerritoryID = @T

)

Question No: 59 CORRECT TEXT

You have a database that contains a table named Customer. The customer table contains

a column named LastName that has a column definition of varchar(50). An application named App1 reads from the table frequently.

You need to change the column definition to nvarchar(100). The solution must minimize the amount of time it takes for App1 to read the data.

Which statement should you execute?

image

image

  1. Option A

  2. Option B

  3. Option C

  4. Option D

Answer: C

Explanation:

To change the data type of a column in a SQL Server (or Microsoft access) table , usethe following syntax:

ALTER TABLE table_name

ALTER COLUMN column_name datatype

References: https://www.w3schools.com/SQl/sql_alter.asp

Question No: 60 DRAG DROP

You maintain a SQL Server database that is used by a retailer to track sales and salespeople. The database includes two tables and two triggers that is defined by the following Transact-SQL statements:

image

During days with a large sales volume, some new sales transaction fail and report the following error: Arithmetic overflow error converting expression to data type int.

You need to ensure that the two triggers are applied once per sale, and that they do not interfere with each other.

How should you complete the relevant Transact-SQL statement? To answer, drag the appropriate Transact-SQL segments to the correct location or 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.

image

Answer:

image

Explanation:

image

Box 1: OFF

Box 2: 0

Only direct recursion of AFTER triggers is prevented when the RECURSIVE_TRIGGERS database option is set to OFF. To disable indirect recursion of AFTER triggers, also set the nested triggers server option to 0.

Note: Both DML and DDL triggers are nested whena trigger performs an action that initiates another trigger. These actions can initiate other triggers, and so on. DML and DDL triggers can be nested up to 32 levels. You can control whether AFTER triggers can be nested through the nested triggers server configuration option.

If nested triggers are allowed and a trigger in the chain starts an infinite loop, the nesting level is exceeded and the trigger terminates.

References:https://msdn.microsoft.com/en-us/library/ms190739.aspx

100% Dumps4cert Free Download!
70-461 PDF
100% Dumps4cert Pass Guaranteed!
70-461 Dumps

Dumps4cert ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.