Ensurepass
2017 June Microsoft Official New Released 70-761 Q&As
100% Free Download! 100% Pass Guaranteed!
http://www.ensurepass.com/70-761.html

Querying Data with Transact-SQL

QUESTION 1

Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.

 

You create a table named Customers. Data stored in the table must be exchanged between web pages and web servers by using AJAX calls that use REST endpoint.

 

You need to return all customer information by using a data exchange format that is text- based and lightweight.

 

Which Transact-SQL statement should you run?

 

clip_image002

clip_image004

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

F.

Option F

G.

Option G

H.

Option H

 

Correct Answer: C

Explanation:

JSON can be used to pass AJAX updates between the client and the server.

Export data from SQL Server as JSON, or format query results as JSON, by adding the FOR JSON clause to a SELECT statement.

When you use the FOR JSON clause, you can specify the structure of the output explicitly, or let the structure of the SELECT statement determine the output.

 

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

 

 

QUESTION 2

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

 

After you answer a question in this section. you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

 

You create a table named Customer by running the following Transact-SQL statement:

 

clip_image005

 

You must insert the following data into the Customer table:

 

clip_image007

 

You need to e
nsure that both records are inserted or neither record is inserted.

 

Solution: You run the following Transact-SQL statement:

 

clip_image009

 

Does the solution meet the goal?

 

A.

Yes

B.

No

 

Correct Answer: B

Explanation:

As there are two separate INSERT INTO statements we cannot ensure that both or neither records is inserted.

 

 

QUESTION 3

You have a database named MyDb. You run the following Transact-SQL statements:

 

clip_image010

 

A value of 1 in the IsActive column indicates that a user is active.

 

You need to create a count for active users in each role. If a role has no active users. you must display a zero as the active users count.

 

Which Transact-SQL statement should you run?

 

clip_image012

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

 

 

QUESTION 4

DRAG DROP

Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question on this series.

 

You have a database that tracks orders and deliveries for customers in North America. System versioning is enabled for all tables. The database contains the Sales.Customers, Application.Cities, and Sales.CustomerCategories tables.

 

Details for the Sales.Customers table are shown in the following table:

 

clip_image014

 

Details for the Application.Cities table are shown in the following table:

 

clip_image016

 

Details for the Sales.CustomerCategories table are shown in the following table:

 

clip_image018

 

You are creating a report to show when the first customer account was opened in each city. The report contains a line chart with the following characteristics:

 

clip_image020The chart contains a data point for each city, with lines connecting the points.

clip_image020[1]The X axis contains the position that the city occupies relative to other cities.

clip_image020[2]The Y axis contains the date that the first account in any city was opened.

 

An example chart is shown below for five cities:

 

clip_image021

 

During a sales promotion, customers from various cities open new accounts on the same date.

 

You need to write a query that returns the data for the chart.

 

How should you complete the Transact-SQL statement?

 

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.

 

NOTE: Each correct selection is worth one point.

 

clip_image023

 

Correct Answer:

clip_image025

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 5

HOTSPOT

Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question in this series.

 

You are developing a database to track customer orders. The database contains the following tables: Sales.Customers, Sales.Orders, and Sales.OrderLines.

 

The following table describes the columns in Sales.Customers.

 

clip_image026

 

The following table describes the columns in Sales.Orders.

 

clip_image028

 

The following table describes the columns in Sales.OrderLines.

 

clip_image030

 

You need to create a database object that calculates the total price of an order including the sales tax. The database object must meet the following requirements:

 

clip_image020[3]Reduce the compilation cost of Transact-SQL code by caching the plans and reusing them for repeated execution.

clip_image020[4]Return a value.

clip_image020[5]Be callable from a SELECT statement.

 

How should you complete the Transact-SQL statements?

To answer, select the appropriate Transact-SQL segments in the answer area.

 

clip_image032

 

Correct Answer:

clip_image034

 

 

 

QUESTION 6

Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.

 

You create a table by running the following Transact-SQL statement:

 

clip_image035

 

