当前位置:网站首页>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'
边栏推荐
- What are the advantages of the industry private network over the public network? What specific requirements can be met?
- 麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
- [FreeRTOS interrupt experiment]
- [noip2009 popularization group] score line delimitation
- Project manager, can you draw prototypes? Does the project manager need to do product design?
- 内核判断i2c地址上是否挂载外设
- Platformio create libopencm3 + FreeRTOS project
- Ue5 small knowledge points to enable the setting of lumen
- Supreme Court, judgment standard of divorce cases
- GAMES202-WebGL中shader的编译和连接(了解向)
猜你喜欢
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University
[classic example] binary tree recursive structure classic topic collection @ binary tree
Class inheritance in yyds dry inventory C
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Digital children < daily question> (Digital DP)
Uva1592 Database
Microblogging hot search stock selection strategy
行业专网对比公网,优势在哪儿?能满足什么特定要求?
Introduction of several RS485 isolated communication schemes
Yolov5 tensorrt acceleration
随机推荐
Postman manage test cases
Quick sort
Digital children < daily question> (Digital DP)
Fuzzy -- basic application method of AFL
集合详解之 Collection + 面试题
力扣(LeetCode)186. 翻转字符串里的单词 II(2022.07.05)
JS quick start (II)
Redis 排查大 key 的4种方法,优化必备
IPv6 comprehensive experiment
Extension of graph theory
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Postman测试报告
Request (request object) and response (response object)
2021robocom robot developer competition (Preliminary)
Summary of three log knowledge points of MySQL
项目经理,你会画原型嘛?项目经理需要做产品设计了?
Simple understanding of interpreters and compilers
Rce code and Command Execution Vulnerability
集合详解之 Map + 面试题
Codeforces Round #804 (Div. 2)