Data Control Language in SQL ( DCL Commands )
What are DCL Commands ??
Data Control Language or shortly called DCL commands are a set of SQL Commands that provides database security by granting or removing various permissions or privileges for the database given to the users. Thus they control the access level of the data .
Who can provide or remove these privileges to/from the users ??
Only Database Administrators ( DBAs) or Database Owner have the rights to grant or remove privileges from the users.
Types of DCL Commands :
There are two types of DCL Commands :
Before studying these commands in details , It is important to understand what is meant by Privileges and Roles.
Privileges are the permissions given to the users for accessing the database objects.
Roles may be defined as a bundle or packet of privileges. When a Role is granted to the user automatically all the privileges that comes under it are also assigned to the user. Similar is the case with the revoke.
The main advantage of creating roles is to ease the process of granting and revoking in case of multi user environment where multiple privileges can be granted or revoked at one shot which otherwise would take lot of time if done separately.
The Roles may be of two types :
1. User defined .
2. System defined.