Professional Documents
Culture Documents
Databases
Topic 5:
The Relational Model 1
Topic Review
Topic 3 – Entity Relationship Modelling 1
• Terminology
4
Table
Entity A Entity B
6
Data Independence
• Changes in the internal data representation, such as file structure,
storage and access paths should not have an effect on the
applications programs.
8
Normalised Relations
• By having an underpinning in set theory, it is possible to
organise relations as sets so that there is a minimum of data
redundancy. This process is known as normalisation.
9
Terminology -1
1) Relation
2) Attribute
3) Domain
4) Null
5) Not Null
Attributes 2) Attribute = Column
5) Not Null
3) Domain of valid course
codes:
COMP, HIST, LIT etc.
11
Terminology - 2
1) Tuple
2) Degree
3) Cardinality
4) Relational Database
5) Relational Schema
1) Tuple = Row Student ID First Name Last Name Course Code
Cardinality
4 Tuples S334 Dave Watson COMP
S765 Jagpal Jutley COMP
S783 Cynthia Kodogo HIST
S111 Walace Antigone LIT
3) Cardinality =
Number of
Degree tuples/rows
Alternative Terminology
Formal Term Alternative 1 Alternative 2
Properties of a Relation 1
Unique (3) Order (2) Cell Value (1)
Student Table
• Rows (no duplicate)
Student ID First Name Last Name Course Code
Properties of a Relation - 1
• It has a name which is unique within the relational schema.
Properties of a Relation - 2
Student Name Modules Course • relation name - X
1…* 1…*
Student Module
23 Med 1
28 OS
23 Med 2
21
Normalisation
• This process of moving from data that is not in a relational form, to a
relation, and finally to a set of ideal relations is known as
normalisation.
Keys
• Primary Key
• Foreign Key
• Super Key
• Candidate Key
23
Super Key
References
• Connolly, T. & Begg, C. (2004). Database Systems: A Practical Approach to Design,
Implementation, and Management, 4th Edition. Addison Wesley. Chapter 3.
• Codd, E. F. (1970), “A Relational Model for Large Shared Data Banks”. Retrieved on
20/05/11 from: http://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf
• McJones, P. (1995). Discussion of System R: “The 1995 SQL Reunion, People,
Projects and Politics”. Retrieved on 20/05/11 from:
http://www.mcjones.org/System_R/SQL_Reunion_95/