nerdexam
Oracle

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]…

JSON

Question

Examine this statement and output:

You execute this statement:

SELECT JSON_SEARCH(product,'one','IT') FROM fshop ; What is the output?

Exhibit

1Z0-909 question #17 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)
  • A
    81% (25)
  • B
    3% (1)
  • C
    10% (3)
  • D
    6% (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

#JSON_SEARCH#JSON paths#JSONPath notation#JSON return types

Community Discussion

No community discussion yet for this question.

Full 1Z0-909 Practice