SOL-C01 · Question #54
SOL-C01 Question #54: Real Exam Question with Answer & Explanation
The correct answer is D: CREATE TEMP TABLE AS SELECT FROM existing_table;. The 'CREATE TEMP TABLE statement is the correct way to create a temporary table in Snowflake that is only visible within the current session and is automatically dropped when the session ends. 'GLOBAL TEMPORARY TABLE' and 'LOCAL TEMPORARY TABLE' are not valid Snowflake syntax. 'C
Question
A data scientist needs to create a temporary table in Snowflake to perform some data analysis. The table should only be accessible within their current session and should be automatically dropped at the end of the session. Which of the following SQL statements is the CORRECT way to create such a table?
Options
- ACREATE TABLE AS SELECT FROM existing_table;
- BCREATE GLOBAL TEMPORARY TABLE AS SELECT FROM existing_table;
- CCREATE LOCAL TEMPORARY TABLE AS SELECT FROM existing_table;
- DCREATE TEMP TABLE AS SELECT FROM existing_table;
- ECREATE VOLATILE TABLE AS SELECT FROM existing_table;
Explanation
The 'CREATE TEMP TABLE statement is the correct way to create a temporary table in Snowflake that is only visible within the current session and is automatically dropped when the session ends. 'GLOBAL TEMPORARY TABLE' and 'LOCAL TEMPORARY TABLE' are not valid Snowflake syntax. 'CREATE TABLE without 'TEMP' creates a permanent table. 'VOLATILE applies to functions, not tables.
Topics
Community Discussion
No community discussion yet for this question.