Professional Documents
Culture Documents
Database System
Week 1
Courtesy:
Welcome!
About me
PIMSAT, Karachi
BS Information Technology ‘06
SZABIST, Karachi
MS Computer Science ‘12
Research Interests
Software-Defined Networking (SDN), Network Function Virtualization (NFV),
Cloud Computing, Virtualization
Network Security, Blockchain Technology, HPC/HTC
Industry Experiences
Korea Institute of Science and Technology Information (KISTI), S. Korea
Fermi National Accelerator Lab (FNAL), USA
NESCOM HQ, Islamabad,
National Telecommunication Corporation (NTC) HQ, Islamabad
NADRA RHQ, Pakistan
Overview
This course provides students with the essential concepts, principles, and
techniques of modern database systems from a user perspective.
The course teaches students the ability to develop a solution for a real-
world data management problem that requires the application of the
theories and practices developed in class.
Reference Books
Thomas Connolly, Carolyn Begg, Database Systems: A practical
approach to design, implementation and Management, 6th Edition,
2015.
C.J. Date, An Introduction to Database Systems, 8th Edition, 2004
Grading/Assignments/Project
Grade breakdown
Term exams (1 & 2) 30%
Assignments/Quiz 10%
Project 10%
Final exam 45%
Class participation 5%
All assignments will be in latex format
Final Project & Term paper
2~3 members per group
Plagiarism will be marked as Zero.
Passing Marks = 50
Class Attendance should be >= 80.
No Student will be allowed after 10 Mins starting of the
class.
Contact and Course Logistics
Instructor: Dr. Syed Asif Raza
Email: asif.raza@nu.edu.pk
Contact Hours:
2:00-3:30pm
Monday & Tue.
Office hours
Office: Compute Science building, Basement 2, room #9
Course Website
https://slate.nu.edu.pk
Check often for announcements
Assignments/Projects
Discussion/Help
Databases Applications: Examples
Supermarkets?
Credit cards?
Travel agents?
Library?
Insurance?
University?
Etc.
Manual filing systems
Works well
Client
clientNo, fName, Iname, telNo, prefType, maxRent
PrivateOwner
ownerNo, fName, Iname, address, telNo
Lease Department
Lease
leaseNo, propertyNo, clientNo, rent, paymentMethod, deposit,
paid, rentStart, rentFinish, duration
PropertyForRent
propertyNo, street, city, postcode, type, rooms, rent
Client
clientNo, fName, Iname, telNo, prefType, telNo
Limitations of file-based systems
Seperation and isolation of data
Each program maintain its own data
Waste of space
Data dependence
File structure is defined in program code
Result!
Database Management System (DBMS)
What Is a Database System?
Basic Definitions
Database:
A collection of related data.
Data:
Known facts that can be recorded and have an implicit meaning.
Mini-world:
Some part of the real world about which data is stored in a
database. For example, student grades and transcripts at a
university.
Database Management System (DBMS):
A software package/ system to facilitate the creation and
maintenance of a computerized database.
Database System:
The DBMS software together with the data itself. Sometimes, the
applications are also included.
Database: What
Database
is collection of related data and its metadata organized in a structured
format
for optimized information management
Database System
is an integrated system of hardware, software, people, procedures, and data
that define and regulate the collection, storage, management, and use of
data within a database environment
Database: Why
Purpose of Database
Optimizes data management
Transforms data into information
Importance of Database Design
Defines the database’s expected use
different approach needed for different types of databases
Avoid data redundancy & ensure data integrity
data is accurate and verifiable
Poorly designed database generates errors
leads to bad decisions
can lead to failure of organization
Implementation
Create the database
Maintenance
Troubleshoot, update, streamline the database
Business Rules
What
Brief, precise, and unambiguous descriptions of operations in an
organization
based on policies, procedures, or principles within a specific organization
help to create and enforce actions within that organization’s environment
apply to any organization that stores and uses data to generate information
Why
Enhance understanding & facilitate communication
Standardize company’s view of data
Constitute a communications tool between users and designers
Allow designer to understand business process as well as the nature, role, and
scope of data
Promote creation of an accurate data model
How (sources)
Interviews
Company managers
Policy makers
Department managers
End users
Written documentation
Procedures, Standards, Operations manuals
Observation
Business operations
Database: User-centered
Perspective
The user is always right. If there is a problem with the use of the system,
the system is the problem, not the user.
Compliance
The user has the right to a system that performs exactly as promised.
Instruction
The user has the right to easy-to-use instructions (user guides, online or
contextual help, error messages) for understanding and utilizing a system to
achieve desired goals and recover efficiently and gracefully from problem
situations.
Usability
The user should be the master of software and hardware technology, not
vice-versa. Products should be natural and intuitive to use.
Database: Data Models
Importance
Abstraction of complex real-word data structures in relative simple
(graphical) representations
Facilitate interaction among the designer, the applications
programmer, and the end user
Timeline
File-based
Hierarchical
Object-
Network
oriented
Relational Web-based
Entity-Relationship
Simplified database system environment
Database Management System
- manages interaction between end users and database
Hardware
Software
- OS
- DBMS
- Applications
People
Procedures
Data
Conceptual schema
defines logical structure View 1 View 2 View 3
Conceptual Schema
Physical schema describes
Physical Schema
the files and indexes used.
carefully”.
Transactions: ACID Properties
Key concept is a transaction: a sequence of database actions
(reads/writes).
Note: can specify simple integrity constraints on the data. The DBMS
enforces these.
Beyond this, the DBMS does not understand the semantics of the
data.
Ensuring that a single transaction (run alone) preserves
consistency is largely the user’s responsibility!
Ensuring Transaction Properites
DBMS ensures atomicity (all-or-nothing property) even if
system crashes in the middle of a Xact.
DBMS ensures durability of committed Xacts even if system
crashes.
Idea: Keep a log (history) of all actions carried out by the
DBMS while executing a set of Xacts:
Before a change is made to the database, the corresponding
log entry is forced to a safe location.
After a crash, the effects of partially executed transactions are
undone using the log. Effects of committed transactions are
redone using the log.
trickier than it sounds!
The Log
DB
Advantages of a DBMS
Data independence
Efficient data access
Data integrity & security
Data administration
Concurrent access, crash recovery
Reduced application development time
So why not use them always?
Expensive/complicated to set up & maintain
DB application programmers
Build enterprise applications on top of DBMSs