BY : Ajaz Khan Baig
1
Database Management
Systems
Lecture -3
2
Introduction
Database Architecture
3 layer architecture
Data Independence
3
Data Models (Terms)
Models
(1) Levels or views of the Database
Conceptual, logical, physical
(2) DBMS types
Relational, Hierarchic, Network, Object-
Oriented, Object-Relational
10/19/24
Models (1)
Application 1 Application 2 Application 3 Application 4
External External External External
Model Model Model Model
Application 1
Conceptual
requirements
Application 2
Conceptual Internal
requirements
Conceptual Logical Model
Application 3 Model Model
Conceptual
requirements
Application 4
Conceptual
requirements
10/19/24
Data Models(2): History
Hierarchical Model (1960’s and
1970’s)
Similar to data structures in programming
languages.
Books
(id, title)
Authors
Publisher Subjects
(first, last)
10/19/24
Data Models(2): History
Network Model (1970’s)
Provides for single entries of data and
navigational “links” through chains of
data.
Authors
Subjects Books
Publishers
10/19/24
Data Models(2): History
Relational Model (1980’s)
Provides a conceptually simple model for
data as relations (typically considered
“tables”) with all data visible.
pubid pubname Authorid Author name
1 Harper 1 Smith
2 Addison 2 Wynar
3 Oxford 3 Jones
Book ID Title pubid Author id 4 Que 4 Duncan
1 Introductio 2 1 5 Applegate
2 The history 4 2
3 New stuff ab 3 3
4 Another title 2 4
5 And yet more 1 5 Book ID Subid
1 2
Subid Subject
2 1
1 cataloging
3 3
2 history
4 2
3 stuff
4 3
10/19/24
Data Models(2): History
Object Oriented Data Model (1990’s)
Encapsulates data and operations as
“Objects”
Books
(id, title)
Authors
Publisher Subjects
(first, last)
10/19/24
Data Models(2): History
Object-Relational Model (1990’s)
Combines the well-known properties of
the Relational Model with such OO
features as:
User-defined datatypes
User-defined functions
Inheritance and sub-classing
10/19/24
Database System Life Cycle
Physical
Creation
2
Design Conversion
1 3
Growth,
Change, & Integration
Maintenance
4
6
Operations
5
10/19/24
Design
Determination of the needs of the
organization
Development of the Conceptual Model
of the database
Typically using Entity-Relationship
diagramming techniques
Construction of a Data Dictionary
Development of the Logical Model
10/19/24
Physical Creation
Development of the Physical Model of the
Database
data formats and types
determination of indexes, etc.
Load a prototype database and test
Determine and implement security, privacy
and access controls
Determine and implement integrity
constraints
10/19/24
Conversion
Convert existing data sets and
applications to use the new database
May need programs, conversion utilities
to convert old data to new formats.
10/19/24
Integration
Overlaps with Phase 3
Integration of converted applications
and new applications into the new
database
10/19/24
Operations
All applications run full-scale
Privacy, security, access control must
be in place.
Recovery and Backup procedures
must be established and used
10/19/24
Growth, Change & Maintenance
Change is a way of life
Applications, data requirements, reports,
etc. will all change as new needs and
requirements are found
The Database and applications and will
need to be modified to meet the needs of
changes
10/19/24
Another View of the Life Cycle
Integration
4 Operations
5
Design
Physical 1
Creation Conversion Growth,
2 3 Change
6
10/19/24
Data, Database, Data Model and DBMS
interact
End users
Software
Application
Application
Programmers
Programs develop
“What” to
get
Database
DBMS
maintainAdministrators
“How” to
get
Data
design Database
Database Designers
Users
19
Architecture
Depicted by three schemas or three
models
Refers to permanent structure or
intention of database
20
Database Architecture
A basis for understanding DBMS functionalities
Three levels at which data can be described
Objective:
Separate users view from the physical
representation
Why?
Different views of same data
Consolidated representation
Both ways easy change
21
The Three-Level Architecture
User 1 User 2 User n
External View 1 View 2 View n
Level
Conceptual
Conceptual Schema
Level
Internal
Internal Level Schema
Physical Data
Organization Database
Level 1 (External View)
The way users think about data
Each user has a view of the database limited
to the appropriate portion of the user’s
perspective of reality.
Users may have different views of the same
data e.g. date, time etc.
Virtual/calculated data: that is not actually
stored in the database but is created when
needed e.g. age, statistical data etc.
23
Continue…(External View)
DBMS uses external views to create user interface
for different users which is both the facility and
barrier
User’s external view is created after considering
data access, reports, and the transactions needs.
External schema evolves as user needs are
modified over time
24
Example of external view
Employee Data Saleema
Workers
First Name: Rana
Name: R. Aslam
Last Name: Aslam
Age: 25y,10d
Date of Birth:
Dept: Sales
12 Sep, 1970
Saleem
External Layer
Lower Layers
Level 2 Logical or Conceptual View
A complete description of the
information content of the database
Conceptual Schema
The entire information structure of the
database, as seen by the DBA
The community view of data
All entities, attributes and their
relationships are represented here
26
Continue….(Conceptual Schema)
Contains record types representing
Entities,
Data item types with their attributes,
Relationships and constraints on data.
Contains Semantic information about
Data meaning,
Security and integrity information
Relatively constant: designed with the present as
well as future needs of an organization
27
Example
Schema definition
Granting data access
Routine Maintenance
Backups
Monitoring disk space
Monitoring jobs running
28
Employee Data Workers
Saleema
First Name: Rana Name: R. Aslam
Last Name: Aslam Age: 24y,10d
Date of Birth: Dept: Sales
12 Sep, 1970
Saleem
External Layer
Logical Record Interface
Conceptual Layer
Name DoB Deps DepId
Rana Aslam 12/09/70 5 D001
Marya Wasti 29/02/80 0 D005
Internal or Physical View
DBMS chooses type of data structures
lays out data on storage devices with operating
system access methods
Internal record: a single stored record
Does not just contain what we see at the
conceptual level
DBMS adds other data
30
Physical Level
Generally same as Internal
Actual representation of data on the
storage device
In the binary format
OS responsibility
31
Inter-Schema Mappings
Also a part of 3-level architecture
External/conceptual mapping
Conceptual/Internal
Ext/Con Mapping
Specifies mapping between objects in the external view
to those in the logical model
Con/Int Mapping
Specifies mapping between objects in the logical model
to those in the physical model-data independence
32
3-Level Architecture
User 1 User 2 User n
External View 1 View 2 View n
Level
Ext/Con Mapping Conceptual
Schema
Conceptual
Level
Internal
Con/Int Mapping
Schema
Internal
Level
Physical Data Database
Organization
33
First Name: Rana Saleema Name: R. Aslam
Last Name: Aslam Age: 24y,10d
Date of Birth: Dept: Sales
12 Sep, 1970
Saleem
Name DoB Deps DepId
Rana Aslam 12/09/70 5 D001
Marya Wasti 29/02/80 0 D005
BH RH Rana Aslam 120970 5 D001 RH Marya Wasti…
01110011010011100101001010100101010010101…..
Data Independence
A major outcome of 3-L Arch
The immunity of applications to change in
storage structure and access strategy
Changes in lower level do not affect the upper
levels
35
Data Independence Types
Logical Data Independence
Physical Data Independence
36
Logical Data Independence
Changes in conceptual model do not affect the external
views
Immunity of external level from changes at conceptual level
Types of Changes
Adding a new file/index etc.
Adding a new field in a file
Changing type/size
Deleting an attribute
37
Physical Data Independence
Changes in the internal model do not affect the conceptual
model
Immunity of Conceptual level from changes at Internal level
Changes Examples.
Changing file organization
Index implementation, hash, tree etc.
Changing storage medium
38
3-Level Architecture (review)
User 1 User 2 User n
External View 1 View 2 View n
Level
Ext/Con Mapping Conceptual
Schema
Conceptual
Level
Internal
Con/Int Mapping
Schema
Internal
Level
Physical Data Database
Organization
39
KEY POINTS
Data base architecture:
External View
The way users think about data
Each user has a view of the database limited to the
appropriate portion of the user’s perspective of
reality.
Conceptual view
A complete description of the information content of the
database
Physical view
DBMS chooses type of data structures
lays out data on storage devices with operating system access
methods
40
SUMMARY
• In this lecture we discussed the data base
structure its views.
• We also discussed the external and logical
views of the database structure
• Views includes:
• External view
• Logical view
41