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

Analysis of operation examples of tables in oracle database

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly shows you the "oracle database table operation example analysis", the content is simple and easy to understand, organized clearly, I hope to help you solve doubts, let Xiaobian lead you to study and learn "oracle database table operation example analysis" this article bar.

1. create tables

create table test_1(num number(2) not null,name VARCHAR2(20) not null,primary key(num));

Created a table with two fields, num and name, both set to non-empty, num set to the primary key, often a "missing left parenthesis" error message when creating the table, estimated to be VARCHAR2 type without adding data length, plus just fine. This is to create a table with sql statements, feel more than right-click to create a new trouble, may sometimes have to build a table like this.

2. replicated table

create table test_2 as select * from test_1;

This copy of the table will copy the data, sometimes we only need the table structure is enough, you can delete the data of the new table, of course, you can directly choose to copy the table structure.

create table test_3 as select * from test_1 where 1=2;

3. delete table

drop table test_1

4. Query all field names in the table

SELECT * FROM user_tab_columns t WHERE t.TABLE_NAME='TEST_1';

The table name should be capitalized, otherwise no information can be found.

5. review the user information

--View all users in the database, provided that you have dba permissions, such as sys,system select * from dba_users; --View all users you can manage! select * from all_users; --View current user information! select * from user_users;

View current user information or more commonly used.

The above is "oracle database table operation sample analysis" all the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

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