Complete the code to create a new role named 'manager'.
CREATE ROLE [1];The CREATE ROLE statement creates a new role. Here, 'manager' is the role name.
Complete the code to grant SELECT permission on the 'employees' table to the 'manager' role.
GRANT [1] ON employees TO manager;The GRANT SELECT statement gives read-only access to the 'employees' table for the 'manager' role.
Fix the error in the code to assign the 'manager' role to user 'alice'.
GRANT [1] TO 'alice'@'localhost';
To assign a role, you grant the role name directly to the user. The correct syntax is GRANT manager TO 'alice'@'localhost';
Fill both blanks to revoke the UPDATE permission on 'projects' table from the 'developer' role.
REVOKE [1] ON projects FROM [2];
The REVOKE UPDATE ON projects FROM developer; statement removes the update permission from the developer role on the projects table.
Fill all three blanks to create a user 'bob', assign the 'analyst' role, and grant SELECT on 'reports' table.
CREATE USER '[1]'@'localhost'; GRANT [2] TO '[3]'@'localhost'; GRANT SELECT ON reports TO '[3]'@'localhost';
This sequence creates the user 'bob', grants the 'analyst' role to him, and then grants SELECT permission on the 'reports' table.