Complete the code to grant read access to a user on a table.
GRANT SELECT ON TABLE sensitive_data TO [1];You grant privileges to a user or role. Here, USER_ANALYST is the user receiving SELECT rights.
Complete the code to revoke write access from a role.
REVOKE INSERT ON TABLE customer_info FROM [1];Write permissions are usually granted to roles. Here, ROLE_SALES_TEAM is having INSERT rights revoked.
Fix the error in the code to correctly grant access to a schema.
GRANT USAGE ON SCHEMA [1] TO ROLE data_analyst;Schema names must be valid identifiers without special characters like dashes or dots. sales_data is valid.
Fill both blanks to create a role and grant it access to a database.
CREATE ROLE [1]; GRANT USAGE ON DATABASE [2] TO ROLE [1];
The role data_scientist is created and granted usage on the analytics_db database.
Fill all three blanks to grant a role access to a table with select permission.
GRANT SELECT ON TABLE [1] TO ROLE [2]; GRANT [3] ON SCHEMA public TO ROLE [2];
The data_analyst role is granted SELECT on customer_data table and USAGE on the public schema.