Independent Learning Database
Independent Learning Database
Read through this lesson, try to understand and ask your fellow where you don’t
understand.
Note: All slides should be covered in one period
RELATIONAL The relational data model was
MODEL introduced by C. F. Codd in 1970.
Currently, it is the most widely used
data model. The relational data
model describes the world as “a
collection of inter-related relations
(or tables).”
Relation
A relation, also known as a table or
file, is a subset of the Cartesian
product of a list of domains
characterized by a name. You can
also think of it this way: an attribute
is used to define the record and a
record contains a set of attributes.
RELATIONAL MODEL
Table
a table of patients
a table of a student
a table of teacher
a table of books
Records
Cell
A simple table below gives us the clearest picture of how records and
fields work together in a database storage project.
RELATIONAL MODEL
RELATIONAL MODEL
Null value
In many situations every row and column will contain data, but there
are cases where it makes sense for some columns to not contain a
value.
Degree
For example:
Each field in a record has its own data type. The data types in the fields
can be text, alphanumeric, numeric, and Boolean or date/time.
DATABASE DESIGN:
ENTITY-
RELATIONSHIP
MODEL
Objectives: By the of this lesson, learners will be able to:
- Describe components of Entity-Relationship model,
The entity relationship (ER) data model has existed for over
35 years. It is well suited to data modelling for use with
databases because it is fairly abstract and is easy to discuss
and explain. ER models are readily translated to relations.
ER models, also called an ER schema, are represented by ER
diagrams.
1. Entity type
Strong entity is an entity that not Weak entity is an entity type that
existence-dependent on some is existence-dependent on some
other type. E.g. Student other entity type. E.g. Marks
Entity Relationship Diagram
2. Relationships between
Entities
DATABASE
DESIGN: A diamond represents a
ENTITY- relationship.
RELATIONSHIP
MODEL
Entity Relationship Diagram
3. Attribute
DATABASE
DESIGN: An ellipse represents an
ENTITY- attribute (Property).
RELATIONSHIP
MODEL
Entity Relationship Diagram
3. Attribute
3. Attribute
3. Attribute
3. Attribute
DATABASE
DESIGN: The types of attributes
ENTITY-
RELATIONSHIP Single valued attribute – This
MODEL
type of attribute has one value
for one entity.
For example, the Title attribute
has a single value for each
teacher.
Entity Relationship Diagram
Derived attribute – A derived attribute has its value computed from another attribute or
attributes.
DATABASE A derived attribute is not a part of a table from a database, but is shown for clarity or
DESIGN:
included for design purposes even though it adds no semantic information; it also provides
clues for application programmers.
ENTITY-
RELATIONSHIP An example of this can be : Age can be derived from the attribute Birthdate
In this situation, Birthdate is called a stored attribute, which is physically saved to the
MODEL database.
Entity Relationship Diagram