0% found this document useful (0 votes)
39 views61 pages

AIS CH3 (Relational Database)

This document provides an overview of relational databases and their advantages over traditional file-based systems for storing organizational data. It defines key concepts like entities, attributes, records, files and databases. Relational databases improve data integration, reduce data redundancy and improve data consistency by bringing together related information that may have previously been stored across multiple files. They are managed by a database management system (DBMS) that acts as an interface between users, applications and the centralized database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views61 pages

AIS CH3 (Relational Database)

This document provides an overview of relational databases and their advantages over traditional file-based systems for storing organizational data. It defines key concepts like entities, attributes, records, files and databases. Relational databases improve data integration, reduce data redundancy and improve data consistency by bringing together related information that may have previously been stored across multiple files. They are managed by a database management system (DBMS) that acts as an interface between users, applications and the centralized database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

ABAARSO TECH UNIVERSITY

COURSE: ACCOUNTING INFORMATION SYSTEM

CHAPTER 3: Relational data base

SEMESTER SIX: ACCOUNTING

INSTRUCTOR: ABDIHAKIM TIYARI ( BA, MBA, ACCA).


Contact: [email protected]
Phone number: 063-4075785

1
CHAPTER 3

Relational data base

2
INTRODUCTION

Questions to be addressed in this chapter:

How are databases different than file-based systems?


Why databases are important and what is their
advantage?
What is the difference between logical and physical
views of a database?
What are the fundamental concepts of database systems
such as DBMS, schemas, the data dictionary, and
DBMS languages?
What is a relational database, and how does it organize
data?
How are tables structured to properly store data in a
relational database? 3
INTRODUCTION
 Relational databases are used for most
modern integrated AISs.
– They are the most popular type of database
used for transaction processing.
– In this chapter, we’ll define the concept of
a database and relational data base.

4
FILE VS. DATABASES
• Let’s examine some basic principles about how data are
stored in computer systems.
– An entity is anything about which the organization
wishes to store data. At your college or university,
one entity would be the student.

STUDENTS

Phone
Student ID Last Name First Name Number Birth Date

333-33-3333 Samson Seleshe 333-3333 10/11/84

111-11-1111 Abebe Chine 444-4444 11/24/86

123-45-6789 Fugge Ferera 555-5555 04/20/85


5
FILE VS. DATABASES
– Information about the attributes of an entity
(e.g., the student’s ID number and birth date)
are stored in fields. A field is the physical space
where an attribute is stored.
STUDENTS

Phone
Student ID Last Name First Name Number Birth Date

333-33-3333 Samson Seleshe 333-3333 10/11/84

111-11-1111 Abebe Chine 444-4444 11/24/86

123-45-6789 Fugge Ferera 555-5555 04/20/85


6
FILE VS. DATABASES
– All the fields containing data about one entity (e.g.,
one student) form a record.
– The example below shows the record for Abebe Chine.

STUDENTS

Phone
Student ID Last Name First Name Number Birth Date

333-33-3333 Samson Seleshe 333-3333 10/11/84

111-11-1111 Abebe Chine 444-4444 11/24/86

123-45-6789 Fugge Ferera 555-5555 04/20/85


7
FILE VS. DATABASES
– A set of all related records forms a file (e.g., the student
file).
– If this university only had three students and five fields
for each student, then the entire file would be depicted
below.

STUDENTS
Phone
Student ID Last Name First Name Number Birth Date
333-33-3333 Samson Seleshe 333-3333 10/11/84
111-11-1111 Abebe Chine 444-4444 11/24/86
123-45-6789 Fugge Ferera 555-5555 04/20/85
8
FILE VS. DATABASES

– A master file is a file that stores cumulative information about an


organization’s entities.

– A set of interrelated, centrally coordinated files forms a database.

Student Class
File File

Advisor
File
9
FILE VS. DATABASES
• Database systems were developed to address the
problems associated with the proliferation of
master files.
– For years, each time when a new information
need arose, companies created new files and
programs.
– The result: a significant increase in the number
of master files.

10
FILE VS. DATABASES
• This proliferation of master files
created problems:
Master File 1 Enrollment – Often the same information
Fact A
Fact B
Program was stored in multiple master
Fact C files.
– Made it more difficult to
effectively integrate data and
Master File 2
Fin. Aid
obtain an organization-wide
Fact A
Fact D Program view of the data.
Fact F – Also, the same information
may not have been consistent
between files.
Master File 3
Fact A
Grades e.g. If a student changed his
Program
Fact B phone number, it may have
Fact F been updated in one master
file but not another.
11
FILE VS. DATABASES
Database • Database systems
Fact A Fact B
Fact C Fact D were developed to
Fact E Fact F address the above
stated problems
Database
Management
System

