Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create and manage tables in Oracle

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces how to create and manage tables in Oracle. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

Oracle create tables and manage tables

1. Creation and management of table

Creating a table includes three elements, table name, column name, and data type. Each table has different columns, and each column has a unique data type. Introduction to common data types:

The data type describes the CHARACTER (n) character / string. Fixed length n. INTEGER (p) integer value (no decimal point). Precision p. NUMERIC (pforce s) accurate value, precision p, decimal point after the number of s. VARCHAR (n) character / string. Variable length. Maximum length n. INTEGER integer value (no decimal point). The precision is 10. The range of stored data is-2 to the 31st power of 2 to the 31st power of 2, occupying 4 bytes of storage space. DATE stores the values of year, month, and day. TIMESTAMP stores the values of year, month, day, hour, minute, and second.

Related statement

Table1 has the same structure as table2 table

Create table table1

As

Select * from table2

Note: where can be added to restrict the insertion of data.

Note: if you only need to copy the table structure without data, you can add an untenable condition:

Create table table1

As

Select * from table2

Where 1: 2

The second method: copy after creating the table, copy the two columns of column11,column12 data in table2 to the two columns of column1,column2 in table1

Insert into table1 (column1,column2)

Select column11,column12 from table2

Note: where can be added to restrict the insertion of data.

Modify table data: change the data of column1 in table table1 to value2

Update table1

Set column1=value2

Note: where can be added to restrict the modification of data.

Delete data:

The first method: conditional deletion

Delete from table1

Where...

The second method: delete all, delete all data in table1 (non-rollback)

Truncate table table1

On how to create and manage tables in Oracle to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report