![]() |
VOOZH | about |
The full form of DCL is Data Control Language in Structured Query Language (SQL). DCL commands are used to control privileges in the database. The privileges (right to access the data) are required for performing all the database operations, like creating tables, views, or sequences. DCL statements are used to perform the work related to the rights, permissions, and other controls of the database system.
There are two types of privileges in the database:
The two most important DCL commands are GRANT and REVOKE.
This command is used to grant permission to the user to perform a particular operation on a particular object. If we are a database administrator and we want to restrict user accessibility such as one who only views the data or may only update the data.
we can give the privilege permission to the users according to our wish.
Syntax
GRANT privilege_list
ON Object_name
TO user_name;This command is used to take permission/access back from the user. If we want to return permission from the database that we have granted to the users at that time we need to run REVOKE command.
Syntax
REVOKE privilege_list
ON object_name
FROM user_name;Following commands are granted to the user as a Privilege List:
GRANT and may not revoke unnecessary privileges using REVOKE, which can make the data vulnerable to unauthorized users.INSERT, UPDATE, or DELETE statements.