Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

UNIVERSITY OF MANAGEMENT

AND TECHNOLOGY
Lecture # 3

Database Systems

Lecturer: Miss Nayab Kanwal


Three Level Architecture
_____________________________________________

• Database Task Group (DBTC) developed and published a proposal for a


standard vocabulary and architecture for database systems in 1971.
• It was appointed by Conference on Data Systems and Languages
(CODASYL).
• The Standards Planning and Requirements Committee of American
National Standards Institute (ANSI) Committee on Computers and
Information Processing developed and published a similar vocabulary and
architecture in 1975.
• The result of these reports was the three-level architecture.
• Three-level architecture is the basis of modern database architecture.
• Database can be viewed at three levels.
• The three levels are depicted by three models known as three-level schema.
Three Level Architecture
_____________________________________________
• The models refer to the structure of the database not the data stored in it.
• The permanent structure of database is known as intension of database or
database schema.
• The data stored at a given time is known as extension of database or
database instance.
• The intension of a database should not be changed once it has been defined.
• This is because a small change in the intension of database may require
many changes to the data stored in database.
• The extension of database is performed after the intension of database has
been finalized.
• It means that data is stored in database when database structure has been
defined.
Three Level Architecture
_____________________________________________
"Intension" of a Database
_____________________________________________

• The "intension" of a database or database schema refers to its inherent


properties or characteristics that define its structure and organization.
• It represents the blueprint or design of a database, which includes the
data types, relationships, constraints, and rules that govern the data
stored in it.
External Level / View
_____________________________________________
• The external level consists of different external views of a database.
• Each external view the view of a particular user about the system, Different
users conceive the system in different ways.
• Each user is interested in one part of the system and ignores other parts.
• One user may not be aware of the whole system at all.
• Different views may have different representations of the same data.
• For example, one user may think that dates are stored in the form
(month/day/year). Another user may think they are represented
as(year/month/day).
• Some views might include virtual or calculated data.
• Virtual data is the data that is not actually stored in database but created
when needed.
External Level / View
_____________________________________________

• For example, the product name and its price can be stored in database. The
total bill can be created as and when desired. Similarly, the marks of
different subjects can be stored in database. The overall grade of the
students can be calculated when result card is prepared.
• External level is described in external schema. It is also called subschemas.
External schemas refer to different views of data.
Logical or Conceptual Level / View
_____________________________________________

• This is the middle-level view in three-level architecture.


• The logical or conceptual level describes the data stored in the database.
• It contains the definition of the data to be stored in the database.
• It also contains the rules and information about the structure and type of
data.
• It is the complete description of data stored in community view of the
database.
• That is why it is also known as Community view of the database.
• This level contains the logical structure of entire database as seen by
DBA.
• It hides the physical storage structure.
Logical or Conceptual Level / View
_____________________________________________
• The conceptual level represent the following:
• All entities, their attributes and their relationship.
• The constraint on the data.
• The semantic information about the data
• Security and integrity information
• The conceptual level supports each external view.
• It means that any data required by any user must be available from conceptual
level.
• The conceptual model is comparatively constant.
• DBA designs a conceptual model to fulfil the present and future requirements
of the organization.
• If there is any change in external model, the conceptual model should be able
to accommodate that change.
Logical or Conceptual Level / View
_____________________________________________
Internal or Physical Level
_____________________________________________
• Internal level is responsible to store data on storage media.
• It describes the physical representation of database on computer.
• It describes how the data is stored in database.
• It covers the data structures and file organization used to store data on storage
devices.
• Internal and physical levels are normally considered to be same. But there is a
slight difference between them.
• The data is stored in binary format on disks.
• The binary storage method is implemented by operating system.
• DBMS partially decides the way data is stored on the disk.
• This decision of DBMS is based on the specifications of DBA.
• Additionally, DBMS adds information to the data to be stored. For example, it
selects a specific file organization for storing data on disk.
Internal or Physical Level
_____________________________________________
• It also creates specific indexes to implement that file system.
• It uses the same index information for retrieving the data from the disk.
• DBMS performs storage space utilization to consume minimum space for
storing data.
• Data compression can be performed for this purpose.
• It also applies different data encryption algorithms to implement security on
the data.
• The records at internal level are presented according to the format of schema
definition but the data is not in record format at physical level.
• The records at internal level are presented according to the format of schema
definition but the data is not in record format at physical level.
• It is in character format.
Internal or Physical Level
_____________________________________________

• The rules specified by the schema of record are not enforced at physical
level.
• Data is managed by operating system at physical level.
• Internal level is described in internal schemas.
• They describe the internal mode.
• They contain the definitions of stored records, methods of
representation, data fields and indexes etc.
• There is only one internal schema for one database.
Mapping
_____________________________________________

