当前位置:网站首页>Oracle query table index, unique constraint, field
Oracle query table index, unique constraint, field
2022-07-06 04:57:00 【Terence-Wang】
Query the index of the table
select t.Index_Name,t.table_name,t.column_name,i.tablespace_name,i.uniqueness from user_ind_columns t,user_indexes i where t.index_name=i.index_name and t.table_name=i.table_name and t.table_name=' Upper case table name : Lowercase table names are not supported here ';1、 Look up all indexes of the table ( Include index name , type , Constituent column ):
select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = i.table_name and t.table_name = Table to query
2、 Primary key of lookup table ( Include the name , Constituent column ):
select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.table_name = Table to query
3、 Uniqueness constraints for lookup tables ( Include the name , Constituent column ):
select column_name from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'U' and au.table_name = Table to query
4、 Foreign key of lookup table ( Include the name , The table name and corresponding key name of the reference table , The following is a multi-step query ):
select * from user_constraints c where c.constraint_type = 'R' and c.table_name = Table to query Query the column names of foreign key constraints :
select * from user_cons_columns cl where cl.constraint_name = Name of the foreign key Query the column name of the key of the reference table :
select * from user_cons_columns cl where cl.constraint_name = The foreign key refers to the key name of the table 5、 Query all the columns of a table and their properties
select t.*,c.COMMENTS from user_tab_columns t,user_col_comments c where t.table_name = c.table_name and t.column_name = c.column_name and t.table_name = Table to query Inquire about oracle List the information ( surface , Field , constraint , Indexes )
1、 Find out all the user tables
select * from user_tables You can query all user tables
2、 Query the indexes of all tables of the user
select * from user_indexes
3、 Query the index of the user table ( Nonclustered indexes ):
select * from user_indexes where uniqueness='NONUNIQUE'
4、 Query the primary key of the user table ( Clustered index ):
select * from user_indexes where uniqueness='UNIQUE'
5、 Index of query table
select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and
t.table_name='NODE'
6、 Primary key of query table
select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and
au.constraint_type = 'P' AND cu.table_name = 'NODE'
7、 Uniqueness constraints for lookup tables ( Include the name , Constituent column ):
select column_name from user_cons_columns cu, user_constraints au where cu.constraint_name=au.constraint_name and
cu.table_name='NODE'
8、 Foreign key of lookup table
select * from user_constraints c where c.constraint_type = 'R' and c.table_name='STAFFPOSITION'
Query the column names of foreign key constraints :
select * from user_cons_columns cl where cl.constraint_name = Name of the foreign key
Query the column name of the key of the reference table :
select * from user_cons_columns cl where cl.constraint_name = The foreign key refers to the key name of the table
9、 Query all the columns of a table and their properties
select t.*,c.COMMENTS from user_tab_columns t,user_col_comments c where t.table_name='NODE'
边栏推荐
- 饼干(考试版)
- 行业专网对比公网,优势在哪儿?能满足什么特定要求?
- Summary of three log knowledge points of MySQL
- Postman Association
- Fuzzy -- basic application method of AFL
- 二叉树基本知识和例题
- What are the advantages of the industry private network over the public network? What specific requirements can be met?
- Supreme Court, judgment standard of divorce cases
- Yyds dry goods inventory OSI & tcp/ip
- 集合详解之 Collection + 面试题
猜你喜欢
随机推荐
DMA use of stm32
你需要知道的 TCP 三次握手
关于es8316的音频爆破音的解决
Ue5 small knowledge points to enable the setting of lumen
Orm-f & Q object
驱动开发——第一个HelloDDK
Raspberry pie 3.5-inch white screen display connection
Basic knowledge and examples of binary tree
Codeforces Round #804 (Div. 2)
比尔·盖茨晒18岁个人简历,48年前期望年薪1.2万美元
The kernel determines whether peripherals are attached to the I2C address
Luogu deep foundation part 1 Introduction to language Chapter 2 sequential structure programming
Codeforces Round #804 (Div. 2)
Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser
Programmers' position in the Internet industry | daily anecdotes
[NOIP2009 普及组] 分数线划定
11. Intranet penetration and automatic refresh
Summary of redis AOF and RDB knowledge points
Three.js学习-光照和阴影(了解向)
[classic example] binary tree recursive structure classic topic collection @ binary tree








