0% found this document useful (0 votes)
26 views32 pages

Ais Chapter 4

The document discusses relational databases, which are essential for modern integrated Accounting Information Systems (AIS) and organize data in tables with rows and columns. It covers key concepts such as entities, database management systems, data dictionaries, and the importance of maintaining data integrity through rules like entity and referential integrity. Additionally, it highlights the advantages and challenges of database systems, including normalization to eliminate anomalies in data management.

Uploaded by

xiaouejin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views32 pages

Ais Chapter 4

The document discusses relational databases, which are essential for modern integrated Accounting Information Systems (AIS) and organize data in tables with rows and columns. It covers key concepts such as entities, database management systems, data dictionaries, and the importance of maintaining data integrity through rules like entity and referential integrity. Additionally, it highlights the advantages and challenges of database systems, including normalization to eliminate anomalies in data management.

Uploaded by

xiaouejin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

CHAPTER 4:

RELATIONAL
DATABASES
Prepared by : Dhelrey Janine Yoldan
Gwyneth Jane Deiparine
Archie Villar
RELATIONAL DATABASES

❑ Underlie most modern integrated AISs. They are the most


popular type of database used for transaction processing.

❖ is a type of database that stores and organizes data in


tables (also called relations).

❖ Each table consists of rows and columns, where:


➢ Rows (Tuples) represent individual records or
entries.
➢ Columns (Attributes/Field) represent the properties
or fields of the data.
ENTITY

❑ is any object, person, place, event, or concept that can


be distinctly identified and stored as data. Entities are
the building blocks of a database and are typically
represented as tables in a relational database. Each
entity has attributes that define its properties or
characteristics.

❑ is anything about which the organization wishes to store


data. At your college or university, one entity would be
the student.
ENTITY

STUDENTS
Last First Phone Birth
Student ID Name Name Number Date
333-33-3333 Simpson Alice 333-3333 10/11/84
111-11-1111 Sanders Ned 444-4444 11/24/86
123-45-6789 Moore Artie 555-5555 04/20/85
ENTITY
All the fields containing data about one entity (one student) form a record.
❑All the fields containing data about one entity (one
student) form a record.
❑A set of all related records forms a file (student file).
❑A set of interrelated, centrally coordinated files forms a
database.

Student Class
File File

Advisor
File
DATABASE MANAGEMENT SYSTEM

❑serves as the interface between the database and the


various application programs.

DATABASE SYSTEM
❑ is the combination of the database, the DBMS, and the
application programs that access the database.

❑ were developed to address the problems associated with


the proliferation of master files.
Database
Fact A Fact B
Fact C Fact D
Fact E Fact F

Database
Management
System

Enrollment Fin. Aid Grades


Program Program Program

The person responsible for the database is the database administr


ator. As technology improves, many large companies are developing
very large databases called data warehouses.
IMPORTANCE AND DISADVANTAGES OF DATA
BASE SYSTEM
✓ Database technology is everywhere.

✓ Used in accounting/audit.

✓ Benefits includes:
❖ Data Integration
❖ Data Sharing
❖ Reporting Flexibility
❖ Minimal Data Redundancy and Inconsistencies
❖ Data Independence
❖ Central Management of Data
❖ Cross Functional Analysis

✓ Logical and physical views of data


❖ Logical view
❖ Physical view
Logical View—User A Logical View—User B
Enrollment by Class

The DBMS translates


DBMS users’ logical views in
to instructions as to w
hich data should be re
Operating trieved from the datab
System ase.

Database
Logical View—User A Logical View—User B
Enrollment by Class

DBMS
The operating system
Operating translates DBMS requ
System ests into instructions t
o physically retrieve d
ata from various disks
.
Database
DATABASE SYSTEM

❑Schemas - describes logical structure of a database.

Three levels:
❖Conceptual - shows the entire database, list of all data el
ement and its relationship.
❖External - a set of individual views on portions of the data
base
Subschema- refers to individual views
❖Internal - a low level view of the database describing how
data are accessed and stored.
Subschema--User A Subschema--User B Subschema--User C
Smith . . . A
Jones . . . B
Arnold . . .D

Mapping external-level views to conceptual-level schema

Classes Enroll Student

Cash
Receipt

Mapping conceptual-level items to internal-level descriptions


