The SQL REVOKE
statement is used to revoke privileges from a user or role. The REVOKE
statement is used to undo the privileges granted using the GRANT
statement. The basic syntax of the REVOKE
statement is as follows:
REVOKE privilege1, privilege2, ...
ON object_type object_name
FROM user_or_role;
Where privilege1
, privilege2
, … are the privileges you want to revoke, object_type
is the type of object the privileges are being revoked from (such as TABLE, VIEW, PROCEDURE, etc.), object_name
is the name of the object, and user_or_role
is the user or role that the privileges are being revoked from.
Here’s an example of using the REVOKE
statement in SQL:
REVOKE SELECT, INSERT, UPDATE
ON employees
FROM user1;
In this example, the SELECT
, INSERT
, and UPDATE
privileges are being revoked from the user1
user for the employees
table.
You can also revoke privileges from all objects of a specific type by using the *
wildcard character:
REVOKE SELECT
ON TABLE *
FROM user2;
In this example, the SELECT
privilege is being revoked from the user2
user for all tables in the database.
In conclusion, the SQL REVOKE
statement is used to revoke privileges from a user or role, and its basic syntax is REVOKE privilege1, privilege2, ... ON object_type object_name FROM user_or_role;
. The privileges can be revoked from a specific database object or from all objects of a specific type, and can be revoked from a user or role.
Also check WHAT IS GIT ? It’s Easy If You Do It Smart
You can also visite the Git website (https://git-scm.com/)