当前位置:网站首页>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'
边栏推荐
- Raspberry pie 3.5-inch white screen display connection
- Vulnerability discovery - vulnerability probe type utilization and repair of web applications
- Introduction of several RS485 isolated communication schemes
- EditorUtility.SetDirty在Untiy中的作用以及应用
- web工程导入了mysql驱动jar包却无法加载到驱动的问题
- Summary of three log knowledge points of MySQL
- [detailed steps of FreeRTOS shift value for the first time]
- It is also a small summary in learning
- Microservice resource address
- 驱动开发——HelloWDM驱动
猜你喜欢
Uva1592 Database
acwing周赛58
Delete subsequence < daily question >
[数学建模] 微分方程--捕鱼业的持续发展
yolov5 tensorrt加速
Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
Compilation and connection of shader in games202 webgl (learn from)
The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder
【LGR-109】洛谷 5 月月赛 II & Windy Round 6
Weng Kai C language third week 3.1 punch in
随机推荐
Postman前置脚本-全局变量和环境变量
ISP学习(2)
EditorUtility.SetDirty在Untiy中的作用以及应用
Leetcode 186 Flip the word II in the string (2022.07.05)
acwing周赛58
Postman管理测试用例
Drive development - the first helloddk
The kernel determines whether peripherals are attached to the I2C address
SQL injection vulnerability (MSSQL injection)
关于es8316的音频爆破音的解决
[buuctf.reverse] 159_ [watevrCTF 2019]Watshell
Excellent PM must experience these three levels of transformation!
集合详解之 Collection + 面试题
Compilation and connection of shader in games202 webgl (learn from)
Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
Scala function advanced
Principle and performance analysis of lepton lossless compression
ISP learning (2)
Sorting out the knowledge points of multicast and broadcasting
Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser