Open In App

DCL Full Form

DCL stands for Data Control Language in Structured Query Language (SQL). As the name suggests these commands are used to control privilege 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 command is a statement that is used to perform the work related to the rights, permissions, and other control of the database system.



There are two types of Privileges in database:

Need Of DCL commands

Commands in DCL

The two most important DCL commands are:



GRANT

This command is used to grant permission to the user to perform a particular operation on a particular object. If you are a database administrator and you want to restrict user accessibility such as one who only views the data or may only update the data. You can give the privilege permission to the users according to your wish.

Syntax:

GRANT privilege_list
ON Object_name
TO user_name;

REVOKE

This command is used to take permission/access back from the user. If you want to return permission from the database that you have granted to the users at that time you 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:

Advantages Of DCL commands

Article Tags :