You are on page 1of 6

IT-IMO1: ADVANCED DATABASE SYSTEMS I Relational Data Model

Data Models • A model composed of datasets that may have


different types but also contain fields that may
• Refers to the process of creating a specific data
be related to other tables.
representation for a determined business
problem • These fields serve as a link to another table to
form a relation.
• “Blueprint” with all the instructions to build a
database that will meet all end-user • Structural independence promoted by use of
requirements independent tables

• An implementation-ready data model should • The relational database table resembles a file
contain at least the following components: (similar but with a crucial difference)

• Records are organized into tables, with


relationships established between
tables (through keys)

• Implemented through a Relational Database


Management System (RDBMS)

TYPES OF DATA MODEL • The RDBMS software translates a user’s


logical requests (queries) into commands
that physically locate and retrieve the
requested data.

• Started database revolution because of:

• Its conceptual simplicity

Hierarchical Data Model • Its powerful and flexible query language


- Structured Query Language (SQL)
• A tree-like data model that stores data in a
hierarchic structure. • Allows the user to specify what must be
done without specifying how.
• Each record-type is represented by a node in
the tree. • The RDBMS uses SQL to translate user
queries into instructions for retrieving
• Organize records not relationships the requested data.

• SQL makes it possible to retrieve data


with far less effort than any other
database or file environment.

Object Oriented Data Model

• Follows the concepts of the use of object-


oriented technology in database creation
Network Data Model • Since object oriented, we can store pictures,
• Advancement of a hierarchical data model. audio, video, and other types of data, which was
previously impossible to store with the
Data in a network data model may have one or
many 'ancestors. relational approach.

• Allows navigation

• Main Disadvantages:

• Complicated Relationships

• Need for Large Storage Capacity


NoSQL Data Model ER Diagram

• A new generation of databases that address the • Entity – typically noun


specific challenges of the Big Data era and have
• Attributes – characteristic
the following general characteristics:
of entities

• Relationships – association;
typically verb

ER Diagram: Example

Three Important Elements of Data Model

- A person, place, thing,


or event about which
data will be collected or
stored Composite Attributes
- Represents a particular
type of object in the ▪ made up of two or more simple attributes
real world

- A characteristic of an
entity
- Equivalent of fields in
file systems

- Describes an
association among
- Three Types of
relationships: one-to-
many, many-to-many, Multivalued attributes
and one-to-one
▪ capable of taking on more than one value
All of these are an equal part of a data model. None of
each element is greater than the other.

Properties of Data Model

Derived Attributes

▪ an attribute whose value is calculated from


other attributes
• ERD Process

I. Identify the business rules based on the


description of operations

II. Identify the main entities and relationships from


the business rules

III. Identify the attributes and primary keys that


adequately describe the entities

IV. Develop the initial ERD

V. Revise and review the ERD, as needed


Relationship

▪ If a customer can have multiple loans

IT IMO1: ADVANCED DATABASE SYSTEMS I: LESSON 2

Enhanced Entity-Relationship Model Generalization

• Also known as Extended ER Model • It is the process of determining entities with


common attributes to form a more general
• Result of adding more features and
entity type and is also known as a supertype
relationships to the original ER model
entity.

EER vs ER Diagram

• Both diagrams make designing your database


easier.

- Gives you the visual


outlook of your
database.
- It details the
relationships and
attributes of its entities,
paving the way for
smooth database Specialization
development in the
steps ahead. • Process of determining one or more subtype
from the supertype to create a supertype or a
- Best for taking a more subtype relationship.
detailed look at your -
information.
- When your database
contains a larger
amount of data, it’s
best to turn to an
enhanced version to
more deeply
understand your model. -
Supertype and Subtypes

• Supertype - It is a general
entity type that may be
related to a single or
more subgroup

• Subtype - It is a more specific


subgrouping that shares
attributes with the supertype.
Aggregation Total Specialization Rule

• When two entities having relation is treated as a ▪ Each instance of an entity in supertype should
sole entity be a part of a subtype in the relation.

• Sometimes called the “Has a” relationship

Partial Specialization Rule

▪ An occurrence of an entity in supertype is


permissible not to belong to any subtype

EER Constraints: Disjointness Constraint



Disjointness Constraint

▪ denotes an “either or” scenario wherein the


supertype can belong to one of the subtypes
but cannot belong to others.

Composition

• Also known as a special or restricted


aggregation

• The existence of one entity is dependent on the



existence of another.

Overlap Rule
EER Constraints : Completeness Constraints
▪ states that a single entity can be a part of two or
Completeness Constraints
more subtypes
▪ is a type of constraint used to determine or
specify if an occurrence of an entity supertype
can also be included to least one subtype.
• IT IMO1: ADVANCED DATABASE SYSTEMS I: LESSON 3

Database Normalization

Conceptual Model to Relational Model

• Conceptual Models like ER Diagrams is a great


way of designing and representing the database
design in more of a flow chart form.
Notations
• We can generate relational database schema
using the ER diagram, by keeping in mind the
following:

• Entity gets converted into Table, with all the


attributes becoming fields(columns) in the
table.

• Primary Keys should be properly set.

EERD Example Normalization

• An organization depends on a number of • A process of structuring attributes on a


different types of members for its successful relational database to eliminate data
operation. Three types of members are of repetition/redundancy.
greatest interest: employees, volunteers and • Data redundancy occurs when the same piece
donors. Only employees have a date hired of data exists in multiple places.
attribute, and only volunteers have a skill
attribute. Donors only have a relationship
(named Donates) with an item that has number
and name. A donor must have donated one or
more items, and an item may have no donors or Normalization: Anomalies
one donor.
Insertion Anomaly
• The organization is interested in the following
▪ You cannot add up data on new doctors until
attributes for all of these person: Name,
they have a patient of their own.
Address, and phone number. A person may have
multiple telephone numbers. Deletion Anomaly
• There are persons other than employees, ▪ If Doctor Jekyll has only one patient (David), and
volunteers, and donors who are of interest to his record got deleted accidentally, then the
the organization. On the other hand, at a given data about Doctor Jeckyll will also be deleted
time a person may belong to two or more of
Modification Anomaly
these group.
▪ Supposed Doctor Hyde leaves the hospital and
• Assumption: Potential donors are not included
be replaced by Dr John. Then we have to update
in this database
all the records of patients of Doctor Hyde to
reflect Doctor John’s data

Normalization: Objectives

Advantages of Normalization
Goals of Normalization Process Partial Dependency

• When the determinant of a functional


dependency is only an attribute or a part of the
primary key.

• Partial dependencies tend to be straightforward


and easy to identify.

If (A, B) → (C, D), B → C, and (A, B) is the primary


key, then the functional dependence B → C is a
Normalization partial dependency because only part of the
• Normalization works through a series of stages primary key (B) is needed to determine the value
called normal forms of C.

Recall: Functional Dependence

• The attribute B is functionally dependent on the Dependency Diagram


attribute A if each value of A uniquely • Used to illustrate the dependencies determined
determines value of B. in a table structure

• It also provides an overview of relationships


that are existing on a table.

• It would reduce the risk of having an important


dependency being overlooked.

• The dependency diagram indicates that authors


are paid royalties for each book they write for a
publisher. The amount of the royalty can vary by
author, by book, and by edition of the book.
Transitive Dependency

• It exists when there is an indirect relationship


between the two attributes/fields

If A → B and B → C are valid functional


dependencies, the dependency A → C is a
transitive dependency because A determines the
value of C via B

You might also like