You need to return normalized data for all customers that were added in the year 2014.

 

Which Transact-SQL statement should you run?

 

clip_image037

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D.

E.

Option E.

F.

Option F.

G.

Option G.

H.

Option H.


 

Correct Answer: G

Explanation:

The following query searches for row versions for Employee row with EmployeeID = 1000 that were active at least for a portion of period between 1st January of 2014 and 1st January 2015 (including the upper boundary):

SELECT * FROM Employee

FOR SYSTEM_TIME

BETWEEN ‘2014-01-01 00:00:00.0000000’ AND ‘2015-01-01 00:00:00.0000000’ WHERE EmployeeID = 1000 ORDER BY ValidFrom;

 

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

 

 

QUESTION 7

Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.

 

You have a database that stores sales and order information.

 

Users must be able to extract information from the tables on an ad hoc basis. They must also be able to reference the extracted information as a single table.

 

You need to implement a solution that allows users to retrieve the data required, based on variables defined at the time of the query.

 

What should you implement?

 

A.

the COALESCE function

B.

a view

C.

a table-valued function

D.

the TRY_PARSE function

E.

a stored procedure

F.

the ISNULL function

G.

a scalar function

H.

the TRY_CONVERT function

 

Correct Answer: C

Explanation:

User-defined functions that return a table data type can be powerful alternatives to views. These functions are referred to as table-valued functions. A table-valued user-defined function can be used where table or view expressions are allowed in Transact-SQL queries. While views are limited to a single SELECT statement, user-defined functions can contain additional statements that allow more powerful logic than is possible in views. A table-valued user-defined function can also replace stored procedures that return a single result set.

 

References: https://technet.microsoft.com/en-us/library/ms191165(v=sql.105).aspx

 

 

 

QUESTION 8

CORRECT TEXT

You have a database that contains the following tables.

 

clip_image039

 

You need to create a query that lists all complaints from the Complaints table, and the name of the person handling the complaints if a person is assigned. The ComplaintID must be displayed first, followed by the person name.

 

Construct the query using the following guidelines:

 

clip_image020[6]Use two-part column names.

clip_image020[7]Use one-part table names.

clip_image020[8]Do not use aliases for column names or table names.

clip_image020[9]Do not use Transact-SQL functions.

clip_image020[10]Do not use implicit joins.

clip_image020[11]Do not surround object names with square brackets.

 

Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within the code that has been provided as well as below it.

 

clip_image041

clip_image042

 

Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position.

 

Correct Answer: Pending

 

 

QUESTION 9

DRAG DROP

Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question in this series.

 

You are developing a database to track customer orders. The database contains the following tables: Sales.Customers, Sales.Orders, and Sales.OrderLines. The following table describes the columns in Sales.Customers.

 

clip_image026[1]

 

The following table describes the columns in Sales.Orders.

 

clip_image043

 

The following table describes the columns in Sales.OrderLines.

 

clip_image044

 

You need to create a function that calculates the highest tax rate charged for an item in a specific order.

 

Which five Transact-SQL segments should you use to develop the solution?

 

To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

 

clip_image046

 

Correct Answer:

clip_image048

 

 

QUESTION 10

DRAG DROP

You have a table named HR.Employees as shown in the exhibit. (Clic
k the exhibit button.)

 

clip_image049

You need to write a query that will change the value of the job title column to Customer Representative for any employee who lives in Seattle and has a job title of Sales Representative. If the employee does not have a manager defined, you must not change the title.

 

Which three Transact-SQL segments should you use to develop the solution?

 

To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

 

clip_image051

 

Correct Answer:

clip_image053

100% Free Download!
—Download Free Demo:70-761 Demo PDF
100% Pass Guaranteed!
Download 2017 Ensurepass 70-761 Full Exam PDF and VCE Q&As:59
—Get 10% off your purchase! Copy it:TJDN-947R-9CCD [2017.06.01-2017.06.30]

Ensurepass 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

2017 Ensurepass IT Certification PDF and VCE