You are on page 1of 29

Databases

Topic 5:
The Relational Model 1

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.2

Scope and Coverage


This topic will cover:
Aims of the relational model
Basic concepts of the relational model
Terminology

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.3

Learning Outcomes
By the end of this topic, students will be able to:
Understand the aims of the relational model
Understand the basic concepts of the relational
model
Define key terms of the relational model

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.4

Background to Relational Model


Dominates the market in databases
Second generation of DBMSs
Developed by E.F. Codd in 1970
In the relational model, all data is logically
structured in relations.
Relations can be thought of as tables.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.5

Do not confuse relations with


relationships in ER models

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.6

History Theoretical Basis


E. F. Codds 1970 paper A relational model of data
for large shared data banks
- There should be a high degree of data
independence.
- There should be a minimum of redundancy:
relations should be normalised.
- There should be a set-orientated data
manipulation language.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.7

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.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.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.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.9

Set-Orientated Data Manipulation


Languages
Data can be manipulated by using set operations
since it will be organised in set-like relations.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.10

History Practical Developments - 1


System R. Developed by IBM in late 1970s

Development of the SQL Development of


(Structured Query Language) commercial database
systems
DB2; SQL/DS; Oracle

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.11

History Practical Developments - 2


INGRESS. Developed by University of California in
late 1970s

The INGRESS commercial products

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.12

History - Practical Developments - 3


Peterlee Relational Test Vehicle. Developed at
IBM UK in 1976

Theoretical insights into


Query Processing
Optimisation

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.13

Terminology -1
Relation
Attribute
Domain
Null

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.14

Attributes

Student ID First Name Last Name Course


Code
Relation

S334 Dave Watson COMP


S765 Jagpal Jutley COMP
S783 Cynthia Kodogo HIST
S111 Wallace Antigone LIT

Domain of valid course codes:


COMP, HIST, LIT etc.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.15

Terminology - 2
Tuple
Degree
Cardinality
Relational Database
Relational Schema

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.16

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

Degree

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.17

Alternative Terminology
Formal Term Alternative 1 Alternative 2

Relation Table File

Tuple Row Record

Attribute Column Field

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.18

Properties of a Relation - 1
It has a name which is unique within the relational
schema.
Each cell of a relation contains exactly one value.
Each attribute has a name.
Each tuple is unique.
The order of attributes is insignificant.
The order of tuples is insignificant.

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.19

Activity - Is This a Relation?


Student Name Modules Course
Guy Smith Med1 Medieval History History
1

Med2 Medieval History


2

TCE Twentieth Century


Sarah Anusiem OS Operating Systems Computing
12 New Street
Lagos NET Networks

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.20

Properties of a Relation - 2
It has a name which is unique within the relational
schema - X
Each cell of a relation contains exactly one value -
X
Each attribute has a name YES
Each tuple is unique - YES
The order of attributes is insignificant YES
The order of tuples is insignificant - YES

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.21

Now a Relation - Still Problems


Students
Student Address Modules Course
Name
Guy Smith Med1 Medieval History 1 History

Guy Smith Med2 Medieval History 2 History


Guy Smith TCE Twentieth Century History

Sarah Anusiem 12 New Street OS Operating Systems Computing


Lagos
Sarah Anusiem 12 New Street NET Networks Computing
Lagos

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.22

Students
Turned into a Student ID Name Address Course
set of normalised
28 Guy Smith History
relations...
23 Sarah 12 New Street Computing
Anusiem Lagos

Student Modules
Student ID Modules Code
Modules
28 Net
Module Code Name
23 Med 1 Med1 Medieval History 1
28 OS OS Operating Systems

23 Med 2 Med2 Medieval History 2


NET Networks
TCE Twentieth Century
History

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.23

Student ID Name Address Course


Keys...
28 Guy Smith History

23 Sarah 12 New Street Computing


Anusiem Lagos

Student ID Modules Code

28 Net Primary keys


23 Med 1 Module Code Name

28 OS Med1 Medieval History 1

23 Med 2 OS Operating Systems


Med2 Medieval History 2
NET Networks
TCE Twentieth Century
History

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.24

Student ID Name Address Course


Keys...
28 Guy Smith History

23 Sarah 12 New Street Computing


Foreign keys Anusiem Lagos

Student Modules Code


ID Module Code Name

28 Net Med1 Medieval History 1


OS Operating
23 Med 1
Systems
28 OS Med2 Medieval History 2
23 Med 2 NET Networks
TCE Twentieth Century
History

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.25

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.

We will be exploring normalisation more in the next


session...

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.26

Key Concepts Needed for Next


Session

Primary key
Super key
Candidate key
Foreign key

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.27

Learning Outcomes Have We


Met Them?
By the end of this topic, students will be able to:
Understand the aims of the relational model
Understand the basic concepts of the relational
model
Define key terms of the relational model

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.28

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/

V1.0 NCC Education Limited


The Relational Model 1 Topic 5 - 5.29

Topic 5 The Relational Model 1

Any Questions?

V1.0 NCC Education Limited

You might also like