Chapter 2 Relational Data Model
Chapter 2 Relational Data Model
Candidate Key
Super key (K) such that no proper subset is a super key
within the relation.
Must ensure two properties to be a candidate key
In each tuple of R, values of K uniquely identify that tuple
(uniqueness).
No proper subset of K has the uniqueness property (irreducibility).
Composite Candidate key- CK. that has more than one
attribute
15 Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 2
Relational Keys
Primary Key
Candidate key selected to identify tuples uniquely
within relation.
Alternate Keys
Candidate keys that are not selected to be primary
key.
Foreign Key
Attribute, or set of attributes, within one relation
that matches candidate key of some (possibly same)
relation.
View
Dynamic result of one or more relational operations
operating on base relations to produce another
relation.
Null Values
NULL applies to attributes which are not applicable or
which do not have values or not available now.
Value of a key attribute can not be null.
Default value - assumed value if no explicit value from
the user
30 Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 2
Entity versus Attributes
When designing the conceptual specification of the
database, one should pay attention to the
distinction between an Entity and an Attribute.
Should address be an attribute of Employees or an
entity (connected to Employees by a relationship)?
If we have several addresses per employee, address must be an
entity (attributes cannot be set-valued/multi valued)
If the structure (city, Woreda, Kebele, etc) is
important, e.g. want to retrieve employees in a
given city, address must be modeled as an entity
(attribute values are atomic)
31 Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 2
Relationships
In any business processing one object may be
associated with another object due to some event.
Such kind of association is what we call a
RELATIONSHIP between entity objects.
Related entities require setting of LINKS from one
part of the database to another.
A relationship should be named by a word (verb)or
verb phrase which explains its function
Role names are different from the names of entities
forming the relationship: one entity may take on many
roles, the same role may be played by different entities
32 Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 2
Relationships Cont’d…
Relationship Type (Relationship)
Relationship between entity types
Relationship Occurrence/Instance:
Relationship between entity occurrences/Instances