When we are executing 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? Is it necessary to apply DESC
Table in the tables to know what the foreign keys are?
Is there any command in oracle that shows us the foreign keys between the tables?
that would be the form;
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';