Relational Database

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Relational

Database

Adapted from :

Romney & Steinbart (2018)

Hall (2011)
Database Model

The database model is a particular


philosophy whose objectives are supported
by specific strategies, techniques,
hardware, and software that are very
different from those associated with flat-
file environments (Hall, 2011).
Database Vs Flat-file (legacy)
Approach

Romney & Steinbart (2018)


Database Vs Flat-file (legacy)
Approach

Database Flat-file
+ No data redundancy – Data stored individually by each units in
separated storage.
+ Single Update – Need multiple updates to change data in all
+ Current Values files.
– If a change is not well disseminated among
+ Task-data independence all users, inaccuracy of decision-making will
- Risk of unauthorized access more likely to happen.
– Since the data is exclusively owned by each
user, it is limitedly accessible.
Database Environment

Via application programs


Via direct query
Users

1. Program development
Physical 2. Backup and recovery
DB Elements DBMS 3. Database usage reporting
4. Database access

Magnetic spots
on magnetic disks

DBA
Database Management System
(DBMS)

A Software for
Managing Access to
Database by a variety
of authorized users
Database Approaches

Relational
- Database with tabular schema
Network (comprises rows and columns)
- Most-used currently
- First proposed by E. F. Codd in
the late 1960’s
Hierarchial
Navigational /
Structured Models
Database Administrator
Associations and Cardinality
The Physical
Database Tables
Properly designed tables possess the following four
characteristics:

1. The value of at least one attribute in each occurrence (row)


must be unique. This attribute is the primary key. The values of
the other (nonkey) attributes in the row need not be unique.

2. All attribute values in any column must be of the same class.

3. Each column in a given table must be uniquely named.


However, different tables may contain columns with the same
name.

4. Tables must conform to the rules of normalization. This


means they must be free from structural dependencies
including repeating groups, partial dependencies, and transitive
dependencies (see this chapter’s appendix for a complete
discussion).
Linkages
between
Relational
Database
User Views

CEO HR Manager Clerk


Database Anomalies

Update
Anomalies

Insertion
Deletion
Normalizing Tables

One or more of these anomalies will exist in tables that are not normalized or are
normalized at a low level, such as first normal form (1NF) or second normal form (2NF).
To be free of anomalies, tables must be normalized to the third normal form (3NF) level.
The resulting tables will then meet the two conditions below:
1. All non-key (data) attributes in the table are dependent on (defined by) the primary
key.
2. All non-key attributes are independent of the other non-key attributes.

Accountant’s role?
Designing Relational Databases

1. Identify entities.
2. Construct a data model showing entity associations.
3. Add primary keys and attributes to the model.
4. Normalize the data model and add foreign keys.
5. Construct the physical database.
6. Prepare the user views.
1. Identify
Entities
a. Condition 1. An entity must
consist of two or more
occurrences.

b. Condition 2. An entity must


contribute at least one attribute
that is not provided through
other entities.
2. Construct a data
model showing entity
associations.
1. PO – Inventory (0, M:M)

2. Inventory – Supplier (M:M)

3. Supplier – PO (1:0,M)

4. PO – RR (1:1)

5. RR – Inventory (0,M:M)
3. Add primary keys and
attributes to the model.
4. Normalize the data
model and add foreign
keys.
5. Construct the
physical database
Relational Database Queries
Romney & Steinbart (2018)
Page 122
THANK YOU

You might also like