Lecture 3B: Relational Model Flashcards
What is another name for relational Model?
Conceptual model of data.
describe facts for the relational model.
- all data is structured within relations (tables).
2. dominant database solution
Quickly list the DB design from top to bottom
- conceptual db design
- logical db design
- physical db design
define relation
table with columns and rows.
it is a set, thus no duplicate tuples in a relationship
define attributes
a column of a relation
define tuples
a row in a relation
define domain
a set of allowable values for one or more attributes
define degree (of a relation)
number of attributes it contains
define cardinality (of a relation)
number of tuples it contains
Maths behind Relational Model contains Cartesian products of two sets (D1, D2),
what other names are used to describe these sets?
- a set of ordered pairs
- sets D1 and D2 are called domains.
can contain n domains. therefore the relation represented with that product has degree n
and elements are n-tuples
in a relational model we have constraints that impose restrictions on values in a column or a combination of columns within a table.
define constraint.
a column or group of columns must be unique across all rows in the table
e.g. student_no must be unique in student table.
define superkey
attribute or set of attributes that uniquely identify a tuple in a relation
define candidate key
a superkey such that none of its subset is a superkey for that relation.
e.g. its unique and irreducible
what is a primary key
the candidate key, that is used to uniquely identify tuples in a relation.
thus, there may be many candidate keys, but only one is chosen as PK
What is a foreign key
an attribute or set of attributes within one relation (home relation) that matches the candidate key in another relation.