we can create the same name table in Snowflake database.
we create permanent table, temporary table in same database, But when we query the table temporary table takes priority.
create permanent table in public schema in SALES_DB
CREATE TABLE CUSTOMERS
(
ID INT,
NAME STRING,
CITY STRING
);
create temporary table in public schema in SALES_DB
CREATE temporary TABLE CUSTOMERS
(
ID INT,
NAME STRING,
CITY STRING
);
insert some records into temporary table ,when you not mention the schema name by default it will insert to temporary table
select count(*) from public.CUSTOMERS; --0 records --permanent table
select count(*) from CUSTOMERS; --3 temp records
we can conclude that temporary table will take the precedence or priority when we use same name table in Snowflake database.
No comments:
Post a Comment