If a column (foreign key) / multiple columns (foreign key columns) referencing some table becomes a column in a table as a NON-PRIMARY KEY, and then it is non-identifying relationship.
Example 1: Employee Table with Department Table:
Since the relationship is one to many with Department_No (Department Table) and Department_No (Employee table), we go with Non-Identifying Relationship. In Non-Identifying relationship, primary key migrates from the Department table to Employee table and it is not a part of the primary key in Employee table. Here Department_No becomes the foreign key column and generally Foreign Key relationship is represented by a dotted line.
Parent Table | Child Table | Mandatory Parent | Mandatory Child | Cardinality Relationship |
---|---|---|---|---|
Department.Department_No | Employee.Department_No | Yes | Yes | 1..1 to 1..n |
Department.Department_No | Employee.Department_No | Yes | No | 1..1 to 0..n |
Department.Department_No | Employee.Department_No | No | Yes | 0..1 to 1..n |
Department.Department_No | Employee.Department_No | No | No | 0..1 to 0..n |
Repeat the above same procedure and you can see how Title table and Employee table are connected. You can see a new column Title_Code is included in the Employee Table.
When a Foreign key references the parent key(Primary key) of the same table, then it is called a SELF REFERENTIAL OR RECURSIVE RELATIONSHIP. The column Manager_No in the Employee table is a Foreign key which takes its values from the column Employee_No of the same Employee table.
This relationship is created by non-identifying relationship with cardinality 1 to many relationship in Employee Table:
Learn data modeling design Skills on OLTP and OLAP from a US University Professor with…
These SQL commands are related with Oracle's data dictionary and can be used to get…
important DDL Statements from Oracle like Commit, Rollback, Grant, Revoke etc..
In this section, we will try to explain about important database DROP commands that are…
In this section, we will try to explain about important database DML commands that are…
In this section, we will try to explain about important database ALTER commands that are…