Query all columns and their properties for a table:
Select
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 = women;
To find the primary key for a table:
Find the foreign key of the table (including the name, the table name of the reference table, and the corresponding key name, which are divided into multi-step queries):
SELECT * from user_constraints c where c.constraint_type = ' R ' and c.table_name = women
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 = key name of the foreign key reference table;
Query for all field names in the table with known table names in Oracle, whether each field is a primary key, is a foreign key, or is an empty SQL statement