Review of the
Relational Model:
Relations
- Relation:
- Example: a relation
+-------+------------+---------------+----------+-----+
| 12345 | John Doe | 123 My Ln | 123-4567 | 3.5 |
+-------+------------+---------------+----------+-----+
| 22222 | James Bond | 10 Downing St | 777-7777 | 3.7 | <---"tuple"
+-------+------------+---------------+----------+-----+
| 56789 | Jane Doe | 321 Your Way | 876-5678 | 3.8 |
+-------+------------+---------------+----------+-----+
|
|
Definitions: (1)
relation name,
(2) attribute name and
(3) tuple
- Definitions (terminology):
-
Relation name =
name
(identification) of the
relation (= table)
-
Attribute name =
name (identification) of
a column
of the relation (= table)
-
Tuple =
a row of values
of the relation (table)
|
Schematically:
|
Properties of
relations
- Properties
of relations (tables):
-
Tuples
in a relation (= table) are
unordered
-
Attributes (= columns)
of a relation (= table) are
ordered
Note:
- This property makes it
very difficult
to add or remove attributes
from/to
relations (= tables)
once the
relations are
populated with data....
|
-
Attribute values
are
atomic
|
|
Concepts: (1) Super key
and (2) Key
More concepts:
(1) Candidate key,
(2) Primary key
and (3) Foreign "key"
Examples of the
3 different
keys on
next slide
Examples
with all the key concepts
- Examples of
candidate key,
primary key and
foreign key:
|
❮
❯