Topic 1 Database Concepts Ict200

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

Database Systems:

Design, Implementation, and


Management
Ninth Edition

Chapter 1
Database Systems
Learning outcomes
2

In this chapter, you will learn:


 The difference between data and information

 What a database is, the various types of

databases, and why they are valuable assets for


decision making
 The importance of database design

 How modern databases evolved from file systems

Database Systems, 9th Edition


Learning outcomes (cont’d.)
3

 About flaws in file system data management


 The main components of the database system
 The main functions of a database management
system (DBMS)

Database Systems, 9th Edition


Introduction
4

 Good decisions require


good information
derived from raw
facts/data
 Data is managed most
efficiently when stored
in a database
 Databases evolved from
computer file systems
 Understanding file
system characteristics is
important
Database Systems, 9th Edition
Why Databases?
5

 Databases solve many of the problems encountered


in data management
 Usedin almost all modern settings involving data
management:
◼ Business
◼ Research
◼ Administration

 Important to understand how databases work and


interact with other applications

Database Systems, 9th Edition


Data vs. Information
6

Database Systems, 9th Edition


Data vs. Information
7

 Data are raw facts


 Information is the result of processing raw data to
reveal meaning
 Information requires context to reveal meaning
 Raw data must be formatted for storage,
processing, and presentation
 Data are the foundation of information, which is the
bedrock of knowledge

Database Systems, 9th Edition


Data vs. Information (cont’d.)
8

 Data: building blocks of information


 Information produced by processing data
 Information used to reveal meaning in data
 Accurate, relevant, timely information is the key to
good decision making
 Good decision making is the key to organizational
survival

Database Systems, 9th Edition


Data vs. Information (cont’d.)
9

 Example

the photograph is information. But, what


you look like is data
Source: http://www.infogineering.net/data-information-knowledge.htm

Database Systems, 9th Edition


Data vs. Information (cont’d.)
10

 Example

Data: Information

You are 5 feet tall You’ve gathered all the data. Next
You have brown hair you describe that photograph to
You have blue eyes other people. It becomes
Etc…. information. Why? You have shared
with other people.
Database Systems, 9th Edition
Introducing the Database
11

 Database: shared & integrated computer structure


that stores a collection of:
 End-user data: raw facts of interest to end user
◼ [1]provided by a data warehouse or the data [2] created
by end users for query processing.
 Metadata: data about data
◼ Provides description of data characteristics and
relationships in data, OR
◼ Provides information about a certain item's content
◼ Complements and expands value of data

Database Systems, 9th Edition


Introducing the Database
12

 More on Metadata
 an image may include
metadata that describes how
large the picture is, the color
depth, the image resolution,
when the image was created,
and other data
 A text document's metadata
may contain information
about how long the document
is, who the author is, when
the document was written,
and a short summary of the
document

Database Systems, 9th Edition


Introducing the Database
13

 More on Metadata
 Web pages often include metadata in the form of
meta tags. Description and keywords meta tags are
commonly used to describe the Web page's content.
Most search engines use this data when adding pages
to their search index

Database Systems, 9th Edition


Role and Advantages of the DBMS
14

 Database management system (DBMS): collection


of programs
 Manages structure and controls access to data
 DBMS is the intermediary between the user and
the database
 Database structure stored as file collection
 Can only access files through the DBMS

 DBMS enables data to be shared


 DBMS integrates many users’ views of the data
Database Systems, 9th Edition
15 Database Systems, 9th Edition
Role and Advantages of the DBMS
16
(cont’d.)
 Advantages of a DBMS:
 Improved data sharing
 Improved data security

 Better data integration

 Minimized data inconsistency

 Improved data access

 Improved decision making

 Increased end-user productivity

Database Systems, 9th Edition


Types of Databases
17

 Databases can be classified according to:


DB
classification

[1] Users [2] Location [3] Usage

Single-User Centralized Operational

Distributed/
Multiuser Warehouse
Decentralized
Database Systems, 9th Edition
Types of Databases
18

 [1] Users
 Single-user database supports only one user at a time
◼ Desktop database: single-user; runs on PC (locally)
◼ E.g. Auto Teller Machine (ATM)

 Multiuser database supports multiple users at the


same time
◼ Workgroup and enterprise databases
◼ E.g. i-Student Portal, any Web application

Database Systems, 9th Edition


Types of Databases (cont’d.)
19

 [2] Location
 Centralized database: data located at a single site
 Distributed/Decentralized database: data distributed
across several different sites

Database Systems, 9th Edition


Types of Databases (cont’d.)
20

 [3] Usage
 Operationaldatabase: supports a company’s day-to-
day operations
◼ Transactional or production database
 Data warehouse: stores data used for tactical or
strategic decisions
◼ Meant for top management for decision making, forecasting,
strategic planning

Database Systems, 9th Edition


