
- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence
- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation
- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview
- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins
- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure
- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing
- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock
- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery
- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion
What are the DCL commands in DBMS?
Data control language (DCL) is used to access the stored data. It is mainly used for revoke and to grant the user the required access to a database. In the database, this language does not have the feature of rollback.
It is a part of the structured query language (SQL).
It helps in controlling access to information stored in a database. It complements the data manipulation language (DML) and the data definition language (DDL).
It is the simplest among three commands.
It provides the administrators, to remove and set database permissions to desired users as needed.
These commands are employed to grant, remove and deny permissions to users for retrieving and manipulating a database.
DDL Commands
The Data Definition Language (DDL) commands are as follows −
GRANT Command
It is employed to grant a privilege to a user. GRANT command allows specified users to perform specified tasks
Syntax
GRANT privilege_name on objectname to user;
Here,
privilege names are SELECT,UPDATE,DELETE,INSERT,ALTER,ALL
objectname is table name
user is the name of the user to whom we grant privileges
REVOKE Command
It is employed to remove a privilege from a user. REVOKE helps the owner to cancel previously granted permissions.
Syntax
REVOKE privilege_name on objectname from user;
Here,
privilege names are SELECT,UPDATE,DELETE,INSERT,ALTER,ALL
objectname is table name
user is the name of the user whose privileges are removing
Example
GRANT SELECT, UPDATE ON employees TO Bhanu
Explanation − Firstly, to give the permissions to user, we have to use GRANT command. The privileges are SELECT because to view the records and UPDATE to modify the records. The objectname is table name which is Employee. The user name is bhanu.
REVOKE SELECT, UPDATE ON employees TO Bhanu
Explanation − Firstly, to revoke the permissions to user, we have to use REVOKE command. The privileges Need to revoke are SELECT because to view the records and UPDATE to modify the records. The objectname is table name which is Employee. The user name is Bhanu.
- Related Articles
- What are the DDL commands in DBMS?
- What are the DML commands in DBMS?
- What are the TCL commands in DBMS?
- Data Definition Commands in DBMS
- Data Manipulation Commands in DBMS
- What are Shell Commands?
- What are the different commands used in MySQL?
- What are the Pre-processor Commands in C language?
- What are the useful commands in JShell in Java 9?
- What are the different "/edit" commands in JShell in Java 9?
- What are the different "/types" commands in JShell in Java 9?
- What are the different "/vars" commands in JShell in Java 9?
- What are the components of DBMS?
- What are the applications of DBMS?
- What are the states of transaction in DBMS?