DATABASE SYSTEM
❑Data Dictionary
✓The first application of the newly implemented database sy
stem, containing the overall structure of the database
✓It records and provides description for each data element
✓Information for each data element:
❖ Description
❖ The record on which it is contained
❖ Length and type of field it if stored
❖ The program on which it is used
❖ Authorized users
DATABASE SYSTEM

❑Data Dictionary
▪ Dictionary Inputs include:
❖Records of new or deleted data elements
❖Changes in the names, description, or uses of the
existing elements
▪ Dictionary Outputs include:
❖Designing and implementing the system
❖Creating and audit trail
DATABASE SYSTEM
❑DBMS LANGUAGE
Every DBMS must perform the three basic functions of:
▪ Creating a database
The set of commands used to create the database is
called Data Definition Language (DDL) that is used to:
❖ Build the data dictionary
❖ Initialize the database
❖ Specify limitations
DATABASE SYSTEM

❑DBMS LANGUAGE
▪ Changing a database
The set of commands used to change the database is
called Data Manipulation Language (DML). DML is use
d for maintaining the data including:
❖ Updating data
❖ Inserting data
❖ Deleting portions of the database
▪ Querying a database
The set of commands used to query the database is c
alled Data Query Language (DQL).
❖ Ordering
❖ Sorting
❖ Retrieving records
DATABASE SYSTEM
❑Report Writer
✓ Simplifies creation of reports
✓ Users typically specify:
❖ What elements they want printed
❖ How the report should be formatted
✓ The report writer then:
❖ Searches the database
❖ Extracts specified data
❖ Prints them out according to specified format
RELATIONAL DATABASES
Relational Data Model
Presents related data in the forms of tables

Relation
RELATIONAL DATABASES
Alternatives for Storing Data
❑ Store all data in one uniform table.
For example, instead of separate tables for students
and classes, we could store all data in one table and
have a separate line for each student x class
combination.
❑Store each student in one row of the table and create
multiple columns to accommodate each class that he is
taking.
First
Student ID Last Name Name Phone No. Course No. Section Day Time
333-33-3333 Simpson Alice 333-3333 ACCT-3603 1 M 9:00 AM
333-33-3333 Simpson Alice 333-3333 FIN-3213 3 Th 11:00 AM
333-33-3333 Simpson Alice 333-3333 MGMT-3021 11 TH 12:00 PM
111-11-1111 Sanders Ned 444-4444 ACCT-3433 2 T 10:00 AM
111-11-1111 Sanders Ned 444-4444 MGMT-3021 5 W 8:00 AM
111-11-1111 Sanders Ned 444-4444 ANSI-1422 7 F 9:00 AM
123-45-6789 Moore Artie 555-5555 ACCT-3433 2 T 10:00 AM
123-45-6789 Moore Artie 555-5555 FIN-3213 3 Th 11:00 AM

• Using the suggested approach, a student taking three classes would


need three rows in the table.
• In the above, simplified example, a number of problems arise.
First
Student ID Last Name Name Phone No. Course No. Sect. Day Time
333-33-3333 Simpson Alice 333-3333 ACCT-3603 1 M 9:00 AM
333-33-3333 Simpson Alice 333-3333 FIN-3213 3 Th 11:00 AM
333-33-3333 Simpson Alice 333-3333 MGMT-3021 11 TH 12:00 PM
111-11-1111 Sanders Ned 444-4444 ACCT-3433 2 T 10:00 AM
111-11-1111 Sanders Ned 444-4444 MGMT-3021 5 W 8:00 AM
111-11-1111 Sanders Ned 444-4444 ANSI-1422 7 F 9:00 AM
123-45-6789 Moore Artie 555-5555 ACCT-3433 2 T 10:00 AM
123-45-6789 Moore Artie 555-5555 FIN-3213 3 Th 11:00 AM

