Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

MANAGING DATA USING DBMS

SOFTWARE

Prepared by:
DR. MARYGIN E. SARMIENTO
Professor III
OBJECTIVES:
• To define what is
database
• To identify the advantages
and Disadvantages of
DBMS and its capabilities
• To acknowledge the
importance of planning a
Database
• To understand the type of
Files.
DATABASE

It is a collection of related
information or
interrelated data which is
organized in a useful
manner that provides
basic procedures like
retrieving information,
drawing conclusions, and
making decisions.
DATABASE MANAGEMENT
SYSTEM

It integrates the data files into


a database and provides
different views to different
viewers.
It enables the database users
to satisfy multiple “views” of
the needed. It includes
techniques in building up a file
that produces data for inquiry
and reporting purposes.
Examples:

• Dictionary
• Telephone directory
• Bank accounts,
• Student records,
• Personnel and
employees records,
• Inventories
• cookbook,
• Personal information
RECORD

ItItisisaaset
setofofinformation
information
totobe bestored
storedininaarow.
row.

FIELD

It is a separate item in a
record. It is sometimes
called as column.
Examples

FIELD
RECORD

Emp_ID LastName FirstName

0001 Sarmiento Marygin

0002 Esplana Sammy

003 Santos CJay


OBJECTIVES OF DATABASE

• Data Integrity. It stores


information in one place
and allows each
application to access it.
• Data Integration. It links
between data must be
maintained, in order to
achieve the objectives of
data centralization, it must
be possible to access data
records using a wide
variety of search keys.
OBJECTIVES OF DATABASE

• Data Independence. It
allows the data to be
changed without the need
to reprogram, and the
program can be modified
without the reorganization
of data.
FUNCTIONS OF DATABASE
MANAGEMENT SYSTEM

• It protects data against


unauthorized access.
• It provides recovery and
restart facilities after a
hardware of software
failure.
• It safeguards data against
corruption.
• The frequently used data
can be placed in readily
accessible form.
ADVANTAGES OF
DATABASE MANAGEMENT

• Data Independence. It is a
separation of data from
the application programs
that use the data. The
organized data can be
changed and evolved
necessitating changes in
application programs that
process data.
ADVANTAGES OF
DATABASE MANAGEMENT

• Sharing Data. It allows all


the authorized users in an
organization to share its
data. It provides the user
to precise view of data
required to make a
decision or perform some
functions without making
the user aware of the
overall complexity of the
database.
ADVANTAGES OF
DATABASE MANAGEMENT

• Integrated Data is
considered integrated for
any item of data can be
used to satisfy an inquiry
or a report. This advantage
is related to the reduced
redundancy advantage, for
data can be retrieved from
any place in the database.
ADVANTAGES OF
DATABASE MANAGEMENT

Ease of Application
Development. It reduces cost
and time for developing
business applications. A
program can code and debug
a new application at least 2 to
4 times faster than with
conventional data files.
ADVANTAGES OF
DATABASE MANAGEMENT

Data Accessibility and


Responsiveness. It provides
multiple retrieval parts to
each item of data, providing
the user greater flexibility in
locating and retrieving data
than with data files. It results
to easily retrieved more and
better information.
ADVANTAGES OF
DATABASE MANAGEMENT

Uniformed Security, Privacy


and Integrated Controls. It
improves the data protection,
centralized control and
standard procedures provided
by a dispersed data file
system. The database will be
vulnerable files which is
exposed to more users if
proper controls are not
applied.
DISADVANTAGES OF
DATABASE MANAGEMENT

Access. This refers to users


who have improper access to
a database. The employees
must be trained to the correct
ways of using database
management system, specially
in a large organization..
Expense. It is usually
expensive to set up and
maintain a database. The
employees must be trained to
use the database properly.
DISADVANTAGES OF
DATABASE MANAGEMENT

Excess. In an organization that


carries more data than
expected, it is theoretically
possible for a database to
carry unsuitable data.
COMPONENTS OF THE
DATABASE MANAGEMENT
SYSTEM
Application Programs. It is
used to create and maintain
the database and provides
information to users.

Repository. It contains all


screen and report formats, all
data information, and
definitions or other
organizations and system
components which is a
centralized knowledge based.
COMPONENTS OF THE
DATABASE MANAGEMENT
SYSTEM

User Interface. These are


languages, menu and other
facilities where in the users
interact with various system
components.
Database Management
System. A commercial
program that is used to create
and maintain the database
and providing information to
the users.
COMPONENTS OF THE
DATABASE MANAGEMENT
SYSTEM
System Developers. These are
persons who design and develop
new application programs such as
programmers and system analysis.
Data Administrators. Persons who
are responsible for the overall
information resources of an
organization.
End Users. These are the persons
within the organization who
operate and modify the data in the
database and who request or
receive information from it.
TYPES OF FILES

