Mid Term Exam: COVERS Chapters 1-3, 7-8 Two Parts
Mid Term Exam: COVERS Chapters 1-3, 7-8 Two Parts
• OWNER C
• ------------------------------ -
• AGGARWAL P
• AGGARWAL R
• AGGARWAL R
Entities:
– An object of interest
– Person
– Place
– Event
– concept
– An entity type consists of entity instances
Attributes
– Properties of an entity
– Describes an entity
– Attributes have DOMAINS.
– Domain is a set of possible values. Two attributes can share the
– same domain
Derived Attributes:
Unary (recursive):
Entity has a relationship to itself
• 1:1
• 1:m
• m:n
Super & sub type entities (used extensively in
Object oriented systems)
Relationship:
• IS-A super, sub entity relationships are of the type “IS A”;
– Ex: full time employee “IS AN” employee
• HAS-A: between two entities..STUDENT “HAS A” relationship with
CLASS
Inheritance
• All attributes of a super type become
attributes of the subtype
• Each attribute should be located at the
highest level in the hierarchy
CARDINALITY (useful in getting approximate
database size)
ENTREE DINNER
Cardinality
Cardinality
One entrée can be part of a min of 1 dinner
and a max of many dinners, say n
One dinner can be part of a minimum of one
entrée and a max of one entrée
entree dinner
(1,N) (1,1)
Relationship between DINNER and
GUEST
Note there are TWO relationships
A guest can attend many dinners
Vice versa
A guest can have many dinner invitations
Vice versa
invitation
Dinner Guest
Relationship between DINNER and
GUEST
Note there are TWO relationships
A guest can attend many dinners
Vice versa
STUDENT
PROFESSOR CLUB
Relations will be
STUDENT
(St_ID, st_name,…,Club_ID, Prof_ID)
CLUB
(Club_ID, location,date_established,..)
PROFESSOR
(Prof_ID, Prof_name, specialty,..)