COM1302-Database Management Systems
By
Nadeeshani Aththanagoda
Outline Syllabus
• Basic concepts
• Relational integrity rules
• Relational algebra
• Database design
• Relational systems
• Physical Database implementation-(Mysql Practical)
Assessment & Weighting
• In class assignments 20%
• Mysql Practical Assignment 20%
• Group Project-20%
• End of semester examination Structured examination paper 40%
3
Lecture 01
Sub Topics
• Data , Information & Processing
• Types of Databases
• Problems of File base data processing
• History of Database Systems
• Database models
• Common Uses of Databases
• Components of DBMS Environment
Data , Information &
Processing
Data ,information & processing
Processing
Today:- 2013/05/06
DOB :-1990/05/06
23-0-0
Data
processed AGE:23
DOB:-1990/05/06 c
Data Information
Raw material processing Final product
Data ,information & processing
User Query
DBMS
(processing)
Store the data Retrieve the Information distribution
Data Collection
with well data by user
organized form query
Database
8
Data vs. Information
Information
Data
• Final result
raw facts
• with context
no context
• Useable
Useless
• processed
Before processed data
• value-added
No value-added to data
• Summarized, organized, Analyzed
• just numbers and text etc .. without meaning
• just numbers and text etc .. with meaning
What is Data?
Data is a stream of raw facts representing
things or events that have happened.
In ICT, we usually say that data is made up
from four basic types:
• Numbers
• Text
• Images
• Sound
Storing Data?
Inside the computer, however, all data is
stored as numbers(binary):
• Numbers…
• Text…
• Images…
• Sounds…
What is Information?
• Information is data that has been processed to
make it meaningful and useful
Data + Meaning = Information
Why DBMS?
• Suppose we need to develop a Information system.
• How do we
-store the data? (use file structures…)
-query the data? (write programs…)
-Update data safely? (write more programs…)
-provide different views on the same data?
(staff & students different)
-deal with crashes?
• DBMS helps to above activities.
13
Types of Databases
• Manual file Processing (paper based)
• Time Consuming
• Does not support large volumes of data
• File based Processing
• Database Management system
14
File Based Processing ID
Name
001
mery
Address colombo
TelNo 747374
Data File Marks
Entry Processing 34
Student System Files
ID 001
Name mery
Address colombo
TelNo 747374
Data File Books-bor 6
Entry Processing
Library System Files
Data Duplication 15
File Based Processing ID
Name
001
mery
Change request Address colombo
TelNo 747374
Data File Marks
Entry Processing 34
Student System Files
ID 001
Name mery
Address colombo
TelNo 747374
Data File Books-bor 6
Entry Processing
Library System Files
16
File Based Processing ID
Name
001
mery
Address Change request Address Kandy
TelNo 747374
Data File Marks
Entry Processing
34
Student System Files
ID 001
Name mery
Address colombo
TelNo 747374
Data File Books-bor 6
Entry Processing
Library System Files
Inconsistent Data 17
Problem in file based system
• Inconsistent data
• Data duplication
• Security
• Inflexibility
• Limited data sharing
• Excessive program maintenance
• How do we resolve these problems?
18
Solution is DBMS
• DBMS is solution to rectify file based processing problems
19
Database Processing
Change Request
stno Name address
001 mery colombo
…………….
Data Entry &
Reports
Application
Students Programs
DBMS
Data Entry & Database
Reports
Library App. Programs
Database Processing
Change Request
stno Name address
001 mery Kandy
…………….
Data Entry &
Reports
Application
Students Programs
DBMS
Data Entry & Database
Reports
Library App. Programs
DATABASE
DEFINITION
• A shared collection of logically related data designed to meet the
information requirements of an organisation.
22
Database Management System (DBMS)
• A software system that enables users to define, create and maintain
the database and which provides controlled access to the database.
23
History of Database Systems
• 1950s and early 1960s:
• Data processing using magnetic tapes for storage
• Tapes provide only sequential access
• Punched cards for input
• Late 1960s and 1970s:
• Hard disks allow direct access to data
• Network and hierarchical data models in widespread use
• Ted Codd defines the relational data model
• Would win the ACM Turing Award for this work
• IBM Research begins System R prototype
• UC Berkeley begins Ingres prototype
• High-performance (for the era) transaction processing
24
History (cont.)
• 1980s:
• Research relational prototypes evolve into commercial systems
• SQL becomes industry standard
• Parallel and distributed database systems
• Object-oriented database systems
• 1990s:
• Large decision support and data-mining applications
• Large multi-terabyte data warehouses
• Emergence of Web commerce
• 2000s:
• XML and XQuery standards
• Automated database administration
• Increasing use of highly parallel database systems
• Web-scale distributed data storage systems
25
Database models
Early Types of DBMS
• Hierarchical
• Network
Current Generation
• Relational
Advanced Systems
- Object Based
26
What is a Database System?
Database System = Database + DBMS
• A Database is
• A large, integrated collection of data
• Models (represents) a real-world enterprise.
Entities (e.g., students, courses)
Relationships (e.g., Mary takes CS123)
• A Database Management System (DBMS) is
• A software package designed to store and
• Manages databases easily and efficiently.
27
Common Uses of Databases
• Try to think why each of these need to use a database:
• Supermarkets
• Insurance
• Credit Cards/Banking
• Libraries
• Travel Agents
• Universities
28
Components of DBMS Environment
Components of DBMS Environment
• Hardware
Can range from a PC to a network of computers.
• Software
DBMS, operating system, network software (if necessary)
and also the application programs.
• Data
Used by the organization and a description of this data
called the schema.
Components of DBMS Environment
• Procedures
Instructions and rules that should be applied to the
design and use of the database and DBMS.
• People
Data Administrator (DA), Database Administrator (DBA),
Database Designers (Logical and Physical), Application
Programmers, End Users (naive and sophisticated)
Examples: DBMS
• Oracle
• MySQL
• Microsoft SQL Server
• PostgreSQL
• MongoDB
• Redis
• IBM DB2
• Elasticsearch
• SQLite
• Microsoft Access
• Common features:
• Relational model
• SQL as query language
• Server-client architecture
32
Advantages of using a DBMS
Minimal data redundancy
Efficient data access
Data integrity and security
Data administration
Concurrent access, recovery from crashes
Reduced application development time
33
Disadvantages
Complexity
Additional Hardware costs
Experts – Specialised personnel
Higher impact of failure
• Simple applications may not need DBMS at all
34
When not to use a DBMS
• High initial investment in hardware, software, and training.
• Generality that a DBMS provides for defining and processing data.
• Overhead for providing security, concurrency control, recovery, and
integrity functions.
Main Characteristics of the Database
Approach
• Self-describing nature of a database system
• Insulation between programs and data
• Data Abstraction
• Support of multiple views of the data
36
Main Characteristics of the Database
Approach
• Self-describing nature of a database system:
• A DBMS catalog stores the description of the database.
• called meta-data).
• allows the DBMS software to work with different databases.
Database
Raw data Meta data
Systems Catalog 37
Main Characteristics of the Database Approach
• Insulation between programs and data: Called program-data
independence.
• Allows changing data storage structures and operations without
having to change the DBMS access programs.
38
Data independence
Application programs are independent of data
representation and storage details.
The structure of data files is stored in the DBMS catalog
separately from the access programs.
E.g. a file access program may be written in such a
way that it can access only STUDENT records of the
structure.
First Year SLIIT-2006 39
39
Main Characteristics of the Database
Approach
• Data Abstraction: A data model is used to hide
storage details and present the users with a
conceptual view of the database.
40
Main Characteristics of the Database Approach
• Support of multiple views of the data: Each user may see a
different view of the database, which describes only the data of
interest to that user.
stno name gpa program regDate payment
100 Mira 3.8 BSc. IT 2005 - JAN Full
200 Janet 2.5 BSc IS 2004- JAN Half
300 Ravi 2.7 M.Sc IT 2006- JAN Full
stno name gpa stno regDate pay
100 Mira 3.8 100 2005 - JAN Full
200 Janet 2.5 200 2004- JAN Half
300 Ravi 2.7 300 2006- JAN Full
Lecturer view
Administrative staff view
Questions?
42