• Suppose Alice Simpson changes her phone number. You need to make
the change in three places. If you fail to change it in all three places or
change it incorrectly in one place, then the records for
Alice will be inconsistent.
• This problem is referred to as an update anomaly.
First
Student ID Last Name Name Phone No. Course No. Sect. Day Time
333-33-3333 Simpson Alice 333-3333 ACCT-3603 1 M 9:00 AM
333-33-3333 Simpson Alice 333-3333 FIN-3213 3 Th 11:00 AM
333-33-3333 Simpson Alice 333-3333 MGMT-3021 11 TH 12:00 PM
111-11-1111 Sanders Ned 444-4444 ACCT-3433 2 T 10:00 AM
111-11-1111 Sanders Ned 444-4444 MGMT-3021 5 W 8:00 AM
111-11-1111 Sanders Ned 444-4444 ANSI-1422 7 F 9:00 AM
123-45-6789 Moore Artie 555-5555 ACCT-3433 2 T 10:00 AM
123-45-6789 Moore Artie 555-5555 FIN-3213 3 Th 11:00 AM

• What happens if you have a new student to add, but he hasn’t signed up
for any courses yet?
• Or what if there is a new class to add, but there are no students enrolled
in it yet? In either case, the record will be partially blank.
• This problem is referred to as an insert anomaly.
First
Student ID Last Name Name Phone No. Course No. Sect. Day Time
333-33-3333 Simpson Alice 333-3333 ACCT-3603 1 M 9:00 AM
333-33-3333 Simpson Alice 333-3333 FIN-3213 3 Th 11:00 AM
333-33-3333 Simpson Alice 333-3333 MGMT-3021 11 TH 12:00 PM
111-11-1111 Sanders Ned 444-4444 ACCT-3433 2 T 10:00 AM
111-11-1111 Sanders Ned 444-4444 MGMT-3021 5 W 8:00 AM
111-11-1111 Sanders Ned 444-4444 ANSI-1422 7 F 9:00 AM
123-45-6789 Moore Artie 555-5555 ACCT-3433 2 T 10:00 AM
123-45-6789 Moore Artie 555-5555 FIN-3213 3 Th 11:00 AM

• If Ned withdraws from all his classes and you eliminate all three of
his rows from the table, then you will no longer have a record of Ned. If
Ned is planning to take classes next semester, then you probably didn’t
really want to delete all records of him.
• This problem is referred to as a delete anomaly.
First
Student ID Last Name Name Phone No Class 1 Class 2 Class 3 Class 4
ACCT-36 MGMT-3
333-33-3333 Simpson Alice 333-3333 03 FIN-3213 021
ACCT-34 MGMT-3 ANSI-142
111-11-1111 Sanders Ned 444-4444 33 021 2
ACCT-34
123-45-6789 Moore Artie 555-5555 33 FIN-3213
RELATIONAL DATABASES

Basic Requirements of a Relational Database


❑ Every column in a row must be single valued.
❑ The primary key cannot be null.
o The primary key uniquely identifies a specific row
in the table, so it cannot be null, and it must be
unique for every record.
o This rule is referred to as the entity integrity rule
RELATIONAL DATABASES

❑ A foreign key must either be null or correspond to


the value of a primary key in another table.
o This rule is referred to as the referential integrity rule
o The rule is necessary because foreign keys are
used to link rows in one table to rows in another table.
❑ All non-key attributes in a table should describe a
characteristic of the object identified by the primary key.
STUDENTS
Advisor N
Student ID Last Name First Name Phone No. o.
333-33-3333 Simpson Alice 333-3333 1418
111-11-1111 Sanders Ned 444-4444 1418
123-45-6789 Moore Artie 555-5555 1503

ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Melton Amy 316
1503 Zhang Xi 202
1506 Radowski J.D. 203
DESIGNING RELATIONAL DATABASE
1. Normalization
✓ Starts with the assumption that everything is initially
stored in one large table.
✓ A set of rules is followed to decompose that initial table
into a set of normalized tables.
✓ Objective is to produce a set of tables in third-normal
form (3NF) because such tables are free of update,
insert, and delete anomalies.
DESIGNING RELATIONAL DATABASE

2. Semantic Data Modelling


✓ Database designer uses knowledge about how business
processes typically work and the information needs
associated with transaction processing to draw a
graphical picture of what should be included in the
database.
✓ The resulting graphic is used to create a set of relational
tables that are in 3NF.
DATABASE SYSTEM FUTURE OF ACCTG.
✓ Database systems may profoundly affect the fundamental
nature of accounting.
✓ The use of accounting information in decision making will
be enhanced by:
❖ Powerful querying capabilities that accompany
database packages.
❖ The ability to accommodate multiple views of the
same underlying phenomenon.
❖ The ability to integrate financial and operational data.
THANK YOU

You might also like