SnowPro Core Certification — Question 828
A permanent table and temporary table have the same name, TBL1, in a schema.
What will happen if a user executes select * from TBL1;?
Answer options
- A. The temporary table will take precedence over the permanent table.
- B. The permanent table will take precedence over the temporary table.
- C. An error will say there cannot be two tables with the same name in a schema.
- D. The table that was created most recently will take precedence over the older table.
Correct answer: A
Explanation
When executing select * from TBL1, the database will prioritize the temporary table over the permanent one due to its scope and lifecycle. Permanent tables are generally overshadowed by temporary tables within the same session or transaction. The other options are incorrect as they misinterpret how table precedence is determined in this context.