April 2026
Beginner
493 pages
23h 2m
English
Revoking privileges with DCL is nearly the same as granting privileges. All we need to do is to use the expression REVOKE...FROM instead of GRANT...TO. It’s that simple!
Nevertheless, let’s go through some exercises. Listing 8.34 demonstrates how to remove a privilege from a user.
REVOKE INSERT ON finance_transaction FROM john_doe;
Listing 8.34 Removing Single Privilege from User
The syntax doesn’t change much for roles either. Listing 8.35 demonstrates how to remove a privilege from a role.
REVOKE DELETE ON sales_customer FROM sales_role;
Listing 8.35 Removing Single Privilege from Role
How do you remove a role from a user, then? See Listing 8.36 for a demonstration.
REVOKE sales_role FROM olivia_warren;
Read now
Unlock full access