Professional Documents
Culture Documents
Models of Database and Database Design: Lecture Two
Models of Database and Database Design: Lecture Two
DATABASE AND
DATABASE DESIGN
LECTURE TWO
OBJECTIVES
By the end of this lecture students should
be able to (i) explain the difference
between a database instance and a
database schema;
(ii) describe the the 3 levels of abstraction
that were identified by the American
National Standards Institute Special
Planning and Requirements Committee
(ANSI-SPARC) and
(iii) define the term data independence
and identify the 2 types of data
independence that exist in relation to the
ANSI-SPARC Architecture.
Database Schema and Database
Instance
• Database Schema
• the description of the database is called
the database schema or intension;
• specified at the creation of the database
(using the Create Database or Create
Table statement)
• not expected to change very often
• Database Instance
• the raw data that populates a database
at a particular moment in time
Example of Database Schema and
Database Instance
Database schema (names of columns + the types associated with them)
Name DOB Address Job Scale
String Date String String Int
A database instance
Name DOB Address Job Scale
A. Johnson 2/04/1960 London Programmer 12
B. Holiday 3/10/1947 Leeds Analyst 14
C. Clark 12/08/1971 York Programmer 10
Why the ANSI SPARC Architecture?
• It allows independent customised user views; The Three
Level Architecture has the aim of enabling users to access
the same data but with a personalised view of it; Each user
should be able to access the same data, but have a
different customized view of the data. These should be
independent: changes to one view should not affect
others.
• It hides the physical storage details from users; The
distancing of the internal level from the external level
means that users do not need to know how the data is
physically stored in the database. This level separation also
allows the Database Administrator (DBA) to change the
database storage structures without affecting the users'
views.
The three ANSI/SPARC levels of
abstraction
Conceptual level
Internal level
physical storage
EXTERNAL LEVEL
• It represents the user’s view of the
database
• It describes that part of the database
that is relevant to a particular user
• It excludes irrelevant data as well as data
which the user is not authorised to
access.
• May provide different representations of
the same data e.g some may view dates
in the form (day/month/year) or
(year/month/day)
• Views may include derived or calculated
data
CONCEPTUAL LEVEL
• Aka the community view of the database
• The conceptual level is a way of describing what
data is stored within the whole database and how
the data is inter-related but it does not specify how
the data is physically stored.
• It represents the following: all entities, their
attributes and relationships; the constraints on the
data; security and integrity information
• It supports each external view in that any data
available to a user must be contained in or
derivable from the conceptual level
• Only a database administrator is allowed to modify
or structure this level.
INTERNAL LEVEL
• The internal level involves how the database is physically
represented on the computer system. It describes how the
data is actually stored in the database and on the computer
hardware.
• It describes how the data is stored in the database in terms
of particular data structures and file organizations
• The internal level is the most technical of the three
levels. However, the internal level view is still abstract
meaning even if it shows how the data is stored physically,
it will not show how the database software operates on it.
• Is concerned with: allocating storage space for data and
indexes; describing the forms that records will take when
stored; record placement; data compression and encryption
techniques
•Below the internal level is the physical
level which is managed by the OS under
the direction of the DBMS and deals
with the mechanics of physically storing
data on a device such as a disk
Difference between External,
Conceptual and Internal Level
Logical D
Independ
Conceptual level
Physical
Independ
Internal level
physical storage
THANK YOU
QUESTIONS????