Assignment 1
Assignment 1
Assignment 1
ER Diagram stands for Entity Relationship Diagram, also known as ERD is a diagram that
displays the relationship of entity sets stored in a database. In other words, EtR diagrams help to
explain the logical structure of databases. ER diagrams are created based on three basic concepts:
entities, attributes and relationships.
1. One to one relationship with ER Diagram:
When only one instance of an entity is associated with the relationship, it is marked as
'1:1'. Only one instance of each entity should be associated with the relationship. It
depicts one-to-one relationship. For example- a student has 1 Contact Info and one
Contact Info is associated with one Student only.
Here, we can reduce relationship (has) table and we can link Student and Contact Info
table using foreign key as shown in below;
In this example, the key field in each table, Student ID, is designed to contain unique values. In the
Students table, the Student ID field is the primary key; in the Contact Info table, the Student ID
field is a foreign key.
This relationship returns related records when the value in the Student ID field in the Contact Info
table is the same as the Student ID field in the Students table.
In this example the primary key field in the Customers table, Customer ID, is designed to contain
unique values. The foreign key field in the Orders table, Customer ID, is designed to allow
multiple instances of the same value.
This relationship returns related records when the value in the Customer ID field in the Orders
table is the same as the value in the Customer ID field in the Customers table.
In this example the primary key field in the College table, College ID, is designed to contain
unique values. The foreign key field in the Student table, Student ID, is designed to allow multiple
instances of the same value.
This relationship returns related records when the value in the College ID field in the Student table
is the same as the value in the College ID field in the College table.