Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CSC 220
Calender
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 11 / 50
Introduction Database Management System
The Web is leaving the era of search and entering one of discovery.
What’s the difference?
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 18 / 50
Introduction Drawbacks of using file systems to store data
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 access needed for performance
Uncontrolled concurrent accesses can lead to inconsistencies
Example: Two people reading a balance (say 100) and updating it by
withdrawing money (say 50 each) at the same time
Security problems
Hard to provide user access to some, but not all, data
Database as solution
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 22 / 50
Introduction Levels of Abstraction
Three Levels
Physical level:
describes how a record (e.g., instructor) is stored.
Logical level:
describes data stored in database, and the relationships among the
data.
View level:
application programs hide details of data types. Views can also hide
information (such as an employee’s salary) for security purposes.
View of Data
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 25 / 50
Introduction Instances and Schemas
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 27 / 50
Data Models Data Model
Data Model
Data Model(cont,)
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 30 / 50
Database System Languages Data Manipulation Language (DML)
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 34 / 50
Database System Languages Data Definition Language (DDL)
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Figure 4: Example
For example, suppose the university requires that the account balance
of a department must never be negative.
How it will be ensured ?
Relational Database
Relational Database
Outline
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Dr. Ghulam Mustafa (BULC) Week1 February 13, 2019 40 / 50
Relational Database Relational Model
Relational Model
Figure 5: Example of RM
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
SQL
Figure 7: Example1
Figure 8: Example2
Relational Model
Figure 9: Example of RM
Database Design
ERM
1 Introduction
Database Management System
Drawbacks of using file systems to store data
Levels of Abstraction
Instances and Schemas
2 Data Models
Data Model
3 Database System Languages
Data Manipulation Language (DML)
Data Definition Language (DDL)
4 Relational Database
Relational Model
5 SQL
6 Summary
Summary