Complete the code to create a new role named 'data_analyst'.
CREATE ROLE [1];The command CREATE ROLE data_analyst; creates a new role named 'data_analyst'.
Complete the code to grant the 'SELECT' privilege on the 'sales' schema to the role.
GRANT SELECT ON SCHEMA sales TO ROLE [1];The role 'data_analyst' is granted SELECT privilege on the 'sales' schema.
Fix the error in the code to assign the role 'data_analyst' to the user 'alice'.
GRANT ROLE [1] TO USER alice;The correct role name is 'data_analyst' to assign it to user 'alice'.
Fill both blanks to revoke the 'SELECT' privilege from the role on the 'marketing' schema.
REVOKE [1] ON SCHEMA marketing FROM ROLE [2];
The command revokes the SELECT privilege from the 'data_analyst' role on the 'marketing' schema.
Fill all three blanks to create a custom role 'report_viewer', grant it USAGE on the 'reports' database, and assign it to user 'bob'.
CREATE ROLE [1]; GRANT USAGE ON DATABASE reports TO ROLE [2]; GRANT ROLE [3] TO USER bob;
This sequence creates the role 'report_viewer', grants it usage on the 'reports' database, and assigns it to user 'bob'.