Introduction To Databases (Week 1) : Remedios de Dios Bulos
Introduction To Databases (Week 1) : Remedios de Dios Bulos
(week 1)
Remedios de Dios Bulos
How
How were
were data
data records
records maintained
maintained
in
in the
the pre-computer
pre-computer period?
period?
Manual Filing System prepared by:RdDB
Projects
Projects Clients
Clients
Products
Products Employees
Employees
Equipment
Equipment Sales
Sales …
Collection
Collectionof
of
related
relateddata
data
At this stage, for purpose of discussion, we
define:
What
What does
doesan
an employee
employee
record
recordcontain?
contain?
Clients
Clients
Employee
Employeeid
id
}
Employees
Employees
Name
Name Structure
Structure
Sales
Sales
Address
Address
organization
organization
Position
Position
Manual Filing System prepared by:RdDB
Add
Addaarecord
record
Update
Updateaarecord
record
Projects
Projects Clients
Clients
Delete
Deleteaarecord
record
Products
Products Employees
Employees
Query
Queryaarecord
record
Equipment
Equipment Sales
Sales
Generate
Generatereports
reports
using
using aafile
file
What
Whatdo
doyou
youdo
dowith
with Generate
Generatereports
reports
records?
records? using
using22or
or more
more
files
files
Manual Filing System prepared by:RdDB
Store
Store
Projects
Projects Clients
Clients Update
Update
Query
Query
Products
Products Employees
Employees
Time
Timeconsuming
consuming
Equipment
Equipment Sales
Sales
Costly
Costly
Prone
Proneto
toerrors
errors
Goals of the Course
1. Logical design of a database
2. Implement the logical design
a) Database Schema creation
b) Manipulation of database
i. Add
ii. Delete
iii. Update
iv. Query
How
How can
canaauser
user access
accessthe
the database?
database?
Application
Students
Students
programs
DBMS Courses
Courses
Faculty
Faculty
SQL
Exercise
• Given: IDNo, SName, Degree, GPA
• Required:
– List of students sorted alphabetically and their
corresponding GPAs
File-based system
aacollection
collectionofof application
application
programs
programsthatthatperform
perform
services
servicesfor
for the
theend
end users
users
such
suchasasthe
theproduction
productionofof
reports.
reports. Student
Courses
Faculty
Registrar File
enrollment
EAF
Data
Dataentry
entryof
of Data
Dataentry
entryof
of Generation
Generationof
of
courses
courses enrollment
enrollment EAF
EAF
Student
prepared by:RdDB
Registrar
File
enrollment
EAF
Data
Dataentry
entryof Data
Each
Each program
program inin the
the
of Dataentry
entryof
of
courses
courses enrollment
enrollment system
system defines
defines and
and
manages
manages its
its own
own data.
data.
struct
structcourse
course [CBS98]
[CBS98]
{{char
charcode[5];
code[5];
char
chardesc[20];
desc[20];
int
intunits
units[3];
[3];
}}
Each
Eachuser
user(with
(withthe
theassistance
assistanceofof
File-based systems
prepared by:RdDB
DP
DPstaff)
staff)defines
definesand
andimplements
implements
(including
(includingstorage
storageand
andcontrol)
control)the
the
files
filesneeded
neededfor foraaspecific
specific
application.
application.[CBS98,
[CBS98,EN94]
EN94]
Student
Registrar File Courses
Faculty
enrollment
EAF
Student
Accounting File Fees
payment of fees
OR
redundancy
Student System (File-based)
Student
Registrar File Courses
Faculty
enrollment
EAF
Student
Accounting File Fees
payment of fees
OR
observed? and
Student System (File-based) isolation
isolationof
of data
data
Student
Registrar File Courses
Faculty
enrollment
EAF
Student
Accounting File Fees
payment of fees
OR
CC
Student
Accounting File Fees
payment of fees
OR
Student
Accounting File Fees
payment of fees
OR
Products
Products
Projects
Projects Clients
Clients
Equipment
Equipment
Products
Products Employees
Employees
Clients
Clients
Equipment
Equipment Sales
Sales
Employees
Employees
Sales
Sales
What is a database?
• It is a shared collection of logically coherent
data with some inherent meaning;
• It is designed , built and populated with data
for specific purpose such as meeting the
Departments
Departments information needs of an organization;
• It represents some aspect of the real-world.
Employees
Employees
[EN94]
Projects
Projects • Ex: student database, employee database,
library database, air flights database,
hospital database, etc.
prepared by:RdDB
Departments
Can
Canaauser
user Departments
directly
directlyaccess
access
Employees
aadatabase?
database? Employees
Projects
Projects
Application
program
Departments
Departments
Can
Canaauser
user access
access
Employees
aadatabase
databasethrough
through Employees
an
anapplication
application Projects
Projects
program
programalone?
alone?
How
Howcan
canaauser
useraccess
accessthe
the
database?
database?
Application Departments
Departments
programs
DBMS Employees
Employees
Projects
Projects
What is a DBMS?
• Database Management System
• It is a software system that enables users to :
– define, create and maintain the database
• DDL
• DML
– provide controlled access to this database
• Security
• Integrity
• Concurrency control
• Recovery control
• User-accessible catalogue (description of data)
Solution to Exercise:
Database Approach Using Access
How
How can
can we
we create
createan
an
electronic/computerized
electronic/computerizeddatabase?
database?
Projects
Projects
Products
Products
Projects
Projects Clients
Clients Equipment
Equipment
Employees
Employees
Equipment
Equipment Sales
Sales
Sales
Sales
Steps in
developing an
DB
Information
System
Steps in developing a DB Information System
Procedure People
Hardware Software - data admin
Data - log on
- DBMS - database
- stored data - start/stop
- PC - OS - backup admin
- meta-data
- mainframe - network - handle - DB designer
- schema
- network software failures - application
- application - change programmers
structure - end users
programs
Bridge
Machine Human
prepared by:RdDB
enrollment EAF
payment
DBMS DB
of fees
processing course
official
of grades cards
receipt
prepared by:RdDB
inventory &
oil official
milk price check
receipt
credit
card check DBMS DB
END …. Thank You!
Application programming with connection to a database
• http://www.configure-all.com/java_access_mysql.php
• http://alperguc.blogspot.com/2008/12/c-ms-access-connectio
n-string-ole-db.html
• http://www.easysoft.com/developer/languages/c/odbc_tutori
al.html
Prepared by: RdDB
Hardware [CBS96]
• Ranges of computer hardware:
– a single personal computer
– a single mainframe
– a network of computers
• Multi-User DBMS Architectures
– Teleprocessing : one computer with a single CPU and a
number of terminals
– File-Server : LAN where the file-server acts as a shared
hard disk drive for the database, and the applications
and DBMS run on each workstation
– Client-Server : the DBMS resides in the server
DBMS
Application Programs Database
Teleprocessing topology
File-Server Workstation 1
DBMS
Workstation 2 Workstation 3
DBMS DBMS
LAN
Request for data Files returned
Database
File-server
Client-Server Client 1
Client 2 Client 3
LAN
Request for data Selected data returned
Database
Server with
DBMS
Software
Procedures
These refer to the instructions and rules that govern the use
and design of the database:
• log on to the DBMS
• use a particular DBMS facility or application program
• start and stop the DBMS
• make a backup copies of the database
• handle hardware or software failures
• change the structure of a table, reorganize the database,
improve performance, archive data to secondary storage
Workers Behind the Scene
• DBMS Designers and Implementers
– Data Administrator
– Database Administrator
– Database Designer
• Logical database designer
• Physical database designer
– Application Programmers
• Tool Developers (e.g. performance monitoring,
graphical interfaces, etc.)
• Operators and Maintenance Personnel
• End Users
prepared by RdDB
• Data Administrator manages the data resource including:
– database planning,
– development and maintenance of standards, policies
and procedures and
– logical database design.
• Database Administrator is responsible for the physical
realization of the database including
– physical design and implementation,
– security and integrity control,
– maintenance of the operational system and
– ensuring satisfactory performance for the applications
and users.
prepared by RdDB
• Complexity
• Size
• Cost of DBMS
• Additional hardware costs
• Cost of conversion
• Performance
• Higher impact of a failure
Steps in
developing a
DB
Information
System
1st Step: Database / Application Planning
• Defining:
– Purpose of the database project
– Objectives that the target application needs to
accomplish and attain
– Development of standards for the target
application as well as the whole process of
developing the application
2nd Step: System Definition
• Defining:
– Scope and
boundaries of
database application
– The different users of
the system and their
perspective over the
target application
– The connection
between these
perspectives
3rd Step: Requirements Gathering and Analysis