0% found this document useful (0 votes)
3 views

Relational databases

This document discusses the fundamental concepts of accounting information systems and relational databases, highlighting the advantages of databases over file-based systems, the importance of good data, and the structure of relational databases. It covers key topics such as database management systems, schemas, data dictionaries, and querying databases using Microsoft Access. Additionally, it explains the design approaches for relational databases and provides examples of queries to extract information from the database.

Uploaded by

weena acuña
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)
3 views

Relational databases

This document discusses the fundamental concepts of accounting information systems and relational databases, highlighting the advantages of databases over file-based systems, the importance of good data, and the structure of relational databases. It covers key topics such as database management systems, schemas, data dictionaries, and querying databases using Microsoft Access. Additionally, it explains the design approaches for relational databases and provides examples of queries to extract information from the database.

Uploaded by

weena acuña
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/ 30

ACCOUNTING INFORMATION SYSTEM

RELATIONAL DATABASES
Chapter 4
Learning Outcomes
1. Explain the importance and advantages of databases, as
well as the difference between database systems and file-
based legacy systems.
2. Explain the difference between logical and physical
views of a database.
3. Explain fundamental concepts of database systems
such as DBMS, schemas, the data dictionary, and DBMS
languages.
4. Describe what a relational database is and how it
organizes data.
5. Create a set of well-structured tables to store data in a
relational database.
6. Perform simple queries using the Microsoft Access
database.
FILES VS. DATABASE

FIGURE 1. Basic Elements of Data Hierarchy


FILES VS. DATABASE
DATABASE is a set of interrelated, centrally
coordinated data files that are stored with as little
data redundancy as possible.
Databases were developed to address the
proliferation of master files.
FILES VS. DATABASE

FIGURE 2. File- Oriented System Vs. Database Systems


