0
0
Snowflakecloud~20 mins

Creating custom roles in Snowflake - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Snowflake Role Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Role Hierarchy in Snowflake

In Snowflake, when you create a custom role and grant it to another role, what is the effect on the privileges of the parent role?

AThe parent role can use privileges of the custom role only if the custom role is granted to it explicitly.
BThe custom role inherits all privileges of the parent role automatically.
CThe parent role inherits all privileges of the custom role automatically.
DPrivileges are not shared between roles regardless of grants.
Attempts:
2 left
💡 Hint

Think about how role inheritance works in Snowflake.

Configuration
intermediate
2:00remaining
Creating a Custom Role with Specific Privileges

Which Snowflake SQL command correctly creates a custom role named data_analyst and grants it the privilege to select from the sales_data schema?

ACREATE ROLE data_analyst; GRANT SELECT ON DATABASE sales_data TO ROLE data_analyst;
BCREATE ROLE data_analyst; GRANT SELECT ON SCHEMA sales_data TO ROLE data_analyst;
CCREATE ROLE data_analyst; GRANT USAGE ON SCHEMA sales_data TO ROLE data_analyst;
DCREATE ROLE data_analyst; GRANT SELECT ON TABLE sales_data TO ROLE data_analyst;
Attempts:
2 left
💡 Hint

Remember that to select data, the role needs SELECT privilege on the schema or tables.

Architecture
advanced
3:00remaining
Designing Role Hierarchy for Separation of Duties

You want to design a Snowflake role hierarchy to separate duties between data engineers and data analysts. Which design best enforces that data engineers can manage tables but cannot query data, while data analysts can query data but cannot manage tables?

ACreate a <code>data_engineer</code> role with CREATE and MODIFY privileges on tables, and a separate <code>data_analyst</code> role with SELECT privileges only; do not grant either role to the other.
BCreate a <code>data_analyst</code> role with all privileges and grant it to <code>data_engineer</code> role.
CCreate a single role with both CREATE and SELECT privileges and assign it to both engineers and analysts.
DCreate a <code>data_engineer</code> role with SELECT privileges and grant it to <code>data_analyst</code> role.
Attempts:
2 left
💡 Hint

Think about how granting roles affects privilege inheritance and separation.

security
advanced
2:30remaining
Preventing Privilege Escalation with Custom Roles

Which practice helps prevent privilege escalation when creating custom roles in Snowflake?

AUse the PUBLIC role to grant all privileges to custom roles.
BGrant all privileges to custom roles to avoid permission errors during operations.
CAssign the ACCOUNTADMIN role to all users and then create custom roles for auditing.
DGrant only the minimum required privileges to each custom role and avoid granting powerful roles like ACCOUNTADMIN to users directly.
Attempts:
2 left
💡 Hint

Think about the principle of least privilege.

service_behavior
expert
3:00remaining
Effect of Revoking a Role in a Role Hierarchy

Consider the following Snowflake role hierarchy: role_A is granted to role_B, and role_B is granted to role_C. If role_A is revoked from role_B, what is the effect on role_C?

A<code>role_C</code> loses all privileges inherited from <code>role_A</code> because the grant chain is broken.
B<code>role_C</code> retains privileges from <code>role_A</code> because it was granted directly.
C<code>role_C</code> gains additional privileges from <code>role_A</code> automatically.
DRevoking <code>role_A</code> from <code>role_B</code> has no effect on <code>role_C</code>.
Attempts:
2 left
💡 Hint

Consider how privilege inheritance works through role grants.