Documente Academic
Documente Profesional
Documente Cultură
ASIM RASUL
University of the Punjab
Punjab University College of Information Technology
(PUCIT)
DATABASE CONCEPTS
File Systems and
Databases
OUTLINE
What a database is, what it does, and why database
design is important
How modern databases evolved from files and file
systems
About flaws in file system data management
What a DBMS is, what it does, and how it fits into the
database system
About types of database systems and database models
DATA VERSUS INFORMATION
Example:
Robcor company has two divisions and the two division
has 1,380,456 and 1,453,907 invoices, respectively.
Each invoice has invoice number, date, and amount
The period is from the first quarter of 1997 to first
quarter of 2002
Total 2,834,363 records
Data versus Information
… … …
… … …
Information:----------?
Data versus Information
Data constitute building blocks of
information
Information produced by processing
data
Information reveals meaning of data
Good, timely, relevant information
key to decision making
Good decision making key to
organizational survival
DATABASE MANAGEMENT
Database is shared, integrated computer structure
that stores a collection of data:
End user data (raw data)
Metadata (data about data, it contains data
characteristics and relationships)
DATABASE MANAGEMENT
Database Management System (DBMS): software
system (collect of software) help to manage the data
contents
Manages Database structure
Controls access to data
Contains query language
• Query language allows quick answers to ad hoc queries
• Provides better access to more and bettermanaged data
• Promotes integrated view of organization’s operations
• Reduces the probability of inconsistent data
• Improved data sharing
• Improved data security
WHY DATABASE DESIGN IS
IMPORTANT
Database design focuses on design of database
structure used for enduser data
Designer must identify database’s expected use
Welldesigned database:
Facilitates data management
Generates accurate and valuable information
Poorly designed database:
Causes difficulttotrace errors
HISTORICAL ROOTS OF
DATABASE
FILES AND FILE SYSTEMS:
Why we need to study files and file system?
Historically handling data
Help to understand database design
HISTORICAL ROOTS OF
DATABASE
FILES AND FILE SYSTEMS:
First applications focused on clerical tasks
Requests for information quickly followed
File systems developed to address needs
Data organized according to expected
use
Data Processing (DP) specialists
computerized manual file systems
FILE TERMINOLOGY
Data
Raw Facts
Field
Group of characters with specific meaning
Record
Logically connected fields that describe a person, place, or
thing
File and file folder
Collection of related records
FILE SYSTEM CRITIQUE
File System Data Management
Requires extensive programming in thirdgeneration
language (3GL): COBOL, Basic, and Fortran (what must
be done and how it is to be done)
Time consuming
depends on physically store data
Makes ad hoc queries impossible
Make difficult to modify file system (each file has its own
system)
Leads to islands of information
FILE SYSTEM CRITIQUE (CON’T.)
Data Dependence
Change in file’s data characteristics requires modification of
data access programs
Must tell program what to do and how to do
Makes file systems cumbersome from programming and data
management views
Structural Dependence
Change in file structure requires modification of related
programs
FILE SYSTEM CRITIQUE
(CON’T.)
Field Definitions and Naming Conventions
Flexible record definition anticipates reporting
requirements
Selection of proper field names important
Attention to length of field names
Use of unique record identifiers
FILE SYSTEM CRITIQUE
(CON’T.)
Data Redundancy: (Unnecessary Duplication of data)
Results of uncontrolled data redundancy
Data anomalies
Modification
Insertion
Deletion
Data inconsistency (Different and conflicting versions of same data)
Lack of data integrity
DATABASE SYSTEMS
Database consists of logically related data stored in a
single repository
Provides advantages over file system management
approach
Eliminates data inconsistency (lack of data integrity),
data anomalies, data dependency, and structural
dependency problems
Stores data structures, relationships, and access paths
DATABASE VS. FILE SYSTEMS
DATABASE SYSTEM
ENVIRONMENT
DATABASE SYSTEM
ENVIRONMENT
Hardware
System’s Physical devices
Computers
Peripherals
Network
DATABASE SYSTEM
ENVIRONMENT
Software
Operating system: manages hardware
components
DBMS: manages database
MS Access, MSSQL Server, Oracle, DB2, MySQL
Application and utility software: support
access and manipulate data
Generate information for decision making
Help to manage database system
DATABASE SYSTEM
ENVIRONMENT
People (five users)
System administrator: hardware system
support
Database administrator: manage DBMS use
Database designer: design database structure
System analyst and programmers: implement
application programs
End users
DATABASE SYSTEM
ENVIRONMENT
Procedures
Instruction and rule that govern the
design and use of the database
system
Data
DATABASE SYSTEM TYPES
Singleuser vs. Multiuser Database (user number)
Desktop database – Single user
Workgroup database supports a small number
Enterprise database supports a large number
Centralized vs. Distributed (location)
Use
Production or transactional or Operational or
OLTP (Routine Operational Data)
Decision support or data warehouse or OLAP
(obtain Strategically information)
(R) DBMS FUNCTIONS
Objective: Guarantee the integrity and consistency of
data. It has several functions:
Data dictionary management: (the definition of the data
elements and their relationships are stored in a data
dictionary). It remove data and structure dependencies.
Data storage management: structures required for data storage
Data transformation and presentation: relieving us from the
distinct between logical data format and physical data format
Security management
Multiuser access control (concurrency)
(R) DBMS FUNCTIONS
Backup and recovery management
Data integrity management
Database access language and application
programming interfaces
Query language (DDL and DML)
Database communication interfaces
DATABASE MODELS
Definition: collection of logical constructs used to
represent data structure and relationships within
the database
Conceptual models: logical nature of data
representation; it emphasizes on what entity is presented;
it is used for database design as blueprint
Implementation models: emphasis on how the data are
represented in the database
DATABASE MODELS
Conceptual models include
Entityrelationship database model (ERDBD)
Objectoriented model (OODBM)
Implementation models include
Hierarchical database model (HDBM)
Network database model (NDBM)
Relational database model (RDBM)
Objectoriented database model (ODBM)
DATABASE MODELS (CON’T.)
Relationships in Conceptual Models
Onetoone (1:1)
Onetomany (1:M)
Manytomany (M:N)
Implementation Database Models
Hierarchical
Network
Relational
ObjectOriented
EVOLUTION OF DATABASE
MODALS
2000s
1990s
1980s
1970s
1960s
Object oriented ?
Hierarchical
Relational
Client Oriented
Traditional Object-relational
files
Network
HIERARCHICAL DATABASE
MODEL (HDBM)
Logically represented by an upside down tree
Each parent can have many children (segment linkage)
Each child has only one parent
A single table acts as the "root" of the database from which
other tables "branch" out.
Relationships in such a system are children and
parents.
Parents and children are tied together by links called
"pointers
HIERARCHICAL DATABASE
MODEL
Logically represented by an upside down tree
1:M relationship
HIERARCHICAL DATABASE
MODEL
Hierarchical path (beginning from left)
Leftlist hierarchical path, or preorder traversal, or
hierarchical sequence
Frequently access large amount of
transactions
HIERARCHICAL DATABASE
MODEL
Advantages
Conceptual simplicity: relationship between layers is logically
simple; design process is simple
Database security: enforced uniformly through the system
Data integrity
Data independence
Efficiency in 1:M relationships and when uses require large
numbers of transactions
Dominant in 1970s , when we used mainframe system with
large databases
HIERARCHICAL DATABASE
MODEL
Disadvantages
Complex implementation: physical data storage
characteristics; database design is complicated
Difficult to manage and lack of standards
Lacks structural independence
Applications programming and use complexity (pointer
based)
Implementation limitations, i.e. especially it only handle
1:M type of model
NETWORK DATABASE MODEL
(NDBM)
Each record can have multiple parents
Called by Database Task Group (DBTG) to define standards
Three crucial database components
Network schema: conceptual organization of the entire database
Subschema: portion of database as information for application programs
Database management language: defining data characteristics and data
structure
Schema Data definition language (DDL): define schema components
Subschema Data definition language
Data manipulating language: manipulate data content
NETWORK DATABASE MODEL
Each record can have multiple parents
Introduce set to describe relationship
Each set has owner record and member record,
parallel to parent and child in HDM
Member may have several owners
Oneownership
Hierarchical model is a subset of the network model.
The network model uses set theory to provide a tree
like hierarchy.
NETWORK DATABASE MODEL
Member may have several owners
NETWORK DATABASE MODEL
Advantages
Conceptual simplicity, just lime HDM
Handles more relationship types (but all 1:M
relationship)
Data access flexibility
Promotes database integrity
Data independence
Conformance to standards
NETWORK DATABASE MODEL
Disadvantages
System complexity
(Develop by the Computer programmers for the
Computer Programmers rather than user)
Lack of structural independence
RELATIONAL DATABASE MODEL
(RDBM)
Let’s user or database designer to operate human logical
environment
Perceived by user as a collection of tables for data storage,
while let RDBMS handles the physical details.
Tables are a series of row/column intersections
Tables related by sharing common entity characteristics
It allows 1:1, 1:M, M:N relationships
RELATIONAL DATABASE MODEL
RELATIONAL DATABASE
MODEL
Advantages
Structural independence: data access path is is irrelevant to
database design; change structure will not affect the database
Improved conceptual simplicity
Easier database design, implementation, management, and
use
Ad hoc query capability with SQL (4GL is added)
Powerful database management system
RELATIONAL DATABASE MODEL
Disadvantages
Substantial hardware and system software
overhead
Poor design and implementation is made easy
May promote “islands of information”
problems