File Approach Database Approach
Data is an organizational resource that is
Data is stored in individual files and there is used by and managed for the entire
no centralized control of management of data, organization, not just originating department.
and each file is typically independent.
Database System
Database Management Database, data management system, and
System (DBMS ) the application programs that that access the
database through the DBMS
Program that manages and control the data
and interfaces between the data and the Database Administration
application programs that use data stored in (DBA)
the database. Responsible for coordinating, controlling,
and managing the database.
Using Data Warehouses for Business
Intelligence
Data Warehouse Business Intelligence
Analyzing large amounts of data for strategic
One or more very large databases decision making.
containing both detailed and
summarized data for a number of years TWO MAIN TECHNIQUES USED IN BUSINESS
that is used for analysis rather than INTELLIGENCE
transaction processing. 1.Online Analytical Processing (OLAP
Contain hundreds or thousands of -Using queries to investigate hypothesized
terabytes of data. relationships among data.
2. Data Mining
- Using sophisticated statistical analysis to
discover unhypothesized relationships in the data.
The Advantages of Database
Systems
1. Data Integration
2. Data Sharing
3.Miniral data redundancy and
Inconsistencies
4. Data Independence
5. Cross- functional Analysis
The Importance of Logical and Physical
Good Data Views of Data
Record Layout
Good data supports better decision- Document that shows the items stored in a file, including
making, operational efficiency, and the order and length of the data fields and the type of data
overall business performance, stored.
making it an essential asset in today’s
data-driven world. Two Separate Views of Data:
1. Logical View
Incorrect data can lead to bad -how people conceptually organize, view and understand the
decisions, embarrassment, and relationships among data items.
angry users.
2. Physical View
-the way data are physically arranged and stored in the
computer system.
FIGURE 3. Function of DBMS: To Support Multiple Views of Data
SCHEMAS
A schema is a description of the data elements in a
database,the relationships among them,and the logical model
used to organize and describe the data.
THREE LEVELS OF
SCHEMAS
1. Conceptual-Level Schema
2. External-Level Schema
3. Internal-Level Schema
DATA DICTIONARY
Information about the structure of the database, including a
description of each data element.
Key Components of a Data Dictionary
1.Table Names
2.Column Names
3.Data Types
4.Constraints
5.Relationships
6.Default Values
7.Indexes Access Rights
DATA LANGUAGES
Data Definition Language (DDL) - DBMS language that builds the data dictionary,
creates the database, describes logical views, and specifies record or field
security constraints.
Data Manipulation Language (DML) - DBMS language that changes database
content, including data element creations, updates, insertions, and deletions.
Data Query Language (DQL) - High-level, English-like, DBMS language that
contains powerful, easy-to-use commands that enable users to retrieve, sort,
order, and display data.
Report Writer - DBMS language that simplifies report creation
RELATIONAL DATABASES
The relational data model represents conceptual- and external-level schemas
as if data are stored in two-dimensional tables.
•The data are actually stored not in tables, but in the manner described in the
internal-level schema.
TYPES OF ATTRIBUTES
A PRIMARY KEY is the database attribute, or combination of attributes, that
uniquely identifies a specific row in a table.
A FOREIGN KEY is an attribute in a table that is also a primary key in another
table and is used to link the two tables.
BASIC REQUIREMENTS OF A RELATIONAL
DATABASE
1. Every column in a row must be single valued.In a relational database, there can
only be one value per cell. At S&S, each sale can involve more than one item.
2. Primary keys cannot be null. A primary key cannot uniquely identify a row in a table
if it is null (blank). A nonnull primary key ensures that every row in a table represents
something and that it can be identified. This is referred to as the entity integrity rule.
3. Foreign keys, if not null, must have values that correspond to the value of a primary
key in another table. Foreign keys link rows in one table to rows in another table.
4. All nonkey attributes in a table must describe a characteristic of the object identified
by the primary key. Most tables contain other attributes in addition to the primary and
foreign keys.
These four constraints produce a well-structured (normalized) database in which
data are consistent and data redundancy is minimized and controlled
TWO APPROACHES TO DATABASE DESIGN

One way to design a relational database, called normalization, begins by assuming


that everything is initially stored in one large table. Rules are then followed to
decompose that initial table into a set of tables in what is called third normal form
(3NF), because they are free of update, insert, and delete anomalies.
In an alternative design approach, called semantic data modeling, the designer
uses knowledge of business processes and information needs to create a diagram
that shows what to include in the database. This diagram is used to create a set of
relational tables that are already in 3NF.
CREATING RELATIONAL DATABASE QUERIES

In an alternative design approach, called semantic data modeling, the designer


uses knowledge of business processes and information needs to create a diagram
that shows what to include in the database. This diagram is used to create a set of
relational tables that are already in 3NF.
To retrieve stored data, users query databases. This section of the chapter shows
you how to query databases using Microsoft Access. If you want to follow along by
creating the queries illustrated in this section, download the S&S In-Chapter Database
from the text’s website. When you open the database and select the Create ribbon, the
ribbon in the top half of Table 4-6 appears.
CREATING RELATIONAL DATABASE QUERIES
There are two ways to query the database: create a query in
Design view (the “Query Design” button) or use the wizard (the
“Query Wizard” button). These options are outlined in blue in the top
half of Table 4-6. The Design view is used in all of the query examples
shown. Clicking on the “Query Design” button produces the Show
Table window shown in Table 4-6. The user selects the tables
needed to produce the desired information; if more tables than
necessary are selected, the query may not run properly. We will use
the tables in Table 4-5 to walk through the steps nee
QUERY 1
Query 1 answers two questions: What are the invoice
numbers of all sales made to D. Ainge, and who was the
salesperson for each sale? The Sales and Customer tables
contain the three items needed to answer this query: Sales
Invoice #, Salesperson, and Customer Name. Click the
“Query Design” button (see Table 4-6), and select the Sales
and Customer tables by double-clicking on their names or by
single-clicking on the name and clicking the Add button. The
selected tables appear as shown in Table 4-7. A line between
the two tables connects the Customer # fields (the Customer
table primary key and the Sales table foreign key). Click on
Close to make the Show Table window disappear
QUERY 2

Query 2 answers this question: How


many televisions were sold in
October?
The Sales, Inventory, and Sales-
Inventory tables contain the three
items needed to answer this query:
Date, Inventory Description, and
Quantity
QUERY 3

Query 3 answers this


question: What are the
names and addresses of
customers buying
televisions in October?
QUERY 4

Query 4 answers this


question: What are the
sales invoice numbers,
dates, and invoice totals
for October sales,
arranged in descending
order by sale amount?
QUERY 4
QUERY 5

Query 5 will answer this


question: What are total
sales by salesperson?
THANK YOU!!!!!
in behalf of;
Bonita, Julia A.
Ibana, Czarina
Lallo, Glechel
Lomeda, Thryzja Myel
Majores, Roilan Josh C.
REPORTERS

You might also like