SOL-C01 · Question #124
A Snowflake table named 'ORDERS' contains columns: ORDER ID (NUMBERY, CUSTOMER ID (NUMBERY, 'ORDER DATE (DATE), and ORDER DETAILS (VARIANT)'. The 'ORDER DETAILS column stores JSON data. You need to in
Sign in or unlock SOL-C01 to reveal the answer and full explanation for question #124. The question stem and answer options stay visible for context.
Question
A Snowflake table named 'ORDERS' contains columns: ORDER ID (NUMBERY, CUSTOMER ID (NUMBERY, 'ORDER DATE (DATE), and ORDER DETAILS (VARIANT)'. The 'ORDER DETAILS column stores JSON data. You need to insert data into this table from a CSV file. However, the CSV file only contains data for 'ORDER ICY, CUSTOMER ICY, and 'ORDER DATE. The 'ORDER DETAILS' column should be populated with a default JSON object containing a status of 'PENDING' for all new orders. Which SQL INSERT statement is the most efficient and correct way to achieve this? A. B. C. D. E.
Options
- AINSERT INTO ORDERS (ORDER_ID, CUSTOMER_ID, ORDER_DATE, ORDER_DETAILS) SELECT ORDER_ID, CUSTOMER_ID, ORDER_DATE, {'status': 'PENDING'} FROM @my_stage/orders.csv (FILE_FORMAT => 'my_csv_format');
- BINSERT INTO ORDERS (ORDER_ID, CUSTOMER_ID, ORDER_DATE, ORDER_DETAILS) SELECT $1, $2, $3, PARSE_JSON('{"status": "PENDING"}') FROM @my_stage/orders.csv (FILE_FORMAT => 'my_csv_format');
- CINSERT INTO ORDERS (ORDER_ID, CUSTOMER_ID, ORDER_DATE) SELECT $1, $2, $3 FROM @my_stage/orders.csv (FILE_FORMAT => 'my_csv_format');
- DINSERT INTO ORDERS SELECT $1, $2, $3, '{"status": "PENDING"}' FROM @my_stage/orders.csv (FILE_FORMAT => 'my_csv_format');
Unlock SOL-C01 to see the answer
You've previewed enough free SOL-C01 questions. Unlock SOL-C01 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.