SELECT * FROM All_tab_comments
--Query All users ' tables, views, etc.
SELECT * FROM User_tab_comments
--Query the user's table, view, etc.
SELECT * FROM All_col_comments
--Query the column names and comments for all users ' tables.
SELECT * FROM User_col_comments
--Query the column names and comments for this user's table
SELECT * FROM All_tab_columns
--query for information such as column names for all users ' tables (verbose but no notes).
SELECT * FROM User_tab_columns
--Query the column name of the user's table (detailed but no notes).
--General use 1:
Select t.table_name,t.comments from User_tab_comments t
--General use 2:
Select R1, R2, R3, R5
From (select A.table_name R1, A.column_name R2, a.comments R3
From User_col_comments a),
(select T.table_name R4, t.comments R5 from User_tab_comments t)
where R4 = R1
The above is an introduction to Oracle's statement of all tables for querying users.
How to query the table name, primary key name, index, foreign key, and so on for all user tables in Oracle
1. Find all indexes of the table (including 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.tabl E_name and t.table_name = table to query
2. lookup table's primary key (including 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, find the uniqueness of the table constraints (including the name, the constituent column):
Select column_name from User_cons_columns cu, user_constraints au where cu.constraint_name = Au.constraint_name and Au.con Straint_type = ' U ' and au.table_name = table to query
4. Find the foreign key of the table (including the name, the table name of the reference table and the corresponding key name, the following is divided into multi-step query):
SELECT * from user_constraints c where c.constraint_type = ' R ' and c.table_name = table to query
Query the column name of the FOREIGN KEY constraint:
SELECT * from User_cons_columns cl where cl.constraint_name = FOREIGN key Name
Query the column name of the key referencing the table:
SELECT * from User_cons_columns cl where cl.constraint_name = foreign key reference table key name
5. Querying all columns of the 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