Upload
hitesh-mohapatra
View
245
Download
0
Embed Size (px)
Citation preview
8/14/2019 Lecture 2 Database Database System DBMS
1/33
DBMS
Lecture 2
Database
Database System
DBMS
Hitesh Mahapatra
8/14/2019 Lecture 2 Database Database System DBMS
2/33
2
Introduction to Database
Collection of data related to a particular topic
Single large file that contains all the data
Series of Rows and Columns
Collection of Tables, Forms, Reports etc
8/14/2019 Lecture 2 Database Database System DBMS
3/33
3
Database
A database is a computerized record
keeping system
Database itself can be regarded as a kind
of electronic filing cabinet
It is a repository for the collection of
computerized data files
8/14/2019 Lecture 2 Database Database System DBMS
4/33
4
More completely, it is a system involving data,
the hardwarethat physically stores that data, the
software that utilizes the hardware's file system
in order to:
1) store the data and
2) provide a standardized method for retrieving
or changing the data, and finally, the userswho turn the data into information
8/14/2019 Lecture 2 Database Database System DBMS
5/33
5
A database might be as complex and
demanding as an account tracking system
used by a bank to manage the constantlychanging accounts of thousands of bank
customers, or it could be as simple as a
collection of electronic business cards on
your laptop
8/14/2019 Lecture 2 Database Database System DBMS
6/33
6
The important thing is that a database
allows you to store data and get it or
modify it when you need to easily and
efficiently regardless of the amount of data
being manipulated
8/14/2019 Lecture 2 Database Database System DBMS
7/33
7
Elmasri says:
A Database (DB) is collection of related
data - with the following properties:
A DB has some relevant meaning
A DB is designed, built and populated with data
for a specific purpose
A DB represents some aspect of the real world
8/14/2019 Lecture 2 Database Database System DBMS
8/33
8
Kroenke says:
An integrated, self-describing collection of
relateddata
Integrated: Data is stored in a uniform way, typically all in one
place (a single physical computer for example)
Self-Describing: A database maintains a description of the data
it contains (Catalog)
Related: Data has some relationship to other data. In aUniversity we have students who take courses taught by
professors
8/14/2019 Lecture 2 Database Database System DBMS
9/33
9
We can also say that the database is a model of what theusers perceive
Three main categories of models:
User Models: How users perceive the world and / or thebusiness
Logical Models: Represent the logic of how a businessoperates. For example, the relationship between differententities and the flow of data through the organization. Based on
the User's modelPhysical Models: Represent how the database is
actually implemented on a computer system. This is based onthe logical model
8/14/2019 Lecture 2 Database Database System DBMS
10/33
10
What is in a Database?What is in a Database?
A database contains information about
a particular enterprise or a particular
application E.g., a database for an enterprise may
contain everything needed for the planning
and operation of the enterprise: customerinformation, employee information, product
information, sales and expenses, etc
8/14/2019 Lecture 2 Database Database System DBMS
11/33
11
You dont have to be a company to use a database:
you can store your personal information, expenses,
phone numbers in a database (e.g., using Access on
a PC) As a matter of fact, you could store all data
pertinent to a particular purpose in a
database
This usually means that a database stores data that
are related to each other
8/14/2019 Lecture 2 Database Database System DBMS
12/33
12
Examples
Credit card shopping it automatically checks
the balance and updates the amount in the card
after deduction
Scanner used to read Universal Product Code
Online Air Reservation System
8/14/2019 Lecture 2 Database Database System DBMS
13/33
13
Example Soft wares
Traditionally, databases ran on large, powerfulmainframes for business applications. You willprobably have heard of such packages as
Oracle orSQL ServerHowever with the advent of small, powerful
personal computers, databases have becomemore readily usable by the average computer
user. Microsoft's Access and Borland'sParadox are two popular PC-based enginesaround
8/14/2019 Lecture 2 Database Database System DBMS
14/33
14
Database System
Database system is basically a
computerized record keeping system; that
is a computerized system whose overallpurpose is to maintain information and to
make that information available on
demand
8/14/2019 Lecture 2 Database Database System DBMS
15/33
15
A collection of software programs that are
used to define, construct, maintain and
manipulate data in a database
8/14/2019 Lecture 2 Database Database System DBMS
16/33
16
Who Needs Database SystemsWho Needs Database Systems
Corporate databases
Web datamanagement
Typical Applications:Personnel management
Inventory and purchase orderInsurance policies
Typical Applications
Web page managementPersonalize web pages
8/14/2019 Lecture 2 Database Database System DBMS
17/33
17
The user of the system will be given facilities
to perform a variety of operations on such
files :
Adding new empty files to database Inserting new data into existing files
Retrieving data from existing files
Updating data in existing files
Deleting data from existing files
Removing existing files, empty or otherwise, from the
database
8/14/2019 Lecture 2 Database Database System DBMS
18/33
18
Now we will refer these files in the
database as Tables
The rows of such tables are referred to as
Records of that file/table
The columns can be regarded asrepresenting the Fields
8/14/2019 Lecture 2 Database Database System DBMS
19/33
19
DBMS
All access to the database is controlled by a
sophisticated software called Data Base
Management System
Software that defines a database, stores the
data, supports a query language, produces
reports, and creates data entry screens
Microsoft Accessis an example of DBMS
8/14/2019 Lecture 2 Database Database System DBMS
20/33
20
What is the goal of real DBMS
Electronic record-keeping
Fast and convenient access to information
8/14/2019 Lecture 2 Database Database System DBMS
21/33
21
Example
E.g. students, taking classes, obtaining
grades;
Find my GPA
8/14/2019 Lecture 2 Database Database System DBMS
22/33
22
Solution: paper-based
Advantages?
Disadvantages?
8/14/2019 Lecture 2 Database Database System DBMS
23/33
23
Solution: paper-based
Advantages? cheap
Disadvantages?
8/14/2019 Lecture 2 Database Database System DBMS
24/33
24
Solution: paper-based
Advantages? cheap
Disadvantages?
no queries no sharing
large physical foot-print
8/14/2019 Lecture 2 Database Database System DBMS
25/33
25
Next solution
computer-based (flat) files +
C (Java, ...) programs to access them
e.g., one (or more) UNIX/DOS files,
with student records and their courses
8/14/2019 Lecture 2 Database Database System DBMS
26/33
26
Next solution
your layout for the student records?
8/14/2019 Lecture 2 Database Database System DBMS
27/33
27
Next solution
your layout for the student records?
(eg., comma-separated values CSV)
1,Sarfraza,Chattha,Lahore
50,Tompson,Peter,NewYork
151,Shazia,Qayyum,Lahore
8/14/2019 Lecture 2 Database Database System DBMS
28/33
28
Next solution
your layout for the student records?
(many other layouts are also possible)eg.:
Smith,John,1,London
Tompson,Peter,234Atkinson,Mary,345,03009449449,Lahore
8/14/2019 Lecture 2 Database Database System DBMS
29/33
29
Problems?
Inconvenient access to data (need C++
expertise, plus knowledge of file-layout)
Data redundancy
Integrity problems
8/14/2019 Lecture 2 Database Database System DBMS
30/33
30
Problems? (contd)
...
Concurrent-access anomalies
Security problems
8/14/2019 Lecture 2 Database Database System DBMS
31/33
31
Problems? (contd)
why?
because of two main reasons: file-layout description is buried within the C
programs and
there is no support for transactions (concurrency
and recovery)
DBMS handle exactly these two problems
8/14/2019 Lecture 2 Database Database System DBMS
32/33
32
Main Products
Commercial
Oracle
IBM/DB2
MS SQL-Server
Sybase
InformixMS Access
8/14/2019 Lecture 2 Database Database System DBMS
33/33
33
Company Product RemarksOracle Oracle 8i, 9i, etc. Worlds 2nd largest software company CEO,
Larry Ellison, worlds 2nd richest
IBM
DB2, Universal ServerWorlds 2nd largest after Informix acquisition
Microsoft Access, SQL Server Access comes with MS Office
Sybase Adaptive Server CEO John Chen, grown up in HK
Informix Dynamic ServerAcquired by IBM in 2001
Big Names in Database SystemsBig Names in Database Systems