In Oracle, the data modification statement is the update statement. The function of this statement is to modify the data specified in the table. The syntax is "UPDATE table name SET column name = new value WHERE condition".
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
The purpose of the update statement in Oracle is to modify the data in the table.
Syntax:
UPDATE 表名称 SET 列名称 = 新值 <WHERE 条件>.
For example, in the database, the test table data is as follows:
Now we need to add Wang Wu’s name To change to Wang Jiu, you can use the following statement:
update test set name='王九' where name='王五'; commit;
Result after execution:
1. For example, to modify a certain column of data, update studentinfo set studentsex=' Female' where studentid=1;select * from studentinfo.
2. Modify certain columns of data, update studentinfo set studentname='李五', studentsex='女', studentage=15;where studentid=2;commit;select * from studentinfo.
3. Clear certain data, such as Zhang Shan’s sex, update studentinfo set studenttel=null where studentid=1;commit;select * from studentinfo.
4. Set the age in all data to female, update studentinfo set studentsex='female';commit.
5. Add the data in the table to increase Zhang Shan’s age by 10 years, update studentinfo set studentage=studentage 10 where studentid=1;commit.
6. Multiply the data in the table, multiply Wang Wu’s age by 3 years, update studentinfo set studentage=studentage*3 where studentid=3;commit;select * from studentinfo.
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of What is the Oracle data modification statement?. For more information, please follow other related articles on the PHP Chinese website!