COF-C02 · Question #369
A tag object has been assigned to a table (TABLE_A) in a schema within a Snowflake database. Which CREATE object statement will automatically assign the TABLE_A tag to a target object?
The correct answer is C. CREATE TABLE <table_name> AS SELECT * FROM TABLE_A. In Snowflake, tag lineage is propagated through CTAS (CREATE TABLE AS SELECT). When a new table is created by selecting from a source table (TABLE_A) that has a tag assigned, the new table automatically inherits that tag. CREATE TABLE ... LIKE copies the structure but not tags…
Question
A tag object has been assigned to a table (TABLE_A) in a schema within a Snowflake database. Which CREATE object statement will automatically assign the TABLE_A tag to a target object?
Options
- ACREATE TABLE <table_name> LIKE TABLE_A;
- BCREATE VIEW <view_name> AS SELECT * FROM TABLE_A;
- CCREATE TABLE <table_name> AS SELECT * FROM TABLE_A;
- DCREATE MATERIALIZED VIEW <view name> AS SELECT * FROM TABLE A;
How the community answered
(51 responses)- A6% (3)
- B4% (2)
- C88% (45)
- D2% (1)
Explanation
In Snowflake, tag lineage is propagated through CTAS (CREATE TABLE AS SELECT). When a new table is created by selecting from a source table (TABLE_A) that has a tag assigned, the new table automatically inherits that tag. CREATE TABLE ... LIKE copies the structure but not tags. CREATE VIEW and CREATE MATERIALIZED VIEW do not inherit tags from the source table in this manner. Only CTAS triggers automatic tag propagation from the source to the new object.
Topics
Community Discussion
No community discussion yet for this question.