[Free] 2017(June) Ensurepass Examcollection Microsoft 70-761 Actual Tests 11-20

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 11

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_image001

 

You are developing a report that aggregates customer data only for the year 2014. The report requires that the data be denormalized.

 

You need to return the data for the report.

 

Which Transact-SQL statement should you run?

 

clip_image003

clip_image005

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

 

 

QUESTION 12

CORRECT TEXT

You have a table named Cities that has the following two columns: CityID and CityName. The CityID column uses the int data type, and CityName uses nvarchar(max).

 

You have a table named RawSurvey. Each row includes an identifier for a question and the number of persons that responded to that question from each of four cities. The table contains the following representative data:

 

clip_image007

 

A reporting table named SurveyReport has the following columns: CityID, QuestionID, and RawCount, where RawCount is the value from the RawSurvey table.

 

You need to write a Transact-SQL query to meet the following requirements:

 

clip_image009Retrieve data from the RawSurvey table in the format of the SurveyReport table.

clip_image009[1]The CityID must contain the CityID of the city that was surveyed.

clip_image009[2]The order of cities in all SELECT queries must match the order in the RawSurvey table.

clip_image009[3]The order of cities in all IN statements must match the order in the RawSurvey table.

 

Construct the query using the following guidelines:

 

clip_image009[4]Use one-part names to reference tables and columns, except where not possible.

clip_image009[5]ALL SELECT statements must specify columns.

clip_image009[6]Do not use column or table aliases, except those provided.

clip_image009[7]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_image012

 

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

 

Correct Answer: UNPIVOT

Explanation:

UNPIVOT must be used to rotate columns of the Rawsurvey table into column values.

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

 

 

QUESTION 13

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 query a database that includes two tables: Project and Task. The Project table includes the following columns:

 

clip_image014

clip_image016

 

You plan to run the following query to update tasks that are not yet started:

 

clip_image017

You need to return the total count of tasks that are impacted by this UPDATE operation, but are not associated with a project.

 

What set of Transact-SQL statements should you run?

 

Correct Answer: The WHERE clause of the third line should be WHERE ProjectID IS NULL, as we want to count the tasks that are not associated with a project.

 

 

QUESTION 14

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 have a database that tracks orders and deliveries for customers in North America. The database contains the following tables:

 

Sales.Customers

clip_image019

 

Application.Cities

clip_image020

 

Sales.CustomerCategories

clip_image021

 

The company’s development team is designing a customer directory application. The application must list customers by the area code of their phone number. The area code is defined as the first three characters of the phone number.

 

The main page of the application will be based on an indexed view that contains the area and phone number for all customers.

 

You need to return the area code from the PhoneNumber field.

 

Solution: You run the following Transact-SQL statement:

 

clip_image022

 

Does the solution meet the goal?

 

A.

Yes

B.

No

 

Correct Answer: B

Explanation:

The variable max, in the line DECLARE @areaCode nvarchar(max), is not defined.

 

 

QUESTION 15

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:

 

 

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

 

clip_image026

 

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

 

clip_image028

 

You need to create a query that meets the following requirements:

 

clip_image009[8]For customers that are not on a credit hold, return the CustomerID and the latest recorded population for the delivery city that is associated with the customer.

clip_image009[9]For customers that are on a credit hold, return the CustomerID and the latest recorded population for the postal city that is associated with the customer.

 

Which two Transact-SQL queries will achieve the goal? Each correct answer presents a complete solution.

 

clip_image030

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

Explanation:

Using Cross Joins

A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table. However, if a WHERE clause is added, the cross join behaves as an inner join.

 

B: You can use the IIF in the ON-statement.

IIF returns one of two values, depending on whether the Boolean expression evaluates to true or false in SQL Server.

 

References:

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

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

 

 

QUESTION 16

DRAG DROP

You need to create a stored procedure to update a table named Sales.Customers. The structure of the table is shown in the exhibit. (Click the exhibit button.)

 

clip_image031

 

The stored procedure must meet the following requirements:

 

clip_image009[10]Accept two input parameters.

clip_image009[11]Update the company name if the customer exists.

clip_image009[12]Return a custom error message if the customer does not exist.

 

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.

 

NOTE: More than one order of answer choices is correct. You will receive credit for any of the correct orders you select.

 

clip_image033

 

Correct Answer:

clip_image035

 

 

QUESTION 17

CORRECT TEXT

You create a table named Sales.Orders by running the following Transact-SQL statement:

 

clip_image036

 

You need to write a query that meets the following requirements:

 

clip_image009[13]removes orders from the table that were placed before January 1, 2012

clip_image009[14]uses the date format of YYYYMMDD

clip_image009[15]ensures that the order has been shipped before deleting the record

 

Construct the query using the following guidelines:

 

clip_image009[16]use one-part column names and two-part table names

clip_image009[17]do not use functions

clip_image009[18]do not surround object names with square brackets

clip_image009[19]do not use variables

clip_image009[20]do not use aliases for column names and table names

 

clip_image037

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_image038

 

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 18

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_image039

 

You must insert the following data into the Customer table:

 

clip_image041

 

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

 

Solution: You run the following Transact-SQL statement:

 

clip_image042

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 19

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_image001[1]

 

You need to audit all customer data.

 

Which Transact-SQL statement should you run?

 

clip_image044

clip_image046

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

F.

Option F

G.

Option G

H.

Option G

 

Correct Answer: B

Explanation:

The FOR SYSTEM_TIME ALL clause returns all the row versions from both the Temporal and History table.

 

Note: A system-versioned temporal table defined through is a new type of user table in SQL Server 2016, here defined on the last line WITH (SYSTEM_VERSIONING = ON…, is designed to keep a full history of data changes and allow easy point in time analysis.

 

To query temporal data, the SELECT statement FROM<table> clause has a new clause FOR SYSTEM_TIME with five temporal-specific sub-clauses to query data across the current and history tables.

 

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

 

 

QUESTION 20

HOTSPOT

You run the following Transact-SQL statement:

 

clip_image047

 

You need to ensure that you can insert data into the table.

 

What are the characteristics of the data?

 

To answer, select the appropriate options in the answer area.

 

clip_image048

 

Correct Answer:

clip_image049

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