[Abreast of the times] 70 461 exam dumps

Ucertify offers free demo for sql 70 461 exam. "Querying Microsoft SQL Server 2012", also known as exam 70 461 practice test exam, is a Microsoft Certification. This set of posts, Passing the Microsoft 70 461 certification exam, will help you answer those questions. The 70 461 exam questions Questions & Answers covers all the knowledge points of the real exam. 100% real Microsoft 70 461 exam questions exams and revised by experts!


♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Microsoft 70-461 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 70-461 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/70-461-exam-dumps.html

Q51. CORRECT TEXT 

You have an XML schema collection named Sales.InvoiceSchema. You need to declare a variable of the XML type named XML1. The solution must ensure that XML1 is validated by using Sales.InvoiceSchema. 

Which code segment should you use? 

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

Answer: 

DECLARE @XML1 XML(Sales.InvoiceSchema) 


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


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

Answer: 


Q54. You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for students. The table has marks obtained by 50 students for various subjects. 

You need to ensure that the following requirements are met: 

Students must be ranked based on their average marks. 

If one or more students have the same average, the same rank must be given to 

these students. 

Consecutive ranks must be skipped when the same rank is assigned. 

Which Transact-SQL query should you use? 

A. SELECT StudentCode as Code, RANK() OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks GROUP BY StudentCode 

B. SELECT Id, Name, Marks, DENSE_RANK() OVER(ORDER BY Marks DESC) AS Rank FROM StudentMarks 

C. SELECT StudentCode as Code, DENSE_RANK() OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks GROUP BY StudentCode 

D. SELECT StudentCode as Code, NTILE(2) OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks GROUP BY StudentCode 

E. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks, RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp WHERE Rank = 1 

F. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks, RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp WHERE Rank = 1 

G. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks, RANK() OVER(PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp WHERE Rank = 1 

H. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks, RANXO OVER(PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp WHERE Rank = 1 

Answer:


Q55. You are a database developer for an application hosted on a Microsoft SQL Server 2012 server. 

The database contains two tables that have the following definitions: 

Global customers place orders from several countries. 

You need to view the country from which each customer has placed the most orders. 

Which Transact-SQL query do you use? 

A. SELECT c.CustomerID, c.CustomerName, o.ShippingCountry FROM Customer c INNER JOIN (SELECT CustomerID, ShippingCountry, RANK() OVER (PARTITION BY CustomerID ORDER BY COUNT(OrderAmount) DESC) AS Rnk FROM Orders GROUP BY CustomerID, ShippingCountry) AS o ON c.CustomerID = o.CustomerID WHERE o.Rnk = 1 

B. SELECT c.CustomerID, c.CustomerName, o.ShippingCountry FROM (SELECT c.CustomerID, c.CustomerName, o.ShippingCountry, RANK() OVER (PARTITION BY CustomerID ORDER BY COUNT(o.OrderAmount) ASC) AS Rnk FROM Customer c INNER JOIN Orders o ON c.CustomerID = o.CustomerID GROUP BY c.CustomerID, c.CustomerName, o.ShippingCountry) cs WHERE Rnk = 1 

C. SELECT c.CustomerID, c.CustomerName, o.ShippingCountry FROM Customer c INNER JOIN (SELECT CustomerID, ShippingCountry, RANK() OVER (PARTITION BY CustomerID ORDER BY OrderAmount DESC) AS Rnk FROM Orders GROUP BY CustomerID, ShippingCountry) AS o ON c.CustomerID = o.CustomerID WHERE o.Rnk = 1 

D. SELECT c.CustomerID, c.CustomerName, o.ShippingCountry FROM Customer c INNER JOIN (SELECT CustomerID, ShippingCountry, COUNT(OrderAmount) DESC) AS OrderAmount FROM Orders GROUP BY CustomerID, ShippingCountry) AS o ON c.CustomerID = o.CustomerID ORDER BY OrderAmount DESC 

Answer:


Q56. You use Microsoft SQL Server 2012 to develop a database application. 

You create a stored procedure named DeleteJobCandidate. 

You need to ensure that if DeleteJobCandidate encounters an error, the execution of the stored procedure reports the error number. 

Which Transact-SQL statement should you use? 

A. DECLARE @ErrorVar INT; 

DECLARE @RowCountVar INT; 

EXEC DeleteJobCandidate 

SELECT @ErrorVar = @@ERROR, @RowCountVar = @@ROWCOUNT; 

IF (@ErrorVar <> 0) 

PRINT N'Error = ' + CAST(@@ErrorVar AS NVARCHAR(8)) + 

N', Rows Deleted = ' + CAST(@@RowCountVar AS NVARCHAR(8)); 

GO 

B. DECLARE @ErrorVar INT; 

DECLARE @RowCountVar INT; 

EXEC DeleteJobCandidate 

SELECT @ErrorVar = ERROR_STATE(), @RowCountVar = @@ROWCOUNT; 

IF (@ErrorVar <> 0) 

PRINT N'Error = ' + CAST(ERRORSTATE() AS NVARCHAR(8)) + 

N', Rows Deleted = ' + CAST(@@RowCountVar AS NVARCHAR(8)); 

GO 

C. EXEC DeleteJobCandidate 

IF (ERROR_STATE() != 0) 

PRINT N'Error = ' + CAST(@@ERROR AS NVARCHAR(8)) + 

N', Rows Deleted = ' + CAST(@@ROWCOUNT AS NVARCHAR(8)); 

GO 

D. EXEC DeleteJobCandidate 

PRINT N'Error = ' + CAST(@@ERROR AS NVARCHAR(8)) + 

N', Rows Deleted = ' + CAST(@@ROWCOUNT AS NVARCHAR(8)); 

GO 

Answer:


Q57. Your database contains a table named SalesOrders. The table includes a DATETIME column named OrderTime that stores the date and time each order is placed. There is a non-clustered index on the OrderTime column. 

The business team wants a report that displays the total number of orders placed on the current day. 

You need to write a query that will return the correct results in the most efficient manner. 

Which Transact-SQL query should you use? 

A. SELECT COUNT(*) FROM SalesOrders 

WHERE OrderTime = CONVERT(DATE, GETDATE()) 

B. SELECT COUNT(*) FROM SalesOrders 

WHERE OrderTime = GETDATE() 

C. SELECT COUNT(*) FROM SalesOrders 

WHERE CONVERT(VARCHAR, OrderTime, 112) = CONVERT(VARCHAR, GETDATE(I, 

112)) 

D. SELECT COUNT(*) FROM SalesOrders 

WHERE OrderTime >= CONVERT(DATE, GETDATE()) 

AND OrderTime < DATEADD(DAY, 1, CONVERT(DATE, GETDATE())) 

Answer:


Q58. You use a Microsoft SQL Server 2012 database that contains a table named BlogEntry that has the following columns: 

Id is the Primary Key. 

You need to append the "This is in a draft stage" string to the Summary column of the recent 10 entries based on the values in EntryDateTime. 

Which Transact-SQL statement should you use? 

A. UPDATE TOP(10) BlogEntry 

SET Summary.WRITE(N' This is in a draft stage', NULL, 0) 

B. UPDATE BlogEntry 

SET Summary = CAST(N' This is in a draft stage' as nvarchar(max)) 

WHERE Id IN(SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC) 

C. UPDATE BlogEntry 

SET Summary.WRITE(N' This is in a draft stage', NULL, 0) FROM ( 

SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC) AS s WHERE BlogEntry.Id = s.ID 

D. UPDATE BlogEntry 

SET Summary.WRITE(N' This is in a draft stage', 0, 0) 

WHERE Id IN(SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC) 

Answer:


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

You need to store media files in several tables. 

Each media file is less than 1 MB in size. The media files will require fast access and will be retrieved frequently. 

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

Answer:


Q60. CORRECT TEXT 

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

You need to create a view named uv_CustomerFullName to meet the following requirements: 

The code must NOT include object delimiters. 

The view must be created in the Sales schema. 

Columns must only be referenced by using one-part names. 

The view must return the first name and the last name of all customers. 

The view must prevent the underlying structure of the customer table from being 

..... 

changed. 

. The view must be able to resolve all referenced objects, regardless of the user's default schema. 

Which code segment should you use? 

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

Answer: