in Programming
4,431 views
1 vote
1 vote

Explain recursive foreign key with suitable example..

in Programming
4.4k views

1 Answer

0 votes
0 votes

Foreign Key

The key of a table which acts as a primary key of some another table.

The recursive foreign key is the key which refers back to the same table i.e. the foreign key is in the same table. So Parent and child table is the same.

For example :

Let's have a table Employee having to fields empID and managedbyempID, this both fields contain the employee id's(Both are employees)  from the same table. One act as a primary key and another one will act as a recursive foreign key.  

1 comment

Ok diksha thanks a lot, but can u tell me why there is a need of recursive foreign key in your example.. means in which case we need recursive foreign key.. ?

0
0

Related questions