exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 13 discussion

Actual exam question from Microsoft's 70-761
Question #: 13
Topic #: 1
[All 70-761 Questions]

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:


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.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
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

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
exam_taker5
Highly Voted 5 years, 10 months ago
The first box should be the UPDATE T statement, as we are updating the T table, not the P table.
upvoted 37 times
...
prakash101179
Highly Voted 5 years, 8 months ago
Answer should be - Update T SET T.EndTime = P.EndTime FROM Tasks as T INNER JOIN Projects AS P ON T.ProjectId = P.ProjectID WHERE P.EndTime is not null and T.EndTime is NULL
upvoted 37 times
...
Anirudh_net
Most Recent 3 years, 3 months ago
The requirements: "column named EndTime for several records in the Project table, but updates to the corresponding task records in the Task table failed.". So, the information on Project is ok. You need to synchronize Task table.
upvoted 1 times
...
CristianCruz
5 years ago
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 update p set p.endtime = t.endtime from task as t inner join project as p on t.projectid = p.projectid where p.endtime is not null and t.endtime is null
upvoted 2 times
eduardogtc
4 years, 9 months ago
The requirements: "column named EndTime for several records in the Project table, but updates to the corresponding task records in the Task table failed.". So, the information on Project is ok. You need to synchronize Task table.
upvoted 1 times
Luzix
4 years, 6 months ago
You need to update Task!!
upvoted 1 times
...
...
Luzix
4 years, 6 months ago
If you have to write values in Task table, you should update task, never project.
upvoted 1 times
...
...
Tazul
5 years, 10 months ago
Box 1: UPDATE T SET T.EndTime = P.EndTime
upvoted 19 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...