Enrollment Fin. Aid Grades


Program Program Program

12
FILE VS. DATABASES
• The database approach treats
Database
Fact A Fact B data as an organizational
Fact C Fact D resource that should be used
Fact E Fact F by entire organization and
managed for the entire
organization,
Database
Management • Data is not just a particular
System department.
• A database management
system (DBMS) serves as
Enrollment
Program
Fin. Aid
Program
Grades
Program
the interface between the
database and the various
application programs.
13
FILE VS. DATABASES
Database • The combination of
Fact A Fact B
Fact C Fact D the database, the
Fact E Fact F DBMS, and the
application programs
Database
Management
that access the
System database is referred
to as the database
Enrollment
Program
Fin. Aid
Program
Grades
Program
system.

14
FILE VS. DATABASES
Database • The person responsible
Fact A Fact B for the database is the
Fact C Fact D
Fact E Fact F database
administrator.
Database • As technology
Management
System
improves, many large
companies are
Enrollment Fin. Aid Grades
developing very large
Program Program Program databases called data
warehouses.
15
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS

• As accountants, you are likely to audit or work for


companies that use database technology to store,
process, and report accounting transactions.
– Many accountants work directly with databases
and will enter, process, and query databases.
– Some will develop and evaluate internal
controls necessary to ensure database integrity.
– Others will be involved in the design and
management of databases.
16
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS

• Database technology provides the following


benefits to organizations:
– Data integration • Achieved by combining
master files into larger
pools of data accessible
by many programs.

17
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS

• Database technology provides the following


benefits to organizations:
– Data integration
– Data sharing • It’s easier to share data
that’s integrated.

18
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS

• Database technology provides the following


benefits to organizations:
– Data integration
– Data sharing
– Reporting flexibility
• Reports can be revised easily and
generated as needed.
• The database can easily be browsed
to research problems or obtain
detailed information. 19
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS

• Database technology provides the following


benefits to organizations:
– Data integration
– Data sharing
– Reporting flexibility
– Minimal data redundancy and
inconsistencies
• Because data items are
usually stored only once.
20
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS
• Database technology provides the following benefits to
organizations:
– Data integration
– Data sharing
– Reporting flexibility
– Minimal data redundancy and inconsistencies

21
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS

• Database technology provides the following benefits to


organizations:
– Data integration
– Data sharing
– Reporting flexibility
– Minimal data redundancy and inconsistencies
– Central management of data
• Data management is more efficient because the
database administrator is responsible for coordinating,
controlling, and managing data.
22
IMPORTANCE AND ADVANTAGES OF DATABASE SYSTEMS
• Database technology provides the following
benefits to organizations:
• Relationships can be
– Data integration
explicitly defined and
– Data sharing used in the preparation
– Reporting flexibility of management
reports.
– Minimal data redundancy and inconsistencies
• EXAMPLE:
– Central management of data Relationship between
– Cross-functional analysis selling costs and
promotional
campaigns.
23
DATABASE SYSTEMS
Logical and Physical Views of Data
In file-oriented systems, programmers must
know the physical location and layout of
records used by a program.
• They must reference the location, length,
and format of every field they utilize.
• When data is used from several files, this
process becomes more complex.

24
DATABASE SYSTEMS
• Database systems overcome this problem by
separating the storage and use of data
elements.
Two separate views of the data are provided:
• Logical view
 How the user or programmer
conceptually organizes and
understands the data.

25
DATABASE SYSTEMS
• Database systems overcome this problem by
separating the storage and use of data elements.
– Two separate views of the data are provided:
• Logical view
• Physical view

 How and where the data are


physically arranged and stored.
 Tape, CD-ROM, or other
media.
26
Logical View—User A Logical View—User B
Enrollment by Class Scholarship Distribution
Fr.
5%
Sr. Soph.
33% 24%

Jr.
38%

DBMS The DBMS


translates users’
logical views into
Operating
System
instructions as to
which data should
be retrieved from
Database the database.
27
Logical View—User A Logical View—User B
Enrollment by Class Scholarship Distribution
Fr.
5%
Sr. Soph.
33% 24%

Jr.
38%

DBMS The operating


