nerdexam
Snowflake

COF-C02 · Question #309

A permanent table and temporary table have the same name, TBL1, in a schema. What will happen if a user executes select * from TBL1 ;?

The correct answer is A. The temporary table will take precedence over the permanent table. In Snowflake, temporary tables are session-scoped and take name precedence over permanent tables within the same session. If a temporary table (TBL1) and a permanent table (TBL1) share the same name in the same schema, any query referencing TBL1 in that session will resolve to…

Snowflake Cloud Data Platform Features and Architecture

Question

A permanent table and temporary table have the same name, TBL1, in a schema. What will happen if a user executes select * from TBL1 ;?

Options

  • AThe temporary table will take precedence over the permanent table.
  • BThe permanent table will take precedence over the temporary table.
  • CAn error will say there cannot be two tables with the same name in a schema.
  • DThe table that was created most recently will take precedence over the older table.

How the community answered

(47 responses)
  • A
    91% (43)
  • B
    2% (1)
  • C
    2% (1)
  • D
    4% (2)

Explanation

In Snowflake, temporary tables are session-scoped and take name precedence over permanent tables within the same session. If a temporary table (TBL1) and a permanent table (TBL1) share the same name in the same schema, any query referencing TBL1 in that session will resolve to the temporary table. This is by design - Snowflake resolves name conflicts in this priority order: temporary > transient > permanent. No error is thrown. Once the session ends and the temporary table is dropped, queries will again resolve to the permanent table.

Topics

#Temporary Tables#Table Types#Name Resolution#Schema Objects

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice