0% found this document useful (0 votes)
292 views50 pages

AIS Chapter 3 Relational Data Base

application or department. Management System A database is a structured collection of related data stored together in one or more files or tables. A relational database organizes data into tables and establishes relationships between them. Relational databases are more flexible than file-based systems as they allow data to be accessed in multiple ways through relationships. A database management system provides users with tools to efficiently store, query and manage related data across multiple applications and departments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
292 views50 pages

AIS Chapter 3 Relational Data Base

application or department. Management System A database is a structured collection of related data stored together in one or more files or tables. A relational database organizes data into tables and establishes relationships between them. Relational databases are more flexible than file-based systems as they allow data to be accessed in multiple ways through relationships. A database management system provides users with tools to efficiently store, query and manage related data across multiple applications and departments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 50

C HAPTER 3

Relational Databases
Relational Databases and REA Data Model
Database Systems, Database Design Using the REA Data
Model, Database Systems and Future of Accounting

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 1 of 95
INTRODUCTION
• Questions to be addressed in this chapter:
– How are databases different than file-based legacy
systems?
– Why are databases important and what is their
advantage?
– 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?

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 2 of 95
INTRODUCTION

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 3 of 95
INTRODUCTION
• WHAT IS A DATABASE?
• A database is a set of data stored in a computer. This
data is usually structured in a way that makes the data
easily accessible.

• WHAT IS A RELATIONAL DATABASE?


A relational database is a type of database. It uses a
structure that allows us to identify and access data in
relation to another piece of data in the database. Often,
data in a relational database is organized into tables.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 4 of 95
INTRODUCTION

• Relational databases underlie most


modern integrated AISs.
– They are the most popular type of database
used for transaction processing.
– Relational data bases are the most common
data base systems
– A relational data base is a collection of data
items organized as a set of fromally described
tables from which data can be accessed in
different ways
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 5 of 95
FILE VS. DATABASES
• FILE VS. DATABASES

• A database is generally used for storing related,


structured data, with well defined data formats, in an
efficient manner for insert, update and/or retrieval
(depending on application).
• On the other hand, a file system is a more unstructured
data store for storing arbitrary, probably unrelated data.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 6 of 95
FILE VS. DATABASES
The difference between file processing system and database management
system is as follow:
• File stores data in a plain text, file holds one record, file can not
have multiple tables or records. Where as data base will have
multiple tables and records.
• File processing system provides less flexibility in accessing data,
whereas dbms has more flexibility in accessing data.
• File processing system does not provide data consistency, whereas
DBMS provides data consistency through normalization.
• File processing system is less complex, whereas DBMS is more
complex

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 7 of 95
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 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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 8 of 95
FILE VS. DATABASES
– Information about the attributes of an entity (e.g., the
student’s ID number and birth date) are stored in
fields.

STUDENTS

Phone
Student ID Last Name First Name Number Birth 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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 9 of 95
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 Artie Moore.

STUDENTS

Phone
Student ID Last Name First Name Number Birth 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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 10 of 95
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 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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 11 of 95
FILE VS. DATABASES
– A set of interrelated, centrally coordinated files forms
a database.

Student Class
File File

Advisor
File
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 12 of 95
FILE VS. DATABASES

