Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Chapter 1: Introduction

Database System
y p , 6th Ed.
Concepts,
©Silberschatz, Korth and Sudarshan
See www.db-book.com for conditions on re-use

Database Management System (DBMS)


 Data is a raw fact about peoples, objects, events, etc and
which need to be processed. It is unorganized set of
information.
information

 Database is a collection of related files that are usually


integrated, linked or cross-referenced to one another. The
advantage of a database is that data and records contained
in different files can be easily organized and retrieved
using specialized database management software called a
database management system (DBMS) or database manager.

 A database management system is a set of software programs


that allows users to create,
create edit and update data in
database files, and store and retrieve data from those
database files. Data in a database can be added, deleted,
changed, sorted or searched all using a DBMS.

Database System Concepts - 6th Edition 1.2 ©Silberschatz, Korth and Sudarshan
Database Management System (DBMS)
 Generally DBMS contains information about a particular
enterprise
 Collection of interrelated data
 Set of programs that provide a way to store and retrieve
th ddata
the t th
that th convenient
t iis bboth i t andd efficient
ffi i t to
t use

1.1 Database Applications:


Database is used widely. Some representative applications are
 Banking:
g For customer information,, accounts,, loans,, and
banking transactions
 Airlines: for reservations and schedules information.
 Universities: for student information, course
registration, grades in additions to enterprise
information suchh as hhuman resource and
d accounting.

Database System Concepts - 6th Edition 1.3 ©Silberschatz, Korth and Sudarshan

Database Management System (DBMS)


1.1 Database Applications(cont…)
 Sales: customers, products, purchases information
 Online retailers: online order tracking, customized
recommendations and maintain online product evaluations
 Manufacturing: for managing supply chain and tracking
production items in factories, inventory of items in
warehouse,
r h u orders.
rd r
 Human resources: for information about employee,
salaries tax deductions
salaries,
 Telecommunications for keeping of records of calls made,
ggenerating
g monthly
y bills,
, storing
g information about
communication networks.
 Hospitals for maintaining records of patient

Database System Concepts - 6th Edition 1.4 ©Silberschatz, Korth and Sudarshan
Database Management System (DBMS)
1.1 Database Applications(cont…)
 Digital Libraries for management and delivery of large
textual and multimedia data.
 E-commerce- integration of heterogeneous information
sources for business
b activity such
h as online
l shopping,
h
booking of holiday, consulting doctors
 Databases
D t b can
n be
b very
r large.
l r it touch
t u h all
ll aspects
p t off our
ur
lives

 Goals of DBMS
 Storing and retrieving data efficiently and effectively
 To ensure security and avoid the problem
 Concurrency control

Database System Concepts - 6th Edition 1.5 ©Silberschatz, Korth and Sudarshan

Database Management System (DBMS)


 Function of DBMS
 Defining:- specifying data types, structures and
constraints for the data
 Constructing:- process of storing data itself on some
storage medium
d
 Manipulating:- querying database to retrieve specific
d t and
data nd upd
updating
tin ddatabase.
t b
 Sharing:- allow multiple user and program to access
database concurrently
concurrently.
 Protection:- protect system against software and
hardware failures and also pprovide security
y pprotection
against malicious user/access.
 Maintaining:- should allow database to evolve as
requirements change over time.
Database System Concepts - 6th Edition 1.6 ©Silberschatz, Korth and Sudarshan
1.2 Purpose of Database System
Drawbacks of using file systems to store data
 Data redundancy and inconsistency
 Multiple file formats, duplication of information in
different files
 Difficulty in accessing data
 Need to write a new program to carry out each new
task
 Data isolation — multiple files and formats made
writing
iti new application
li ti program tto retrieve
t i ddata.
t
 Integrity problems
 Integrity constraints (e.g.,
( account balance
b l > 0))
become “buried” in program code rather than being
stated explicitly
 Hard to add new constraints or change existing ones
Database System Concepts - 6th Edition 1.7 ©Silberschatz, Korth and Sudarshan

(Cont.)

 Atomicity of updates - Failures may leave database in


an inconsistent state with partial updates carried out
 Example: Transfer of funds from one account to
another should either complete or not happen at all
 Concurrent access by multiple users
 Concurrent access needed for performance and
