From the course: SQL Queries Made Easy
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Committing database changes - SQL Tutorial
From the course: SQL Queries Made Easy
Committing database changes
- [Instructor] In this chapter, we will learn about Transaction Control Language, also called TCL. There are three TCL statements namely COMMIT, ROLLBACK, and SAVEPOINT. A transaction begins when the first DML statement is executed, and it ends in three different scenarios. When COMMIT or ROLLBACK is issued, or when a DDL or DCL statement is executed, autocommit will occur. And the third scenario is if the user exits the system or the system crashes. Now let's learn about the first TCL statement that is COMMIT. COMMIT ends the current transaction and saves all the data changes that have been made thus making them permanent. For DML statements, we need to give the COMMIT statement explicitly in order to save the changes, unlike DDL and DCL statements which are autocommited. Autocommit also occurs when the user exits the system normally without explicitly giving a COMMIT statement. Now let's compare the state of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.