Home > Database > Oracle > body text

What is the Oracle data modification statement?

WBOY
Release: 2022-01-21 16:02:19
Original
14903 people have browsed it

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".

What is the Oracle data modification statement?

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

What is the oracle data modification statement?

The purpose of the update statement in Oracle is to modify the data in the table.

Syntax:

UPDATE 表名称 SET 列名称 = 新值 <WHERE 条件>.
Copy after login

For example, in the database, the test table data is as follows:

What is the Oracle data modification statement?

Now we need to add Wang Wu’s name To change to Wang Jiu, you can use the following statement:

update test set name=&#39;王九&#39; where name=&#39;王五&#39;;
commit;
Copy after login

Result after execution:

What is the Oracle data modification statement?

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template