1. Subject Name Code Credit Hours
Database System COMP 219 3
DATABASE MANAGEMENT SYSTEM
2. Subject Name Code Credit Hours
Database System COMP 219 3
Introduction :
• Introduction to Database
• Database Systems Vs File Systems
• View of data
• Data Models
• Data base languages
• Transaction Management
• Database systems Structure
• History of Database Systems
• Database Systems Applications
• Entity Relationship Model
3. Subject Name Code Credit Hours
Database System COMP 219 3
INTRODUCTION
• Data is stored facts.
• Data may be numerical data which may be
integers or floating point numbers, and non-
numerical data such as characters, date and
etc.,
What is Data ?
4. Subject Name Code Credit Hours
Database System COMP 219 3
Example:
98
89
87
92
phy
chem
maths
biology
The above numbers may be anything:
It may be distance in kms or amount
in rupees or no of days or marks in
each subject etc.,
5. Subject Name Code Credit Hours
Database System COMP 219 3
What is information ?
Information is RELATED DATA. The data ( information) which is
used by an organisation – a college, a library, a bank, a
manufacturing company – is one of its most valuable resources.
98
89
87
92
phy
chem
maths
biology
6. Subject Name Code Credit Hours
Database System COMP 219 3What is Database ?
Database is a collection of information organized in such a way that a computer
program can quickly select desired pieces of data.
98
89
87
92
phy
chem
maths
biology
76
87
79
88
phy
chem
maths
biology
91
67
87
77
phy
chem
maths
biology
86
80
79
88
phy
chem
maths
biology
7. Subject Name Code Credit Hours
Database System COMP 219 3
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: all transactions
– Airlines: reservations, schedules
– Universities: registration, grades
– Sales: customers, products, purchases
– Online retailers: order tracking, customized recommendations
– Manufacturing: production, inventory, orders, supply chain
– Human resources: employee records, salaries, tax deductions
• Databases touch all aspects of our lives
A collection of programs that enables you to store, modify, and extract information
from a database.
8. Subject Name Code Credit Hours
Database System COMP 219 3
Database Systems Vs File 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
9. Subject Name Code Credit Hours
Database System COMP 219 3
Database Systems Vs File 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
10. Subject Name Code Credit Hours
Database System COMP 219 3
View of data
• 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 : integer;
end;
(PASCAL CODE)
• View level: application programs hide details of data types. Views can also
hide information (such as an employee’s salary) for security purposes.
Data Abstraction:
11. Subject Name Code Credit Hours
Database System COMP 219 3
View of data Contd.
An architecture for a database system:
12. Subject Name Code Credit Hours
Database System COMP 219 3
Instances and Schemas
• Similar to types and variables in programming languages
• Schema – the logical structure of the database
– Example: The database consists of information about a set of customers and accounts
and the relationship between them)
– Analogous to type information of a variable in a program
– Physical schema: database design at the physical level
– Logical schema: database design at the logical level
• 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.
13. Subject Name Code Credit Hours
Database System COMP 219 3
Instances and Schemas
• DB Schema Diagram for a Company:
Employee:
Eno Ename Salary Address
14. Subject Name Code Credit Hours
Database System COMP 219 3
Instances and Schemas
» DB Schema Diagram for a Company:
Department:
Dno Dname Dlocation
Project:
Pno Pname Hours
15. Subject Name Code Credit Hours
Database System COMP 219 3
Instances and Schemas
• Instance Example:
Eno Ename Salary Address
1
2
3
A
B
C
10,000
20,000
30,000
First street
Second street
Third street
16. Subject Name Code Credit Hours
Database System COMP 219 3
Data Independence
Three schema architecture for a database system:
View1 View2 View n
Conceptual Schema
Internal Schema
Disk
External schema
Conceptual
mapping
Internal/Physical
level
17. Subject Name Code Credit Hours
Database System COMP 219 3
Data Independence
• Two types of Data Independence
• Logical Data Independence
Capacity to change the conceptual schema without
having to change external schema
• Physical Data Independence
Capacity to change the Internal schema without having
to change external schema