1Z0-909 · Question #17
Examine this statement and output: You execute this statement: SELECT JSON_SEARCH(product,'one','IT') FROM fshop ; What is the output?
The correct answer is A. product->''$.varieties [4]. origin[1]. JSON_SEARCH(product, 'one', 'IT') returns the path to the first match of the string 'IT' within the JSON column, and option A correctly represents that result using the -> extraction operator syntax with the $ root symbol and the accurate path indices $.varieties[4].origin[1]…
Question
Examine this statement and output:
You execute this statement:
SELECT JSON_SEARCH(product,'one','IT') FROM fshop ; What is the output?
Exhibit
Options
- Aproduct->''$.varieties [4]. origin[1];;
- B''$.varieties[4]. origin[1]''
- Cproduct->varieties[3]. origin[0]''
- D''$.varieties [3]. origin[0]''
How the community answered
(31 responses)- A81% (25)
- B3% (1)
- C10% (3)
- D6% (2)
Explanation
JSON_SEARCH(product, 'one', 'IT') returns the path to the first match of the string 'IT' within the JSON column, and option A correctly represents that result using the -> extraction operator syntax with the $ root symbol and the accurate path indices $.varieties[4].origin[1].
Option B is wrong because it omits the product-> column reference prefix that contextualizes the path output. Option C is wrong on two counts: it drops the required $ root symbol from the path AND uses incorrect indices ([3] and origin[0]). Option D uses the wrong array indices ([3].origin[0] instead of [4].origin[1]), meaning it points to the wrong element entirely.
Memory tip: Think of JSON_SEARCH as a GPS - it returns the full address (column → $ → path), so the output must start with the column reference and $. If an answer is missing either piece, eliminate it.
Topics
Community Discussion
No community discussion yet for this question.
