Module 18 · Lesson 1 of 10Detailed study · about 38 min

Snowflake data governance fundamentals and lab setup

Learn how data owners, stewards and engineers put privacy, access, audit and quality rules into practice. Build the Maple Market lab.

Before you beginModule 17 · Account roles and role inheritance

What data governance does at Maple Market

Maple Market sells goods in India, Europe and the United States. Support needs to contact customers. Finance needs accurate revenue. People Operations needs employee salaries. One broad reporting grant would give teams data they do not need. If reports also accept duplicate sales, the company could publish the wrong totals.

Data governance is the way an organization makes and owns those decisions. The business data owner approves who can use the data and what good data looks like. A steward keeps the definitions and classification inventory current. An engineer builds controls and investigates failures. An auditor compares the rules with the evidence. One person can hold several jobs in a small team, but someone must be accountable for each decision.

Data security controls actions such as signing in and reading a table. Privacy asks whether a person’s data should be collected or used for this purpose and how long it should be kept. Governance assigns responsibility for both and adds rules about quality, meaning and evidence.

Maple Market lab access contract
DatasetOwnerAllowed exampleDenied or limited example
Customer contactCustomer OperationsSupport sees full contact detailsAnalyst sees only a verified email domain. Restricted reader sees REDACTED.
Employee salariesPeople OperationsApproved lab owner validates two synthetic rowsRegional readers cannot SELECT the employee table
SalesCommerceIndia role reads sale 701, global reporting reads all eligible salesIndia role cannot see Europe or US rows
Credit limits and sales totalsFinanceFinance defines how amounts reconcileCredit limits stay out of the consumer contact view
Incoming sales and rejected recordsData OperationsPipeline operator validates and repairs a batchReporting roles cannot read the raw or quarantine tables

Identify sensitive data and decide how to protect it

Personally identifiable information (PII) identifies a person directly or in combination with other records. Names, phone numbers and email addresses are common examples. An internal customer ID can identify someone if another dataset connects it to a name. A salary or credit limit is sensitive financial information even when a classifier does not assign a personal-identifier label to that column.

Start with purpose and ownership. Inspect the fields, assign a classification, choose controls, test through the same roles that will use the data and review who actually used it. Agree on retention, deletion and ownership changes outside this lab. In Snowflake Horizon Catalog, tags and classification help identify data, policies enforce access, history and lineage provide evidence, and quality metrics track whether data meets its contract.

Enterprise governance from landing to audit Solid decisions become controls at the serving layer. Results and audit evidence go back to the people who own the rules.
  1. Source systemsLoad under a limited service role to Private landing
  2. Private landingValidate and label to Catalog and controls
  3. Catalog and controlsPublish after tests to Approved serving objects
  4. Approved serving objectsRecord access and quality to Evidence and review
  5. Evidence and reviewCorrect a rule or control to Catalog and controls
Source systems
Customer, sales and payroll data.
Private landing
Engineers validate the input.
Catalog and controls
Steward reviews labels. Engineer applies access rules.
Approved serving objects
Roles see only the rows and values they need.
Evidence and review
Owners review results, exceptions and access.

Set up the disposable governance lab and test roles

Use an authorized scratch account, an existing approved warehouse and distinct pre-existing test users. Ask the administrator to substitute all angle-bracket placeholders with approved names. Check that the database and nine role names are unused. Stop if an object already uses a lab name. The sample rows and email domains are synthetic.

The owner role builds and owns only this lab. The administrator grants narrow consumer roles instead of using a system administrator for access tests. A regional role inherits the base analyst role, including warehouse usage. The auditor is separate from data readers. The privacy controls, classification, audit tools and scheduled metrics used later generally require Enterprise Edition or higher. Plain SQL examples can be read or modeled independently of those services.

Create the lab roles and their inheritance

Use USERADMIN for role creation. Regional and global reporting roles inherit analyst privileges. SYSADMIN is the administrative parent of the custom roles. A test uses its assigned role, never SYSADMIN.

