It is the relationship between the instances of two different entity types. Two entities will participate in the relationship.
Person and events are two different entity types which are related by using the relationship called “attends”.
Mapping one to many relationship
Create two tables for two entities.
Primary key of one side relation is a foreign key for many side relations.
One side relation is customer and many side relations is Order.
The primary key cutomerID of the customer is a foreign key of order.
The equivalent relations for the above ER diagram are as follows −
One-one, many-one, many-many can be done in a similar fashion.
A simultaneous relationship between the instances of three entity types with unique attributes is called a ternary relationship.
Consultant, client and contract are three different entities with different attributes.
These three entities are related with a single relationship called “signs”.
Three foreign keys of works in the table are empID, deptID, pID.
They refer to the primary key of an employee, department, project.
These attributes are the component of the primary key of works in table.
The primary key works in the table is (empID,depID,pID).
The equivalent relation for the above ER diagram is as follows −