Bird
Raised Fist0
Snowflakecloud~10 mins

Data classification and tagging in Snowflake - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a tag named 'Confidentiality'.

Snowflake
CREATE TAG [1];
Drag options to blanks, or click blank then click option'
AConfidentiality
BDataClassification
CSecurityLevel
DAccessControl
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces or special characters in the tag name.
Forgetting to use CREATE TAG command.
2fill in blank
medium

Complete the code to assign the tag 'Confidentiality' with value 'High' to the table 'CustomerData'.

Snowflake
ALTER TABLE CustomerData SET TAG [1] = 'High';
Drag options to blanks, or click blank then click option'
ASecurityLevel
BConfidentiality
CDataSensitivity
DAccessLevel
Attempts:
3 left
💡 Hint
Common Mistakes
Using a tag name that was not created.
Incorrect syntax for setting a tag.
3fill in blank
hard

Fix the error in the code to correctly assign the tag 'Confidentiality' with value 'Medium' to the column 'email' in table 'Users'.

Snowflake
ALTER TABLE Users ALTER COLUMN email SET TAG [1] = 'Medium';
Drag options to blanks, or click blank then click option'
ASecurityTag
BDataClassification
CPrivacyLevel
DConfidentiality
Attempts:
3 left
💡 Hint
Common Mistakes
Using a tag name that does not exist.
Incorrect ALTER COLUMN syntax.
4fill in blank
hard

Fill both blanks to create a tag named 'RetentionPeriod' and assign it the value '7 years' on the table 'Orders'.

Snowflake
CREATE TAG [1];
ALTER TABLE Orders SET TAG [2] = '7 years';
Drag options to blanks, or click blank then click option'
ARetentionPeriod
BDataRetention
DOrderRetention
Attempts:
3 left
💡 Hint
Common Mistakes
Using different tag names in creation and assignment.
Misspelling the tag name.
5fill in blank
hard

Fill all three blanks to assign tags 'Confidentiality' with value 'Low', 'RetentionPeriod' with value '3 years', and 'Owner' with value 'FinanceTeam' to the table 'Invoices'.

Snowflake
ALTER TABLE Invoices SET TAG [1] = 'Low';
ALTER TABLE Invoices SET TAG [2] = '3 years';
ALTER TABLE Invoices SET TAG [3] = 'FinanceTeam';
Drag options to blanks, or click blank then click option'
AConfidentiality
BRetentionPeriod
COwner
DAccessLevel
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up tag names and values.
Using tag names that were not created.

Practice

(1/5)
1. What is the main purpose of data classification and tagging in Snowflake?
easy
A. To speed up query performance by indexing data
B. To convert data into different file formats
C. To automatically delete old data after a set time
D. To organize and protect data by labeling it with tags

Solution

  1. Step 1: Understand data classification and tagging

    Data classification and tagging help label data to organize and protect it.
  2. Step 2: Identify the purpose in Snowflake context

    Tags are used to mark data for governance and security, not for performance or deletion.
  3. Final Answer:

    To organize and protect data by labeling it with tags -> Option D
  4. Quick Check:

    Data classification = Organize and protect data [OK]
Hint: Tags label data to organize and protect it [OK]
Common Mistakes:
  • Confusing tagging with indexing for performance
  • Thinking tags delete data automatically
  • Assuming tags change data format
2. Which of the following is the correct syntax to create a tag in Snowflake?
easy
A. CREATE TAG tag_name COMMENT = 'description';
B. CREATE TAG tag_name WITH 'description';
C. MAKE TAG tag_name COMMENT 'description';
D. NEW TAG tag_name SET COMMENT = 'description';

Solution

  1. Step 1: Recall Snowflake tag creation syntax

    The correct syntax uses CREATE TAG followed by the tag name and COMMENT clause.
  2. Step 2: Compare options with syntax

    Only CREATE TAG tag_name COMMENT = 'description'; matches the correct syntax: CREATE TAG tag_name COMMENT = 'description';
  3. Final Answer:

    CREATE TAG tag_name COMMENT = 'description'; -> Option A
  4. Quick Check:

    CREATE TAG ... COMMENT = ... is correct syntax [OK]
Hint: Use CREATE TAG with COMMENT = 'text' [OK]
Common Mistakes:
  • Using MAKE or NEW instead of CREATE
  • Missing equal sign in COMMENT clause
  • Using WITH instead of COMMENT
3. Given the following commands, what will be the result of querying the tags on the customers table?
CREATE TAG pii COMMENT = 'Personally Identifiable Information';
ALTER TABLE customers SET TAG pii = 'true';
SHOW TAGS ON TABLE customers;
medium
A. It will show the tag 'pii' with value 'true' assigned to the customers table
B. It will show an error because tags cannot be set on tables
C. It will show the tag 'pii' but with no value assigned
D. It will show no tags because SHOW TAGS is invalid syntax

Solution

  1. Step 1: Understand tag creation and assignment

    The tag 'pii' is created and then assigned to the 'customers' table with value 'true'.
  2. Step 2: Check SHOW TAGS syntax and output

    SHOW TAGS ON TABLE customers; lists tags assigned to the table, showing 'pii' = 'true'.
  3. Final Answer:

    It will show the tag 'pii' with value 'true' assigned to the customers table -> Option A
  4. Quick Check:

    SHOW TAGS ON TABLE shows assigned tags [OK]
Hint: SHOW TAGS ON TABLE lists assigned tags and values [OK]
Common Mistakes:
  • Thinking tags cannot be assigned to tables
  • Assuming SHOW TAGS syntax is invalid
  • Expecting tags without values to appear
4. You run the following command but get an error:
ALTER TABLE orders SET TAG sensitive = 'yes';

What is the most likely cause of the error?
medium
A. ALTER TABLE cannot be used to set tags
B. The value 'yes' is not allowed for tags
C. The tag 'sensitive' was not created before assigning it
D. Tags can only be assigned to columns, not tables

Solution

  1. Step 1: Check if tag exists before assignment

    Tags must be created with CREATE TAG before assigning to tables or columns.
  2. Step 2: Analyze error cause

    If 'sensitive' tag was not created, assigning it causes an error.
  3. Final Answer:

    The tag 'sensitive' was not created before assigning it -> Option C
  4. Quick Check:

    Tags must exist before assignment [OK]
Hint: Create tags before assigning them [OK]
Common Mistakes:
  • Assuming any value is invalid
  • Thinking ALTER TABLE can't set tags
  • Believing tags only apply to columns
5. You want to classify columns in a payments table as either 'confidential' or 'public' using tags. Which approach correctly applies tags to columns and supports data governance?
hard
A. Create tags and assign them to database schemas instead of columns
B. Create tags 'confidential' and 'public', then assign them to each column with ALTER TABLE ... ALTER COLUMN ... SET TAG
C. Use column comments instead of tags to classify data sensitivity
D. Create tags and assign them only to the table, not columns, to simplify management

Solution

  1. Step 1: Understand tagging granularity

    Tags can be assigned to columns to classify data precisely, supporting governance.
  2. Step 2: Identify correct tagging method

    Using ALTER TABLE ... ALTER COLUMN ... SET TAG applies tags to columns, enabling classification.
  3. Final Answer:

    Create tags 'confidential' and 'public', then assign them to each column with ALTER TABLE ... ALTER COLUMN ... SET TAG -> Option B
  4. Quick Check:

    Column-level tags enable precise data classification [OK]
Hint: Tag columns directly for precise classification [OK]
Common Mistakes:
  • Tagging only tables loses column-level detail
  • Using comments instead of tags for governance
  • Assigning tags to schemas instead of columns
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard