SlideShare a Scribd company logo
2
Most read
8
Most read
9
Most read
DQL commands
It consists of only 1 command i.e. SELECT command.
SELECT
it is used to retrieve all the records or particular record from table.
Syntax :
i. SELECT * from <table_name>;
This will retrieve all the records from table.
ii. SELECT * from <table_name> WHERE condition;
This will retrieve particular records from table, according to specified
condition.
Mrs. Pallavi Patil
DML commands
1. Insert command
Used to insert values into created table.
Syntax 1: for inserting single row
Insert into <table_name> values(value1, value2,…..,value n);
Ex. Insert into student values(111,’aaa’,86);
 Syntax 2 : by using attribute list
Insert into <table_name> (attribute1, attribute2,…….,attribute n) values
(value1, value2,……., value n);
Mrs. Pallavi Patil
 Syntax 3: for inserting values for particular column
Insert into <table_name>(column1, column2)values(value1, value2);
2. Update command
It is used to change data values in the table.
We can update one or more values using update command.
Syntax:
UPDATE <table_name> SET column_name=expression WHERE condition;
Ex. UPDATE student SET marks= marks+3 where class =‘TY’;
Mrs. Pallavi Patil
3. DELETE
This command is used to delete particular rows or records from the
database table.
DELETE command without WHERE clause will delete all the records from
table.
• syntax 1:
DELETE from <table_name> WHERE condition;
This syntax is used to delete particular record.
• Syntax 2:
DELETE from <Table_name>;
This syntax will delete all the records from table.
Mrs. Pallavi Patil
DCL commands
• Used to control various user actions like insert, update, delete or viewing
data.
• DCL commands also perform task of assigning privileges. So user can
access certain objects in database.
Mrs. Pallavi Patil
 Create user
• The database administrator can create users of database by using this
command.
Syntax:
Create user <username> identified by <password>;
Ex.
Create user admin1 identified by ad123;
GRANT
• Grant command allows user to do certain operations on other user’s table.
• The different types of previleges can be granted to users such as alter,
insert, delete, update, select, etc.
Mrs. Pallavi Patil
Syntax:
Grant <privilege list> on <TableName> to <username>;
Ex.
Grant insert , update on student_info to admin1;
REVOKE
• It is used to cancel or to take back the granted privileges from the
specific user.
Syntax
Revoke <privileges list> on table_name from <user_name>;
Ex. Revoke insert on student_info from admin1;
Mrs. Pallavi Patil
TCL Commands
COMMIT command
• It is used to make changes permanent in the database. This command is
used to end the transaction.
Syntax:
COMMIT;
Mrs. Pallavi Patil
Savepoint
• Savepoints are treated as marker to divide very lengthy transactions into
smaller one.
• We can create marker within current transaction using savepoint
statement.
• All savepoints get erased when commit command is used.
• You can rollback the transactions after certain savepoint without rolling
back entire transaction.
Syntax:
Savepoint savepoint_name;
Mrs. Pallavi Patil
Savepoint sp1;
DELETE from student where rollno=3;
Savepoint sp2;
Update student set student_name=‘ABC’ where rollno=1;
Delete from student where rollno=5;
Savepoint sp3;
Delete from student where rollno=8;
Mrs. Pallavi Patil
3. Rollback
• Rollback is used to undo or cancel the changes done in current
transactions.
• We rollback entire transactions using rollback command or if savepoint
is given, rollback can be done till specific savepoint.
Syntax:
Rollback;
Or
Rollback to savepoint_name;
Mrs. Pallavi Patil

More Related Content

PPTX
Trigger in mysql
PPTX
Oracle Tablespace - Basic
PDF
Chapter 4 Structured Query Language
PPTX
5. stored procedure and functions
PPTX
SQL - DML and DDL Commands
PPTX
SQL Data types and Constarints.pptx
PPT
SQL Tutorial - Basic Commands
PPT
SQL subquery
Trigger in mysql
Oracle Tablespace - Basic
Chapter 4 Structured Query Language
5. stored procedure and functions
SQL - DML and DDL Commands
SQL Data types and Constarints.pptx
SQL Tutorial - Basic Commands
SQL subquery

What's hot (20)

PPTX
Types of keys in dbms
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPT
Using the set operators
PDF
Database User and Administrator
PPT
PL/SQL Introduction and Concepts
PPTX
Sql operator
PPT
MYSQL Aggregate Functions
PPT
Including Constraints -Oracle Data base
PPT
Sql oracle
PPTX
Data warehouse architecture
PPSX
Sql triggers
PPT
SQL Views
PPTX
PPTX
Sql queries presentation
PPTX
SQL Functions
PPT
Week 3 Classification of Database Management Systems & Data Modeling
PDF
SQL Overview
PPTX
Aggregate function
Types of keys in dbms
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
Using the set operators
Database User and Administrator
PL/SQL Introduction and Concepts
Sql operator
MYSQL Aggregate Functions
Including Constraints -Oracle Data base
Sql oracle
Data warehouse architecture
Sql triggers
SQL Views
Sql queries presentation
SQL Functions
Week 3 Classification of Database Management Systems & Data Modeling
SQL Overview
Aggregate function
Ad

Similar to DML, DCL and TCL commands in SQL database.pptx (20)

