Chapter3. Relational Database
Chapter3. Relational Database
SEMESTER: SEVEN
LECTURER: AHMED A. AIDID
Accounting Information System. 1
Learning Objectives
3
Basic Elements of Data Hierarchy
4
Importance of Database
5
File-Oriented Systems versus
Database Systems
In early processing systems, an organization’s
information was stored as groups of records in separate
files. These file processing systems constituted of a few
data files and many data application programs.
In the database approach, data is an organizational
resource that is used by and managed for the entire
organization, not just the originating department.
A database management system (DBMS) is the
program that manages and controls the data and the
interfaces between the data and the application
programs that use the data stored in the database. Like
SQL , MySQL, Oracle etc.
6
Continue…….
8
The Advantages of Database Systems
9
Database Systems- Logical and
Physical Views of Data.
In file-oriented systems, programmers must know the
physical location and layout of records.
A record layout is a document that shows the items
stored in a file, including the order and length of the
data fields and the type of data stored.
Database systems overcome this problem by separating the storage
of the data from the use of data elements. The database approach
provides two separate views of the data: the physical view and the
logical view.
The logical view is how people conceptually organize
and understand the relationships among data items.
The physical view refers to the way data are physically
arranged and stored in the computer system.
10
Database Design Process
The database design process consist of four primary
elements:
1. Users: users access the database in two ways. The first
is via user application programs that systems
professionals prepare. The second method of database
access is via direct query, which requires no formal
user programs.
2. Database Management System: The DBMS provides a
controlled environment to assist (or prevent) user access
to the database and to efficiently manage the data
resource. Each DBMS model accomplishes the following
objectives:
11
Continue……
i. Program development. The DBMS contains application
development software.
ii. Backup and recovery.
iii. Database usage reporting.
iv. Database access. The most important feature of a
DBMS is to permit authorized user access to the
database.
3. Database Administrator: The DBA is responsible for
managing the database resource. Multiple users sharing a
common database require organization, coordination,
rules, and guidelines to protect the integrity of the
database.
12
Continue……
4. The Physical Database: This is the lowest level of the
database. It’s the abstract representation of the database.
13
Relational Databases
A relational database is a type of database that stores
and provides access to data points that are related to one
another.
A relational database uses a relational data model.
Relational data model - is a two-dimensional table
representation of data; each row represents a unique
entity (record) and each column is a field where record
attributes are stored.
Each table is made up records ( the horizontal rows in
the table is called tuples ).
Each record is made up of fields ( which are the vertical
columns of the table also called attributes).
14
Relational Database Model
15
Types of Attributes
16
The Relational (REA) Database Model
17
The Relational Algebra Functions
Restrict, Project, and Join.
Restrict: Extracts specified rows from a specified table.
This operation, illustrated in Figure below (a), creates a
virtual table (one that does not physically exist) that is a
subset of the original table.
Project: Extracts specified attributes (columns) from a
table to create a virtual table. This is presented in Figure
below (b).
Join: Builds a new physical table from two tables
consisting of all concatenated pairs of rows, from each
table. See Figure below (c).
18
The Relational Algebra Functions
Restrict, Project, and Join.
19
The Elements of REA Database Model
Thank You
Managerial Accounting 22