What happens to foreign key constraints when a table is cloned to another database?
What happens to foreign key constraints when a table is cloned to another database?
I changed my mind: https://docs.snowflake.com/en/user-guide/object-clone Cloning and foreign key constraints A table can have a foreign key constraint that references a table that includes the primary key. When a table with a foreign key constraint is cloned, the cloned table references the source or cloned table that includes the primary key: If the database or schema containing both tables is cloned, the cloned table with the foreign key references the primary key in the other cloned table. If the tables are in separate databases or schemas, the cloned table references the primary key in the source table. Hence, the answer is B, since the question does not mention that the both tables are cloned, within the same cloned database.
If the database or schema containing both tables is cloned, the cloned table with the foreign key references the primary key in the other cloned table. If the tables are in separate databases or schemas, the cloned table references the primary key in the source table.
Master data is lost when cloning, except the micro-partitioning of the source table. But, the question is about foreign key. hence, even if the C is correct, the real answer is D.
Cloning and foreign key constraints A table can have a foreign key constraint that references a table that includes the primary key. When a table with a foreign key constraint is cloned, the cloned table references the source or cloned table that includes the primary key: If the database or schema containing both tables is cloned, the cloned table with the foreign key references the primary key in the other cloned table. If the tables are in separate databases or schemas, the cloned table references the primary key in the source table. https://docs.snowflake.com/en/user-guide/object-clone