In relational databases, a foreign key is typically a field that is linked to another table‘s primary key field in a relationship between two tables.
However, there’s also a type of foreign key we call the self-referencing foreign key. The self-referencing foreign key refers to a field within the same table, creating a relationship between rows in the same table.
Continue reading