System Files. It is an operating


system program. Data files hold data
that is related to application
software, such as a memo you typed
using word processing software.
Application Software Files. It is a
software needed for an application
such as word processing.
Data Files. Most users deal with
output data files. Output data files
usually contain data created by you
and may be used only by you,
especially in an academic
environment.
METHODS OF
INFORMATION RETRIEVAL
Information Retrieval. It is a file
processing which objective of
retrieving information to produce
accurate and useful information.
1. Retrieval. To access the data
within the fields. It is the act of
transferring a record from a
secondary storage to main
memory.
2. Insertion. It is the process of
adding new record to an existing
file.
3. Writing. To transfer a record
from main memory to secondary
storage.
METHODS OF
INFORMATION RETRIEVAL

4. Updating. It makes changes to the


contents of a record maintained on a
file to reflect its new status.
5. Deleting. The act of removing a
record from the file.
6. Merging. It could be a record
merging or a file merging. It is a
combination of two or more files in
same sequence into a single output
file.
7. Sorting. It is the act of rearranging
the records in a file to produce
ordered reports.
METHODS OF
INFORMATION RETRIEVAL

8. Searching. To satisfy specific


criteria that involves looking for
records with a certain key value.

9. Matching. To compare two ore


more records against other records
in order to ensure that there is a
complete set of records for each key.
Mismatch records are highlighted for
subsequent action.
DATA TYPES PROCESSING
FILES
1. Master File. It is a file that
consists of permanent or
semi-permanent data
consolidated for reference
and updating. It is to be
updated to reflect the
current status of the data
contents. Example. Payroll
Master, Stock Master File.
2. Work File. It is temporary
file used for the storing of
immediate data for further
processing.
DATA TYPES PROCESSING
FILES

3. Transaction File. It is a file that


contains source of data or
transaction data about recorded
events used to update the
master file, like sales transaction
file is used to update the stock
master file.
4. Security or Backup File. It is a
backup copy of a file to
safeguard against the damage or
loss of current versions.
DATA TYPES PROCESSING
FILES
5. Transition File. It is a temporary
file created during processing for a
specific use like customer details
extracted from master and
transaction files to form a
statement detail file. Used for
printing of monthly customer
statements.
6. Audit File. It will enable the
author to check the correct
functioning of computer-based
procedures by keeping a copy of all
transactions that cause the
permanent files to be changed.
The Main Access window
When you open Microsoft Access, many items you see are
standard, just like with most Microsoft software programs
like Word, Excel, and PowerPoint.
Menu bar
The Menu bar displays the menus available for use in
Access 2003. The contents of any menu can be
displayed by left-clicking the menu.
NORMALIZATION

1ST, 2nd, 3rd Normal Form


1ST NORMAL FORM

• All rows be unique (no duplicate rows)


• Each cell must only contain a single value (not
a list)
• Each value should be non divisible (can’t be
split down further)
Problem 1
Customer Name Order
Marygin Sarmiento Burger, Fries, Coke
Sammy Sarmiento Nuggets, Lemonade, Fries
Christian Jay Sarmiento Burger, Fries, Coke
Problem 1- All rows must be uniquely
identifiable
Customer Name Order
Marygin Sarmiento Burger, Fries, Coke
Sammy Sarmiento Nuggets, Lemonade, Fries
Christian Jay Sarmiento Burger, Fries, Coke

Identical rows
Solution- Add an order ID as a primary
key
OrderId Customer Name Order

1 Marygin Sarmiento Burger, Fries, Coke

2 Sammy Sarmiento Nuggets, Lemonade, Fries

3 Christian Jay Sarmiento Burger, Fries, Coke


Problem 2- Each Cell must only contain
a single value
OrderId Customer Name Order

1 Marygin Sarmiento Burger, Fries, Coke

2 Sammy Sarmiento Nuggets, Lemonade, Fries

3 Christian Jay Burger, Fries, Coke


Sarmiento

Multiple Values
Solution: Create a separate table with
order items
OrderId Customer Name OrderId Item

1 Marygin Sarmiento 1 Burger

2 Sammy Sarmiento 1 Fries

1 Coke
3 Christian Jay Sarmiento
2 Nuggets

2 Lemonade

2 Fries

3 Burger

3 Fries

