You are on page 1of 13

Unit 09 – Database Concepts

9.2.2 ER Diagram

1
Single-value Attribute

 Value of the attribute cannot be broken down in to


component parts. Contains only a single value.
 Ex: NIC Number

NIC

2
Composite Attribute

 Value of the attribute can be sub divided into component


parts.
 Ex: Name may have f_name and l_name.

F_Name L_Name

Name

3
Derived Attribute

 Do not exist in the physical database,


 but their values are derived from other attributes present
in the database.
 Ex:- Age can be derived from date_of_birth.

Age

4
Multi-value Attribute

 Contain more than one values.


 Ex:- An Employee can have more than one
Qualification.

Qualification

5
Example of an Employee Entity
Primary Key attribute

Employee ID
Derived attribute
Component Attributes
First Name
Multi Valued Atb Age
Atattribute
Second
DOB Name Name

Employee
Composite Attribute
Address
Promotion

Student No Tel No

6
Strong Entity Vs Weak Entity

 Strong Entity – Does not depend on another Entity.


 Weak Entity – Depend on another Strong Entity.

Customer Makes Payment

Strong Entity Weak Entity

7
Degree of a Relationship

 Number of Entities in a Relationship.


Entity 2 Entity 3
 UNARY - 01 Entity
 BINARY -02 Entities Entity 1

 TERNARY -03 Entities


 N-ARY – More than 03 entities

8
Cardinality

 Number of occurrences in a Relationship.

 One to One
1 1
Person Has NIC

ONE person can have maximum ONE NIC, ONE NIC can be belonged to maximum ONE person

1 M

 One to Many
Customer Places Order

ONE customer can place MANY orders and MANY orders can be placed by only ONE customer
Enrolls
M N
Student in Batch
 Many to Many
ONE student can enroll in maximum MANY batches ONE batch can contain maximum MANY students

9
One To One

1..1 0..1

Person Has NIC

 ONE person can have NONE OR ONLY ONE NIC


 ONE NIC MUST be belonged to ONE AND ONLY ONE
person

10
One To Many

1..1 1..*

Customer Places Order

 ONE Customer MUST place AT LEAST ONE OR MANY


orders
 ONE order MUST be placed by ONE AND ONLY ONE
customer

11
Many To Many

0..*
1..*
Student Enrolls in
Batch

 ONE student MUST enroll in AT LEAST ONE OR MANY


batches
 ONE batch MAY contain NONE OR MANY students at a
time

12
Lesson Summary

 Types of Attributes
 Types of Entities
 Degree of Relationship
 Cardinality
 One to One
 One to Many
 Many to Many

13

You might also like