Question 780
A subscription report measures days between successive customer events without self-joining every row. The team implemented this change: Compute LEAD over customer events with a stable tie-break and date difference. Which result would best confirm the change worked?
Explanation
Correct Answer
Sample intervals match hand-calculated timeline and last rows remain defined. LEAD accesses a next ordered row in a window partition. LEAD does not invent a next event for the last row in each partition.
Incorrect Answers
LEAD must partition events by customer. Cross-customer pairing produces invalid subscription intervals.
Tied timestamps need a deterministic order for expected subscription intervals. Test duplicate-time fixtures.
LEAD does not cross customer partitions. The last event's next value is NULL unless an explicit default is supplied.