O'Reilly logo

OCA Oracle Database 11g: SQL Fundamentals I: A Real-World Certification Guide by Steve Ries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying data with UPDATE

Next in our examination of the subject of data manipulation is the ability to change existing database data. This section looks at a number of the common methods to update data within our database.

Understanding the purpose and syntax of the UPDATE statement

The first of our DML statements allowed us to insert new data into a table. However, often the data we're interested in already exists in the table and simply needs to be altered in some way. In these circumstances, we need to modify the data, not insert it. In such situations, we use an UPDATE statement. Its syntax tree is shown as follows:

UPDATE {table_name}
SET {column_name} = {value2}
[WHERE {column_name} = {value1}];

Using the UPDATE statement, we modify the data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required