Skip to main content
๐Ÿ“˜ Complete PDF

Snowflake Certification Practice Test 06

Practice Test 06

Question 1 of 20
๐Ÿ“‹ Multiple Choice
Question 81
A newly joined Data Engineer at a global banking company is assigned to a project containing customer account information. The compliance team has identified that account numbers, PAN numbers, and national identifiers should only be visible in plain text to authorized compliance officers. Business analysts should still be able to query the table for counts and joins but must not see the actual sensitive values. What Snowflake feature should the engineer implement?
A. Virtual Warehouse Auto-Scaling
โœ“
B. Dynamic Data Masking Policy
C. Materialized View Precomputation
D. Snowpipe Streaming Ingestion
Answer
โœ… B. Dynamic Data Masking Policy
Explanation

1. Concept Overview / Core Concept / Direct Confirmation Dynamic Data Masking (DDM) is a column-level security feature that applies masking expressions to column data at query execution time based on the querying user's active role, without altering the underlying data stored on disk.

2. Why This Answer Is Correct / Detailed Breakdown With Dynamic Data Masking, a masking policy is created using SQL and assigned to columns like `account_number`. When an authorized user with the `COMPLIANCE_OFFICER` role queries the table, they see the raw plaintext values. When an analyst queries the table, Snowflake dynamically evaluates the policy and returns redacted values (e.g. `'*********1234'`), preserving joinability or aggregate counts while guaranteeing privacy.

3. Why Other Options Are Incorrect / Distractor Analysis - **A. Warehouse Auto-Scaling:** Auto-scaling adds compute clusters to absorb concurrent query queues; it provides zero data security or obfuscation. - **C. Materialized View:** Materialized views precompute query results; they do not dynamically mask sensitive column values by role. - **D. Snowpipe Streaming:** Snowpipe is an automated data loading service; it has no relation to role-based column data obfuscation.

4. Architectural & Execution Context / Physical Execution Dynamic Data Masking is evaluated in the Cloud Services layer during query compilation. Snowflake rewrites the query execution plan to inject conditional masking functions (e.g. `CASE WHEN CURRENT_ROLE() IN (...) THEN val ELSE ... END`) before worker nodes fetch micro-partitions.

5. Practical Code Example

-- Creating a reusable Dynamic Data Masking Policy
CREATE OR REPLACE MASKING POLICY mask_bank_account AS (val STRING) 
RETURNS STRING ->
CASE
    WHEN CURRENT_ROLE() IN ('COMPLIANCE_OFFICER', 'ACCOUNTADMIN') THEN val
    ELSE CONCAT('****-****-', RIGHT(val, 4))
END;

-- Applying the masking policy to the sensitive column
ALTER TABLE customer_banking_info 
MODIFY COLUMN account_number SET MASKING POLICY mask_bank_account;

6. Key Takeaway Dynamic Data Masking obscures sensitive column data in place at query runtime based on the caller's role without duplicating tables.

7. Best Practice & Production Recommendation Use `CURRENT_ROLE()` or entitlement mapping tables in masking policy bodies, and apply policies via object tags (Tag-Based Masking) to ensure automatic protection across all tables.

8. Real-World Engineering Scenario A fintech bank needed 50 data scientists to analyze credit card fraud patterns without seeing raw card numbers. A masking policy redacting all but the last 4 digits allowed model training to proceed without exposing full PANs.

9. Common Exam Trap / Anti-Pattern / Misconception Masking policies do not prevent users with write permissions from overwriting or updating data; they only govern SELECT query projections.

10. Related InsightfulSaga Tutorial Master these concepts in [Snowflake Governance and Access Control](/tutorials/snowflake/snowflake-dynamic-data-masking-use-cases).

Answered: 0 / 20
Question Navigator (Test 06)0% Answered