Ensurepass.com : Ensure you pass the IT Exams
2018 May Microsoft Official New Released 70-761
100% Free Download! 100% Pass Guaranteed!

Querying Data with Transact-SQL (beta)

Question No: 31

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 is denormalized. Users make frequent changes to data in a primary table.

You need to ensure that users cannot change the tables directly, and that changes made to the primary table also update any related tables.

What should you implement?

  1. the COALESCE function

  2. a view

  3. a table-valued function

  4. the TRY_PARSE function

  5. a stored procedure

  6. the ISNULL function

  7. a scalar function

  8. the TRY_CONVERT function

Answer: B Explanation:

Using an Indexed View would allow you to keep your base data in properly normalized tables and maintain data-integrity while giving you the denormalized quot;viewquot; of that data.

References: http://stackoverflow.com/questions/4789091/updating-redundant- denormalized-data-automatically-in-sql-server

Question No: 32

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:

Ensurepass 2018 PDF and VCE

You must insert the following data into the Customer table:

Ensurepass 2018 PDF and VCE

Ensurepass 2018 PDF and VCE

You need to ensure that both records are inserted or neither record is inserted. Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?

  1. Yes

  2. No

Answer: A Explanation:

With the INSERT INTO..VALUES statement we can insert both values with just one statement. This ensures that both records or neither is inserted.

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

Question No: 33 HOTSPOT

You have the following subqueries: Subquery1, Subquery2, and Subquery3.

You need to replace the three subqueries with named result sets or temporary tables. The following requirements must be met:

Ensurepass 2018 PDF and VCE

Which replacement techniques should you use? To answer, select the appropriate options in the answer area.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Explanation:

Ensurepass 2018 PDF and VCE

Subquery1: common table expression (CTE)

A common table expression (CTE) can be thought of as a temporary result set that is defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW statement. A CTE is similar to a derived table in that it is not stored as an object and lasts only for the duration of the query. Unlike a derived table, a CTE can be self-referencing and can be referenced multiple times in the same query.

Subquery2: global temporary table

Global temporary tables are visible to any user and any connection after they are created, and are deleted when all users that are referencing the table disconnect from the instance of SQL Server.

Subquery3: local temporary table

Local temporary tables are visible only to their creators during the same connection to an instance of SQL Server as when the tables were first created or referenced. Local temporary tables are deleted after the user disconnects from the instance of SQL Server.

References:

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

Question No: 34 DRAG DROP

You have a database that stored information about servers and application errors. The database contains the following tables.

Servers

Ensurepass 2018 PDF and VCE

Errors

Ensurepass 2018 PDF and VCE

You are building a webpage that shows the three most common errors for each server. You need to return the data for the webpage.

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

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 35 DRAG DROP

You create three tables by running the following Transact-SQL statements:

Ensurepass 2018 PDF and VCE

For reporting purposes, you need to find the active user count for each role, and the total active user count. The result must be ordered by active user count of each role. You must use common table expressions (CTEs).

Which four 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.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 36

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

Ensurepass 2018 PDF and VCE

Application.Cities

Ensurepass 2018 PDF and VCE

Sales.CustomerCategories

Ensurepass 2018 PDF and VCE

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.

Ensurepass 2018 PDF and VCE

You need to return the area code from the PhoneNumber field. Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?

  1. Yes

  2. No

Answer: A Explanation:

As the result of the function will be used in an indexed view we should use schemabinding. References: https://sqlstudies.com/2014/08/06/schemabinding-what-why/

Question No: 37

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 contains tables named Customer_CRMSystem and Customer_HRSystem. Both tables use the following structure:

Ensurepass 2018 PDF and VCE

The tables include the following records: Customer_CRMSystem

Ensurepass 2018 PDF and VCE

Customer_HRSystem

Ensurepass 2018 PDF and VCE

Records that contain null values for CustomerCode can be uniquely identified by CustomerName.

You need to display a list of customers that do not appear in the Customer_HRSystem table.

Which Transact-SQL statement should you run?

Ensurepass 2018 PDF and VCE

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

  5. Option E

  6. Option F

  7. Option G

  8. Option H

Answer: D Explanation:

EXCEPT returns distinct rows from the left input query that aren’t output by the right input query.

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

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

Ensurepass 2018 PDF and VCE

Ensurepass 2018 PDF and VCE

When running an operation, you updated a column named EndTime for several records in the Project table, but updates to the corresponding task records in the Task table failed.

You need to synchronize the value of the EndTime column in the Task table with the value of the EndTime column in the project table. The solution must meet the following requirements:

  • If the EndTime column has a value, make no changes to the record.

  • If the value of the EndTime column is null and the corresponding project record is marked as completed, update the record with the project finish time.

Which four 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.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Explanation:

Ensurepass 2018 PDF and VCE

Box 1: UPDATE T SET T.EndTime = P.EndTime

We are updating the EndTime column in the Task table.

Box 2: FROM Task AS T

Where are updating the task table.

Box 3:INNER JOIN Project AS P on T.ProjectID = P.ProjectID

We join with the Project table (on the ProjectID columnID column).

Box 4: WHERE P.EndTime is NOT NULL AND T.EndTime is NULL

We select the columns in the Task Table where the EndTime column in the Project table has a value (NOT NULL), but where it is NULL in the Task Table.

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

Question No: 39 CORRECT TEXT

You have a database that contains the following tables.

Ensurepass 2018 PDF and VCE

You need to create a query that lists the lowest-performing salespersons based on the current year-to-date sales period. The query must meet the following requirements:

  • Return a column named Fullname that includes the salesperson FirstName, a space, and then LastName.

  • Include the current year-to-date sales for each salesperson.

  • Display only data for the three salespersons with the lowest year-to-year sales values.

  • Exclude salespersons that have no value for TerritoryID.

    Construct the query using the following guidelines:

  • Use the first letter of a table name as the table alias.

  • Use two-part column names.

  • Do not surround object names with square brackets.

  • Do not use implicit joins.

  • Use only single quotes for literal text.

  • Use aliases only if required.

Ensurepass 2018 PDF and VCE

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.

Ensurepass 2018 PDF and VCE

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

Answer: Pending

Question No: 40

Ensurepass 2018 PDF and VCE

You have a database that contains the following tables: Customer

CustomerAudit

Ensurepass 2018 PDF and VCE

Where the value of the CustomerID column equals 3, you need to update the value of the CreditLimit column to 1000 for the customer. You must ensure that the change to the record in the Customer table is recorded on the CustomerAudit table.

Which Transact-SQL statement should you run?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

Answer: D Explanation:

The OUTPUT Clause returns information from, or expressions based on, each row affected by an INSERT, UPDATE, DELETE, or MERGE statement. These results can be returned to the processing application for use in such things as confirmation messages, archiving, and other such application requirements. The results can also be inserted into a table or table variable. Additionally, you can capture the results of an OUTPUT clause in a nested INSERT, UPDATE, DELETE, or MERGE statement, and insert those results into a target table or view.

Note: If the column modified by the .RITE clause is referenced in an OUTPUT clause, the complete value of the column, either the before image in deleted.column_name or the after image in inserted.column_name, is returned to the specified column in the table variable.

100% Ensurepass Free Download!
Download Free Demo:70-761 Demo PDF
100% Ensurepass Free Guaranteed!
70-761 Dumps

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