PPTX
Data Manipulation Language, Data Control Language and Transaction Control La...
PPTX
SQL commands
PPTX
DBMS UNIT-2.pptx ggggggggggggggggggggggg
PDF
STRUCTURED QUERY LANGUAGE
PPT
Sql Commands_Dr.R.Shalini.ppt
DOC
Dbmsmanual
PPTX
Introduction to database and sql fir beginers
PDF
ppt.pdf
PPTX
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
PPTX
Database Languages power point presentation
PDF
SQL-Notes.pdf mba students database note
PDF
PDF
sql all type of commands in this power point presentation
PDF
COMMANDS PPT(1).pdf
PPTX
Database Management System PART- II.pptx
PPTX
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
PPTX
SQL: Data Definition Language(DDL) command
PPTX
introdution to SQL and SQL functions
PPT
Mysql Ppt
Data Manipulation Language, Data Control Language and Transaction Control La...
SQL commands
DBMS UNIT-2.pptx ggggggggggggggggggggggg
STRUCTURED QUERY LANGUAGE
Sql Commands_Dr.R.Shalini.ppt
Dbmsmanual
Introduction to database and sql fir beginers
ppt.pdf
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
Database Languages power point presentation
SQL-Notes.pdf mba students database note
sql all type of commands in this power point presentation
COMMANDS PPT(1).pdf
Database Management System PART- II.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
SQL: Data Definition Language(DDL) command
introdution to SQL and SQL functions
Mysql Ppt
Ad

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Well-logging-methods_new................
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Welding lecture in detail for understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
composite construction of structures.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
PPT on Performance Review to get promotions
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
OOP with Java - Java Introduction (Basics)
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Well-logging-methods_new................
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Model Code of Practice - Construction Work - 21102022 .pdf
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Welding lecture in detail for understanding
Operating System & Kernel Study Guide-1 - converted.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
composite construction of structures.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Digital Logic Computer Design lecture notes
PPT on Performance Review to get promotions
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
UNIT 4 Total Quality Management .pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf

DML, DCL and TCL commands in SQL database.pptx

  • 1. DQL commands It consists of only 1 command i.e. SELECT command. SELECT it is used to retrieve all the records or particular record from table. Syntax : i. SELECT * from <table_name>; This will retrieve all the records from table. ii. SELECT * from <table_name> WHERE condition; This will retrieve particular records from table, according to specified condition. Mrs. Pallavi Patil
  • 2. DML commands 1. Insert command Used to insert values into created table. Syntax 1: for inserting single row Insert into <table_name> values(value1, value2,…..,value n); Ex. Insert into student values(111,’aaa’,86);  Syntax 2 : by using attribute list Insert into <table_name> (attribute1, attribute2,…….,attribute n) values (value1, value2,……., value n); Mrs. Pallavi Patil
  • 3.  Syntax 3: for inserting values for particular column Insert into <table_name>(column1, column2)values(value1, value2); 2. Update command It is used to change data values in the table. We can update one or more values using update command. Syntax: UPDATE <table_name> SET column_name=expression WHERE condition; Ex. UPDATE student SET marks= marks+3 where class =‘TY’; Mrs. Pallavi Patil
  • 4. 3. DELETE This command is used to delete particular rows or records from the database table. DELETE command without WHERE clause will delete all the records from table. • syntax 1: DELETE from <table_name> WHERE condition; This syntax is used to delete particular record. • Syntax 2: DELETE from <Table_name>; This syntax will delete all the records from table. Mrs. Pallavi Patil
  • 5. DCL commands • Used to control various user actions like insert, update, delete or viewing data. • DCL commands also perform task of assigning privileges. So user can access certain objects in database. Mrs. Pallavi Patil
  • 6.  Create user • The database administrator can create users of database by using this command. Syntax: Create user <username> identified by <password>; Ex. Create user admin1 identified by ad123; GRANT • Grant command allows user to do certain operations on other user’s table. • The different types of previleges can be granted to users such as alter, insert, delete, update, select, etc. Mrs. Pallavi Patil
  • 7. Syntax: Grant <privilege list> on <TableName> to <username>; Ex. Grant insert , update on student_info to admin1; REVOKE • It is used to cancel or to take back the granted privileges from the specific user. Syntax Revoke <privileges list> on table_name from <user_name>; Ex. Revoke insert on student_info from admin1; Mrs. Pallavi Patil
  • 8. TCL Commands COMMIT command • It is used to make changes permanent in the database. This command is used to end the transaction. Syntax: COMMIT; Mrs. Pallavi Patil
  • 9. Savepoint • Savepoints are treated as marker to divide very lengthy transactions into smaller one. • We can create marker within current transaction using savepoint statement. • All savepoints get erased when commit command is used. • You can rollback the transactions after certain savepoint without rolling back entire transaction. Syntax: Savepoint savepoint_name; Mrs. Pallavi Patil
  • 10. Savepoint sp1; DELETE from student where rollno=3; Savepoint sp2; Update student set student_name=‘ABC’ where rollno=1; Delete from student where rollno=5; Savepoint sp3; Delete from student where rollno=8; Mrs. Pallavi Patil
  • 11. 3. Rollback • Rollback is used to undo or cancel the changes done in current transactions. • We rollback entire transactions using rollback command or if savepoint is given, rollback can be done till specific savepoint. Syntax: Rollback; Or Rollback to savepoint_name; Mrs. Pallavi Patil