Recall & Review
beginner
What does the REVOKE command do in MySQL?
The REVOKE command removes specific privileges from a user, stopping them from performing certain actions on the database.
Click to reveal answer
beginner
Syntax of REVOKE command to remove SELECT privilege on a database from a user.
REVOKE SELECT ON database_name.* FROM 'username'@'host';
Click to reveal answer
intermediate
Can you revoke multiple privileges at once in MySQL? How?
Yes, you can revoke multiple privileges by listing them separated by commas, for example: REVOKE SELECT, INSERT ON db.* FROM 'user'@'host';
Click to reveal answer
beginner
What happens if you revoke all privileges from a user?
The user loses all the specified permissions and cannot perform any actions on the database objects for which privileges were revoked.
Click to reveal answer
intermediate
Why is it important to revoke privileges carefully?
Revoking privileges carefully ensures users only have access they need, improving security and preventing accidental or malicious data changes.
Click to reveal answer
Which command removes privileges from a MySQL user?
✗ Incorrect
REVOKE is used to remove privileges; GRANT is used to give privileges.
How do you revoke the INSERT privilege on all tables in a database named 'shop' from user 'alice'?
✗ Incorrect
Option B correctly revokes INSERT privilege on all tables in 'shop' from user 'alice'.
Can you revoke privileges from a user that does not have them?
✗ Incorrect
Revoking privileges the user does not have does not cause an error; it just has no effect.
Which of these is NOT a valid privilege to revoke?
✗ Incorrect
CREATE USER is an administrative privilege, not revoked with REVOKE on database objects.
What is the effect of revoking ALL PRIVILEGES from a user?
✗ Incorrect
Revoking ALL PRIVILEGES removes all permissions, so the user cannot read or write data.
Explain how to revoke the SELECT and UPDATE privileges from a user on a specific database in MySQL.
Think about how to list privileges separated by commas and specify the user with host.
You got /3 concepts.
Why is it important to manage user privileges carefully using REVOKE in a database system?
Consider what could happen if users have more access than needed.
You got /4 concepts.