Database Management System
Database Management System
System
Lecture 1
1
Chapter 1: Introduction
• Purpose of Database Systems
• View of Data
• Data Models
• Data Definition Language
• Data Manipulation Language
• Transaction Management
• Storage Management
• Database Administrator
• Database Users
• Overall System Structure
2
Database Management System (DBMS)
3
Purpose of Database System
• In the early days, database applications were built 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 part of program code
• Hard to add new constraints or change existing ones
4
Purpose of Database Systems (Cont.)
5
Levels of Abstraction
6
View of Data
An architecture for a database system
7
Instances and Schemas
• Similar to types and variables in programming languages
• Schema – the logical structure of the database
• e.g., 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
• 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.
8
9
Data Models
• A collection of tools for describing
• data
• data relationships
• data semantics
• data constraints
• Entity-Relationship model
• Relational model
• Other models:
• object-oriented model
• semi-structured data models
• Older models: network model and hierarchical model
10
Entity-Relationship Model
11
Entity Relationship Model (Cont.)
12
Relational Model Attributes
• Example of tabular data in the relational model
13
A Sample Relational Database
14
Definition?
Manipulation ?
15
Data Definition Language (DDL)
16
Data Manipulation Language (DML)
17
SQL
• SQL: widely used non-procedural language
• E.g. 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’
• E.g. 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
• 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
18
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
• Naïve users – invoke one of the permanent application programs
that have been written previously
• E.g. people accessing database over the web, bank tellers, clerical staff
19
Database Administrator
• Coordinates all the activities of the database system; the
database administrator has a good understanding of the
enterprise’s information resources and needs.
• Database administrator's duties include:
• Schema definition
• Storage structure and access method definition
• Schema and physical organization modification
• Granting user authority to access the database
• Specifying integrity constraints
• Acting as liaison with users
• Monitoring performance and responding to changes in
requirements
20
Transaction Management
21
Storage Management
22
Overall System Structure
23
Application Architectures
24