0% found this document useful (0 votes)
10 views

SQL_Part 4_RB

Uploaded by

jignesh jani
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

SQL_Part 4_RB

Uploaded by

jignesh jani
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Structured Query language

(SQL)

Author : Ranjeet Bhadaniya


Aartronix Innovation Pvt. Ltd
1
Structured Query language (SQL)

Aartronix Innovation Pvt. Ltd


2
TCL- Transaction control language.

In SQL, TCL stands for Transaction control language.


COMMIT and ROLLBACK are the most commonly used TCL commands in SQL.

1. COMMIT :This command is used to save the data permanently.


2. ROLLBACK : This command is used to get the data or restore the data to
the last save point or last committed state.

Aartronix Innovation Pvt. Ltd


3
1. COMMIT :
This command is used to save the data permanently.
Whenever we perform any of the DML command like -INSERT, DELETE or UPDATE, these can be
rollback if the data is not stored permanently. So in order to be at the safer side COMMIT command
is used.

Syntax:
commit;

2. ROLLBACK :
This command is used to get the data or restore the data to the last savepoint or
last committed state. If due to some reasons the data inserted, deleted or
updated is not correct, you can rollback the data to a particular savepoint or if
savepoint is not done, then to the last committed state.
Syntax:
Rollback;
Aartronix Innovation Pvt. Ltd
4
Commit Example

DELETE FROM CUSTOMERS


WHERE AGE = 25; COMMIT;

Aartronix Innovation Pvt. Ltd


5
Rollback Example

DELETE FROM CUSTOMERS


WHERE AGE = 25;
ROLLBACK;

Aartronix Innovation Pvt. Ltd


6
SQL JOINS
wads

Aartronix Innovation Pvt. Ltd


7
CROSS JOIN

In SQL, the CROSS JOIN is used to combine each row of the first table with each row
of the second table. It is also known as the Cartesian join since it returns the
Cartesian product of the sets of rows from the joined tables.

Syntax:-
SELECT [column names]
FROM [Table1]
CROSS JOIN [Table2]

Aartronix Innovation Pvt. Ltd


8
CROSS JOIN

SELECT *
FROM employee
CROSS JOIN department

Aartronix Innovation Pvt. Ltd


9
Aartronix Innovation Pvt. Ltd
10

You might also like