You create a reflexive relationship to link a column in a table with another column in the same table. For example, suppose the employee
table has an emp_id
column and a mgr_id
column. Because each manager is also an employee, you relate these two columns by drawing a relationship line from the table to itself. This relationship ensures each manager ID that is added to the table matches an existing employee ID.
Before you create a relationship, you must first define a primary key or unique constraint for your table. You then relate the primary key column to a matching column. Once you create the relationship, the matching column becomes the foreign key of the table.
To draw a reflexive relationship
When you run queries against a table, a reflexive relationship is called a self-join. For information about querying tables with joins, see Querying Using Multiple Tables.