Uncontrolled concurrent accesses can lead to
inconsistencies
– EExample:
l TTwo people
l reading
di a bbalance
l ((say 100)
and updating it by withdrawing money (say 50 each)
at the same time
 Security problems - Hard to provide user access to
some, but not all, data
Database systems offer solutions to all the above problems
Database System Concepts - 6th Edition 1.8 ©Silberschatz, Korth and Sudarshan
1.3 View Of Data
 The major propose of database system is to provide users
with an abstract view of the data just by hiding certain
details of how the data are stored and maintained.

1 3 1 Levels of Abstraction
1.3.1
 Physical level: lowest level of abstraction which
describes how a record (e
(e.g.,
g customer) is actually stored
stored.
 Describes complex low level data structures in detail.
 Logical level: describes what data are stored in database
database,
and the relationships exist among the data.
type instructor = record
ID : string; name : string;
dept_name
p _ g salaryy : integer;
: string; g
end;
Database System Concepts - 6th Edition 1.9 ©Silberschatz, Korth and Sudarshan

View of Data
 View level: highest level of abstraction and application programs
hide details of data types. Views can also hide information (such
as an employee’s
employee s salary) for security purposes
purposes. Simplify the
interaction of user and the system during data manipulation

An architecture for a database system


Database System Concepts - 6th Edition 1.10 ©Silberschatz, Korth and Sudarshan
1.3.2 Instances and Schemas
 Similar to types and variables in programming languages
 Schema – the overall design and the logical structure of
the database
 Example: The database consists of information about a
set of customers and accounts and the relationship
between them
 AAnalogous
l to type iinformation
f i off a variable
i bl in
i a
program
 Physical schema: database design at the physical level
 Logical schema: database design at the logical level
and its important as its effect on the application
because programmers construct applications by using
this schema.

Database System Concepts - 6th Edition 1.11 ©Silberschatz, Korth and Sudarshan

Cont ….
 Instance – the actual content of the database at a
particular point in time
 Analogous to the value of a variable
 Physical Data Independence
 The ability to modify the physical schema without
changing the logical schema
 Applications depend on the logical schema
 In general, the interfaces between the various levels
and components should be well defined so that changes
in some parts do not seriously influence others.

Database System Concepts - 6th Edition 1.12 ©Silberschatz, Korth and Sudarshan
1.3.3 Data Models
 A collection of conceptual tools for describing
 Data, Data relationships
 Data semantics and Data constraints

1) Relational model
 Use a collection of tables to represent both data and
the relationship among those data.
 An example of record based model in which the database
is structured in fixed format records of several types.
2) EEntity-Relationship
tit R l ti hi model
d l (mainly
( i l for
f database
d t b ddesign)
i )
 Use a collection of basic objects, called entity and
relationship among these objects
objects.
 Entity is a real world object that is distinguishable
from other objects.
 Entity set is a collection of entity.
Database System Concepts - 6th Edition 1.13 ©Silberschatz, Korth and Sudarshan

Cont….
3) Object-based data models (Object-oriented and Object-
relational)
 Object-oriented data model is seen as extending of E-R
model with the notions of encapsulation, method and
object identity
identity.
 Object-Relation model combines the concept of object
oriented and relational data model.
4) Semi-structured data model (XML)
 Permits the specification of data where individual data
items of the same type may have different sets of
attributes.
5) Other older models: tied closely to the underlying
implementation and complicated task of modeling.
 Network model
 Hierarchical model
Database System Concepts - 6th Edition 1.14 ©Silberschatz, Korth and Sudarshan
Relational Model
 Relational model (Chapter 2)
Columns
 Example of tabular data in the relational model

Rows

Database System Concepts - 6th Edition 1.15 ©Silberschatz, Korth and Sudarshan

1.4 Database Language


1.4.1 Data Manipulation Language (DML)
 Language for accessing and manipulating the data organized
by the appropriate data model.
 Example retrieval information from, Insertion of new
information into, Deletion and modification of
information in the database.
 DML also known as query language
 Two classes of languages
 Procedural – user specifies what data is required and
how to get those data
 Declarative (nonprocedural) – user specifies what data
is required without specifying how to get those data
 SQL is the
h most widely
d l used
d query language
l

Database System Concepts - 6th Edition 1.16 ©Silberschatz, Korth and Sudarshan
Cont….
1.4.1 Data Definition Language (DDL)
 Specification notation for defining the database schema
 Used to specify storage structure and access method used
the database by a set of statement found in the special DDL
called data storage and definition.
 Like any programming language it gets as input some
iinstruction
t ti statement
t t t andd generates
t some output
t t which
hi h
placed in the data dictionary, which contains metadata.
 Database schema
 Integrity constraints
 Primary key (ID uniquely identifies instructors)
 Referential integrity (references constraint in SQL)
 A h i
Authorization
i

Database System Concepts - 6th Edition 1.17 ©Silberschatz, Korth and Sudarshan

Cont….
 Data dictionary is special type of table that can only
accessed and updated by the database system itself.
 Generally DDL used to define
 Domain constraints: domain of possible must be
associated
i d with
i h every attribute
ib (int,
(i char,
h ddate/time)
/ i )
 Referential integrity: to ensure that the values that
appear in one relation for a given set of attributes
also appear in certain set of another relation.
 Assertions: this is any condition that the database must
always satisfy. Example domain constraints and
referential integrity is special form of assertions.
 Authorization: in which user of database are
differentiated in the base of the data access right they
Example, read,
have Example
have. read insert,
insert update,
update delete
authorization.
Database System Concepts - 6th Edition 1.18 ©Silberschatz, Korth and Sudarshan
1.5 Database Design
 The process of designing the general structure of the
database:
 CConceptual
l DDesign
i – transforming
f i the
h specification
ifi i
requirements to conceptual schema
 Logical Design – Deciding on the database schema
schema.
Database design requires that we find a “good”
collection of relation schemas.
 Business decision – What attributes should we record
in the database?
 Computer Science decision – What relation schemas
should we have and how should the attributes be
di t ib t d among th
distributed the various
i relation
l ti schemas?
h ?
 Physical Design – Deciding on the physical layout of
the database

Database System Concepts - 6th Edition 1.19 ©Silberschatz, Korth and Sudarshan

Database Design?
 Is there any problem with this design?

 Normalization Theory (Chapter 8)


 Formalize what designs are bad, and test for them

Database System Concepts - 6th Edition 1.20 ©Silberschatz, Korth and Sudarshan
The Entity-Relationship Model
 Models an enterprise as a collection of entities and
relationships
 Entity: a “thing” or “object” in the enterprise that
is distinguishable from other objects (person, bank
accounts) and Described by a set of attributes.
attributes
 Entity set: a set of all entities of the same type
 R l ti
Relationship:
hi an association
i ti among several
l entities
titi
 Represented diagrammatically by an entity-relationship
diagram:

What happened to dept_name of instructor and student?


Database System Concepts - 6th Edition 1.21 ©Silberschatz, Korth and Sudarshan

Object-Relational Data Models


 Relational model: flat, “atomic” values
 Object
j Relational Data Models
 Extend the relational data model by including object
orientation and constructs to deal with added data
types.
 Allow attributes of tuples to have complex types,
i l di non-atomic
including i values
l such
h as nested
d relations.
l i
 Preserve relational foundations, in particular the
declarative access to data
data, while extending modeling
power.
 Provide upward compatibility with existing relational
languages.

Database System Concepts - 6th Edition 1.22 ©Silberschatz, Korth and Sudarshan
XML: Extensible Markup Language
 Defined by the WWW Consortium (W3C)
 Originally
O i i ll iintended
t d d as a ddocument
t markup
k llanguage not
t a
database language
 The ability to specify new tags
tags, and to create nested tag
structures made XML a great way to exchange data, not just
documents
 XML has become the basis for all new generation data
interchange formats.
 A wide variety of tools is available for parsing, browsing
and querying XML documents/data

Database System Concepts - 6th Edition 1.23 ©Silberschatz, Korth and Sudarshan

1.6 Storage Management


 Storage manager is a program module that provides the
interface between the low-level data stored in the database
and the application programs and queries submitted to the
system.
 The
Th storage
t manager iis responsible
ibl tto th
the ffollowing
ll i ttasks:
k
 Interaction with the file manager
 Efficient storing, retrieving and updating of data
 Issues:
 Storage access
 File organization
 Indexing and hashing

