Lecture 5-Relational Database Model
Lecture 5-Relational Database Model
Systems
Lecture 5
Presentation layout
Lecture Objectives
Introduction
Characteristics of a relational database
Relational Keys
Data integrity constraints
Functional dependency
Conclusion
References
Lecture Objectives
At the end of the lecture the student should be
able to:
1. Define relational database schema, table,
attribute and tuple.
2. Describe the characteristics of a relation
3. Explain the roles of the different types of
relational keys
4. Understand how data integrity is maintained
5. Describe the concept of functional
dependency.
The Relational model
The most popular DBMS model
The relational model, proposed by IBM
researcher E. F. Codd(1970)
It is based on predicate logic and set theory.
The relational model has three well-
defined components:
manipulated.
Relational Model Terminology -
Relation
Data is treated as a collection of related relations(tables).
A relation is perceived as a two-dimensional structure
(table) composed of rows and columns.
◦ a kind of set, also known as a dataset in Microsoft Access
◦ a subset of a Cartesian product
◦ an unordered set of ordered tuples
A relation contains information about an entity example of
an entity information is STUDENT in a COLLEGE database
◦ STUDENT relation contains student details like a unique student
number, last name , first name, other names, title, address, gender,
programme enrolled for e.t.c.
Each relation contains a group of related entity occurrences
◦ Each row in STUDENT relation is an instance of entity occurrence
Characteristics of a Relation
Each table row (tuple) represents a single entity occurrence
within the entity set
Each column represents an attribute, and has a distinct name
◦ An attribute is a property of an entity e.g StudentNumber
◦ Same as column name in a table
Each row/column intersection contains a single data value
(atomic)
All values in a single column must be of the same format
Each column is defined over the same attribute domain
The order of roes and column is not important
Each table must have attribute(s) that uniquely identifies rows
(Primary key)
Relational Model Terminology –
Relational Schema
A relational database is represented by a
relational schema.
A relational schema is a textual
attributes
A super key is not necessarily redundant it can
integrity.
To maintain entity integrity
a null (that is, no data entry at all) is not permitted in the
primary key.
A null is no value at all. It does not mean a zero or a space.
A null is created when you press the Enter key or the Tab
key to move to the next entry without making a prior entry
of any kind. Pressing the Spacebar creates a blank (or a
space).
◦ Nulls, if used improperly, can create problems because
they have many different meanings. For example, a null
can represent:
An unknown attribute value.
A known, but missing, attribute value.
A “not applicable” condition.
Entity Integrity Constraint
A primary Key value must exist
and it must not have a null value
Foreign key (FK)
A primary key in another table
A (FK) is an attribute whose values
functional dependencies.
AB C
BC D
CD E
DE A
What are all of the keys of R?
Conclusion
The relational model forms the bases of all
modern database models.
References
Elmasri, R. & Navathe, S., 2013. Fundamentals
of Database Systems. 4th ed. Boston: Digital
Vision.
Ramakrishnan, R. & Gehrke, J., 2010. Database
management Systems. 4th ed. New York:
MaGraw-Hill.
Rob, P. & Coronel, C., 2012. Database Systems:
Design Implementation and Management. 8th
ed. Massachuets: Course Technology.