Exam4Training

You have a table named JSON_TBL which has a variant column JSON_VAR. The json stored in that table looks as below

You have a table named JSON_TBL which has a variant column JSON_VAR. The json stored in that table looks as below

{

"COURSE_DESC": "SNOWFLAKE CERTIFICATION",

"COURSE_ID": 1000,

"DURATION": 2

}

if you run a query SELECT JSON_VAR:Course_id FROM JSON_TBL; what will it return
A . NULL
B. 1000
C. 2

Answer: A

Explanation:

Try it yourself

CREATE OR REPLACE TABLE JSON_TBL (JSON_VAR VARIANT);

INSERT INTO JSON_TBL SELECT PARSE_JSON($${‘COURSE_ID’:1000, ‘COURSE_DESC’:’SNOWFLAKE

CERTIFICATION’,’DURATION’:2}$$);

select * from JSON_TBL;

SELECT JSON_VAR:Course_id FROM JSON_TBL;

What do you see?

Further Explanation:

There are two ways to access elements in a JSON object:

Dot Notation

Bracket Notation

Regardless of which notation you use, the column name is case-insensitive but element names are

case-sensitive. For example, in the following list, the first two paths are equivalent, but the third is not:

src:salesperson.name

SRC:salesperson.name

SRC:Salesperson.Name

Latest ARA-C01 Dumps Valid Version with 156 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version