Before you beginSet up the Maple Market governance lab
What a tag stores and why the value matters
An object tag is a named label with a string value, such as DATA_OWNER = commerce. Instead of guessing who manages every table from its name, Maple Market can search the metadata and find the responsible team. A sensitivity tag helps find fields for protection. A cost-center tag on a warehouse can help report shared compute usage with metering data. Tagging an order table alone does not divide warehouse credits among users.
Use allowed values for labels that drive reports or controls. A controlled list keeps commerce, Commerce and sales_ops from becoming three accidental teams. Document who can change the vocabulary. Tags are metadata, so avoid putting names, actual email addresses or account numbers in tag values or comments.
Create allowed values and apply tags at four levels
Run this against the lab setup as M18_OWNER. CREATE TAG defines the label and its permitted values in the GOV schema. SET TAG attaches a value. For a column, MODIFY COLUMN names the exact field. The lab owner controls the tags and affected objects. In a shared environment, delegate CREATE TAG on the schema to the tag creator. A tag administrator can use account-level APPLY TAG. A delegated object owner can use APPLY on the specific tag.
CORE overrides the database owner label. EMPLOYEES overrides it again. The CUSTOMER EMAIL label is a separate sensitivity decision. An unlisted value such as secret should fail. Use ALTER TAG ... ADD ALLOWED_VALUES only after the owners agree, or choose a valid existing value.
USE ROLE M18_OWNER;
CREATE TAG LS_M18_GOV_LAB.GOV.DATA_OWNER
ALLOWED_VALUES 'commerce', 'people', 'finance', 'operations';
CREATE TAG LS_M18_GOV_LAB.GOV.SENSITIVITY
ALLOWED_VALUES 'public', 'internal', 'restricted';
GRANT APPLY ON TAG LS_M18_GOV_LAB.GOV.DATA_OWNER TO ROLE M18_OWNER;
GRANT APPLY ON TAG LS_M18_GOV_LAB.GOV.SENSITIVITY TO ROLE M18_OWNER;
ALTER DATABASE LS_M18_GOV_LAB
SET TAG LS_M18_GOV_LAB.GOV.DATA_OWNER = 'operations';
ALTER SCHEMA LS_M18_GOV_LAB.CORE
SET TAG LS_M18_GOV_LAB.GOV.DATA_OWNER = 'commerce';
ALTER TABLE LS_M18_GOV_LAB.CORE.EMPLOYEES
SET TAG LS_M18_GOV_LAB.GOV.DATA_OWNER = 'people';
ALTER TABLE LS_M18_GOV_LAB.CORE.CUSTOMERS
MODIFY COLUMN EMAIL SET TAG LS_M18_GOV_LAB.GOV.SENSITIVITY = 'restricted';Find effective tag values and how they were applied
Run the Information Schema query as the object owner. It inspects every column of the named object, including inherited values. FILTER by tag database and schema to avoid matching another team’s identically named tag. Run it after creating the tags and before applying extra inventory labels.
For a table-level check use SYSTEM$GET_TAG with the fully qualified tag, the object and its domain. For account-wide inventory use SNOWFLAKE.ACCOUNT_USAGE.TAG_REFERENCES with an approved role. Compare like scopes because the account view does not list inherited associations and may lag. Use the Information Schema function for this lab’s effective column labels.
| COLUMN_NAME | TAG_NAME | TAG_VALUE | APPLY_METHOD |
|---|---|---|---|
| CUSTOMER_ID | DATA_OWNER | commerce | INHERITED |
| DATA_OWNER | commerce | INHERITED | |
| SENSITIVITY | restricted | MANUAL |
SELECT COLUMN_NAME, TAG_NAME, TAG_VALUE, APPLY_METHOD
FROM TABLE(LS_M18_GOV_LAB.INFORMATION_SCHEMA.TAG_REFERENCES_ALL_COLUMNS(
'LS_M18_GOV_LAB.CORE.CUSTOMERS', 'TABLE'))
WHERE TAG_DATABASE = 'LS_M18_GOV_LAB'
AND TAG_SCHEMA = 'GOV'
AND COLUMN_NAME IN ('CUSTOMER_ID','EMAIL')
ORDER BY COLUMN_NAME, TAG_NAME;Look up an effective table owner
This returns people. The explicit table value takes precedence over commerce inherited from CORE.
SELECT SYSTEM$GET_TAG('LS_M18_GOV_LAB.GOV.DATA_OWNER',
'LS_M18_GOV_LAB.CORE.EMPLOYEES','TABLE') AS DATA_OWNER;Trace inheritance, dependencies and data movement
Inheritance follows where an object lives. A table sits in a schema, and its columns sit in that table. Propagation follows where data came from. A view can read a source table in another schema, and a new table can receive a copy of its rows. Enable propagation on a user-defined tag when the label needs to follow one of those relationships.
Dependency propagation keeps the supported target in sync with later source label changes. Data-movement propagation applies when operations such as CREATE TABLE AS SELECT move the data. It does not continuously sync the target after the move. System tags, inherited tags and tags read from a share do not automatically propagate. A tag explicitly assigned on a target can take precedence. If inputs disagree, define the conflict rule and verify what the target got.
- CORE schemaInherit the owner label to Source table
- Source tablePropagate on dependency to Dependent view
- Source tablePropagate on data movement to Copied table
- CORE schema
- Parent container.
- Source table
- Has an explicit data-flow tag.
- Dependent view
- Can track later source tag changes.
- Copied table
- Gets a tag at the supported move.
Test a tag on a view and a copied table
Automatic propagation requires Enterprise Edition or higher. Have an authorized administrator grant APPLY TAG ON ACCOUNT to the owner of this new demo tag, in the isolated account. There is no need to grant account-wide tagging to the consumer roles. If the grant is unavailable, read the expected result below and use the earlier manual lab.
Create two simple targets from the same tagged source. Change the source from internal to restricted. Use SYSTEM$GET_TAG with domain VIEW or TABLE. The view follows the update while the copy keeps the value it received at creation. Check again after propagation has settled. An inherited label would not propagate from the source at all.
| REPORT_TAG | SNAPSHOT_TAG |
|---|---|
| restricted | internal |
USE ROLE M18_OWNER;
USE SCHEMA LS_M18_GOV_LAB.GOV;
CREATE TAG DATA_FLOW ALLOWED_VALUES 'internal','restricted'
PROPAGATE = ON_DEPENDENCY_AND_DATA_MOVEMENT;
CREATE TABLE TAG_SOURCE (CODE NUMBER);
INSERT INTO TAG_SOURCE VALUES (1);
ALTER TABLE TAG_SOURCE SET TAG DATA_FLOW = 'internal';
CREATE VIEW TAG_REPORT AS SELECT CODE FROM TAG_SOURCE;
CREATE TABLE TAG_SNAPSHOT AS SELECT CODE FROM TAG_SOURCE;
ALTER TABLE TAG_SOURCE SET TAG DATA_FLOW = 'restricted';
SELECT SYSTEM$GET_TAG('LS_M18_GOV_LAB.GOV.DATA_FLOW',
'LS_M18_GOV_LAB.GOV.TAG_REPORT','VIEW') AS REPORT_TAG,
SYSTEM$GET_TAG('LS_M18_GOV_LAB.GOV.DATA_FLOW',
'LS_M18_GOV_LAB.GOV.TAG_SNAPSHOT','TABLE') AS SNAPSHOT_TAG;Interview practice
Explain the decision and the evidence you would use to test it.
What does a tag do?
It records metadata. A steward can search for restricted data or group ownership inventory. I attach a policy separately when the label must change access.
How do you tell an inherited tag from a direct tag?
I query TAG_REFERENCES_ALL_COLUMNS and inspect APPLY_METHOD alongside the effective value. I compare the source and target separately when investigating propagation.
How would you roll out tag-based protections safely?
I start with a small inventory and verify explicit, inherited and propagated values. Then I test a few columns under allowed and restricted roles before expanding scope. A schema-level tag can affect many columns that share a type.
Words used in this lesson
- Object tagging
- Attach a named label with a string value.
- Tag inheritance
- A child gets a label from its container.
- Tag propagation
- A source label is copied to a supported target.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Snowflake object tags, inheritance and automatic propagation
Two routes a Snowflake tag can take
The schema is a container. The view and copied table receive data from the source.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Two routes a Snowflake tag can take
The schema is a container. The view and copied table receive data from the source.
CORE schema → Source table → Dependent view → Copied table
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
All records are fictional. Outputs are expected or simulated. Live practice needs an authorized scratch account, test roles, an approved warehouse and the editions listed in the lesson.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
A reporting team wants to know whether a source change will update a copied table label. Which two objects do you check?
Compare your reasoning
Read the tag on the source and the copy before and after the change. A copy tagged during data movement keeps the value applied then.
Connect this lesson to the learning path
Official sources and curriculum
Module 18 · See module scope
By Rohit Ray · Independent educational lesson · Explore this visual lab