SOL-C01 · Question #54
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 t
The correct answer is D. CREATE TEMP TABLE AS SELECT FROM existing_table;. CREATE TEMP TABLE (option D) is the correct Snowflake syntax for creating a session-scoped temporary table - it is automatically dropped when the session ends and is invisible to other sessions, which matches all the stated requirements exactly. Why the distractors fail: A (CREAT
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;
How the community answered
(53 responses)- C4% (2)
- D94% (50)
- E2% (1)
Explanation
CREATE TEMP TABLE (option D) is the correct Snowflake syntax for creating a session-scoped temporary table - it is automatically dropped when the session ends and is invisible to other sessions, which matches all the stated requirements exactly.
Why the distractors fail:
- A (
CREATE TABLE) creates a permanent table that persists beyond the session and is visible to all users with access - the opposite of temporary. - B (
CREATE GLOBAL TEMPORARY TABLE) is not valid Snowflake syntax; "global" temporary tables (shared across sessions) exist in other databases like Oracle but not in Snowflake. - C (
CREATE LOCAL TEMPORARY TABLE) is also not valid Snowflake syntax; Snowflake usesTEMPorTEMPORARY, not theLOCAL TEMPORARYphrasing from standard SQL. - E (
CREATE VOLATILE TABLE) is Teradata syntax, not Snowflake - a classic cross-platform trap on certification exams.
Memory tip: In Snowflake, think "TEMP = Temporary and Private." If you see GLOBAL, LOCAL, or VOLATILE, those are signals you've left Snowflake's dialect - only TEMP or TEMPORARY are home.
Topics
Community Discussion
No community discussion yet for this question.