0
0
Snowflakecloud~10 mins

Granting and revoking privileges in Snowflake - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to grant SELECT privilege on the table to the user.

Snowflake
GRANT [1] ON TABLE sales_data TO USER analyst;
Drag options to blanks, or click blank then click option'
ASELECT
BUPDATE
CDELETE
DINSERT
Attempts:
3 left
💡 Hint
Common Mistakes
Using INSERT instead of SELECT
Using DELETE which removes data
2fill in blank
medium

Complete the code to revoke the USAGE privilege on the schema from the role.

Snowflake
REVOKE [1] ON SCHEMA marketing FROM ROLE marketing_analyst;
Drag options to blanks, or click blank then click option'
AOWNERSHIP
BSELECT
CCREATE
DUSAGE
Attempts:
3 left
💡 Hint
Common Mistakes
Revoking SELECT instead of USAGE
Revoking OWNERSHIP which is a higher privilege
3fill in blank
hard

Fix the error in the code to grant the role the ability to create schemas in the database.

Snowflake
GRANT [1] ON DATABASE sales_db TO ROLE data_engineer;
Drag options to blanks, or click blank then click option'
ACREATE SCHEMA
BSELECT
CCREATE
DCREATE TABLE
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'CREATE TABLE' which is invalid
Using SELECT instead of CREATE SCHEMA
4fill in blank
hard

Fill both blanks to grant the role the ability to read and write data on the table.

Snowflake
GRANT [1], [2] ON TABLE customer_info TO ROLE sales_team;
Drag options to blanks, or click blank then click option'
ASELECT
BINSERT
CDELETE
DUSAGE
Attempts:
3 left
💡 Hint
Common Mistakes
Using DELETE which removes data
Using USAGE which is for schemas
5fill in blank
hard

Fill all three blanks to revoke all privileges on the database from the user.

Snowflake
REVOKE [1], [2], [3] ON DATABASE analytics_db FROM USER data_scientist;
Drag options to blanks, or click blank then click option'
AUSAGE
BCREATE SCHEMA
COWNERSHIP
DMODIFY
Attempts:
3 left
💡 Hint
Common Mistakes
Revoking MODIFY which is not a valid privilege
Missing OWNERSHIP privilege