Sie sind auf Seite 1von 36

Database Mangement System

Basic Concepts related to Database


• Database
– It is a collection of related data.

• Data
– Known facts that can be recorded and have implicit
meaning.

• Database management system (DBMS)


– software that handles the storage, retrieval, and
updating of data in a computer system.
Database

Field Records Files


Single piece Collection of
Complete set
of records
of fields
information
APPLICATION
#1

APPLICATION
#2
DBMS DATABASE
CONTAINING
CENTRALIZED
SHARED DATA

APPLICATION
#3 DBMS MANAGES DATA
RESOURCES LIKE AN
OPERATING SYSTEM
MANAGES HARDWARE
RESOURCES
Database vs Spreadsheets
ACID Model
More Characteristics of Database
• Real-world entity
• Relation-based tables
• Isolation of data and application
• Less redundancy
• Consistency
• Query Language
• Multiuser and Concurrent Access
• Multiple views
• Security
users
• A typical DBMS has users with different rights and
permissions who use it for different purposes. Some
users retrieve data and some back it up. The users of
a DBMS can be broadly categorized as follows
DBMS Architecture and Data
Independence
• DBMS Architecture describes how data in the
database is viewed by the users.
– it is not concerned with how the data is handled
and processed by the DBMS
– The databse users are provided with an abstract
view of the data by hiding certain details of how
data physically stored.

contd……
Three-level DBMS architecture
OR
Three Schema Architecture
• Database Schema - Logical design of database
• Database Instance – Snapshot of the data in
the database at a given instant in time.
Three Levels of the architecture
External View / Level / Schema / User
View / Global View
 Highest or Top level of data abstraction ( No knowledge of
DBMS S/W and H/W or physical storage).
 This level is concerned with the user.
 Each external schema describes the part of the database
that a particular user is interested in and hides the rest of
the database from user.
 There can be n number of external views for database
where n is the number of users.
 For example, a accounts department may only be
interested in the student fee details. It would not be
expected to have any interest in the personal information
about students.
Conceptual View
 This level is in between the user level and
physical storage view.
 There is only one conceptual view for single
database.
 It hides the details of physical storage
structures and concentrates on describing
entities, data types, relationships, user
operations, and constraints.
Internal View / Physical View
 It is the lowest level of data abstraction. (it has the knowledge about s/w
and h/w)

 At this level, it keeps the information about the actual representation of


the entire database i.e. the actual storage of the data on the disk in the
form of records or blocks.
 It is close to the physical storage method.

 The internal view is the view that tells us what data is stored in the
database and how. At least the following aspects are considered at this
level: Storage allocation, Access paths etc.

 The internal view does not deal with the physical devices directly. Instead it
views a physical device as a collection of physical pages and allocates space
in terms of logical pages.
TYPES OF DATA INDEPENDENCE

• LOGICAL DATA INDEPENDENCE

• PHYSICAL DATA INDEPENDENCE


LOGICAL DATA INDEPENDENCE
• Whenever, there is a change or modification at the
conceptual level without affecting the user level or
external level, it is known as logical data
independence.

• E.g. The name field in conceptual view is stored as


first name, middle name and last name whereas in
external view, it remains to be as a single name field.
PHYSICAL DATA INDEPENDENCE
• Whenever, the changes are made at the internal level
without affecting the above layers, it is known as
physical data independence.

• E.g. The location of the database, if changed from C


drive to D drive will not affect the conceptual view or
external view as the commands are independent of
the location of the database.
Difference between Logical Data Independence &
Physical Data Independence
Logical Data Independence Physical Data Independence
It is concerned with the structure of the data It is concerned with storage of the data.
or changing the data definition.

It is very difficult as the retrieving of data are It is easy to retrieve.


heavily dependent on logical structure of data.

Application program need not be changed if


new fields are added or deleted from the Physical database is concerned with the
database. change of the storage device.

It is concerned with the conceptual schema.


It is concerned with the internal schema.
File Based System vs. DBMS
Data Models
• Data models define how the logical structure
of a database is modeled.
• Data Models are fundamental entities to
introduce abstraction in a DBMS.
• Data models define how data is connected to
each other and how they are processed and
stored inside the system.
Entity-Relationship Model

• Entity-Relationship Model
• Entity-Relationship (ER) Model is based on the notion
of real-world entities and relationships among them.
While formulating real-world scenario into the
database model, the ER Model creates entity set,
relationship set, general attributes and constraints.
• ER Model is best used for the conceptual design of a
database.
• ER Model is based on −
• Entities and their attributes.
• Relationships among entities.
• Entity − An entity in an ER Model is a real-world
entity having properties called attributes.
Every attribute is defined by its set of values
called domain. For example, in a school database,
a student is considered as an entity. Student has
various attributes like name, age, class, etc.
• Relationship − The logical association among
entities is calledrelationship. Relationships are
mapped with entities in various ways. Mapping
cardinalities define the number of association
between two entities.
E-R Model
Mapping cardinalities
• Mapping cardinalities −
• one to one
• one to many
• many to one
• many to many
34
NOTATIONS OF E-R DIAGRAM

► ENTITY TYPE

► ATTRIBUTE

► KEY ATTRIBUTE

► MULTIVALUED ATTRIBUTE

► COMPOSITE ATTRIBUTE

► DERIVED ATTRIBUTE
35
DEGREE OF A RELATIONSHIP: BINARY,
TERNARY, UNARY

QUANTITY
UNARY
SNAME
RELATIONSHIP
SUPPLIER PROJECT

SUPPLY
PROJNAME
TERNARY
RELATIONSHIP MANAGES
PART
EMPLOYEE
PARTNO
SSN
36

Das könnte Ihnen auch gefallen