Week 4 Flashcards
What is the domain in a relational model?
Range of the values in a column; the data type of the attribute
What is a tuple in a relational model?
The data in a row
What is a attribute in a relational model?
The name of the columns
What is a relation in a relational model?
The ‘table’ (NOT EXACTLY)
What are the relation components?
- Relation schema (the NAME of the relation)
2. Relation body (the attributes of the relation)
What are the relation components?
- Relation schema (the NAME of the relation)
2. Relation body (the attributes of the relation)
Whats the difference between a relation and a table?
Main difference is that in a table, data can be input freely
In a relation, tuples (rows) are unique
What is the degree and cardinality of a relation relational model?
Degree = number of attributes (columns) Cardinality = number of tuples (rows)
What is a primary key in a relational model?
This uniquely identifies a tuple in a relation
What is a foreign key?
This shows the relationship between two relations
What is a candidate/minimal key?
A super key that does not contain a subset of any other super key
What is normalisation?
A process that ssigns attributes to entities so that data redundancies are reduced or elimatnted.
What are the stages of normalisation?
- First normal form (1NF)
- Second normal form (2NF)
- Third normal form (3NF)
- Fourth normal form (4NF)
What is denormalisation? Why necessary sometimes?
The process of lowering the stage of a normal form.
Required to sometimes meet performance requirements as lower forms have greater performance but greater redundancies.
What is the prime attribute?
A key attribute that is an attribute that is a part of a key or is the whole key.
What are key attributes?
The attributes that form the primary key
What is a nonprime attribute?
An attribute that is NOT a part of a key
What is a non-key attribute?
An attribute that is NOT a part of a key
What is the objective of normalisation?
To ensure that each relation conforms tto the concept of well-formed relations.
What is the concept of well-formed relations? List the charactersistics of a well-formed relation.
- Each relation only contains data for a single entity
(i. e. STUDENT will only contain data for students) - No data item will be unnecessarily stored in more than one relation. Reduces chance of data anomalies/inconsistencies.
- All non-prime attributes in a relation are dependent on the primary key
- Each relation is void of insertion, update or deletion anomalies. Ensures integrity and consistency of data.
What are the characteristics of the first normal form (1NF)
- Table format
- No repeating groups
- PK identified for the main relation
What are the characteristics of the second normal form (2NF)
- All of 1NF
- No partial dependencies based on any candidate keys
What are the characteristics of the third normal form (3NF)
- All of 2NF
- No transitive dependencies
What is the Boyce-Codd normal form? What are its characteristics?
It is a special case of a 3NF BUT every determinant is a candidate key.