Вы находитесь на странице: 1из 30

Database Management System

(CSE249)
UNITS
UNIT 1 INTRODUCTION TO DATABASES

UNIT 2 RELATIONAL DATABASE LANGUAGE & INTEFACES

UNIT 3 NORMALIZATION IN DESIGN OF DATABASES

UNIT 4 TRANSACTION MANAGEMENT


UNIT 5 CONCURRENCY CONTROL
Contents – UNIT 1
Introduction to Databases
Unit 1 Topic 1 Introduction of DBMS, Characteristic of DBMS, Data
Models, Database languages, Database Administrator,
Database Users

Unit 1 Topic 2 Three Schema architecture of DBMS, Data Models,


Hierarchical, Network, Data independence and
database language, DDL, DML, Data Modeling using
Entity Relationship Model
Unit 1 Topic 3 Strong Entity, Weak entity, Specialization and
generalization, converting ER Model to relational
tables
Introduction To Databases
• Three Schema architecture of DBMS
• Data Models, Hierarchical, Network
• Data independence
• Database language, DDL, DML
• Data Modeling using Entity Relationship Model
Three Level Database Architecture
• Instances, Schemas and Sub-schema
• Database Schema vs. Database State
• Three schemas
• Data independence
INTANCES, SCHEMAS AND SUBSCHEMA in
DBMS
• Database changes over time when information is
inserted or deleted.
• The collection of information stored in the database at a
particular moment is called an instance of the database.
• The overall design of the database is called the database
schema.
• A subschema is a subset of the schema and inherits the
same property that a schema has.
Database Schema
• The description of a database is called the database schema
• Also term metadata ( For example, author, date created and date modified and
file size are examples of very basic document metadata.)
• Schema is also called intension
• Designed during database design process
• Changes very rarely afterwards
• A schema diagram displays only names of record types (entities) and
names of data items (attributes) and does not show the relationships
among the various files.
Instance or State
• Database itself
• State is called extension
• The actual content of the database, the data, changes often
over the years.
• The database state changes every time the database is updated
• A database state at a specific time defined through the currently
existing content and relationship and their attributes is called a
database instance
Database Schema vs. Database State
• The overall design of database is called database schema. The database
schema changes very infrequently.
• The actual data in the database at a particular moment in time is called a
database state. The database state changes every time the database is
updated.
Example of a Database Schema
Example of a database state
Subschema
• The plan (or scheme) for a view
• Subschema refers to an application programmer's
(user's) view of the data item types and record types,
which the user uses.
• It gives the users a window through which user can view
only that part of the database.
Relational schema Relation schema
• Database schema • A set of attributes
• Collection of relation • Also known as table schema
schemas for a whole • Basic information describing
database a table or relation
• Relational or Database • The logical definition of a
schema is a collection of table
meta-data • Defines what the name of
• A blueprint of a database the table is
that outlines the way data • Includes a set of column
is organized into tables names, the data types
associated with each column
Data and Related Structures
• Data are actually stored as bits, or numbers and strings,
but it is difficult to work with data at this level.
• It is necessary to view data at different levels of
abstraction.
• Schema:
– Description of data at some level.
– Each level has its own schema.
• Three forms of schemas:
– physical,
– conceptual, and
– external
Three Schema Architecture
• The three schema architecture
is also called ANSI (American
National Standards Institute) -
SPARC (Scheme for Promotion
of Academic and Research
Collaboration) Architecture or
three-level architecture.
• This framework is used to
describe the structure of a
specific database system.
• The three schema architecture
is also used to separate the
user applications and physical
database.
IMP Points
• There will be only one internal or
physical view, representing the total
database, as it is physically stored.
• There will be only one conceptual view,
consisting of the abstract representation
of the database in it’s entirely.
• The external view insulates users from
the details of the internal and
conceptual levels.
• Applications are written in terms of an
external schema.
• The external view is computed when
accessed.
• It is not stored.
• Different external schemas can be
provided to different categories of
users.
Three-Schema Architecture
• Defines DBMS schemas at three levels:
– Internal schema at the internal level to describe physical
storage structures and access paths (e.g indexes).
• Typically uses a physical data model.
– Conceptual schema at the conceptual level to describe
the structure and constraints for the whole database for
a community of users.
• Uses a conceptual or an implementation data model.
– External schemas at the external level to describe the
various user views.
• Usually uses the same data model as the conceptual
schema.
Differences between Three Levels of Architecture

An external schema specifies a view of the data in terms of the conceptual level.
Three-Schema Architecture: Mapping
• Mapping is used to transform the request and
response between various database levels of
architecture.
• OR Process of transforming request and results
between three level it's called mapping.
• There are the two types of mappings:
External/Conceptual Mapping
Conceptual/Internal Mapping

• The DBMS is responsible for mapping between


these three types of schema.
Three-Schema Architecture: Mapping
External/Conceptual Mapping
• The external/conceptual mapping defines the
correspondence between a particular external
view and conceptual view.
• The external view is an abstraction of the
conceptual view, which in its turn is an abstraction
of the internal view.
• It describes the contents of the database as
perceived by the user or application program of
that view.
• The user of the external view sees and manipulates
a record corresponding to the external view.
Example: External/Conceptual Mapping
• There is a mapping from a particular logical record in
the external view to one (or more) conceptual
record(s) in the conceptual view.
• A number of conceptual fields can be combined into
a single external field,
• For example,
• Last_Name and First_Name at the conceptual level
but Name at the external level.
• A given external record could be derived from a
number of conceptual records.
Conceptual/Internal Mapping
• The conceptual/internal mapping defines the
correspondence between the conceptual view and
the store database.
• It specifies how conceptual record and fields are
represented at the internal level.
• This enables the DBMS to find the actual record or
combination of records in physical storage that
constitute a logical record in conceptual schema.
Data Independence
• When a schema at a lower level is changed, only the
mappings between this schema and higher-level
schemas need to be changed in a DBMS that fully
supports data independence.
• Data independence is the ability of to make
changes to data characteristics without have to
make changes to the programs that access the data.
• It's important because of the savings in time and
potential errors caused by reducing modifications
to data access software.
Data Independence
• The DBMS maps data access
– between the external to conceptual schemas automatically.
– between the conceptual to physical schemas automatically.
• The conceptual schema can be changed without
changing application:
– Mapping from external to conceptual must be changed.
– Referred to as conceptual data independence.
• Physical schema can be changed without changing
conceptual schema:
– DBMS must change mapping from conceptual to physical.
– Referred to as physical data independence.
 Logical data independence
• The ability to change the logical (conceptual)
schema without changing the External
schema (User View) is called logical data
independence.
• For example, the addition or removal of new
entities, attributes, or relationships to the
conceptual schema should be possible without
having to change existing external schemas or
having to rewrite existing application programs.
Physical data independence
• The ability to change the physical schema
without changing the logical schema is called
physical data independence.
• For example, a change to the internal schema,
such as using different file organization or
storage structures, storage devices, or
indexing strategy, should be possible without
having to change the conceptual or external
schemas. 
Data Independence and the ANSI-SPARC
Three-Level Architecture

39

Вам также может понравиться