In this article we wre going to learn , How to find the parent table of a table in oracle . Here, we are going to find parent table of a employee table .

Query :

SELECT COL.TABLE_NAME, CON2.TABLE_NAME R_TABLE_NAME
FROM ALL_CONS_COLUMNS COL JOIN ALL_CONSTRAINTS CON ON COL.OWNER = CON.OWNER
AND COL.CONSTRAINT_NAME = CON.CONSTRAINT_NAME
JOIN ALL_CONSTRAINTS CON2 ON CON.R_OWNER = CON2.OWNER
AND CON.R_CONSTRAINT_NAME = CON2.CONSTRAINT_NAME
WHERE CON.CONSTRAINT_TYPE = ‘R’
AND COL.TABLE_NAME = ‘EMPLOYEE’;