Complete the code to grant a role to another role in Snowflake.
GRANT ROLE [1] TO ROLE analyst_role;The GRANT ROLE command assigns one role to another, establishing a hierarchy. Here, admin_role is granted to analyst_role.
Complete the code to show the roles granted to a specific role.
SHOW GRANTS TO ROLE [1];The command SHOW GRANTS TO ROLE lists all roles and privileges granted to the specified role. Here, we check what analyst_role has.
Fix the error in the code to correctly revoke a role from another role.
REVOKE ROLE [1] FROM ROLE sales_role;The REVOKE ROLE command removes a granted role from another role. Here, marketing_role is revoked from sales_role.
Fill both blanks to create a role hierarchy where 'manager_role' inherits from 'employee_role'.
GRANT ROLE [1] TO ROLE [2];
This command grants employee_role to manager_role, so managers inherit employee permissions.
Fill all three blanks to list all roles granted to 'developer_role' and then revoke one role.
SHOW GRANTS TO ROLE [1]; REVOKE ROLE [2] FROM ROLE [3];
First, we show all grants to developer_role. Then, we revoke intern_role from developer_role.