Database System Concepts - 6th Edition 1.24 ©Silberschatz, Korth and Sudarshan
1.7 DBMS Architecture
1) Physical DBMS Architecture
 Defines the software components used to process and enter
data, and how these software components are related and
interconnected.

Database System Concepts - 6th Edition 1.25 ©Silberschatz, Korth and Sudarshan

Cont ….
ELEMENTS OF A DATABASE MANAGEMENT SYSTEM
 The major components of a DBMS are explained below:
 DML Precompiled: It converts DML statement embedded in an
application program to normal procedure calls in the host
language.
language
 DDL Compiler: The DDL compiler converts the data definition
statements into a set of tables.
tables
 File Manager: Manages the allocation of space on disk storage
and the data structure used to represent information stored on
disk.
 Database Manager: Convert user's queries coming directly via
the
h query processor or iindirectly
di l via
i an application
li i program
from the user's logical view to the physical file system. Also
performs the tasks of enforcing constraints to maintain the
consistency and integrity of the data as well as its security.

Database System Concepts - 6th Edition 1.26 ©Silberschatz, Korth and Sudarshan
Cont ….
ELEMENTS OF A DATABASE MANAGEMENT SYSTEM
 Query Processor: used to interpret the online user's query
and convert it into an efficient series of operations in a
form capable of being sent to the data manager for
execution. It uses the data dictionary to find the
structure of the relevant portion of the database and uses
this information in modifying the query and preparing an
optimal plan to access the database.
 Database Administrator: Responsible for overall management
off ddata
t resources
r ur in an
n organization
r ni ti n inincluding
ludin maintaining
int inin
corporate wide data definitions and standards.
 Data Dictionary: Keeping a track of all the available names
that are used and the purpose for which they were used
becomes more and more difficult.

Database System Concepts - 6th Edition 1.27 ©Silberschatz, Korth and Sudarshan

Database System Internals

Database System Concepts - 6th Edition 1.28 ©Silberschatz, Korth and Sudarshan
1.7 Database Users and Administrators
 There are four different types of database-system users,
differentiated by the way they expect to interact with the
system:
 DBA (Database Administrator): is responsible for
authorizing
th i i tto access ththe ddatabase,
t b tto monitoring
it i it its use
and for acquiring software and hardware resources as
needed.
 Generally DBA are do the following tasks:
 Schema definitions
 Storage structure and access method definitions
 Schema and physical organization modifications
 Granting authorization for data access
 Routine maintainance( regularly backing up database
database,
ensure enough free disk space)
Database System Concepts - 6th Edition 1.29 ©Silberschatz, Korth and Sudarshan

Cont…
 Database Designer: responsible to select appropriate
structure for represent and store the data. Before select
the structure ,Designer
Designer will meet all the database users
and find out all the requirements which they want to
fulfill. After collect all the requirement it comes with
their design and structure and this work is completed
before database implementation.
 End
E d UUsers: These
Th are:
 1)Casual Users: These are the users who communicate
with the database for little period of time.
time They are
occasionally used the database. So these are the
temporary users.
 2) Parametric Or Naive Users: These are the users who
communicate with the database for a regular period.
Th i main
Their i jjobb is
i to constantly
l querying
i andd updating
d i
the database using standard queries
Database System Concepts - 6th Edition 1.30 ©Silberschatz, Korth and Sudarshan
Cont…
 3) Sophisticated End Users: These are engineers,
scientists, business analysts who are familiarize with
the database and when they want to use the database,
they used it regularly and when they don’t want then
they are temporally used .
 4)Stand alone users: These are the users who maintain
their ppersonal database using
g ready
y made software which
is available in the market easily and provide the menu
based interface through which they can easily used the
database.
database
System Analysts and Application Programmers: System analysts
find out the requirements of parametric end users and
develop all the analysis for canned transaction through
which they can meet all the requirements of parametric
users. Application programmers implement these analysis
as programs. These are especially Software engineers.
Database System Concepts - 6th Edition 1.31 ©Silberschatz, Korth and Sudarshan

End of Chapter 1

Database System Concepts - 6th Edition 1.32 ©Silberschatz, Korth and Sudarshan

You might also like