• Mapping is the process of converting one level to another level.


• In this process, the data at one level is related to the data another level.
• There are wo levels of mapping
• From conceptual level to internal level
• From external level to the conceptual level
Conceptual/ Internal Mapping
_____________________________________________

• The conceptual/ internal mapping defines the correspondence


between the conceptual view and stored database.
• It specifies how conceptual records and fields are represented at the
internal level
• If the structure of stored database is changed, then the conceptual/
internal mapping must be changed accordingly so that the
conceptual schema can remain consistent.
• It is the responsibility of DBA to manage such change.
Graphical Representation of External
________________________________________________
&
Internal Conceptual Mapping
External/ Conceptual Mapping
________________________________________________

• An external/ conceptual mapping defines the correspondence


between a particular external view and conceptual view.
• Generally, the difference between these two levels are similar to the
differences between conceptual view and stored database.
• For example, fields can have different data types, fields and record
name can be changed, several conceptual fields can be determined
into signle field.
• Any number of external views can exist at the same time.
• Any number of users can share a given external view an different
external views can overlap each other.
Data Independence
________________________________________________
• The separation of data and application program is called data
independence.
• It is an important feature of DBMS.
• It is the most important advantage of three level architecture.
• Another major advantage is that any change in lower level of three level
architecture does not affect the structure or functionality of upper
levels.
• Data independence enables the user to change the structure of a
database without changing application programs or the way users
access the data.
• Physical data independence
• Logical data independence
Physical Data Independence
________________________________________________
• Physical data independence is a type of independence that enables
the user to change the internal level without changing the conceptual
level.
• In a DBMS, physical structure of database may change without
changing application programs or altering the user's view of data.
• It is passible because DBMS uses abstraction.
• Data is translated from the way it is physically stored on disk to the
representation and access techniques used by logical view.
• If the physical structure changes, DBMS is aware of these changes
but still provides the same logical view.
• The logical view remains constant and the application programs and
user interactions based on logical view of data are not altered.
Logical Data Independence
________________________________________________

• Logical data independence is a type of independence that enables the


user to change the conceptual level without changing the external
level.
• Some additional information may be added to the database by
changing its logical structure
• This change should not affect user interaction or application programs.
This is known as logical data independence.
Logical Data Independence
________________________________________________
• The changes that may be performed at logical level without changing
external level are as follows:
• Addition or removal of entities or relationships
• Adding a file to the database
• Adding new field in the file
• Changing the type of a field etc.
• In some situations, a change that may look similar to the above-
mentioned changes can create a problem.
• Suppose an attribute is deleted from database structure.
• It is serious because any application that is using this attribute may not
run any more. It is important to analyze the effects of a change before
making that change to the database.
Data Models
________________________________________________

• A representation of real world objects, events and their associations is


called a model.
• The model helps the user to understand the complexities of the real
world environment.
• A collection of concepts to describe and manipulate data, relationships
between data and constraints on data is called data model.
Parts of Data Models
________________________________________________

• A data model consists of the following parts:


• Structural Part: It consists of a set of rules. These rules specify how
a database can be developed.
• Manipulative Part: It defines the types of operations that can be
performed on data. The operations include updating or retrieving data
from database and changing the structure of database.
• Set of Integrity Rules: It ensures the accuracy of data in the
database.
Importance of Data Models
________________________________________________
• The data model is used as a communication tool for database designer,
application programmer and end user to interact with one another.
• A good data model enables the users to understand the organization for
which the database design is developed.
• A good data model is very necessary to design a good database.
• Any DBMS is based on a specific data model.
• No DBMS can exist without any data model.
• It is difficult to create a proper database without knowing the data model of
DBMS.
• It is very important to know the structures, manipulation languages and
integrity facilities implemented by DBMS.
• It enables the user to understand the facilities and functionalities provided
by the DBMS
Types of Data Models
________________________________________________

• Object-Based Data Models


• Record-Based Models
• Physical Data Models

• Object-based data models and record-based data models are


used to describe data at conceptual and external levels.
• The physical data models are used to describe data at internal
Object-Based Data Models
________________________________________________
• Object-based data models use the concepts like entities, attributes and
relationships.
• An entity is a person, place, thing or event for which data is collected
and maintained in the database.
• An attribute is the characteristics of an entity.
• A relationship is an association between two or more entities.
• Some types of object-based data Models are as follows:

• Entity-Relationship
• Semantic
• Object-Oriented etc.
Physical Data Models
________________________________________________

• Physical data models describe storage of data in computer.


• They represent information such as record structures, record orderings
and access paths.
• There are not as many physical data models as logical data models.
• The most common physical data models are unifying model and frame
memory.
ANY QUESTION ?
THANK YOU

You might also like