CS207: Database and Information Systems
CS207: Database and Information Systems
CS207: Database and Information Systems
Systems
By :
Dr. Aruna Tiwari
Associate Professor
Department of Computer Science &
Engineering
1
Course Objectives
• Database Design
• Transaction Processing
• Query Optimization
2
Books
• “Database system concepts”, Henry F Korth, Abraham Silberschatz, fourth
ed., McGraw-Hill International editions,
• "Fundamentals of Database Systems", Elmasri, Navathe,
Third ed, Addison Wesley
• "An introduction to Database Systems", C.J.Date, Sixth ed., Narosa
Publications
3
Data processing
• Data Collection
• Recording
• Sorting
• Classifying
• Calculating
• Retrieving
• Summarizing
• Communicating
4
Traditional Method of Data Storage
ER/CORP/CRS/DB07/003
Copyright © 2004, 10
Infosys Technologies Ltd Version No: 2.0
5
Ways of storing data in files – customer data
ER/CORP/CRS/DB07/003
Copyright © 2004, 11
Infosys Technologies Ltd Version No: 2.0
6
Why DBMS ?
Or Need of DBMS
or Comparison with Conventional Data Processing Methods
• Lack of Data Definition
• Data Redundancy
• Data Security
• Atomicity Problems
• Data Integrity
• Adhoc Queries
7
Terminologies
• Data redundancy
• Data consistency/
Consistency Constraints /
Integrity Constraints
• Instances
• Schema
• Subschema
8
Database
• Computer based record-keeping system
• Organized collection of interrelated (persistent) data
• Records & maintains data
9
Where does the DBMS fit in?
Position of DBMS
ER/CORP/CRS/DB07/003
Copyright © 2004, 14
Infosys Technologies Ltd Version No: 2.0
10
Difference Between File and DBMS Operations
ER/CORP/CRS/DB07/003
Copyright © 2004, 15
Infosys Technologies Ltd Version No: 2.0
11
Types of Databases
ER/CORP/CRS/DB07/003
Copyright © 2004, 16
Infosys Technologies Ltd Version No: 2.0
12
TYPES OF DATABASES
Centralized Distributed
• All data is located at a single site • The database is stored on several
• Allows for greater control over accessing computers - from personal computers up to
and updating data mainframe systems
• Vulnerable to failure as they depend on the • Computers in a distributed system
availability of resources at the central site communicate with one another through
Example: The account information of various communication media, such as high
customers is stored in a particular branch speed networks or telephone lines
office of a bank. This information must be • Distributed databases are geographically
shared across all Automated Teller Machines separated and managed
(ATM), so that customers can withdraw • Distributed databases are separately
money from their accounts. Instead of storing administered
the customer information in every ATM • Distributed databases have a slower
machine it can be stored at a common place interconnection
(the branch office of the bank) and shared Example: Consider the bank system. The
over a network. bank’s head office is located at Chicago and
the branch offices are at Melbourne and
Tokyo. The bank database is distributed
across the branch offices. The branch offices
are connected through a network
ER/CORP/CRS/DB07/003
Copyright © 2004, 17
Infosys Technologies Ltd Version No: 2.0
13
Data Abstraction
ER/CORP/CRS/DB07/003
Copyright © 2004, 18
Infosys Technologies Ltd Version No: 2.0
14
•Instances
•Schema:
Overall design of the database.
•Subschema
15
Data Independence
• Physical Data Independence
16
Data Models
ER/CORP/CRS/DB07/003
Copyright © 2004, 23
Infosys Technologies Ltd Version No: 2.0
17
Types of data models
• Object based logical model
– Entity relationship model
– Object Oriented Data Model
• Record based logical model
– Hierarchical data model
– Network data model
– Relational data model
ER/CORP/CRS/DB07/003
Copyright © 2004, 24
Infosys Technologies Ltd Version No: 2.0
18
New Data models
•Object oriented
•Object relational
•semistructured
19
Database Languages
• DDL (Data Definition Language)
20
Data Dictionary
• File Containing metadata (data about data)
21
Detailed System Architecture
ER/CORP/CRS/DB07/003
Copyright © 2004, 19
Infosys Technologies Ltd Version No: 2.0
22
An example of the three levels
Customer_Loan
Cust_ID : 101
Loan_No : 1011 External
Amount_in_Dollars : 8755.00
CREATE TABLE Customer_Loan (
Cust_ID NUMBER(4)
Loan_No NUMBER(4) Conceptual
Amount_in_Dollars NUMBER(7,2))
Cust_ID TYPE = BYTE (4), OFFSET = 0
Loan_No TYPE = BYTE (4), OFFSET = 4 Internal
Amount_in_Dollars TYPE = BYTE (7), OFFSET = 8
ER/CORP/CRS/DB07/003
Copyright © 2004, 20
Infosys Technologies Ltd Version No: 2.0
23
Users of a DBMS
• Sophisticated users
• Application programmers
ER/CORP/CRS/DB07/003
Copyright © 2004, 21
Infosys Technologies Ltd Version No: 2.0
24
System Structure
Query processor
Storage manager
25
Advantages of a DBMS
• Data independence
• Better security
• Better flexibility
ER/CORP/CRS/DB07/003
Copyright © 2004, 22
Infosys Technologies Ltd Version No: 2.0
26
Two Tier Architecture
client
User
Application
network
Server
Database system
27
Three Tier Architecture
User
client
Application
network
Application Server
Server
Database system
28
Record based data model – Hierarchical data model
ER/CORP/CRS/DB07/003
Copyright © 2004, 25
Infosys Technologies Ltd Version No: 2.0
29
Record based data model – Network data model
ER/CORP/CRS/DB07/003
Copyright © 2004, 26
Infosys Technologies Ltd Version No: 2.0
30
Record based data model – Relational data model
ER/CORP/CRS/DB07/003
Copyright © 2004, 27
Infosys Technologies Ltd Version No: 2.0
31
Thanks
Any Queries ?
32