select a.table_name pk_table, a.constraint_name pk_cons_name, (select c.column_name from user_cons_columns c where c.constraint_name = a.constraint_name) pk_col, a.r_constraint_name fk_cons_name, (select c.table_name from user_cons_columns c where c.constraint_name = a.r_constraint_name) fk_table, (select c.column_name from user_cons_columns c where c.constraint_name = a.r_constraint_name) fk_col from user_constraints a where constraint_type in ('P', 'R') -- p:pk , r - fk and table_name in ('PK', 'FK')