Professional Documents
Culture Documents
Name
Reg # Class
Student
- Multi-valued attribute
An attribute that can provide more than one values for an instance, is called multi-
valued attribute, e.g. Hobby.
Name
Reg # Class
Hobby
Hobby
Student
Repeating group
Two or more multi-valued attributes that have same logical association, forms a
repeating group.
Name
Reg # Class
Hobby
Hobby ID
Student
DBMS
Hobby
Hobby Repeating Group
Name
www.techtilldate.blogspot.com www.bscs15.blogspot.com
- Solution for repeating group
We take out the attribute of repeating group from entity class and make another related
entity class that contains these attributes.
Registers
Course
Reg # Reg #
DBMS
www.techtilldate.blogspot.com www.bscs15.blogspot.com
Candidate Key
An attribute that has the quality / characteristics to identify a unique instance of an
entity class is known as candidate key e.g. Reg #, NIC.
Primary Key
A candidate key that has been selected as an identifier is known as primary key, e.g. Reg
no.
Name
Reg # Class
Student
Alternate Key
A candidate key other than primary key is known as alternate key e.g. NIC.
DBMS
www.techtilldate.blogspot.com www.bscs15.blogspot.com
Composite Primary Key
Sometimes there is a situation when there is no single that can identify a unique
instance. Therefore we consider two or more attributes for indentifying a unique
instance. These two or more attributes are called composite primary keys.
Name
Roll no Class
Student
1 Ahmad BSCS
2 Ali BSCS
1 Sabir BSSE
Employ no
ISB-6
LHR-9
KHI-4
Transferred to Lahore
So the name will change i.e. LHR-8
*So that’s why the use of intelligent key should be avoided.
DBMS
www.techtilldate.blogspot.com www.bscs15.blogspot.com
Existence dependency
It is a phenomenon in which instances of an entity class can not exist without the existence of
instances of another entity class.
Movie copy can not exist without the existence of some movie, so it is called as weak
entity class.
Identifying relationship
A relationship in which the weak entity class doesn’t have an identifier and we bring the
primary key of strong entity class in weak entity class to make it part of composite primary key,
such relationship is known as identifying relationship.
Copy ID
M-Name M-ID Media
M-ID M-Type
Has
Hasaa
Movie Movie Copy
1 1 CD
www.techtilldate.blogspot.com www.bscs15.blogspot.com
1 2 CD
1 3 DVD
2 1 Tape
P-Name P-Price
P-ID P-Price
Time Stamp
Effective
Effectivedate
Product date
Requirement
User wants to keep all prices of a product along with the date when it was purchased.
Price
P-Name P-ID Date
P-ID
Has a
Product Product
P1-TFT 17”
Price Date
14000 3-2-2009
DBMS
www.techtilldate.blogspot.com www.bscs15.blogspot.com
12500 28-2-09
12000 1-3-09
12050 15-3-09
DBMS
www.techtilldate.blogspot.com www.bscs15.blogspot.com