BLOGS BY TOPIC
BLOGS BY AUTHOR
BLOGS BY YEAR
This blog teaches you how to modify existing data in your database by either deleting records or updating them.
Posted by Andrew Gould on 08 May 2013
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Modifying Data in SQL
There are three main things you can do to modify the data stored in your database: insert new records into a table, update existing records, and delete existing records.
We've dealt with inserting records into tables in a previous blog. This article is going to concentrate on how you update and delete records.
Changing Your Mind after Modifying Data
Before you attempt to delete or update records in SQL you need to be aware that you can't undo your actions. Make sure that when you practise these techniques you have a backup copy of your data (I speak from bitter experience!).
You can provide yourself with a safety net when modifying data by using transactions. A transaction allows you to undo any changes that you have made since it began. We'll cover transactions in a separate blog.
Now that you've been suitably warned we can look at how to delete data from a table using the DELETE statement. Read the next part of this blog to discover how it works.