311 operators must filter requests whose JSON payload contains a specific tag value. Which JSON function should they use in the predicate?
Select an answer to reveal the explanation.
Short Explanation
You can use JSON_CONTAINS as a tag detector: it checks whether the request payload includes the specified value, so matching requests pass your filter. Rebuilding payloads, injecting defaults, or assigning sequence numbers won’t search the JSON document for that tag.
Full Explanation
When you filter 311 requests by a tag inside a JSON payload, JSON_CONTAINS is the appropriate predicate: it tests whether the payload includes the specified tag value, allowing a WHERE clause to retain matching requests. JSON_OBJECT constructs a JSON object, but rebuilding every payload does not determine whether it contains the tag; a containment test would still be needed. A DEFAULT constraint supplies a value when data is inserted under the relevant conditions, but it does not inspect existing payload contents during filtering. A SEQUENCE assigns ordinal numbers; those numbers do not search JSON documents or establish whether a payload contains a particular tag. Exam caveat: containment depends on the JSON path and value type, so distinguish checking for a value at a specified path from checking for a key or a value elsewhere in the document. As a practical check, test the predicate against one request whose payload contains the specified tag and one whose payload does not, and confirm that only the matching request is returned.