当前位置:网站首页>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'
边栏推荐
- RTP GB28181 文件测试工具
- 【LGR-109】洛谷 5 月月赛 II & Windy Round 6
- The video in win10 computer system does not display thumbnails
- [lgr-109] Luogu may race II & windy round 6
- RT thread analysis - object container implementation and function
- Postman前置脚本-全局变量和环境变量
- 也算是学习中的小总结
- Postman管理测试用例
- A blog to achieve embedded entry
- Postman断言
猜你喜欢

ISP learning (2)

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

Selection of slow motion function

11. Intranet penetration and automatic refresh

Zynq learning notes (3) - partial reconfiguration

Compilation and connection of shader in games202 webgl (learn from)

比尔·盖茨晒18岁个人简历,48年前期望年薪1.2万美元
![[lgr-109] Luogu may race II & windy round 6](/img/fe/d5b67c7dff759c519a04da023630ea.png)
[lgr-109] Luogu may race II & windy round 6

Acwing week 58

The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder
随机推荐
What are the advantages of the industry private network over the public network? What specific requirements can be met?
内核判断i2c地址上是否挂载外设
Simple understanding of interpreters and compilers
Collection + interview questions
Redis 排查大 key 的4种方法,优化必备
Raspberry pie 3.5-inch white screen display connection
从0到1建设智能灰度数据体系:以vivo游戏中心为例
2021RoboCom机器人开发者大赛(初赛)
MPLS experiment
2021 robocom world robot developer competition - undergraduate group (semi-finals)
Yyds dry goods inventory OSI & tcp/ip
Cve-2019-11043 (PHP Remote Code Execution Vulnerability)
Postman管理测试用例
Uva1592 Database
DMA use of stm32
驱动开发——HelloWDM驱动
优秀PM必须经历这3层蜕变!
A little knowledge of CPU, disk and memory
Sqlserver query results are not displayed in tabular form. How to modify them
Principle and performance analysis of lepton lossless compression