DBE Unit 1
DBE Unit 1
Unit 1
Introduction to DBMS
Introduction
• Data
• raw, unorganized facts that need to be processed.
• Data can be something simple and seemingly
random and useless until it is organized.
• Information
• When data is processed, organized, structured or
presented in a given context so as to make it useful,
• it is called information.
Introduction
• Database
• collection of related data
• Database Management System (DBMS)
• software that manages and controls access to the
database.
• Database application
• A program that interacts with the database at
some point in its execution.
Introduction
• Database Management System (DBMS) -
• Collection of interrelated data - database
• Set of programs to access those data
• Primary Goal –
• store and retrieve data in convenient and efficient manner
• Data consistency
• By eliminating redundancy, we reduce the risk of
inconsistencies occurring.
• If a data item is stored only once in the database,
any update to it has to be performed only once
and the new value is available immediately to all.
• More information from the same amount of data
• With the integration of the operational data, it may
be possible for the organization to derive
additional information from the same data.
• Sharing of data
• database belongs to the entire organization and
can be shared by all authorized users.
• Improved data integrity
• Database integrity refers to the validity and
consistency of stored data.
• Integrity is expressed in terms of constraints,
• which are consistency rules that the database is
not permitted to violate.
• Constraints may apply to data items within a
single record or they may apply to relationships
between records.
• Improved security
• Database security is the protection of the
database from unauthorized users.
• Enforcement of standards
• integration allows the DBA to define and enforce
the necessary standards.
• These may include departmental, organizational,
national, or international standards.
• Economy of scale
• Combining all the organization’s operational data
into one database, and creating a set of
applications that work on this one source of data,
can result in cost savings.
• Cost of DBMSs
• The cost of DBMSs varies significantly, depending
on the environment and functionality provided.
• a single-user DBMS for a personal computer may
only cost US$100.
• Additional hardware costs
• The disk storage requirements for the DBMS and
the database may necessitate the purchase of
additional storage space.
• To achieve the required performance, it may
be necessary to purchase a larger machine
• Cost of conversion
• In some situations, the cost of the DBMS and
extra hardware may be insignificant
compared with the cost of converting existing
applications to run on the new DBMS and
hardware.
• This cost also includes the cost of training staff to
use these new systems
• Performance
• a file-based system is written for a specific
application, such as invoicing.
• As a result, performance is generally very good.
• However, the DBMS is written to be more
general, to cater for many applications rather than
just one.
• The effect is that some applications may not run
as fast as they used to.
• Higher impact of a failure
• The centralization of resources increases the
vulnerability of the system.
• Since all users and applications rely on the
availability of the DBMS, the failure of certain
components can bring operations to a halt.
View of Data
• Complex data structures used for efficiency
• Hides certain details of how data are stored and maintained
• Provides abstract view
• Hides complexity
• 3 Levels of Data Abstraction
• Physical Level
• Logical Level
• View Level
Physical Level
• Lowest level of abstraction
• Describes how data are actually stored
• Describes complex low level data structures in detail
• Blocks of consecutive storage locations- words, byte etc
• Administrator may be aware of certain details of the
physical organization
Logical Level
• Next higher level of abstraction
• Describes what data are stored in the database
• And what relationship exists among those data
• Describes entire database in terms of a small number of
relatively simple structures
• Do not bother with complex physical storage
• Database administrator uses logical level
• Who decides what information to keep in database
• Each record is described by a type definition
• Programmers also work at this level
View Level
• Highest level of abstraction
• Describes only part of entire database
• Exists to simplify interaction with the system
• System may provide many views for the same database
• Set of application programs that hide details of the data
types
• Views also provides security mechanisms to prevent users
from accessing certain parts of database
• type customer = record
name : string;
street : string;
city : integer;
end;
Instances and Schemas
• Database changes over time as information is inserted and
deleted
• Instance of the database –
• Collection of information stored in the database at a
particular moment
• Schema –
• The overall design of the database
• Buffer manager
responsible for fetching data from disk storage into
main memory, and deciding what data to cache in
main memory.
The buffer manager is a critical part of the database
system, since it enables the database to handle data
sizes that are much larger than the size of main
memory.
• The storage manager implements several data
structures as part of the physical system
implementation:
• Data dictionary,
which stores metadata about the structure of the
database, in particular the schema of the database.
• Keys-
• Underline the attributes forming primary key
Relational Query Languages
The Relational Algebra