(Out of the syllabus Class- XII)
|
DCL |
Data Control Language |
GRANT, REVOKE |
In SQL, GRANT and REVOKE are DCL (Data Control Language) commands. They are used to control user access and permissions on database objects like tables, views, and procedures.
The GRANT command is used to give privileges (permissions) to a user or role.
SELECT – Read data
INSERT – Add new records
UPDATE – Modify existing data
DELETE – Remove records
ALL – All privileges
Allows user1 to read and insert data into the student table.
User1 can now grant this privilege to other users.
The REVOKE command is used to remove previously granted privileges from a user or role.
Removes the INSERT permission from user1 on the student table.
| Feature | GRANT | REVOKE |
|---|---|---|
| Command Type | DCL | DCL |
| Function | Gives permission | Removes permission |
| Access Control | Allows access | Restricts access |
| Usage | Security management | Security management |