You are loading data from a JSON file into a Snowflake table named 'ORDERS'. The JSON file contains nested arrays and objects. You need to extract specific fields from within these nested structures and load them into corresponding columns in the 'ORDERS' table. The 'ORDERS' table has columns: 'order_id' (VARCHAR), 'customer name' (VARCHAR), 'order_date' (DATE), and 'total_amount' (NUMBER). The JSON structure is as follows:

Which of the following COPY INTO statements correctly extracts the data from the JSON file and loads it into the `ORDERS table?
Correct Answer: E
Option E is the correct solution. It uses a SELECT statement within the COPY INTO statement to extract the nested JSON fields. '$1' refers to the entire JSON document. The syntax extracts the value of the `orderld' field. The , and :NUMBER casts ensure that the data types are correctly converted to match the table schema. Options A does not extract any data it only load the data into the target column but as the target column require extracted data, so it will be incorrect .Option B lacks the necessary data type casting. Option C includes a separate SELECT statement, which is not part of the COPY INTO operation and therefore will not load the data.
Option D has an incorrect syntax for the 'FROM' clause within the 'COPY INTO' statement.