Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ef7abe3
Create README.md
Deepak-Vohra Jul 30, 2024
4d7abbc
Create commit-transaction.sql
Deepak-Vohra Jul 30, 2024
42fc31f
Create commit-and-chain.sql
Deepak-Vohra Jul 30, 2024
9624a3d
Create commit-release.sql
Deepak-Vohra Jul 30, 2024
1bf8ace
Create rollback-transaction.sql
Deepak-Vohra Jul 30, 2024
a010540
Create savepoint.sql
Deepak-Vohra Jul 30, 2024
380ff26
Create implicit-commit.sql
Deepak-Vohra Jul 30, 2024
68140eb
Update commit-and-chain.sql
Deepak-Vohra Jul 30, 2024
b51c8a5
Update commit-release.sql
Deepak-Vohra Jul 30, 2024
3afa3b6
Update commit-transaction.sql
Deepak-Vohra Jul 30, 2024
e5982bc
Update rollback-transaction.sql
Deepak-Vohra Jul 30, 2024
3dec0d2
Update savepoint.sql
Deepak-Vohra Jul 30, 2024
da50607
Update implicit-commit.sql
Deepak-Vohra Jul 30, 2024
4d0db60
Create commit-transaction.sql
Deepak-Vohra Jul 30, 2024
fd9d573
Rename sql-queries-4/commit-transaction.sql to sql-queries-4/commit-r…
Deepak-Vohra Jul 30, 2024
d19aa90
Delete sql-queries-4/commit-rollback-savepoint/commit-transaction.sql
Deepak-Vohra Jul 30, 2024
c7c07bb
Rename sql-queries-4/commit-and-chain.sql to sql-queries-4/commit-rol…
Deepak-Vohra Jul 31, 2024
cda8cf4
Rename sql-queries-4/commit-release.sql to sql-queries-4/commit-rollb…
Deepak-Vohra Jul 31, 2024
4cb4e2b
Rename sql-queries-4/implicit-commit.sql to sql-queries-4/commit-roll…
Deepak-Vohra Jul 31, 2024
b92fff6
Rename sql-queries-4/rollback-transaction.sql to sql-queries-4/commit…
Deepak-Vohra Jul 31, 2024
fadeedc
Rename sql-queries-4/savepoint.sql to sql-queries-4/commit-rollback-s…
Deepak-Vohra Jul 31, 2024
4360bd0
Update commit.sql
Deepak-Vohra Aug 9, 2024
9b5a533
Update rollback-transaction.sql
Deepak-Vohra Aug 9, 2024
d5888a5
Update savepoint.sql
Deepak-Vohra Aug 9, 2024
729c1b1
Update implicit-commit.sql
Deepak-Vohra Aug 9, 2024
a834359
Update commit-and-chain.sql
Deepak-Vohra Aug 9, 2024
5722bb7
Update commit-release.sql
Deepak-Vohra Aug 10, 2024
f76d8a4
Update implicit-commit.sql
Deepak-Vohra Aug 10, 2024
6381377
Update commit-and-chain.sql
Deepak-Vohra Aug 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql-queries-4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions sql-queries-4/commit-rollback-savepoint/commit-and-chain.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
START TRANSACTION; -- Start a new transaction
//SQL Statements
COMMIT AND CHAIN; -- Commit and chain a transaction
SET TRANSACTION ISOLATION LEVEL READ COMMITTED; -- This statement generates an error message
4 changes: 4 additions & 0 deletions sql-queries-4/commit-rollback-savepoint/commit-release.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
START TRANSACTION; -- Start a transaction
//SQL statements
COMMIT RELEASE; -- Commit transaction and disconnect user session
SELECT 1; -- Starts a new user session
11 changes: 11 additions & 0 deletions sql-queries-4/commit-rollback-savepoint/commit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
START TRANSACTION; -- Start a transaction

/* Add some data to the Department table */
INSERT
INTO Department
VALUES(6,'Data Science','DS');
INSERT
INTO Department
VALUES(7,'Electrical Engineering','EE');

COMMIT; -- Commit the transaction
14 changes: 14 additions & 0 deletions sql-queries-4/commit-rollback-savepoint/implicit-commit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
START TRANSACTION; -- Start a new transaction

/* Add some data to the Department table */
INSERT
INTO Department
VALUES(6,'Data Science','DS');

/* Delete the new data from the Department table */
DELETE
FROM Department
WHERE id > 5;

CREATE TABLE t(i INTEGER); -- This statement causes an implicit commit
ROLLBACK; -- This statement has no effect
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
START TRANSACTION; -- Start a transaction

/* Delete Data from Department */
DELETE
FROM Department;

ROLLBACK; -- Rollback the transaction
17 changes: 17 additions & 0 deletions sql-queries-4/commit-rollback-savepoint/savepoint.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
START TRANSACTION; -- Start a new transaction

/* Add data to Department table */
INSERT
INTO Department
VALUES(6,'Data Science','DS');

SAVEPOINT sp1; -- Create a savepoint

/* Delete a row of data from the Department table */
DELETE
FROM Department
WHERE id=6;

ROLLBACK TO SAVEPOINT sp1; -- Rollback transaction to the savepoint

RELEASE SAVEPOINT sp1; -- Release the savepoint