Question 190
A reporting tool must compare the current purchase against the customer's immediately preceding purchase. Which result distinguishes a successful implementation from a cosmetic change?
Explanation
Correct Answer
LAG reads a preceding row within a partition without a self-join for each row. The observation “Each row displays the correct preceding value, and first rows produce the specified default” directly confirms the chosen action worked for this situation: A reporting tool must compare the current purchase against the customer's immediately preceding purchase.
Incorrect Answers
JSON_VALUE extracts scalar content; JSON_QUERY targets JSON objects or arrays. This observation would not establish that the required result occurred for A reporting tool must compare the current purchase against the customer's immediately preceding purchase. The confirming test is: Each row displays the correct preceding value, and first rows produce the specified default.
Window aggregates calculate across partitions without reducing the number of input rows. This observation would not establish that the required result occurred for A reporting tool must compare the current purchase against the customer's immediately preceding purchase. The confirming test is: Each row displays the correct preceding value, and first rows produce the specified default.
CHECK constraints enforce domain predicates within the database on all supported write paths. This observation would not establish that the required result occurred for A reporting tool must compare the current purchase against the customer's immediately preceding purchase. The confirming test is: Each row displays the correct preceding value, and first rows produce the specified default.