2
When we are running SQL statements and we need to navigate between tables it is simple when we know the database modeling to apply JOIN and GROUP BY, but when we do not know, what to do? It is necessary applying DESCTable in tables to know which are the foreign keys?
Is there a command in oracle that shows us the foreign keys between the tables?
that would be the way;
select f.table_name, t.table_name, t.column_name, f.constraint_name, t.owner
from all_cons_columns t, all_constraints f
where f.r_owner = t.owner
and f.table_name = 'PARCELAMENTO'
and f.r_owner='root';
http://stackoverflow.com/questions/1143728/how-can-i-find-which-tables-reference-a-given-table-in-oracle-sql-developer
– Gleison