Open In App

DCL Full Form

Last Updated : 14 May, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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.

DCL-Full-Form

There are two types of Privileges in database:

  • System Privilege
  • Object Privilege

Need Of DCL commands

  • Unauthorized access to the data should be prevented in order to achieve security in our database
  • DCL commands maintain the database effectively than anyone else other than database administrator is not allowed to access the data without permission.
  • These commands provide flexibility to the data administrator to set and remove database permissions in granular fashion.

Commands in DCL

The two most important DCL commands are:

  • GRANT
  • REVOKE

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:

  • EXECUTE
  • UPDATE
  • SELECT
  • DELETE
  • ALTER
  • ALL

Advantages Of DCL commands

  • It allows to restrict the user from accessing data in database.
  • It ensures security in database when the data is exposed to multiple users.
  • It is the wholesome responsibility of the data owner or data administrator to maintain the authority of grant and revoke privileges to the users preventing any threat to data.
  • It prevents other users to make changes in database who have no access to Database

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads