Professional Documents
Culture Documents
UNIT-I
INTRODUCTION AND ER MODEL
M. Muni Babu
M.Tech, (Ph.D)
Assistant Professor
Dept. of CSE
IIIT R K Valley, RGUKT
Idupulapaya
TOPICS
• History of Database
• Elements of an ER Model
• Constructing ER diagrams
• Modelling of constraints
• Elements of an ER Model
• Constructing ER diagrams
• Modelling of constraints
– Entities
– Attributes
– Relationships
• Primary Key: It is the first key which is used to identify one and only one instance of an
entity uniquely.
• Candidate Key: A candidate key is an attribute or set of an attribute which can uniquely
identify a tuple.
•The remaining attributes except for primary key are considered as a candidate key. The
candidate keys are as strong as the primary key.
•Super key: is a set of an attribute which can uniquely identify a tuple. Super key is a superset
of a candidate key.
•Foreign keys are the column of the table which is used to point to the primary key of another
table.
M. Muni Babu, Assistant Professor, Dept. of CSE, IIIT R K Valley, RGUKT
Types of Attributes
• These attribute types can come together in a way like −
• Simple single-valued attributes
• Simple multi-valued attributes
• Composite single-valued attributes
• Composite multi-valued attributes
• Entities
– An entity is anything real or abstract about which we want to store data.
In short, anything, which an organization needs to store data about
• Entities
– Entities are represented on the diagram by labeled boxes
• Entities
– Sometimes it is useful to generalize a group of entities
Example
CAR, SHIP and AEROPLANE all are type of VEHICLE
Vehicle
• Attributes
– Entities are further described by their attributes (also called data
elements)
• Relationships
– A data relationship is a natural association that exist
between one or more entities
Example
EMPLOYEE works in DEPARTMENT
EQUIPMENT is allocated to PROJECT
ESTEEM is a type of CAR
– One-to-one relationship
– One-to-many relationship
– Many-to-many relationship
Person Person
owns
own by
Car Car
has
works in
Employee Employee
works in
assigned to
Project Project
Employee Network
manager
makes
10 basic steps
1. Identify entities
2. Find relationship
3. Draw rough ERD
4. Fill in cardinality
5. Define Primary keys(s)
6. Draw key-based ERD
7. Identify attributes
8. Map attributes
9. Draw fully attributes
10. Check results
Note: One tempted to make company an entity, but it is a false entity because it has only
one instance in this problem. True entities must have more than one instance.
Objective: Name the information details (fields), which are essential to the
system under development
Objective: For each attribute, match it with exactly one entity that it describes
Attribute Entity
Department Name Department
Employee Number Employee
Employee Name Employee
Supervisor Number Supervisor
Supervisor Name Supervisor
Project Name Project
Project Number Project
Objective: Adjust the ERD from Step 6 to account for entities or relationships
discovered in Step 8.
Objective: Does the final ERD accurately depict the system data?
The Final ERD appears to model the data in this system well.
Middle Name
Name
PAN Account No Account Type
Transaction No Date
Customer No
Gender
Customer Transaction Account
Address
Telephone TType TP Account
Customer No Balance
Amount
Account No
END