Sql updating multiple tables
After that moment, even if you run the ROLLBACK clause 20 times, you can get to the state of only the last COMMIT.
So, please, be very careful when setting a condition in the WHERE clause of the UPDATE statement.
One can always make a simple mistake that could result in the loss of a large amount of data. One last thing – to properly switch off the safe updates, reconnection to the database is required. It is used to update the values of existing records in a table.
So, let’s exit this connection and then reconnect, typing the password once again! In the previous post about SQL INSERT Statement, we inserted an employee under the number of 9-9-9-9-0-1, remember? The syntax to adhere to is UPDATE table name, the keyword SET, column names and the respective values assigned to them, and finally – WHERE, and a certain condition, or set of conditions, that must be satisfied.
Remember, you should be careful when using this command because once you execute COMMIT, you cannot reverse any change!
So, after running ROLLBACK, where will we go back to? We see the information we had in the “Departments Duplicate” table at the beginning of this post.