SQL · runnable example
USE ROLE USERADMIN;
CREATE ROLE M18_OWNER;
CREATE ROLE M18_SUPPORT;
CREATE ROLE M18_ANALYST;
CREATE ROLE M18_IN;
CREATE ROLE M18_EU;
CREATE ROLE M18_US;
CREATE ROLE M18_GLOBAL;
CREATE ROLE M18_RESTRICTED;
CREATE ROLE M18_AUDITOR;

GRANT ROLE M18_ANALYST TO ROLE M18_IN;
GRANT ROLE M18_ANALYST TO ROLE M18_EU;
GRANT ROLE M18_ANALYST TO ROLE M18_US;
GRANT ROLE M18_ANALYST TO ROLE M18_GLOBAL;

GRANT ROLE M18_OWNER TO ROLE SYSADMIN;
GRANT ROLE M18_SUPPORT TO ROLE SYSADMIN;
GRANT ROLE M18_IN TO ROLE SYSADMIN;
GRANT ROLE M18_EU TO ROLE SYSADMIN;
GRANT ROLE M18_US TO ROLE SYSADMIN;
GRANT ROLE M18_GLOBAL TO ROLE SYSADMIN;
GRANT ROLE M18_RESTRICTED TO ROLE SYSADMIN;
GRANT ROLE M18_AUDITOR TO ROLE SYSADMIN;

Assign roles to the approved test identities

Use SECURITYADMIN or a delegated administrator with the grant authority. Keep the builder separate from readers. Role inheritance explains why the regional roles can use the lab warehouse even though the warehouse grant goes to M18_ANALYST.

SQL · configuration template
USE ROLE SECURITYADMIN;
GRANT ROLE M18_OWNER TO USER <builder_user>;
GRANT ROLE M18_SUPPORT TO USER <support_user>;
GRANT ROLE M18_ANALYST TO USER <analyst_user>;
GRANT ROLE M18_IN TO USER <india_user>;
GRANT ROLE M18_EU TO USER <europe_user>;
GRANT ROLE M18_US TO USER <us_user>;
GRANT ROLE M18_GLOBAL TO USER <global_user>;
GRANT ROLE M18_RESTRICTED TO USER <restricted_user>;
GRANT ROLE M18_AUDITOR TO USER <auditor_user>;

GRANT USAGE ON WAREHOUSE <approved_lab_warehouse> TO ROLE M18_OWNER;
GRANT USAGE ON WAREHOUSE <approved_lab_warehouse> TO ROLE M18_SUPPORT;
GRANT USAGE ON WAREHOUSE <approved_lab_warehouse> TO ROLE M18_ANALYST;
GRANT USAGE ON WAREHOUSE <approved_lab_warehouse> TO ROLE M18_RESTRICTED;
GRANT USAGE ON WAREHOUSE <approved_lab_warehouse> TO ROLE M18_AUDITOR;

Create the lab database and transfer ownership

SYSADMIN creates the lab database. Ownership gives the lab role control within this database. Run this before adding outbound grants. After the transfer, test learners use their assigned accounts. The builder uses M18_OWNER.

SQL · runnable example
USE ROLE SYSADMIN;
CREATE DATABASE LS_M18_GOV_LAB;
GRANT OWNERSHIP ON DATABASE LS_M18_GOV_LAB TO ROLE M18_OWNER;

Seed customer, employee and sales data

The builder makes CORE for serving objects, GOV for labels and access rules, and QUALITY for private data checks. CUSTOMER_ID connects a person to a sale. CONTACT_VERIFIED is a flag supplied by this fictional source. One SALES row represents one order. One employee row represents one salary record. The final query should return 5 customers, 2 employees and 3 sales. Keep raw tables private until the policy tests are ready.

SQL · configuration template
USE ROLE M18_OWNER;
USE WAREHOUSE <approved_lab_warehouse>;
USE DATABASE LS_M18_GOV_LAB;
CREATE SCHEMA CORE;
CREATE SCHEMA GOV;
CREATE SCHEMA QUALITY;
USE SCHEMA CORE;

