Week 08 - Tutorial Lab Sheet DCL
Week 08 - Tutorial Lab Sheet DCL
Akila Warnapura
ITE 2422 - Database Management Systems Lecture Name:
Akila Warnapura Data Control Language (DCL)
Learning Outcomes
§ After completing this tutorial, you will learn about
SQL commands of Data Control Language (DCL)
Akila Warnapura
Lecture Name:
Data Control Language (DCL)
Structured Query Language Commands
Akila Warnapura
Lecture Name:
Data Control Language (DCL)
Structured Query Language Commands
§ GRANT:
This command grants users database access privileges.
§ REVOKE:
This command revokes the access privileges granted to the user via the ITE 2422 - Database
GRANT command. Management Systems
Akila Warnapura
Lecture Name:
Data Control Language (DCL)
DCL - Data Control Language
The followings are examples of DCL commands
select user from mysql.user;
This command is used to show all users in the MySQL Server
grant create, alter, drop, insert, update, delete, select, references, reload on Lecture Name:
myTestDb.* to ‘kasun'@'localhost’; Data Control Language (DCL)
This command is used to grant specific privileges on all the tables of schema called ‘myTestDb’ to user
‘kasun’ Note: This user ‘kasun’ will not be allowed to grant privileges to other users.
DCL - Data Control Language
The following is examples of DCL commands
flush privileges
When the CREATE USER or GRANT statements are executed, this command reloads the grant tables to
ensure that the newly created privileges are applied