SOL-C01 · Question #17
SOL-C01 Question #17: Real Exam Question with Answer & Explanation
The correct answer is B: CREATE TABLE TEST ORDERS AS SELECT FROM CUSTOMER ORDERS WHERE 1=0;. Option B, 'CREATE TABLE TEST_ORDERS AS SELECT FROM CUSTOMER_ORDERS WHERE 1=0;' , creates a new table TEST_ORDERS' with the same schema as but without any data, as the 'WHERE condition ensures no rows are selected. Option A works but Snowflake recommends cloning for metadata copyi
Question
You have a table named 'CUSTOMER ORDERS' with columns 'ORDER ID', 'CUSTOMER ID', and 'ORDER DATE'. You want to create a clone of this table for testing purposes, ensuring the cloned table contains only the schema definition and no data. Which of the following commands achieves this?
Options
- ACREATE TABLE TEST ORDERS LIKE CUSTOMER ORDERS;
- BCREATE TABLE TEST ORDERS AS SELECT FROM CUSTOMER ORDERS WHERE 1=0;
- CCREATE TABLE TEST ORDERS CLONE CUSTOMER ORDERS;
- DCREATE TABLE TEST ORDERS LIKE CUSTOMER ORDERS DATA ONLY;
- ECREATE TABLE TEST ORDERS CLONE CUSTOMER ORDERS WHERE 1=0;
Explanation
Option B, 'CREATE TABLE TEST_ORDERS AS SELECT FROM CUSTOMER_ORDERS WHERE 1=0;' , creates a new table TEST_ORDERS' with the same schema as but without any data, as the 'WHERE condition ensures no rows are selected. Option A works but Snowflake recommends cloning for metadata copying. Option C copies both schema and data. There is no such thing like 'DATA ONLY option D. Option E is syntactically incorrect.
Topics
Community Discussion
No community discussion yet for this question.