CREATE TABLE CUSTOMERS (
  CUSTOMER_ID NUMBER NOT NULL, FULL_NAME VARCHAR, EMAIL VARCHAR,
  PHONE VARCHAR, CREDIT_LIMIT NUMBER(10,2), CONTACT_VERIFIED BOOLEAN
);
INSERT INTO CUSTOMERS VALUES
  (101,'Asha Rao','asha@example.invalid','+1-202-555-0101',2500,TRUE),
  (102,'Luc Martin','luc@example.invalid','+1-202-555-0102',1800,FALSE),
  (103,'Riley Chen','riley@example.invalid','+1-202-555-0103',3000,TRUE),
  (104,'Meera Shah','meera@example.invalid','+1-202-555-0104',2000,TRUE),
  (105,'Eva Wolf','eva@example.invalid','+1-202-555-0105',2100,TRUE);

CREATE TABLE EMPLOYEES (EMPLOYEE_ID NUMBER, DEPARTMENT VARCHAR, SALARY NUMBER);
INSERT INTO EMPLOYEES VALUES (11,'Finance',95000),(12,'Sales',74000);

CREATE TABLE SALES (
  SALE_ID NUMBER NOT NULL, CUSTOMER_ID NUMBER NOT NULL,
  REGION VARCHAR NOT NULL, AMOUNT NUMBER(10,2) NOT NULL, BUYER_EMAIL VARCHAR
);
INSERT INTO SALES VALUES
  (701,101,'IN',100,'asha@example.invalid'),
  (702,102,'EU',200,'luc@example.invalid'),
  (703,103,'US',150,'riley@example.invalid');

SELECT (SELECT COUNT(*) FROM CUSTOMERS) AS CUSTOMERS,
       (SELECT COUNT(*) FROM EMPLOYEES) AS EMPLOYEES,
       (SELECT COUNT(*) FROM SALES) AS SALES;

Make the rule enforceable and assign the follow-up

A grant lets a role reach a table or view. A row access policy narrows eligible rows. A masking policy changes a sensitive value at query time. A quality check finds a bad record or total. A release gate keeps bad rows away from reports. Choose the right control for the promise you made.

Save the approved names and expected tests without storing personal values in an issue tracker. If access differs from the matrix, start with the active roles and the exact object the consumer queried. If there is a quality failure, stop publication for the affected batch, compare accepted and rejected record counts, and have the source owner approve the correction. Use the capstone cleanup after completing the module.

Run the enterprise capstone and cleanup →

Interview practice

Explain the decision and the evidence you would use to test it.

What is governance beyond permissions?

I assign an owner to define who may use the data and who fixes it. Then I use grants and policies to enforce access, quality tests to protect the report and access history to check what happened.

How would you verify the setup before granting readers access?

I would count the fictional rows as the owner, check the role hierarchy and leave the consumer grants off until the masking and regional policies are attached. Then I would test both allowed and denied paths under the actual reader roles.

Who decides whether a credit limit may be exposed?

Finance and the privacy owner approve the purpose and the audience. I would keep it out of general reporting, check every alternate view that might expose it and agree how long it must be kept. The auditor would verify use against that decision.

Words used in this lesson
Data governance
The decisions, responsibilities and checks that keep data useful and safe.
PII
Personally identifiable information.
Steward
The person who maintains definitions and follows up on issues.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 1

Snowflake data governance fundamentals and lab setup

Source systems
Private landing
Catalog and controls
Approved serving objects
Evidence and review

Enterprise governance from landing to audit

Solid decisions become controls at the serving layer. Results and audit evidence go back to the people who own the rules.

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
  1. Enterprise governance from landing to audit

    Solid decisions become controls at the serving layer. Results and audit evidence go back to the people who own the rules.

    Source systems → Private landing → Catalog and controls → Approved serving objects → Evidence and review

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.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. 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.
  3. 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.
  4. 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.

Who should decide whether customer emails are needed in a sales report?

Try it yourself

Write one allowed and one denied action for the Europe reporting role.

Compare your reasoning

It may read the EU sale and its amount. It may not read the India sale or unmasked buyer email.

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