0% found this document useful (0 votes)
81 views25 pages

DBMS ch1

This document provides an overview of database management systems (DBMS). It discusses that a DBMS allows for the storage and retrieval of data in a database. It provides three levels of abstraction - physical, logical, and view levels. It also describes different data models, database languages for defining schemas and manipulating data, relational databases using tables, and common database architectures like two-tier and three-tier systems. Transaction management in DBMS is discussed to maintain data consistency.

Uploaded by

SonalS Naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views25 pages

DBMS ch1

This document provides an overview of database management systems (DBMS). It discusses that a DBMS allows for the storage and retrieval of data in a database. It provides three levels of abstraction - physical, logical, and view levels. It also describes different data models, database languages for defining schemas and manipulating data, relational databases using tables, and common database architectures like two-tier and three-tier systems. Transaction management in DBMS is discussed to maintain data consistency.

Uploaded by

SonalS Naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

Chapter 1: Introduction

Database Management System (DBMS)

• A Database Management System (DBMS) is a collection of


interrelated data and a set o programs to access those data.

• The collection of data is referred to s a database.

• The primary goal of a DBMS is to provide a way to store and retrieve


database information that is both convenient and efficient.

• Management of data involves both defining structure for storage of


information and providing mechanism for manipulation of
information.

• In addition, DBMS must ensure the safety of the information stored.


Database Management System (DBMS)
• DBMS contains information about a particular enterprise
– Collection of interrelated data
– Set of programs to access the data
– An environment that is both convenient and efficient to use

• Database Applications:
– Banking: for customer information, accounts ,loans.
– Airlines: reservations, schedules
– Universities: for student information, registration, grades
– Sales: customers, products, purchase information.
– Online retailers: order tracking, customized recommendations
– Manufacturing: production, inventory, orders, supply chain
– Human resources: for information about employee, salaries, tax deductions
• Databases touch all aspects of our lives
Purpose of Database Systems
• In the early days, database applications were built directly on
top of file systems
• 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
– Integrity problems
• Integrity constraints (e.g. account balance > 0) become
“buried” in program code rather than being stated
explicitly
• Hard to add new constraints or change existing ones
Purpose of Database Systems (Cont.)

