DCL (Data Control Language)
The DCL stands for Data Control Language means these commands are used to retrieve the saved data from database. And one more thing is the DCL execution is Transactional that means It have roll back parameters. we have two tasks under the Data Control Language below I listed them
- Grant It is used for give user access to the database
- Revoke It is used for to take back the access or permissions from the user
Now I will explain these commands with proper examples for better understanding
Grant
Basically The grant command is used for provide database access to the new user. Here I create one user then I give the access to the database.
Syntax:
GRANT privileges
ON object
TO user_or_role [WITH GRANT OPTION];
Example:
GRANT SELECT, INSERT ON students TO user;
Revoke
The Revoke command is used to to take back database access from the user. Now I provide the example in the below
Syntax:
REVOKE privileges ON object FROM user_or_role;
Example:
REVOKE ALL PRIVILEGES ON students FROM user;
Database Languages in DBMS
Databases are used to store information. The Database is related to both software and hardware here The Software is used for accessing the data in the form of Software applications, and The Hardware is used for storing the data in the memory or hard disk.
Any Database provides an interface between the end user and the database by using this interface, the end user can access the database data. It is a very secure means before accessing database data we need to authenticate first, and then we get access to the database. We have different types of Database Languages which are represented in the below image.