0
0
Snowflakecloud~10 mins

Data classification and tagging in Snowflake - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Data classification and tagging
Start: Data arrives
Identify data type
Assign classification label
Apply tags/metadata
Store data with tags
Use tags for access control, search, and governance
End
Data is first identified by type, then labeled with classification and tagged with metadata before storage, enabling governance and access control.
Execution Sample
Snowflake
CREATE TAG IF NOT EXISTS classification;

CREATE OR REPLACE TABLE customer_data (
  id INT,
  name STRING,
  email STRING
);

ALTER TABLE customer_data SET TAG classification = 'confidential';
Creates a table and applies a classification tag to it.
Process Table
StepActionObjectTag/Classification AppliedResult
1Create tablecustomer_dataNoneTable created with columns id, name, email
2Apply tagcustomer_dataclassification = 'confidential'Tag applied successfully
3Query tagscustomer_dataclassificationReturns 'confidential'
4Use tag for access controlcustomer_dataclassification = 'confidential'Access restricted to authorized users
5ExitN/AN/AProcess complete
💡 All steps completed; data classified and tagged for governance
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
customer_data tableNot createdCreated with columnsTagged as confidentialTag confirmedReady for controlled access
Key Moments - 2 Insights
Why do we apply tags after creating the table and not before?
Tags are metadata applied to existing objects; as shown in execution_table step 2, the table must exist before tags can be assigned.
How does tagging affect data access?
As in step 4, tags like 'confidential' can be used to enforce access control policies, restricting who can see the data.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what tag is applied to the customer_data table at step 2?
Aclassification = 'public'
Bclassification = 'internal'
Cclassification = 'confidential'
Dclassification = 'restricted'
💡 Hint
Check the 'Tag/Classification Applied' column at step 2 in the execution_table.
At which step is the table confirmed to have the classification tag?
AStep 3
BStep 2
CStep 1
DStep 4
💡 Hint
Look for the step where tags are queried and confirmed in the execution_table.
If the tag 'classification = confidential' was not applied, what would change in the execution table?
AStep 2 would show 'Tag applied successfully'
BStep 4 would not restrict access based on classification
CStep 3 would return 'confidential'
DStep 1 would fail to create the table
💡 Hint
Consider how tags affect access control as shown in step 4.
Concept Snapshot
Data classification and tagging in Snowflake:
- Create data objects (tables, views)
- Apply tags as metadata (e.g., classification='confidential')
- Use tags for governance and access control
- Tags help organize and protect data
- Tags are applied after object creation
Full Transcript
Data classification and tagging is a process where data objects like tables are first created, then labeled with classification tags such as 'confidential'. These tags are metadata that help manage data access and governance. In Snowflake, you create a table, then apply tags using ALTER TABLE commands. Tags can be queried to confirm their presence and used to enforce access controls. This process ensures data is properly organized and protected according to its sensitivity.