Database
Systems
Introduction to Database
Basics terms
• Data
• Information: It is produced by processing data.
Information is used to reveal the meaning of
data.
• Data base :is collection of related data that
represent some real-world entities
• DBMS
• Database systems
Databases, Data, and Information
Database Data Information
• Collection of • Collection of • Processed
data organized unprocessed data
in a manner items • Documents
that allows • Text • Audio
access, • Numbers • Images
retrieval, and
• Images • Video
use of that
data • Audio
• Video
Page 514 Discovering Computers 2011: Living in a Digital World 4
Chapter 10
Data vs information
File-Based Systems
• Collection of application programs that
perform services for the end users (e.g.
reports).
• Each program defines and manages its
own data.
File-Based Processing
Limitations of File-Based Approach
• Separation and isolation of data
– Each program maintains its own set of data.
– Users of one program may be unaware of
potentially useful data held by other programs.
• Duplication of data
– Same data is held by different programs.
– Wasted space and potentially different values
and/or different formats for the same item.
Limitations of File-Based Approach
• Data dependence
– File structure is defined in the program code.
• Incompatible file formats
– Programs are written in different languages, and
so cannot easily access each other’s files.
• Fixed Queries
– Programs are written to satisfy particular
functions.
– Any new requirement needs a new program.
File processing system
Database Systems
Database Management System (DBMS) provides….
… efficient, reliable, convenient, and safe
multi-user storage of and access to massive
amounts of data.
DBMS
• It is a collection of programs that manages the database
structure and controls access to the data stored in the
database.
• In a sense, a database resembles a very well-organized
electronic filing cabinet in which powerful software, known as
a database management system, helps manage the cabinet’s
contents.
DBMS
• Database software, often called a database management system (DBMS),
allows users to:
Create a computerized Add, modify, and delete
database data
Create forms and
Sort and retrieve data
reports from the data
Page 515 Discovering Computers 2011: Living in a Digital World 13
Chapter 10
Components of DBMS Environment
Components of DBMS Environment
• Hardware
– Can range from a PC to a network of
computers.
• Software
– DBMS, operating system, network
software (if necessary) and also the
application programs.
• Data
– Used by the organization and a
description of this data called the schema.
Components of DBMS Environment
• Procedures
– Instructions and rules that should be
applied to the design and use of the
database and DBMS.
• People
– Includes database designers, DBAs,
application programmers, and end-
users.
DBMS
Contrasting database and file systems
File Processing Versus Databases
File processing system Database approach
• Each department has its • Programs and users share
own set of files data
• Used for many years • Reduce data redundancy
• Have data redundancy • Improve data integrity
• Isolate data • Share data
• Allows easier access
• Reduces development time
• Can be more vulnerable
Pages 524 - 526 Discovering Computers 2011: Living in a Digital World 19
Chapter 10
Maintaining Data
• Validation compares data with a set of (validation
checks/) rules or values to find out if the data is
correct Alphabetic/Numeric
Consistency check
Range check (logically correct
check
relationship)
Completeness check Check digit (extra Other checks (eg
digits appended to attachment actually
(no blank fields left) primary keys) exists)
Pages 522 - 524 Discovering Computers 2011: Living in a Digital World 20
Chapter 10
Databases, Data, and Information
• Valuable information should have the following
characteristics:
Accurate Verifiable Timely Organized
Cost-
Accessible Useful
effective
Pages 516 - 517 Discovering Computers 2011: Living in a Digital World 21
Chapter 10
Database Systems
Massive
Database systems handle data at a massive scale (Terabytes of data)
Safe
Data managed by the database systems will stay in a consistent state, it won't be lost or
overwritten when there are software or hardware failures.
Multi-user
Database systems allow many different users or applications to access the data
concurrently
Database Systems
Convenient
Physical Data Independence: The way that data is actually stored and laid out
on disk is independent of the way that programs/users think about the
structure of the data. .
Database systems allows you to write queries in a very simple way. The system
itself will find the algorithm to get that data out efficiently.
Efficient
Database systems can execute complex queries over amounts of data very
efficiently About 3,900,000,000 results (0.37 seconds)
Reliable
99.99999 % up time is the type of guarantee that database management
systems are making for their applications.
Database Systems
Enters a DBMS
“Two tier database system”
connection
(ODBC, JDBC)
Database server
(someone else’s
C program) Applications
Data files
24
Components of DBMS Environment
DBMS
===============
Design tools
Table Creation
Form Creation
Query Creation
Report Creation Application
Procedural
language
Programs
Database
compiler (4GL)
=============
Run time
Database contains: Form processor
User’s Data Query processor
User
Metadata Report Writer Interface
Indexes Language Run time Applications
Application Metadata
The Hierarchy of Data
• Data is organized in layers
– Files, records, fields, characters
Page 517 Discovering Computers 2011: Living in a Digital World 26
Figure 10-2
Chapter 10
The Hierarchy of Data
• A record is a group of related fields
– A primary key uniquely identifies each record
• A data file is a collection of related records
Page 519 Discovering Computers 2011: Living in a Digital World 27
Figure 10-4
Chapter 10
Database Systems
Key concepts
Data model: how the data is structured. It is telling you that general form of
data that's going to be stored in the database.
consists of rules and standards that define how the database organizes
data
Schema versus data: logical representation
Data definition language (DDL):create ,alter ,Drop ,rename
Data manipulation or query language (DML):select ,insert ,update ,delete
Database Languages
• Data Definition Language (DDL)
– Allows the DBA or user to describe and name entities,
attributes, and relationships required for the application
– plus any associated integrity and security constraints.
29
Database Languages
• Data Manipulation Language (DML)
– Provides basic data manipulation operations on data
held in the database.
• Procedural DML
– allows user to tell system exactly how to manipulate
data.
• Non-Procedural DML
– allows user to state what data is needed rather than how
it is to be retrieved.
30
Database Systems
Key people
DBMS implementer
– Database designer: Identifying the data, relationship between data and
constrain on data
– Mapping the logical DB design into tables and constraints
Database application developer
Database administrator
Database Analyst
Database Administration
Database analysts and administrators are responsible
for managing and coordinating all database activities
Database Administrator (DBA)
Database Analyst (DA)
Creates and maintains the data
Decides on proper field
dictionary, manages security,
placement, defines data
monitors performance, and
relationship, and identifies users’
checks backup and recovery
access privileges
procedures
Page 538 Discovering Computers 2011: Living in a Digital World 33
Chapter 10
Database system environment
Advantages of DBMSs( self reading)
• Control of data redundancy
• Data consistency
• More information from the same amount of data
• Sharing of data
• Improved data integrity
• Improved security
• Enforcement of standards
• Economy of scale
Advantages of DBMSs ( self reading)
• Balance conflicting requirements
• Improved data accessibility and responsiveness
• Increased productivity
• Improved maintenance through data independence
• Increased concurrency
• Improved backup and recovery services
Disadvantages of DBMSs ( self reading )
• Complexity
• Size
• Cost of DBMS
• Additional hardware costs
• Cost of conversion
• Performance
• Higher impact of a failure
Database Systems
Whether you know it or not,
you’re using a database every day
Examples of Database Applications
• Purchases from the supermarket
• Purchases using your credit card
• Booking a holiday at the travel agents
• Using the local library
• Taking out insurance
• Renting a video
• Using the Internet
• Studying at university