Database
• A database is a set
Fact A Fact B
Fact C Fact D of inter-related,
Fact E Fact F
centrally
coordinated files.
Database • DBMS- provides users and
Management programmers with a systematic
System
way to create, retrieve, update
and manage data
Enrollment Fin. Aid Grades
Program Program Program

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 13 of 95
FILE VS. DATABASES
• The database approach
Database treats data as an
Fact A Fact B
Fact C Fact D
organizational resource
Fact E Fact F that should be used by
and managed for the
entire organization, not
just a particular
Database department.
Management
System
• A database management
system (DBMS) serves
as the interface between
the database and the
Enrollment Fin. Aid Grades
Program Program Program
various application
programs.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 14 of 95
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
Database
Management
programs that
System access the
database is
Enrollment
Program
Fin. Aid
Program
Grades
Program
referred to as the
database system.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 15 of 95
FILE VS. DATABASES
• The person
Database
Fact A Fact B responsible for the
Fact C Fact D
Fact E Fact F database is the
database
administrator.
Database • As technology
Management
System improves, many large
companies are
developing very large
Enrollment Fin. Aid Grades
Program Program Program databases called data
warehouses.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 16 of 95
IMPORTANCE AND ADVANTAGES OF
DATABASE SYSTEMS

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 17 of 95
IMPORTANCE AND ADVANTAGES OF
DATABASE SYSTEMS
• Database technology is everywhere.
– Most new AISs implement a database
approach.
– Virtually all mainframe computer sites use
database technology.
– Use of databases with PCs is growing also.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 18 of 95
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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 19 of 95
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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 20 of 95
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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 21 of 95
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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 22 of 95
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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 23 of 95
IMPORTANCE AND ADVANTAGES OF
DATABASE SYSTEMS
• Database technology provides the
following benefits to organizations:
– Data integration
• Data items are independent of the programs that
use them.
– Data sharing
• Consequently, a data item can be changed
– Reporting flexibility
without changing the program and vice versa.
• Makes programming easier and simplifies data
– Minimal data redundancy and inconsistencies
management.
– Data independence

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 24 of 95
IMPORTANCE AND ADVANTAGES OF
DATABASE SYSTEMS
• Database technology provides the
following benefits to organizations:
– Data integration
– Data sharing
– Reporting flexibility
• Data management is more efficient
because the database
– Minimal data redundancy administrator is
and inconsistencies
responsible for coordinating, controlling,
– Data independence
and managing data.

– Central management of data

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 25 of 95
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.
Data Base Design Process:
Planning –
Requirements analysis-
Design- Coding-
Implementation-
Operation and Maintnance

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 26 of 95
DATABASE SYSTEMS

 Accountants should participate in the


development of the data dictionary because they
have a good understanding of the data elements
in a business organization, as well as where
those elements originate and how they are used.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 27 of 95
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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 28 of 95
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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 29 of 95
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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 30 of 95
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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 31 of 95
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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 32 of 95
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

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 33 of 95
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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 34 of 95
RELATIONAL DATABASES

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 35 of 95
RELATIONAL DATABASES
WHAT IS A RELATIONAL DATABASE MANAGEMENT SYSTEM
(RDBMS)?
• A relational database management system (RDBMS) is a program
that allows you to create, update, and administer a relational
database. Most relational database management systems use the
SQL language to access the database.
• WHAT IS SQL?
• SQL (Structured Query Language) is a programming language used to
communicate with data stored in a relational database management system.
• SQL syntax is similar to the English language, which makes it relatively
easy to write, read, and interpret.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 36 of 95
RELATIONAL DATABASES
• What's in a relational database model?
• The relational database was invented in 1970 by E. F. Codd, then a
young programmer at IBM. In his paper, "A Relational Model of Data
for Large Shared Data Banks.
• Each table, which is sometimes called a relation, in a relational database
contains one or more data categories in columns, also called attributes.
• Each row, also called a record or tuple, contains a unique instance of data,
or key, for the categories defined by the columns. Each table has a unique
primary key, which identifies the information in a table.

