You are on page 1of 60

Introduction to

Database Programming
What is Database?

A storage of organized collection of logically


related data.

DATA
What is File Processing?

Manual Based
What is File Processing?

Computer Based
Disadvantages of File Processing

Program-Data Dependence
All programs maintain metadata for each file they use.

5
Program-Data Dependence
Disadvantages of File Processing

Duplication of Data
Different programs have separate copies of the same
data
Duplicate Data
Disadvantages of File Processing

Limited Data Sharing


No centralized control of data
Disadvantages of File Processing

Lengthy Development Times


Programmers must design their own file formats
Disadvantages of File Processing

Excessive Program Maintenance


80% of information systems budget
Problems with Data Dependency

• Each application programmer must


maintain his/her own data
Problems with Data Dependency

• Each application program needs to


include code for the metadata of each
file
Problems with Data Dependency

• Each application program must have its


own processing routines for reading,
inserting, updating, and deleting data
Problems with Data Dependency
• Lack of coordination and central control
Problems with Data Dependency
• Non-standard file formats
Problems with Data Redundancy
• Waste of space to have duplicate data

18
Problems with Data Redundancy
• Causes more maintenance headaches
Problems with Data Redundancy
The biggest problem:
- Data changes in one file could cause
inconsistencies

UPDATED NOT UPDATED

inconsistent
Problems
• Data Dependency and Redundancy

Solution
• Computerized Database Approach
The DATABASE Approach

• Central repository of shared data

• Data are managed by a controlling Agent

• Data are Standardized

Requires a Database Management System (DBMS)


23
Database Management System
 A software system that is used to create, maintain, and
provide controlled access to user databases

Order Filing
System

Invoicing Central database


DBMS
System
Contains employee,
order, inventory,
pricing, and
Payroll
customer data
System

DBMS manages data resources like an operating system manages


hardware resources
Advantages of THE Database APPROACH

• Program-data independence

• Planned data redundancy

• Improved data consistency

25
Advantages of THE Database APPROACH

• Improved data sharing

• Increased application development productivity

• Enforcement of standards
Advantages of THE Database APPROACH

• Improved data quality

• Improved data accessibility and responsiveness


Advantages of THE Database APPROACH

• Reduced program maintenance

• Improved decision support


Costs and Risks of the Database Approach

• New, specialized personnel

• Installation and management cost and


complexity

29
Costs and Risks of the Database Approach

• Conversion Costs

• Need for explicit backup and recovery

• Organizational conflict
- on rights…
Components of the Database Environment

31
Components of the Database Environment

CASE Tools – computer-aided software engineering

Repository – centralized storehouse of metadata

Database Management System (DBMS)

– software for managing the database

32
Components of the Database Environment

Database – storehouse of the data

Application Programs – software using the data

User Interface – text and graphical displays to users


Components of the Database Environment

Data/Database Administrators – personnel responsible for


maintaining the database

System Developers – personnel responsible for creating a


program

End Users – people who use the applications and databases


Where are Databases used?
It use about boring stuff:

• Corporate Data
payrolls, inventory, sales, customers,
accounting, documents.

• Banking Systems
• Airline Systems

and many more…


• Boring indeed but it deals with “Big Money”
Where are Databases used?
Today, databases are used in all fields:

• Web Databases:
– Search Engines (Google, Yahoo, …)
– Social Media (Facebook, Twitter, Youtube ...)

• Scientific and Medical Databases


Why are Databases used?

• Easy to use

• Flexible searching

• Efficiency

• Centralized storage
Why are Databases used?

• Multi-user access

• Scalability (large amounts of data)

• Security and consistency


Why learn about Databases?

• Very widely used

• Part of most current software solutions

• DB expertise is a career asset


Why learn about Databases?

Interesting:
– Mix of different requirements
– Mix of different methodologies
– Integral part of data driven development
– Interesting real world applications
When to use a Database?
• Need for large storage of data

• Centralized control of data

• Control of redundancy
When to use a Database?
• Control of consistency and integrity

• Multiple user support

• Sharing of data
When to use a Database?

• Control of access and security

• Enforcing integrity constraints


When to use a Database?
• Backup and recovery is needed
When not to use a Database?

• Initial investment in hardware, software and


training is too high

• Overhead for security, concurrency control,


and recovery is too high
When not to use a Database?

• Data and applications are simple and stable

• Real time requirements cannot met by it

• Multiple user access is not needed


Why database design is important?
• Well designed database becomes valuable
information generator.

• Poorly designed database becomes a breeding


ground for redundant data resulting to
difficult to track information errors.
Database System
• Refers to an organization of components that
define and regulate the collection, storage,
management and use of data within a
database environment.
Major parts of Database System
• Hardware

• Software
– OS
– DBMS software such as MS Access, SQL, Oracle
– Application Programs
Major parts of database System
People
– System Administrator
• Oversee the database system general purpose

– Database Administrator
• Manage the DBMS use & ensure that the database is
functioning properly

– Database Designer
• Design the database structure(database architects)
Major parts of database System
People
– System Analyst and programmers
• Design and implement the application programs

– End Users
• People who use the application programs to run the
organization daily operation.
Major parts of Database System
• Procedures
• Instructions and rules that govern the design and use of
the database system

• Data
Types of Database System
• Classified according to the number of users:

– Single User

– Multi User
• Workgroup – fewer than 50 users
• Enterprise – 50 users and more
Types of Database System
• Classified according to the site locations

– Centralized – Located at single site

– Distributed – Locate across several different site


DBMS Functions
• Data management

• Data transformation and presentation

• Security management
DBMS Functions
• Multiuser access control

• Backup and recovery management

• Data Integrity management


DBMS - Database Management System

Many Vendors (Oracle, IBM DB2, MS


SQL Server, MySQL, PostgreSQL, . . . )

• All rather similar

• Very big systems, but easy to use


DBMS
Common features:
• Relational model

• SQL as the query language

• Server-Client architecture
END of the SLIDE

You might also like