0
0
Snowflakecloud~5 mins

Granting and revoking privileges in Snowflake - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the GRANT command in Snowflake?
The GRANT command is used to give specific privileges to roles or users, allowing them to perform certain actions on database objects.
Click to reveal answer
beginner
How do you revoke privileges in Snowflake?
You use the REVOKE command to remove previously granted privileges from roles or users, restricting their access or actions on database objects.
Click to reveal answer
intermediate
What is a role in Snowflake and how does it relate to privileges?
A role is a collection of privileges. Assigning a role to a user grants them all the privileges that role has. This simplifies managing access rights.
Click to reveal answer
intermediate
Explain the difference between granting privileges to a user directly versus granting them to a role.
Granting privileges to a role allows multiple users to share the same access rights by assigning the role to them. Granting directly to a user is less flexible and harder to manage.
Click to reveal answer
intermediate
What happens if you revoke a privilege from a role that is assigned to multiple users?
All users assigned to that role lose the revoked privilege immediately, since the privilege is tied to the role, not individual users.
Click to reveal answer
Which command is used to give a user permission to query a table in Snowflake?
AGRANT SELECT ON TABLE my_table TO USER my_user
BREVOKE SELECT ON TABLE my_table FROM USER my_user
CCREATE ROLE my_user
DDROP TABLE my_table
What does the REVOKE command do in Snowflake?
ADeletes a user
BGives privileges to users or roles
CCreates a new role
DRemoves privileges from users or roles
If you want to manage access for many users easily, what should you use?
AUse the REVOKE command on all users
BGrant privileges directly to each user
CCreate roles and grant privileges to roles
DDelete all users and recreate them
Which privilege allows a user to create tables in a database?
ASELECT
BCREATE TABLE
CUSAGE
DINSERT
What happens if you revoke a privilege from a role assigned to multiple users?
AAll users with that role lose the privilege
BThe privilege remains for all users
COnly one user loses the privilege
DThe role is deleted
Describe how you would grant a user permission to read data from a table in Snowflake.
Think about the command syntax to allow reading data.
You got /4 concepts.
    Explain why using roles to manage privileges is better than granting privileges directly to users.
    Consider how managing many users is simplified.
    You got /4 concepts.