Introduction To Relational Model
Introduction To Relational Model
tuples
(or rows)
Example:
instructor = (ID, name, dept_name, salary)
Formally, given sets D1, D2, …. Dn a relation r is
a subset of
D1 x D2 x … x Dn
Thus, a relation is a set of n-tuples (a1, a2, …, an)
where each ai Di
Introduction to Relational Model
Relations are Unordered
5
instructor
student
advisor
Bad design:
univ (instructor -ID, name, dept_name, salary, student_Id, ..)
results in
repetition of information (e.g., two students have the same instructor)
the need for null values (e.g., represent an student with no advisor)
Normalization theory (Chapter 7) deals with how to design “good”
relational schemas
Relation r
Relation r:
Select A and C
Projection
Π A, C (r)
Relations r, s:
r x s:
Relations r, s:
r s:
Relations r, s:
r – s:
Relation r, s:
rs
Relations r, s:
Natural Join
r s