Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 14

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : Y. Vijaya Bhaskara Reddy
Designation : Senior Lecturer.
Branch : commercial and Computer
Practice.
Institute : G.P.W Kakinada.
Year/semester : VI semester.
Subject : Visual basics—II.
Subject code : CCP603.
Topic : Database Programming
Duration : 50 minutes.
Sub Topic : Structured Query Language.
Teaching Aids : PPTS.
OBJECTIVES

On completion of this period, you would be


able to:
 Know the syntax of SQL statements
Structure Of The Period:
 Data Control Language

 Statements in DCL.
RECAP
 Data Manipulation Language statements

 SELECT
 INSERT
 UPDATE
 DELETE
Data Control Language (DCL):
It provides or takes away the privileges
from the database objects.

DCL statements include:

 grant, revoke, commit, rollback, savepoint.


Grant:
Grant statement provides permissions or role
to a user or to all users.

Syntax:
1. Grant sys_privilege to [user|role|public];
2. Grant obj_privilege [column list…] on object to
[user|role|public] [with grant option];
Revoke :
Revoke statement withdraws the granted
permission from the user.

Syntax:

6. Revoke sys_privilege|all from [user|role|public];


7. Revoke obj_privilege|all on object from [user|role|
public];
Commit :
Commit statement saves the SQL transactions
permanently in the database.

Syntax:
Commit;
Rollback :
Rollback statement cancels the SQL transactions
of the database up to a given save point.

Syntax:

Rollback;
Savepoint :
Savepoint statement creates temporary bookmarks of
the SQL transactions which can be used to Rollback
transactions to the desired point marked by
bookmarks.

Savepoints can be created or deleted according to


convenience.

Syntax:

create savepoint s1;


Quiz
1. What is the statement to save the SQL
transactions permanently in the database ?
Ans: COMMIT.
2.What is the statement to give permissions to the users ?

Ans: GRANT

3.What is the statement to cancel the given


permissions ?
Ans: REVOKE
Frequently Asked Questions:
1. List out the statements in DCL ?

2.Briefly explain the following:


COMMIT, ROLLBACK, SAVEPOINT.
Summary:

 Data Control Language

 GRANT
 REVOKE
 COMMIT
 ROLLBACK
 SAVEPOINT
Assignment

3. Briefly explain the following:


GRANT, REVOKE.

You might also like