Exam DP-800 Topic 1 Question 86 Discussion

Actual exam question for Microsoft's DP-800 exam
Question #: 86
Topic #: 1
You need to meet the database performance requirements for maintenance data How should you complete the Transact-SQL code? To answer, drag the appropriate values to the correct targets. Each value 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.

Suggested Answer:


Explanation:
* ON # m.maintenanceId = i.maintenanceId
* WHERE # m.LastModifiedUtc < > i.LastModifiedUtc
The correct drag-and-drop completion is:
* ON m.maintenanceId = i.maintenanceId
* WHERE m.LastModifiedUtc < > i.LastModifiedUtc
This satisfies the requirement to ensure that when a row in MaintenanceEvents changes, the corresponding LastModifiedUtc value is updated to the current system time, while also helping avoid unnecessary repeat updates.
The inserted pseudo-table in a SQL Server AFTER UPDATE trigger contains the rows that were just updated.
To update the matching row in the base table correctly, the trigger must join the target table row to the corresponding row in inserted by the table's primary key. In this schema, MaintenanceId is the primary key for MaintenanceEvents, so the correct join is m.maintenanceId = i.maintenanceId . Joining on VehicleId would be incorrect because multiple maintenance rows could exist for the same vehicle, which could update unintended rows. Microsoft's trigger documentation explains that inserted and deleted are used to work with the affected rows and that multi-row logic should be based on proper key matching.
The WHERE m.LastModifiedUtc < > i.LastModifiedUtc predicate is used to prevent the trigger from re- updating rows where the timestamp already matches the value in inserted. That reduces redundant writes and supports the requirement to avoid recursive or repeated update behavior. In practice, this means the trigger updates only rows whose current stored timestamp differs from the just-updated version. This is the exam- appropriate pattern for a self-updating timestamp column in an AFTER UPDATE trigger.

by Jack at Aug 27, 2026, 06:30 PM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
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.

0
0
0
10