2. Introduction to the Relational Model Flashcards
What is the Relational Model?
A means of storing information in tables called relations, where each table has multiple columns each with a unique name
Explain the concept of tuples as rows
- In mathematical terminology, a tuple is simply a sequence (or list) of values.
- A relationship between n values is represented mathematically by an n-tuple of values, i.e a tuple with n values, which corresponds to a row in a table.
What is meant by the terms relation, tuple and attribute?
- Relation = table
- Tuple = row
- Attribute = column
What is meant by a relation instance?
This refers to a specific instance of a relation, i.e containing a specific set of rows.
What is the domain of an attribute?
The set of allowed values
What are the properties of relations? (7)
- Relation has a distinct name
- Each cell contains one single value
- Attributes in a relation have distinct names
- Values of an attribute are of the same domain
- There are no duplicate tuples
- Order of attributes has no significance
- Order of tuples has no significance in theory
Explain the concept of a key
- We must have a way to specify how tuples within a given relation are distinguished.
- This is expressed in terms of their attributes. That is, the values of the attribute values of a tuple must be such that they can uniquely identify the tuple.
What is a superkey?
A superkey is a set of one or more attributes that, taken collectively, allow us to identify uniquely a tuple in the relation.
What is a candidate key?
A candidate key is the minimum amount of attributes you need to identify uniquely a tuple in the relation.
What is the Relational Schema Notation?
()
- Primary keys are underlined
- Foreign keys are followed by an asterisk
- Attributes are optionally followed by domain information
e.g instructors (id: integer, name: string, dept_name*: string, salary: float)