-1

What is the query to show relations between existing tables in SQL+ (Oracle)?

Maher
  • 11
  • 1
  • 5
  • Does this answer your question? [List of foreign keys and the tables they reference](https://stackoverflow.com/questions/1729996/list-of-foreign-keys-and-the-tables-they-reference) – andrewJames Apr 14 '20 at 18:06

1 Answers1

1

Oracle has an extensive data dictionary. Views with database information begin with the DBA (for administrators), ALL, and USER prefixes.

Relations of tables are defined by foreign keys.

The foreign key information is in the ALL_CONSTRAINTS view with type R.

select
*
from ALL_CONSTRAINTS t
where t.CONSTRAINT_TYPE = 'R'
Alex R.
  • 266
  • 2
  • 9