system translates
DBMS requests
Operating
System into instructions to
physically retrieve
data from various
Database disks.
28
DATABASE SYSTEMS
• Schemas
– A schema describes the logical structure of a
database.
– There are three levels of schema.
• Conceptual level schema
• The organization-wide view of the
entire database—i.e., the big picture.
• Lists all data elements and the
relationships between them.
29
DATABASE SYSTEMS
• Schemas
– A schema describes the logical structure of a
database.
– There are three levels of schema.
• Conceptual level schema
• External level schema
• A set of individual user views of portions of the
database, i.e., how each user sees the portion of
the system with which he interacts.
• These individual views are referred to as
subschema. 30
DATABASE SYSTEMS
• Schemas
– A schema describes the logical structure of a
database.
– There are three levels of schema.
• Conceptual level schema
• External level schema
• Internal level schema
• A low-level view of the database. Includes specific elements:
– Record layouts
– Definitions
– Addresses
– Indexes 31
Schemas

03/21/2022
DATABASE SYSTEMS

• The Data Dictionary


– A key component of a DBMS is the data
dictionary.
• Contains information about the structure
of the database.
• For each data element, there is a
corresponding record in the data
dictionary describing that element.

33
DATABASE SYSTEMS
Information provided for each element includes:
 A description or explanation of the element.
 The records in which it is contained.
 Its source.
 The length and type of the field in which it is
stored.
 The programs in which it is used.
 The outputs in which it is contained.
 The authorized users of the element.
 Other names for the element. 34
DATABASE SYSTEMS
The DBMS usually maintains the data
dictionary.
– It is often one of the first applications of a
newly implemented database system.
– Inputs to the dictionary include:
• Records of new or deleted data
elements.
• Changes in names, descriptions, or uses
of existing elements.
– Outputs include:
• Reports that are useful to programmers,
database designers, and AIS users. 35
DATABASE SYSTEMS
• DBMS Languages
– Every DBMS must provide a means of
performing the three basic functions of:
• Creating a database
• Changing a database
• Querying a database

36
DATABASE SYSTEMS
• DBMS Languages
– Every DBMS must provide a means of
performing the three basic functions of:
• Creating a database
• Changing a database
• Querying a database

37
DATABASE SYSTEMS
• Creating a database:
– The set of commands used to create the
database is known as data definition language
(DDL). DDL is used to:
• Build the data dictionary
• Initialize or create the database
• Describe the logical views for each
individual user or programmer
• Specify any limitations or constraints on
security imposed on database records or
fields 38
DATABASE SYSTEMS
• DBMS Languages
– Every DBMS must provide a means of
performing the three basic functions of:
• Creating a database
• Changing a database
• Querying a database

39
DATABASE SYSTEMS
• Changing a database
– The set of commands used to change the
database is known as data manipulation
language (DML). DML is used for
maintaining the data including:
• Updating data
• Inserting data
• Deleting portions of the database

40
DATABASE SYSTEMS
• DBMS Languages
– Every DBMS must provide a means of
performing the three basic functions of:
• Creating a database
• Changing a database
• Querying a database

41
DATABASE SYSTEMS
• Querying a database:
– The set of commands used to query the database is
known as data query language (DQL). DQL is used
to interrogate the database, including:
• Retrieving records
• Sorting records
• Ordering records
• Presenting subsets of the database
– The DQL usually contains easy-to-use, powerful
commands that enable users to satisfy their own
information needs.
42
RELATIONAL DATABASES
• DBMS is characterized by the type of
logical data model on which it is based.
– A data model is an abstract representation
of the contents of a database.
– Most new DBMSs are called relational
databases because they use the relational
data model developed by E.F. Codd in
1970.

43
RELATIONAL DATABASES
• The relational data model represents
everything in the database as being stored
in the forms of tables (aka, relations).

44
STUDENTS
Last First
Student ID Name Name
333-33-3333 Samson Alemu
Relation
111-11-1111 Senait Negadras
123-45-6789 Meron Aseged

COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30

STUDENT x COURSE
SCID Student ID Course
333333333-1234 333-33-3333 1234
333333333-1236 333-33-3333 1236
111111111-1235 111-11-1111 1235
111111111-1236 111-11-1111 1235
RELATIONAL DATABASES

• This model only describes how the data


appear in the conceptual- and external-
level schemas.
• The data are physically stored according
to the description in the internal-level
schema.

46
STUDENTS
Last First Phone
Student ID Name Name No.
333-33-3333 Samson Alemu 333-3333
111-11-1111 Asenafi Negadras 444-4444
123-45-6789 Tilahun Aseged 555-5555

COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234
333333333-1236
111111111-1235
111111111-1236
Each row contains
STUDENTS
Last First Phone
data about a
Student ID Name Name No. specific
333-33-3333 Samson Alemu 333-3333 occurrence of the
111-11-1111 Asenafi Negadras 444-4444 type of entity in
123-45-6789 Tilahun Aseged 555-5555 the table.
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234
333333333-1236
111111111-1235
111111111-1236
Each column in
STUDENTS
Last First Phone
a table contains
Student ID Name Name No. information
333-33-3333 Samson Alemu 333-3333 about a specific
111-11-1111 Asenafi Negadras 444-4444 attribute of the
123-45-6789 Tilahun Aseged 555-5555 entity.
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234
333333333-1236
111111111-1235
111111111-1236
STUDENTS
Last First Phone
Student ID Name Name No.
333-33-3333 Samson Alemu 333-3333
111-11-1111 Asenafi Negadras 444-4444
123-45-6789 Tilahun Aseged 555-5555

COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
A primary key is the
333333333-1234 attribute or combination of
333333333-1236 attributes that uniquely
111111111-1235
identifies a specific row in a
111111111-1236
table.
STUDENTS
Last First
Student ID Name Name
333-33-3333 Samson Alemu
111-11-1111 Asenafi Negadras
123-45-6789 Tilahun Aseged

COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234 In some tables, two or more
333333333-1236 attributes may be joined to form
111111111-1235 the primary key.
111111111-1236
STUDENTS
First Advisor
Student ID Last Name Name Phone No. No.
333-33-3333 Samson Alemu 333-3333 1418
111-11-1111 Asenafi Negadras 444-4444 1418
123-45-6789 Tilahun Aseged 555-5555 1503

ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Mengesha Almawu 316
1503 Zenebe Zinabu 202
1506 Robel Jigsaw 203

A foreign key is an attribute in one table and it is a


primary key in another table.
STUDENTS
First Advisor
Student ID Last Name Name Phone No. No.
333-33-3333 Samson Alemu 333-3333 1418
111-11-1111 Asenafi Negadras 444-4444 1418
123-45-6789 Tilahun Aseged 555-5555 1503

ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Mengesha Almawu 316
1503 Zenebe Zinabu 202
1506 Robel Jigsaw 203

Foreign keys are used to link tables


together.
STUDENTS
First Advisor
Student ID Last Name Name Phone No. No.
333-33-3333 Samson Alemu 333-3333 1418
111-11-1111 Asenafi Negadras 444-4444 1418
123-45-6789 Tilahun Aseged 555-5555 1503

ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Mengesha Almawu 316
1503 Zenebe Zinabu 202
1506 Robel Jigsaw 203

Other non-key attributes in each table store


important information about the entity.
RELATIONAL DATABASES
• Basic Requirements of a Relational
Database
B. The primary key cannot be null.
• The primary key uniquely identifies a
specific row in the table, so it cannot be
null, and it must be unique for every
record.
• This rule is referred to as the entity
integrity rule.
55
Last First Phone
Student ID Name Name No.
333-33-3333 Samson Alemu 333-3333
111-11-1111 Ashenafi Negadras 444-4444
123-45-6789 Tilahun Aseged 555-5555

COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID • Note that within each table, there are no
333333333-1234 duplicate primary keys and no null
333333333-1236 primary keys.
111111111-1235
• Consistent with the entity integrity rule.
111111111-1236
RELATIONAL DATABASES
• Basic Requirements of a Relational Database
C. A foreign key must either be null or
correspond to the value of a primary key in
another table.
• This rule is referred to as the referential
integrity rule.
• The rule is necessary because foreign keys
are used to link rows in one table to rows in
another table.
57
STUDENTS
First Advisor
Student ID Last Name Name Phone No. No.
333-33-3333 Samson Alemu 333-3333 1418
111-11-1111 Ashenafi Negadras 444-4444 1418
123-45-6789 Tilahun Aseged 555-5555 1503

ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Mengesha Almawu 316
1503 Zenebe Zinabu 202
1506 Robel Jigsaw 203

Advisor No. is a foreign key in the STUDENTS table. Every


incident of Advisor No. in the STUDENTS table either matches
an instance of the primary key in the ADVISORS table or is
null.
DATABASE SYSTEMS AND THE FUTURE OF
ACCOUNTING
• Database systems may profoundly affect the
fundamental nature of accounting:
May lead to abandonment of double-entry
accounting, because the redundancy of the
double entry is not necessary in computer data
processing.
May also alter the nature of external reporting.
• EXAMPLE: External users could have
access to the company’s database and
manipulate the data to meet their own
reporting needs.
59
DATABASE SYSTEMS AND THE FUTURE OF
ACCOUNTING
 To enhanced the use of accounting
information in decision making and to over
come the above problems:
 Accountants must become knowledgeable
about databases so they can participate in
developing the AIS of the future.
 They must help ensure that adequate controls
are included to safeguard the data and assure
its reliability.
60
End of chapter three

61

You might also like