Types of Databases (cont'd.)
21

 Categories of data
Structured data
• data that is identifiable because it is organized in a structure
• e.g. database

Semi-structured data
• Has structure but not enough to qualify as structured data (Loshin,
2005)
• e.g. XML

Unstructured data
• No identifiable structure/in original format
• e.g. bitmap images/objects, text and other data types that are not
part of a database

Database Systems, 9th Edition


Types of Databases (cont'd.)
22

 Unstructured data exist in their original state


 Structured data result from formatting
 Structure applied based on type of processing to be performed
 Semi structured data have been processed to some extent
 Data may have certain structure but not all information
collected has identical structure
 Some attributes may exist in some of the entities of a
particular type but not in others
 Extensible Markup Language (XML) represents data elements in
textual format
 XML database supports semistructured XML data

Database Systems, 9th Edition


23 Database Systems, 9th Edition
Why Database Design Is Important
24

 Database design focuses on design


of database structure used for end-
user data (= what?)
 Designer must identify database’s
expected use
 Well-designed database:
 Facilitates data management
 Generates accurate and valuable
information
 Poorly designed database:
 Causes difficult-to-trace errors

Database Systems, 9th Edition


Evolution of File System Data
25
Processing
 Reasons for studying file
systems/filesystems:
 Complexity of database design is easier
to understand
 Understanding file system problems helps
to avoid problems with DBMS systems
 Knowledge of file system is useful for
converting file system to database system
 File systems typically composed of
collection of file folders, each tagged
and kept in cabinet
 Organized by expected use

Database Systems, 9th Edition


Evolution of File System Data
26
Processing

Manual File Computer Database


Systems File Systems

IBM
DB2/
MS EXCEL DBMS

Database Systems, 9th Edition


Evolution of File System Data
27
Processing

Physical

Conceptual/logical

Database Systems, 9th Edition


Evolution of File System Data
28
Processing (cont'd.)
 Contents of each file folder are logically related
 Manual systems (current file systems)
 Servedas a data repository for small data collections
 Cumbersome for large collections

 Computerized file systems


 Data processing (DP) specialist (special position)
converted computer file structure from manual system
◼ Wrote software that managed the data
◼ Designed the application programs to generate reports

Database Systems, 9th Edition


Evolution of File System Data
29
Processing (cont'd.)
 Initially, computer file systems resembled manual
systems
 As number of files increased, file systems evolved
 Each file used its own application program to store,
retrieve, and modify data
 Each file was owned by individual or department that
commissioned its creation

Database Systems, 9th Edition


Typical computer file systems

30 Database Systems, 9th Edition


31 Database Systems, 9th Edition
32 Database Systems, 9th Edition
 Another example:

File handling
Data entry routines
and reports
File defination
Sales files
Sales Sales
Salesapplication programs
application programs

File handling
Data entry routines
and reports
File defination
Contracts files Contracts
Sales application
Contracts programs
application
programs

33 Database Systems, 9th Edition


34 Database Systems, 9th Edition
Problems with File System Data
35
Processing
 File systems were an improvement over manual
system
 File
systems used for more than two decades
 Understanding the shortcomings of file systems aids in
development of modern databases
 Many problems not unique to file systems

 Even simple file system retrieval task required


extensive programming
 Ad hoc queries impossible
 Changing existing structure difficult

Database Systems, 9th Edition


Problems with File System Data
36
Processing (cont'd.)
 Security features difficult to program
 Often omitted in file system environments
 Summary of file system limitations:
 Requires extensive programming
 Cannot perform ad hoc queries

 System administration is complex and difficult

 Difficult to make changes to existing structures

 Security features are likely to be inadequate

Database Systems, 9th Edition


Structural and Data Dependence
37

 Structural dependence: changes in the database


structure affect DBMS ability to access data.
 All file system programs must be modified to conform
to a new file structure
 E.g. filesystems, adding new field/attribute

 Structural independence: changes in the database


structure DO NOT affect DBMS ability to access
data.

Database Systems, 9th Edition


Structural and Data Dependence
38
(cont'd.)
Customer
Structural Dependent
Customer_no
Customer_name
Customer_phone An attribute
Customer_address
Customer_email has
been added to Customer
Customer
file. Therefore, you have
Customer_no
to modify your data
Customer_name
Customer_phone
retrieval program.
Customer_address
Customer_email New!
Database Systems, 9th Edition
Structural and Data Dependence
39
(cont'd.)
 Data dependence: data access changes when data
storage characteristics change
 Data is represented/embedded in the source code for
the programs
 Data independence: changes on data storage
characteristics do not affect data access
 Data and programs are separated

Database Systems, 9th Edition


Structural and Data Dependence
40
(cont'd.)

Data independent

It allows the database


to be structurally
changed without
affecting most existing
programs.

In this case, we can


assign value of limit
dynamically (user
input).
Database Systems, 9th Edition
Structural and Data Dependence
41
(cont'd.)
You have this…
float salary = 5000, allowances = 1100;
float totalsalary = 0;
totalsalary = salary + allowances;
Now, make it dynamic. So, user can enter any values
for salary and allowances. How?
cout<<"Enter your salary: RM";
cin>>salary;
cout<<"Enter your allowances: RM";
cin>>allowances;
Database Systems, 9th Edition
Structural and Data Dependence
42
(cont'd.)
 Practical significance of data dependence is
difference between logical and physical format
 Logical data format: how human views the data
 Physical data format: how computer must work
with data
 Each program must contain:
 Lines specifying opening of specific file type
 Record specification

 Field definitions

Database Systems, 9th Edition


Data Redundancy
43

 File system structure makes it difficult to combine


data from multiple sources
 Vulnerable to security breaches
 Organizational structure promotes storage of same
data in different locations
 Islands of information
 Similar Data stored in different locations is unlikely
to be updated consistently
 Data redundancy: same data stored unnecessarily
in different places/tables/entities
Database Systems, 9th Edition
Data Redundancy (cont'd.)
44

 Data inconsistency: different and conflicting


versions of same data occur at different places

Table: Customer

Table: Agent

Database Systems, 9th Edition


Data Redundancy (cont'd.)
45

 Data anomalies: abnormalities when all changes in


redundant data are not made correctly
 Update anomalies:
◼ E.g. what if client changes his phone number?
 Insertion anomalies:
◼ E.g. to add new property without adding its owner
 Deletion anomalies:
◼ E.g. what if client’s record is to be removed from the system?

Database Systems, 9th Edition


Data Redundancy (cont'd.)
46

 Refer to Slide 43 (slide 37 for old version)


 Update anomaly. If agent Vishal has a new phone
number, that number must be entered in each of the
CUSTOMER file records. In this case, only three changes
must be made. In a large file system, such changes
might occur in hundreds or even thousands of records.
 Insertion anomaly. If only the CUSTOMER file exists, to
add a new agent, you would also add a dummy
customer data entry to reflect the new agent’s addition.
 Deletion anomaly. If you delete the customers Amit,
Naresh and Bhavik, you will also delete Vishal’s agent
data. Clearly this is not desirable.

Database Systems, 9th Edition


Lack of Design and Data-Modeling
47
Skills
 Most users lack the skill to properly design
databases, despite multiple personal productivity
tools being available
 Data-modeling skills are vital in the data design
process
 Good data modeling facilitates communication
between the designer, user, and the developer

Database Systems, 9th Edition


Database Systems
48

 Database system consists of logically related data


stored in a single logical data repository
 May be physically distributed among multiple storage
facilities
 DBMS eliminates most of file system’s problems

 Current generation stores data structures, relationships


between structures, and access paths
◼ Alsodefines, stores, and manages all access paths and
components

Database Systems, 9th Edition


49 Database Systems, 9th Edition
The Database System Environment
50

 Database system: an organization of components


that defines and regulates the collection, storage,
management, use of data
data
hardware software procedure people

bridge
machine components human components

Database Systems, 9th Edition


51 Database Systems, 9th Edition
The Database System Environment
52
(cont'd.)
 Hardware: all the system’s physical devices
 PC, Workstation, Server, Mainframe, Supercomputer
 Software: three types of software required:
 Operating system software
 DBMS software: IBM DB2, Oracle, MySQL, etc

 Application programs and utility software

Database Systems, 9th Edition


The Database System Environment
53
(cont'd.)
 Data: the collection of facts stored in the database
 People: all users of the database system
 System and database administrators
 Database designers

 Systems analysts and programmers

 End users

 Procedures: instructions and rules that govern the


design and use of the database system

Database Systems, 9th Edition


The Database System Environment
54
(cont'd.)
 Database systems are created and managed at
different levels of complexity
 Database solutions must be cost-effective as well as
tactically and strategically effective
 Database technology already in use affects
selection of a database system

Database Systems, 9th Edition


The Database System Environment
55
(cont'd.)
 File Systems  DBMS
Database System
File handling
Data entry routines File details +
Data entry
file definitions
and reports and reports
File defination
Sales files Sales
Sales Sales
application programs Sales DBMS
Sales application
Sales application
programs
application
programs
programs

Database
File handling Data entry
Data entry routines and reports
and reports Contracts
File defination Contracts
Sales application
application
programs
Contracts files Contracts programs
SalesContracts
application programs
application
programs

Database Systems, 9th Edition


The Database System Environment
56
(cont'd.)
DBMS Functions
57

 Most functions are transparent to end users


 Can only be achieved through the DBMS
 [1] Data dictionary management
 DBMS stores definitions of data elements and
relationships (metadata) in a data dictionary
 DBMS looks up required data component structures and
relationships
 Changes automatically recorded in the dictionary
 DBMS provides data abstraction and removes
structural and data dependency

Database Systems, 9th Edition


58 Database Systems, 9th Edition
59 Database Systems, 9th Edition
DBMS Functions (cont'd.)
60

 [2] Data storage management


 DBMS creates and manages complex structures
required for data storage
 Also stores related data entry forms, screen definitions,
report definitions, etc.
 Performance tuning: activities that make the database
perform more efficiently
 DBMS stores the database in multiple physical data
files

Database Systems, 9th Edition


61 Database Systems, 9th Edition
62 Database Systems, 9th Edition
DBMS Functions (cont'd.)
63

 [3] Data transformation and presentation


 DBMS transforms data entered to conform to required
data structures
 DBMS transforms physically retrieved data to conform
to user’s logical expectations
 [4] Security management
 DBMS creates a security system that enforces user
security and data privacy
 Security rules determine which users can access the
database, which items can be accessed, etc.

Database Systems, 9th Edition


DBMS Functions (cont'd.)
64

 [5] Multiuser access control


 DBMS uses sophisticated algorithms to ensure concurrent
access does not affect integrity
 [6] Backup and recovery management
 DBMS provides backup and data recovery to ensure
data safety and integrity
 Recovery management deals with recovery of
database after a failure
◼ Critical to preserving database’s integrity

Database Systems, 9th Edition


DBMS Functions (cont'd.)
65

 [7] Data integrity management


 DBMS promotes and enforces integrity rules
◼ Minimizesredundancy
◼ Maximizes consistency

 Data relationships stored in data dictionary used to


enforce data integrity
 Integrity is especially important in transaction-oriented
database systems
 CASCADE & FOREIGN KEY commands

Database Systems, 9th Edition


DBMS Functions (cont'd.)
66

 [8] Database access languages and application


programming interfaces
 DBMS provides access through a query language
 Query language is a nonprocedural language

 Structured Query Language (SQL) is the de facto


query language
◼ Standard supported by majority of DBMS vendors

Database Systems, 9th Edition


DBMS Functions (cont'd.)
67

 [9] Database communication interfaces


 Current DBMSs accept end-user requests via multiple
different network environments
 Communications accomplished in several ways:
◼ End users generate answers to queries by filling in screen
forms through Web browser
◼ DBMS automatically publishes predefined reports on a Web
site
◼ DBMS connects to third-party systems to distribute
information via e-mail

Database Systems, 9th Edition


Managing the Database System:
68
A Shift in Focus
 Database system provides a framework in which
strict procedures and standards enforced
 Roleof human changes from programming to
managing organization’s resources
 Database system enables more sophisticated use
of the data
 Data structures created within the database and
their relationships determine effectiveness

Database Systems, 9th Edition


Managing the Database System:
69
A Shift in Focus (cont'd.)
 Disadvantages of database systems:
 Increased costs: hardware, software
 Management complexity: data safety, data security,
manage resistance, company’s goals, etc
 Maintaining currency: keep your system up-to-date

 Vendor dependence

 Frequent upgrade/replacement cycles: upgrading cost,


training, compatibility issues,

Database Systems, 9th Edition


Summary
70

 Data are raw facts


 Information is the result of processing data to reveal
its meaning
 Accurate, relevant, and timely information is the key
to good decision making
 Data are usually stored in a database
 DBMS implements a database and manages its
contents

Database Systems, 9th Edition


Summary (cont'd.)
71

 Metadata is data about data


 Database design defines the database structure
 Well-designed database facilitates data management
and generates valuable information
 Poorly designed database leads to bad decision
making and organizational failure
 Databases evolved from manual and computerized
file systems

Database Systems, 9th Edition


Summary (cont'd.)
72

 In a file system, data stored in independent files


 Each requires its own management program
 Some limitations of file system data management:
 Requires extensive programming
 System administration is complex and difficult

 Changing existing structures is difficult

 Security features are likely inadequate

 Independent files tend to contain redundant data


◼ Structural and data dependency problems

Database Systems, 9th Edition


Summary (cont'd.)
73

 Database management systems were developed to


address file system’s inherent weaknesses
 DBMS present database to end user as single
repository
 Promotes data sharing
 Eliminates islands of information

 DBMS enforces data integrity, eliminates


redundancy, and promotes security

Database Systems, 9th Edition


Simple Case Study
74

Database Systems, 9th Edition


ITS232 Projects
75

 [1] Flight Reservation Management Database


 [2] Library Management Database – Book
Reservation
 [3] Food Ordering Database for Restaurant
 [4] Hotel Reservation Management Database
 [5] Cinema Ticketing Database
 [6] Futsal Court Reservation Database
 [7] Complaint Database

Database Systems, 9th Edition

You might also like