• The relationship between tables can then be set via the use of foreign keys
-- a field in a table that links to the primary key of another table

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 37 of 95
keys in DBMS

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 38 of 95
keys in DBMS
Key plays an important role in relational database;
it is used for identifying unique rows from table. It
also establishes relationship among tables.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 39 of 95
keys in DBMS
WHAT IS A RELATIONAL DATABASE MANAGEMENT SYSTEM
(RDBMS)?
• A relational database management system (RDBMS) is a program
that allows you to create, update, and administer a relational
database. Most relational database management systems use the
SQL language to access the database.
• WHAT IS SQL?
• SQL (Structured Query Language) is a programming language used to
communicate with data stored in a relational database management system.
SQL syntax is similar to the English language, which makes it relatively
easy to write, read, and interpret.
• Many RDBMSs use SQL (and variations of SQL) to access the data in
tables. For example, SQLite is a relational database management system.
SQLite contains a minimal set of SQL commands (which are the same
across all RDBMSs). Other RDBMSs may use other variants.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 40 of 95
keys in DBMS
WHAT IS A RELATIONAL DATABASE MANAGEMENT SYSTEM
(RDBMS)?
• A relational database management system (RDBMS) is a program
that allows you to create, update, and administer a relational
database. Most relational database management systems use the
SQL language to access the database.
• WHAT IS SQL?
• SQL (Structured Query Language) is a programming language used to
communicate with data stored in a relational database management system.
SQL syntax is similar to the English language, which makes it relatively
easy to write, read, and interpret.
• Many RDBMSs use SQL (and variations of SQL) to access the data in
tables. For example, SQLite is a relational database management system.
SQLite contains a minimal set of SQL commands (which are the same
across all RDBMSs). Other RDBMSs may use other variants.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 41 of 95
keys in DBMS
WHAT IS A RELATIONAL DATABASE MANAGEMENT SYSTEM
(RDBMS)?
• A relational database management system (RDBMS) is a program
that allows you to create, update, and administer a relational
database. Most relational database management systems use the
SQL language to access the database.
• WHAT IS SQL?
• SQL (Structured Query Language) is a programming language used to
communicate with data stored in a relational database management system.
SQL syntax is similar to the English language, which makes it relatively
easy to write, read, and interpret.
• Many RDBMSs use SQL (and variations of SQL) to access the data in
tables. For example, SQLite is a relational database management system.
SQLite contains a minimal set of SQL commands (which are the same
across all RDBMSs). Other RDBMSs may use other variants.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 42 of 95
STUDENTS
Advisor
Student ID Last Name First Name Phone No. No.
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

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.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 43 of 95
keys in DBMS
Candidate Key – A super key with no redundant attribute is known as
candidate key
Candidate key has two key’s- --Primary and secondary/Alternative key

Definition: A primary key is a minimal set of attributes (columns) in a table that


uniquely identifies tuples (rows) in that table.

Primary Key Example in DBMS


Lets take an example to understand the concept of primary key. In the following table,
there are three attributes: Stu_ID, Stu_Name & Stu_Age. Out of these three attributes,
one attribute or a set of more than one attributes can be a primary key.

Alternate Key/secondary – Out of all candidate keys, only one gets selected as primary
key, remaining keys are known as alternate or secondary keys.
Composite Key – A key that consists of more than one attribute to uniquely identify rows
(also known as records & tuples) in a table is called composite key.
Foreign key in DBMS
Definition: Foreign keys are the columns of a table that points to the primary key of
another table. They act as a cross-reference between tables.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 44 of 95
DATABASE SYSTEMS AND THE FUTURE
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.
CONCLUSION
• Relational databases store data in tables. Tables can grow large
and have a multitude of columns and records. Relational database
management systems (RDBMSs) use SQL (and variants of SQL) to
manage the data in these large tables. The RDBMS you use is your
choice and depends on the complexity of your application.

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 45 of 95
REA MODEL

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 46 of 95
REA MODEL

• Resources, Events, Agents:


• Is a model of how an accounting system
can be re-engineered for the computer
age
• REA model was orginally proposed in
1982 by william.E.Mc charthy
• REA model is an alternative accounting
framework for modeling an organisation
critical resources,events,and agents
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 47 of 95
REA MODEL

• Resources: Have the economic value to


the orgaisation :Cash,Automobiles, Assets
• Agents:Agents are the people and
organisation:Customers,Accontants,Suppli
ers,sales representatives,
• Events: Events are the business activities
Sales of goods,Purchase of goods,shipping
of goods, bill payment and recieved,

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 48 of 95
REA MODEL

Inventory Kkdd
Sales Employee

Customer

Cash accounts Receive


Cash Employee

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 49 of 95
Thank you

© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart 50 of 95

You might also like