Data Control Language
Data Control Language
What is the Data Control Language and give some examples?
-
- Posts: 142
- Joined: Fri Nov 23, 2018 2:48 am
Re: Data Control Language
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.
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.
-
- Posts: 21
- Joined: Thu Jan 03, 2019 3:52 am
Re: Data Control Language
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;
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;