Basics of ER-Model
Basics of ER-Model
Entity:
Entity is any physical object which may be a human, place, thing, or any event i.e.
student, chair, Lahore etc. Each entity contains some attributes i.e. student entity
attributes are rollno, Student_name etc.
As, Loan must be taken by some customer. so, the loan is fully participating in
relation. And every customer does not acquire the loan. so, customer is partially
participating in relation.
Attributes
Types of Attributes
Consider example:
1. Simple Attributes:
2. Composite attribute :
Composite attributes are made of more than one simple attribute. For example, a
student's complete name may have first_name and last_name.
6. Key Attributes:
Key attributes are those attributes which can identify an entity uniquely in an entity
set.
For example, the roll_number of a student makes him/her identifiable among
students.
Super Key − A set of attributes (one or more) that collectively identifies an
entity in an entity set.
Candidate Key − A minimal super key is called a candidate key. An entity set
may have more than one candidate key.
Primary Key − A primary key is one of the candidate keys chosen by the
database designer to uniquely identify the entity set.
Foreign keys- Foreign keys are the column of the table used to point to the
primary key of another table.
NOTATIONS: Following are the main components and its symbols in ER Diagrams:
Enrolled in’ is a relationship that exists between entities Student and Course.
Relationship Set
Relationship set is a set of same type of relationships in entity set. A relationship set
may be strong or weak. Let explain both these terms,
I. Strong Relationship Set:
A strong relationship exists in-between two strong entity sets.
Strong Relationship represents through a diamond symbol as below.
Types of Relationships:
a. One-to-One Relationship
2. One-To-Many Relationship.
3. Many-to-one relationship
4. Many-to-many relationship