Data Control Language

Data Control Language (DCL) Commands (GRANT and REVOKE), DCL Operations (Grant privileges to a users and Revoke (remove) privileges from Users) and Database Administration.
Post Reply
manoj
Posts: 87
Joined: Fri Nov 23, 2018 5:29 am

Data Control Language

Post by manoj » Wed Nov 28, 2018 11:56 am

What is the Data Control Language and give some examples?

AyubHussain
Posts: 142
Joined: Fri Nov 23, 2018 2:48 am

Re: Data Control Language

Post by AyubHussain » Wed Nov 28, 2018 11:57 am

Data Control Language :

Data Control Language (DCL) commands are used to control the visibility of the data in the database like revoke access permission for using data in the database.

Data Control Language (DCL) commands:

1.COMMIT to permanently save.
2.ROLLBACK to undo the change.
3.SAVEPOINT to save temporarily.

chowdarybabu
Posts: 21
Joined: Thu Jan 03, 2019 3:52 am

Re: Data Control Language

Post by chowdarybabu » Fri Jan 25, 2019 9:43 am

DCL stands for Data Control Language.
DCL is used to control user access in a database.
This command is related to the security issues.
Using DCL command, it allows or restricts the user from accessing data in database schema.
DCL commands are as follows,
1. GRANT
2. REVOKE
It is used to grant or revoke access permissions from any database user.

1. GRANT COMMAND
GRANT command gives user's access privileges to the database.
This command allows specified users to perform specific tasks.

Syntax:
GRANT <privilege list>
ON <relation name or view name>
TO <user/role list>;

Example : GRANT Command
GRANT ALL ON employee
TO ABC;
[WITH GRANT OPTION]


In the above example, user 'ABC' has been given permission to view and modify the records in the 'employee' table.
2. REVOKE COMMAND
REVOKE command is used to cancel previously granted or denied permissions.
This command withdraw access privileges given with the GRANT command.
It takes back permissions from user.
Syntax:
REVOKE <privilege list>
ON <relation name or view name>
FROM <user name>;

Example : REVOKE Command
REVOKE UPDATE
ON employee
FROM ABC;

Post Reply

Return to “SQL - Data Control Language”