• Drawbacks of using file systems (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 accessed needed for performance
• Uncontrolled concurrent accesses can lead to
inconsistencies
– Example: Two people reading a balance and updating it
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
Levels of Abstraction
• Physical level: The lowest level of abstraction describes how the
data are actually stored.

• Logical level: The next-higher level of abstraction describes what


data are stored in database, and the relationships among those data.

• View level: The highest level of abstraction describes only part of


the entire database.
• Application programs hide details of data types. Views can also hide
information (such as an employee’s salary) for security purposes.
• The view level of abstraction exists to simplify their interaction with
the system.
• The system may provide many views for the same database.
View of Data
Data Models
• A collection of tools for describing
– Data
– Data relationships
– Data semantics
– Data constraints
Data model describes the design of the database.
• Relational model: The relational model uses a collection of tables
to represent both data and the relationships
• among those data.
• Entity-Relationship data model: The entity-relationship (E-R) data
model is based on a perception of a real world that
• consists of a collection of basic objects, called entities, and of
relationships among these objects.
• Object-based data models (Object-oriented and Object-relational)
• Semi-structured data model (XML):The extensible markup
language (XML) is widely used to represent semi-structured data.
Database Languages

• A database system provides a data definition language to specify


the database schema and a data manipulation language to express
database queries and updates.
Data Manipulation Language (DML)
• Language for accessing and manipulating the data organized by the
appropriate data model
– DML also known as query language
• The types of accesses are:
1. retrieval of information stored in a database
2. insertion of new information in a database.
3. deletion of information stored in a database.
4. modification of stored data.
• 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 in a
database without specifying how to get those data
• SQL is the most widely used query language
Data Definition Language (DDL)
• Specification notation for defining the database schema
• The data values stored in a database must satisfy certain
consistency constraints.

• Integrity constraints that must be satisfied are:


• Domain Constraint: a domain of a possible values must be
associated with every attribute.(integer type, char type)
• Referential integrity:
• Assertion: it is the condition that database must always satisfy.
Domain Constraint, Referential integrity are the types of assertion.
• Authorization: specifies the types of access permitted on database
values.

1. Read Authorization
2. Update Authorization
3. Delete Authorization
Relational Database

• A relational database is base on the relational model and uses a collection of tables to represent both data and the relationships among the data.

Tables:

• Each table has multiple columns and each column has unique name.

• The relational model is an example of record based model.

• Each table contains the records of particular type.

• Each record type defines a fixed number of fields.

• Columns of the table correspond to the attribute of record type.


Relational Database Attributes

• Example of tabular data in the relational model


A Sample Relational Database
Database Architectures

Database system can be centralized, client-server.


Database applications partitioned into two or three parts
1. Two-tier architecture:
2. three-tier architecture:
Database Application Architectures

(web browser)

Old Modern
Database Architectures
•Database system can be centralized, client-server.
•Database applications partitioned into two or three parts.
•Two-tier architecture:
•The application is partitioned into a component that resides at the
client machine, which invokes database system functionality at the
server machine through query language statement.

•Three-tier architecture:
•Client end communicates with an application server through an
interface.
•The application server in turn communicates with a database system
to access data.
•The business logic of the application ,which says what action to carry
out under what condition is embedded in the application server.
Overall System Structure
•DBMS (Database Management System) acts as an interface
between the user and the database.

•The user requests the DBMS to perform various operations (insert,


delete, update and retrieval) on the database.

•The components of DBMS perform these requested operations on


the database and provide necessary data to the users.

Database Users:

Naïve Users:
Users who need not to be aware of the presence of database system.
User of ATM.

Application Programmers:
C, C++, Java, .net application programmers developers.
Database administrators:

•responsible for authorizing access to the database, for co-coordinating


and monitoring its use, acquiring software, and hardware resources,
controlling its use and monitoring efficiency of operations.

•A database administrator (DBA) is a person who is responsible for the


environmental aspects of a database.

Duties of DBA:

•Recoverability - Creating and testing Backups.

•Integrity - Verifying or helping to verify data integrity.

•Security - Defining and/or implementing access controls to the data.

•Development and testing support - Helping programmers and


engineers to efficiently utilize the database.
Duties of DBA:

•Handles security and authorization

•Data availability, crash recovery

•Monitoring database performance

Storage Manager:

•DDL compiler:

•Data Description Language compiler processes schema definitions


specified in the DDL.

•DML Compiler and Query optimizer:

•The DML commands such as insert, update, delete, retrieve from the
application program are sent to the DML compiler for compilation into
object code for database access.
•Transaction Manager:

•this module ensures that the transactions which are constituted of


queries and other actions- are execute atomically .

•File manager:

•File manager controls accesses to DBMS information that is stored on


the disk

•Buffer manager:

•It manages the main memory buffers which store data, metadata
Transaction Management

• A transaction is a collection of operations that performs a single


logical function in a database application

• Transaction-management component ensures that the database


remains in a consistent (correct) state despite system failures (e.g.,
power failures and operating system crashes) and transaction
failures.

• Concurrency-control manager controls the interaction among the


concurrent transactions, to ensure the consistency of the database.

• Each transaction is a unit of both atomicity and consistency.

• Transaction do not violate database consistency constraints.

• If database was consistent when transaction started it must be


consistent when transaction terminated.
• For example, the transaction to transfer funds from account A to account B could
be defined to be composed of two separate programs: one that debits account A,
and another that credits account B.
• The execution of these two programs one after the other will indeed preserve
consistency.
• In the absence of failures, all transactions complete successfully, and atomicity is
achieved easily.
• However, because of various types of failure, a transaction may not always
• complete its execution successfully.
• If we are to ensure the atomicity property, a failed transaction must have no effect
on the state of the database.
• Thus, the database must be restored to the state in which it was before the
transaction in question started executing.
• The database system must therefore perform failure recovery, that is, detect
system failures and restore the database to the state that existed prior to the
occurrence of the failure.
End of Chapter 1

You might also like