3 Coke
Problem 3- All data must be atomic (non
divisible) – can’t be split down further)
Order Customer Name OrderId Item
Id
1 Burger
1 Marygin Sarmiento
1 Fries
2 Sammy Sarmiento

1 Coke
3 Christian Jay Sarmiento
2 Nuggets

2 Lemonade

2 Fries

3 Burger

3 Fries

3 Coke
Solution:

OrderI Last Name First Name OrderId Item


d
1 Burger
1 Sarmiento Marygin
1 Fries
2 Sarmiento Sammy

1 Coke
3 Sarmiento Christian Jay
2 Nuggets

2 Lemonade

2 Fries

3 Burger

3 Fries

3 Coke
2ND NORMAL FORM

• Database must be in First Normal


Form
• Non Partial dependency – All
non-prime attributes should be
dependent on the candidate key
Example – No Partial Dependency
Student ID Course ID Course Fee
Composite Key

1 1 500 This Table is not in 2NF


because the course Fee is only
dependent on the primary key
1 2 1000 to determine the course fee,
you can do it with just one
2 4 200
column (course ID)

2 3 750

3 5 1000

3 3 750
Example – No Partial Dependency
Student Courses Course Fees
Student ID Course ID Course Course Fee
Composite Key ID
1 1
1 500
1 2
2 1000
2 1
4 200
2 3
3 750
3 5
5 1000
3 3
3 750
3rd NORMAL FORM

• Database must be in First & Second


Normal Form
• No transitive dependency – all
fields must only be determinable by
the primary/composite key, not by
other keys.
Third Normal Form
Composite Key
Tournament Name Year Winner Winners DOB

Indiana Invitational 1998 Al Fredrickson 21 July 1975

Cleveland Open 1999 Bob Abertson 28 September


1968
Bowling Tournament 1999 Faeng Nepomuceno August 15, 1985

Des Moines Masters 1999 Al Fredrickson 21 July 1975

9 Ball Tournament 1999 Efren Bata Reyes June 20, 1980

Indiana Invitational 1999 Chip Masterson 14 March 1977


Third Normal Form
Tournament Winners Winners DOB

Composite Key
Tournament Year Winner Winner Date of Birth
Name
Indiana 1998 Al Fredrickson Al Fredrickson 21 July 1975
Invitational
Cleveland Open 1999 Bob Abertson Bob Abertson 28 September
Bowling 1999 Faeng 1968
Tournament Nepomuceno Faeng August 15, 1985
Des Moines 1999 Al Fredrickson Nepomuceno
Masters
Efren Bata Reyes June 20, 1980
9 Ball 1999 Efren Bata
Tournament Reyes
Chip Masterson 14 March 1977
Indiana 1999 Chip
Invitational Masterson
LESSON
Conceptual Data3Modeling
(Entity-Relationship Model)
Query
TABLE
Create Table is where you create the
table object with its corresponding
fields (based from normalization). This
is where you give a name to each field
and assign the proper data type and
size for each field (this was explained
in metadata discussion in the first
chapter).
Relationship
It helps to minimize errors and increase
efficiency by eliminating duplicate data.
The entity-relationship diagram is a
modeling tool used to represent data as
entities. It also represents relationships
between entities. The ERD is widely used to
model business problems and is a tool to
be able to design databases.
QUERY
Create Query is the database object which
allows you to query your database.
Without specifically coding your query, you
are able to extract particular data from
your tables using this object. This will allow
you to combine different tables. It allows
you to perform fundamental operations of
mathematical calculations.
Table
Relationship
Query
Table
Relationship
Query
Actual Demonstration
• Creating Customer Records
• Relationships (3 Tables)
• Convert them into one (1) table
• Query Design
• Computation
Database Name: Customer_Records

Table 1: Customer
Table 2: Order
Table 3: Product
Database Name: Customer_Records
Table 1 : Customer
FieldNames: Cust_Id
LastName
FirstName
Middlename
Address
ContactNo
Input 3 Records
Database Name: Customer_Records
Table 2 : Product
Field Names: Prod_Id
Item Description
Size
Color
Stocks
Unit_Price
Input 3 Records
Database Name: Customer_Records
Table 3:Order
Field Names: Cust_Id
Prod_Id
Date Purchased
Branch
Quantity
Total Amount
Input 3 Records
Activity:
Create a database for student records. Create 3
tables (Student, Schedule, Assessment)
Student Schedule Assessment
Stud_No Stud_No SubjCode
LastName SubjCode SubjDescription
FirstName Day Units
MiddleName Time Tuition Fee
ContactNo Section Misc. Fee
Address Room Total Fee
Email_Address Professor

Input 20 records

You might also like