Database Management Systems
Database Management Systems
Database Management Systems
B. Tech II/IT
n iSLIDES g UNIT-I PPT n E O by Raghu Ramakrishnan o Text Books: (1) DBMS aD DBMS by Sudarshan and Korth a (2) F
.c II Semester rs ee
m o
Module as per Lecture PPT Session planner No Slide NO -----------------------------------------------------------------------------------------1. DBS Application and L1 L1- 1 to L1- 9 DBMS Vs File Systems 2. View of DATA L2 L2- 1 to L2- 7 3. DB Language (DML, DDL) L3 L3- 1 to L3- 6 4. DB Users and Administrator L4 L4- 1 to L4- 3 5. Data storage and Querying L5 L5- 1 to L5 -5 6. DBMS Architecture L6 L6- 1 to L6- 3
aa F
o D
E O
g n
ee in
.c rs
m o
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-1
What Is a DBMS?
A very large, integrated collection of data. Models real-world enterprise. Entities (e.g., students, courses) Relationships (e.g., Madonna is taking CS564) A Database Management System (DBMS) is a software package designed to store and manage databases.
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-2
Data independence and efficient access. m co . Reduced application development rs time. ee in Data integrity ng security. and Eadministration. Uniform data O o Concurrent access, recovery from aD a F crashes.
Slide No:L1-3
Shift from computation to information at the low end: scramble to webspace (a mess!) at the high end: scientific applications Datasets increasing in diversity and volume. Digital libraries, interactive video, Human Genome project, EOS project ... need for DBMS exploding DBMS encompasses most of CS OS, languages, theory, AI, multimedia, logic
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-4
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-5
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-6
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-7
Levels of Abstraction
Physical level: describes how a record (e.g., customer) is stored. Logical level: describes data stored in database, and the relationships among the data. type customer = record customer_id : string; customer_name : string; customer_street : string; customer_city : string; end; View level: application programs hide details of data types. Views can also hide information (such as an employees salary) for security purposes.
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-8
Summary
DBMS used to maintain, query large datasets. Benefits include recovery from system crashes, concurrent access, quick application development, data integrity and security. Levels of abstraction give data independence. A DBMS typically has a layered architecture. DBAs hold responsible jobs and are well-paid! DBMS R&D is one of the broadest, most exciting areas in CS.
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L1-9
View of Data
An architecture for a database system
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L2-1
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L2-2
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L2-3
Data Models
A collection of tools for describing Data Data relationships Data semantics Data constraints Relational model Entity-Relationship data model (mainly for database design) Object-based data models (Object-oriented and Object-relational) Semi structured data model (XML) Other older models: Network model Hierarchical model
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L2-4
Data Models
A data model is a collection of concepts for describing data. A schema is a description of a particular collection of data, using the a given data model. The relational model of data is the most widely used model today.
Main concept: relation, basically a table with rows and columns. Every relation has a schema, which describes the columns, or fields.
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L2-5
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L2-6
Data Independence
Applications insulated from how data is structured and stored. m co Logical data independence: .Protection rs from changes in logical e estructure of in data. g n E Physical data independence: O Protection o D from changes in physical aa of data. structure F
Slide No:L2-7
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L3-1
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L3-2
Relational Model
aa F
o D
E O
g n
e in
r e
co . s
Slide No:L3-3
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L3-4
SQL
SQL: widely used non-procedural language Example: Find the name of the customer with customer-id 192-83-7465 select customer.customer_name from customer where customer.customer_id = 192-83-7465 Example: Find the balances of all accounts held by the customer with customer-id 192-83-7465 select account.balance from depositor, account where depositor.customer_id = 192-83-7465 and depositor.account_number = account.account_number
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L3-5
SQL
Application programs generally access databases through one of Language extensions to allow embedded SQL Application program interface (e.g., ODBC/JDBC) which allow SQL queries to be sent to a database
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L3-6
Database Users
Users are differentiated by the way they expect to interact with the system Application programmers interact with system through DML calls Sophisticated users form requests in a database query language Specialized users write specialized database applications that do not fit into the traditional data processing framework Nave users invoke one of the permanent application programs that have been written previously Examples, people accessing database over the web, bank tellers, clerical staff
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L4-1
Database Administrator
Coordinates all the activities of the database system has a good understanding of the enterprises information resources and needs. Database administrator's duties include: Storage structure and access method definition Schema and physical organization modification Granting users authority to access the database Backing up data Monitoring performance and responding to changes Database tuning
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L4-2
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L5-1
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 storage manager is responsible to the following tasks: Interaction with the file manager Efficient storing, retrieving and updating of data Issues: Storage access File organization Indexing and hashing
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L5-2
Query Processing
1.Parsing and translation
2. Optimization 3. Evaluation
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L5-3
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L5-4
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.
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L5-5
Database Architecture
The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running: Centralized Client-server Parallel (multiple processors and disks) Distributed
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L6-1
aa F
o D
E O
g n
ee in
.c rs
m o
Slide No:L6-2
aa F
Old
o D
E O
g n
ee in
.c rs
m o
(web browser)
Modern
Slide No:L6-3