Recall & Review
beginner
What is role-based access control (RBAC) in databases?
RBAC is a method to restrict database access based on user roles. Each role has specific permissions, and users get access by being assigned to roles.
Click to reveal answer
beginner
How do you create a role in MySQL?
Use the statement:
CREATE ROLE 'role_name'; to create a new role.Click to reveal answer
intermediate
How do you assign privileges to a role in MySQL?
Use
GRANT privilege ON database.table TO 'role_name'; to give permissions to a role.Click to reveal answer
intermediate
How do you assign a role to a user in MySQL?
Use
GRANT 'role_name' TO 'user'@'host'; to assign a role to a user.Click to reveal answer
intermediate
What command activates a role for the current session in MySQL?
Use
SET ROLE 'role_name'; to activate the role's privileges in your session.Click to reveal answer
Which command creates a new role in MySQL?
✗ Incorrect
The correct command to create a role is CREATE ROLE 'role_name';
How do you give SELECT permission on a table to a role?
✗ Incorrect
GRANT SELECT ON database.table TO 'role_name'; assigns SELECT permission to the role.
What command assigns a role to a user?
✗ Incorrect
GRANT 'role_name' TO 'user'@'host'; assigns the role to the user.
How does a user activate a role's privileges in their session?
✗ Incorrect
SET ROLE 'role_name'; activates the role's privileges for the session.
Which of these is NOT true about roles in MySQL?
✗ Incorrect
Roles must be activated with SET ROLE; they do not activate automatically.
Explain how role-based access control works in MySQL and why it is useful.
Think about how grouping permissions into roles helps manage many users.
You got /6 concepts.
Describe the steps to create a role, assign privileges, and enable a user to use that role in MySQL.
Focus on the sequence of commands from role creation to user activation.
You got /4 concepts.