Week 1 Lecture Material
Week 1 Lecture Material
Systems
Module 01: Course Overview
of database management
Module systems in modern day
Objectives applications
▪ To Know Your Course
PPD
▪ Course Prerequisite
©Silberschatz, Korth and Sudarshan 01.4 Database System Concepts - 6th Edition
WHY DATABASES?
PPD
▪Why Databases?
▪KYC: Know Your Course
©Silberschatz, Korth and Sudarshan 01.5 Database System Concepts - 6th Edition
▪ Banking: transactions
©Silberschatz, Korth and Sudarshan 01.7 Database System Concepts - 6th Edition
▪ Data isolation
▪ 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
©Silberschatz, Korth and Sudarshan 01.8 Database System Concepts - 6th Edition
▪ 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
▪ Example:
Two people reading a balance (say 100) and updating it by
withdrawing money (say 50 each) at the same time
▪ Security problems
▪Why Databases?
▪KYC: Know Your Course
©Silberschatz, Korth and Sudarshan 01.10 Database System Concepts - 6th Edition
– Set-builder Notation
©Silberschatz, Korth and Sudarshan 01.11 Database System Concepts - 6th Edition
Course Prerequisites
> Definition of Functions
▪ Essential
Total
©Silberschatz, Korth and Sudarshan 01.12 Database System Concepts - 6th Edition
PPD
Course ▪ Essential
Prerequisites ▪ Propositional Logic
Quantification
> Predicates > – Existential, Universal
©Silberschatz, Korth and Sudarshan 01.13 Database System Concepts - 6th Edition
Course > B-Tree
– Balanced Tree
©Silberschatz, Korth and Sudarshan 01.14 Database System Concepts - 6th Edition
Programming in C:
©Silberschatz, Korth and Sudarshan 01.15 Database System Concepts - 6th Edition
PPD
Course ▪ Desirable
Prerequisites ▪ Object-Oriented Analysis
and Design
_course.php?id=noc17-cs25
▪ MOOCs: Object-Oriented
Analysis and Design: ▪ Programming in C++ / Java
https://nptel.ac.in/noc/individual
▪ MOOCs: Programming in C++:
https://nptel.ac.in/noc/individual_course.php?id=noc17- cs24
©Silberschatz, Korth and Sudarshan 01.16 Database System Concepts - 6th Edition
:
Week Topics Week 1 C
ourse
Course Outline Overview
PPD
Course
Textbook
PPD
7th Edition will also do
Website: http://db-book.com/
©Silberschatz, Korth and Sudarshan 01.18 Database System Concepts - 6th Edition
[email protected],
Course TAs 9438911655
▪ Gurunath Reddy M,
▪ Srijoni Majumdar, [email protected],
[email protected], 9434137638
PPD
9674474267
▪ Himadri B G S Bhuyan,
©Silberschatz, Korth and Sudarshan 01.19 Database System Concepts - 6th Edition
Database Management
Systems
Module 02: Introduction to DBMS/1
Slides marked with ‘PPD’ are new or edited
Partha Pratim Das Department of Computer Science and Engineering Indian
Institute of Technology, Kharagpur
▪ Course Prerequisite
©Silberschatz, Korth and Sudarshan 02.3 Database System Concepts - 6th Edition
▪ SQL
▪ Levels of Abstraction
▪ Database Design
▪ Schema & Instance
PPD
▪ Data Models
©Silberschatz, Korth and Sudarshan 02.5 Database System Concepts - 6th Edition
LEVELS OF
ABSTRACTION ▪Levels of Abstraction
Levels of Abstraction
©Silberschatz, Korth and Sudarshan 02.7 Database System Concepts - 6th Edition
View of Data
An architecture for a database system
©Silberschatz, Korth and Sudarshan 02.8 Database System Concepts - 6th Edition
©Silberschatz, Korth and Sudarshan 02.9 Database System Concepts - 6th Edition
in programming languages
Schemas and
▪ Schema
Instances ▪ Logical Schema – the overall
logical structure of the database
▪ Similar to types and variables ▪ Analogous to type information
of a variable in a program
Account # Account Type
▪ Example: The database
Interest Rate Min. Bal.
consists of information about a
Balance
set of customers and accounts
in a bank and the relationship
▪ Physical Schema– the overall
between them
physical structure of the
▪ Customer Schema database
PPD
Name Customer ID Account #
Aadhaar ID Mobile #
▪ Account Schema
©Silberschatz, Korth and Sudarshan 02.10 Database System Concepts - 6th Edition
time
Schemas and
▪ Analogous to the value of a
Instances variable
▪ Customer Instance
▪ Instance Name Customer ID Account #
▪ The
actual content of the Aadhaar ID Mobile # Pavan
database at a particular point in Laha 6728 917322
182719289372 9830100291
Lata Kala 8912 827183 Account # Account Type
918291204829 7189203928 Interest Rate Min. Bal.
Nand Prabhu 6617 372912 Balance 917322 Savings 4.0%
127837291021 8892021892 5000 7812 372912 Current
0.0% 0 291820 827183 Term
Deposit 6.75% 10000 100000
▪ Account Instance PPD
©Silberschatz, Korth and Sudarshan 02.11 Database System Concepts - 6th Edition
DATA MODELS
▪Levels of Abstraction
▪Schema & Instance
▪Data Models
▪DDL & DML
▪SQL
▪Database Design
PPD
©Silberschatz, Korth and Sudarshan 02.13 Database System Concepts - 6th Edition
Data Models
▪ Data relationships
▪ Data semantics
▪ Data constraints
Relational Model
©Silberschatz, Korth and Sudarshan 02.15 Database System Concepts - 6th Edition
▪ Database schema
▪ Integrity constraints
> Primary key (ID uniquely identifies instructors)
▪ Authorization
©Silberschatz, Korth and Sudarshan 02.18 Database System Concepts - 6th Edition
Data Manipulation Language (DML)
▪ Pure used for proving properties about computational power and for
–
optimization
> Relational Algebra (we focus in this course)
SQL
▪Levels of Abstraction
▪Schema & Instance
▪Data Models
▪DDL & DML
▪SQL
▪Database Design
PPD
©Silberschatz, Korth and Sudarshan 02.20 Database System Concepts - 6th Edition
SQL
▪ Application
program interface (e.g., ODBC/JDBC) which allow SQL
queries to be sent to a database
©Silberschatz, Korth and Sudarshan 02.21 Database System Concepts - 6th Edition
DATABASE DESIGN
▪Levels of Abstraction
▪Schema & Instance
▪Data Models
▪DDL & DML
▪SQL
▪Database Design
PPD
©Silberschatz, Korth and Sudarshan 02.22 Database System Concepts - 6th Edition
Database Design
Database Management
Systems
Module 03: Introduction to DBMS/2
Slides marked with ‘PPD’ are new or edited
Partha Pratim Das Department of Computer Science and Engineering Indian
Institute of Technology, Kharagpur
▪ SQL
▪ Levels of Abstraction
▪ Database Design
▪ Schema & Instance
PPD
▪ Data Models
©Silberschatz, Korth and Sudarshan 03.3 Database System Concepts - 6th Edition
components of a database
Module engine
Objectives ▪ To familiarize with database
internals and architecture
▪ To understand the historical
▪ To understand models of
perspective
database management systems PPD
▪ Query Processing
▪ Transaction Management
▪ Database Design
▪ Database Users and
▪ OO Relational Model
Administrators
▪ XML
▪ Database Internals &
▪ Database Engine Architecture
PPD
▪ History of DBMS
©Silberschatz, Korth and Sudarshan 03.5 Database System Concepts - 6th Edition
DATABASE DESIGN
PPD
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.6 Database System Concepts - 6th Edition
Database Design
▪ Physical Design
relation?
Database Design PPD
(Cont.)
Design Approaches
OBJECT-RELATIONAL DATA
MODELS PPD
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.10 Database System Concepts - 6th Edition
▪ 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, including non-
atomic values such as nested relations
▪ Preserverelational foundations, in particular the declarative access to
data, while extending modeling power
▪ Provide upward compatibility with existing relational languages
©Silberschatz, Korth and Sudarshan 03.11 Database System Concepts - 6th Edition
PPD
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.13 Database System Concepts - 6th Edition
DATABASE ENGINE
PPD
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.14 Database System Concepts - 6th Edition
Database Engine ▪ Query processing
▪ Transaction manager
PPD
▪ Storage manager
©Silberschatz, Korth and Sudarshan 03.15 Database System Concepts - 6th Edition
Storage Management
▪ Issues:
▪ Storage access
▪ File organization
▪ Indexing and hashing
©Silberschatz, Korth and Sudarshan 03.16 Database System Concepts - 6th Edition
Query Processing
▪ Equivalent expressions
▪ Depends
critically on statistical information about relations which the
database must maintain
▪ Need
to estimate statistics for intermediate results to compute cost of
complex expressions
©Silberschatz, Korth and Sudarshan 03.18 Database System Concepts - 6th Edition
Transaction Management
▪ What if the system fails?
▪ What if more than one user is concurrently updating the same data?
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.20 Database System Concepts - 6th Edition
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.22 Database System Concepts - 6th Edition
Database Architecture
▪ Centralized
▪ Client-server
▪ Parallel (multi-processor)
▪ Distributed
©Silberschatz, Korth and Sudarshan 03.24 Database System Concepts - 6th Edition
HISTORY OF DBMS
PPD
▪Database Design
▪OO Relational Model
▪XML
▪Database Engine
▪Database Users and Administrators
▪Database Internals & Architecture
▪History of DBMS
©Silberschatz, Korth and Sudarshan 03.25 Database System Concepts - 6th Edition
History (cont.)
▪ 1980s:
management systems
©Silberschatz, Korth and Sudarshan 03.28 Database System Concepts - 6th Edition
9830030880
Instructor and
Srijoni Majumdar, TA
TAs [email protected]
9674474267
Himadri B G S Bhuyan, TA
Name Mail Mobile [email protected]
9438911655
Partha Pratim Das, Instructor
[email protected] Gurunath Reddy M
[email protected] kind permission of the
9434137638 authors.
Database Management
Systems
▪ Query Processing
▪ Transaction Management
▪ Database Design
▪ Database Users and
▪ OO Relational Model
Administrators
▪ XML
▪ Database Internals &
▪ Database Engine Architecture
PPD
▪ History of DBMS
©Silberschatz, Korth and Sudarshan 04.3 Database System Concepts - 6th Edition
©Silberschatz, Korth and Sudarshan 04.4 Database System Concepts - 6th Edition
▪ Attribute Types
Example of a Relation
ATTRIBUTES
PPD
▪Attribute Types
▪Relation Schema and Instance
▪Keys
▪Relational Query Languages
©Silberschatz, Korth and Sudarshan 04.7 Database System Concepts - 6th Edition
Alpha String
Attribute Types
▪ DoB: Date
▪ The set of allowed values for ▪ Passport#: String (Letter
each attribute is called the followed by 7 digits) – nullable
domain of the attribute
▪ Aadhaar #: 12-digit number
▪ Roll #: Alphanumeric string
▪ Department: Alpha String
▪ First Name, Last Name:
▪ Attribute values are (normally)
required to be atomic; that is, Name
indivisible Last Name
DoB Passport # Aadhaar #
▪ The special value null i s a Department
member of every domain. DoB Passport # Aadhaar #
Indicated that the value is Department
“unknown”
▪ The null value causes
complications in the definition of
many operations
PPD
Roll # First