You are on page 1of 23

MANAGEMENT INFORMATION

SYSTEM
(MIS)
CHAPTER #4

Introduction To Database Systems


and DSS

•01/18/21 •Eng. Cawke •1


Objectives
After we complete this chapter we will able
to know :-
1. Types of decisions How decision support system is useful to
managers.
2. Databases and how it works
3. What is relational database management system.
4. Programmers and how they see the database
5. Transactions and ACID properties.

•01/18/21 •Eng. Cawke •2


What is DSS?
Decision support systems (DSS) are
interactive software-based systems
intended to help managers in decision-
making by accessing large volumes of
information generated from Different
information systems involved in
organizational business processes, such as
office automation system, transaction
processing system, etc.

•01/18/21 •Eng. Cawke •3


Types of DSS
 There are two types of decisions - programmed and non-
programmed decisions.
 Programmed decisions are basically automated
processes, general routine work, where:
 These decisions have been taken several times.
 These decisions follow some guidelines or rules.
 For example, selecting a reorder level for inventories, is a
programmed decision.

•01/18/21 •Eng. Cawke •4


Types of DSS
 Non-programmed decisions occur in unusual and non-addressed
situations, so:
 It would be a new decision.
 There will not be any rules to follow.
 These decisions are made based on the available information.
 These decisions are based on respect, sense, understanding and
judgment.
 For example, investing in a new technology is a non-programmed
decision.

•01/18/21 •Eng. Cawke •5


Attributes of a DSS

Ease of use
Efficiency and effectiveness
Complete control by decision-makers
Ease of development
Extendibility
Support for data access
Standalone, integrated, and Web-based

•01/18/21 •Eng. Cawke •6


What Is a Relational Database
Management System ?
Database Management System = DBMS
Relational DBMS = RDBMS

Is a collection of files that store the data.

A big C program written by someone else


that accesses and updates those files for
you

•01/18/21 •Eng. Cawke •7


Where are RDBMS used ?
Backend for traditional “database”
applications
Backend for large Websites
Backend for Web services

•01/18/21 •Eng. Cawke •8


Example of a Traditional Database
Application

Suppose we are building a system


to store the information about:
students
courses
professors
who takes what, who teaches what

•01/18/21 •Eng. Cawke •9


Can we do it without a DBMS ?
Sure we can! Start by storing the data in files:

students.txt courses.txt professors.txt

Now write C or Java programs to implement


specific tasks
•01/18/21 •Eng. Cawke •10
Doing it without a DBMS...
Enroll “Mary Johnson” in “CSE444”:

Write a C program to do the following:


Read
Read ‘students.txt’
‘students.txt’
Read
Read ‘courses.txt’
‘courses.txt’
Find&update
Find&update the
the record
record “Mary
“Mary Johnson”
Johnson”
Find&update
Find&update the
the record
record “CSE444”
“CSE444”
Write
Write “students.txt”
“students.txt”
Write
Write “courses.txt”
“courses.txt”

•01/18/21 •Eng. Cawke •11


Problems without an DBMS...
Read
Read‘students.txt’
‘students.txt’
Read ‘courses.txt’
Read ‘courses.txt’
Find&update
Find&updatethetherecord
record“Mary
“Mary
System Johnson”
crashes: Johnson”
Find&update
Find&updatethetherecord
record“CSE444”
“CSE444”
Write “students.txt”
Write “students.txt” CRASH !
Write
Write“courses.txt”
“courses.txt”

◦ What is the problem ?


Large data sets (say 50GB)
◦ What is the problem ?
Simultaneous access by many users
◦ Need locks: we know them from OS, but now data on disk;
and is there any fun to re-implement them ?

•01/18/21 •Eng. Cawke •12


Enters a DBMS

“Two tier database system”

connection
(ODBC, JDBC)

Database server
Data files (someone else’s
C program) Applications
•01/18/21 •Eng. Cawke •13
Functionality of a DBMS

The programmer sees SQL, which has two components:


 Data Definition Language - DDL
 Data Manipulation Language - DML
◦ query language

Behind the scenes the DBMS has:


 Query optimizer
 Query engine
 Storage management
 Transaction Management (concurrency, recovery)

•01/18/21 •Eng. Cawke •14


Functionality of a DBMS
Two things to remember:

Client-server architecture
◦ Slow, cumbersome connection
◦ But good for the data
It is just someone else’s C program
◦ In the beginning we may be impressed by its speed
◦ But later we discover that it can be frustratingly slow
◦ We can do any particular task faster outside the
DBMS
◦ But the DBMS is general and convenient

•01/18/21 •Eng. Cawke •15


How the Programmer Sees the
DBMS
Start with DDL to create tables:
CREATE
CREATETABLE TABLEStudents
Students((
Name
NameCHAR(30)
CHAR(30)
SSN
SSNCHAR(9)
CHAR(9)PRIMARY
PRIMARYKEY
KEYNOT
NOTNULL,
NULL,
Category CHAR(20)
Category CHAR(20)
)) . .. .. .
Continue with DML to populate tables:

INSERT
INSERTINTO INTOStudents
Students
VALUES(‘Charles’,
VALUES(‘Charles’,‘123456789’,
‘123456789’,‘undergraduate’)
‘undergraduate’)
.. .. .. ..

•01/18/21 •Eng. Cawke •16


How the Programmer Sees the DBMS
Tables:
Students: Takes:
SSN CID
SSN Name Category
123-45-6789 CSE444
123-45-6789 Charles undergrad
123-45-6789 CSE444
234-56-7890 Dan grad
234-56-7890 CSE142
… …

Courses:
CID Name Quarter
CSE444 Databases fall
CSE541 Operating systems winter

•01/18/21 •Eng. Cawke •17


Transactions
Enroll “Mary Johnson” in “CSE444”:
BEGIN
BEGINTRANSACTION;
TRANSACTION;
INSERT
INSERTINTO
INTOTakes
Takes
SELECT
SELECT Students.SSN,Courses.CID
Students.SSN, Courses.CID
FROM
FROMStudents,
Students,Courses
Courses
WHERE
WHEREStudents.name
Students.name==‘Mary
‘MaryJohnson’
Johnson’and
and
Courses.name
Courses.name==‘CSE444’
‘CSE444’
----More
Moreupdates
updateshere....
here....
IF
IFeverything-went-OK
everything-went-OK
THEN
THENCOMMIT;
COMMIT;
ELSE
ELSEROLLBACK
ROLLBACK

If system crashes, the transaction is still either committed or aborted


•01/18/21 •Eng. Cawke •18
Transactions
A transaction = sequence of statements
that either all succeed, or all fail
Transactions have the ACID properties:
A = Atomicity
C = Consistency
I = Independence
D = Durability

•01/18/21 •Eng. Cawke •19


Queries
Find all courses that “Mary” takes
SELECT
SELECT C.name
C.name
FROM
FROM Students
Students S,
S, Takes
Takes T,
T, Courses
Courses CC
WHERE
WHERE S.name=“Mary”
S.name=“Mary” andand
S.ssn
S.ssn ==T.ssn
T.ssn and
and T.cid
T.cid==C.cid
C.cid
What happens behind the scene ?
◦ Query processor figures out how to answer the
query efficiently.

•01/18/21 •Eng. Cawke •20


Queries, behind the scene
Declarative SQL query Imperative query execution plan:
sname
SELECT
SELECT C.name
C.name
FROM
FROMStudents
StudentsS,
S,Takes
TakesT,
T,Courses
CoursesCC
WHERE
WHERES.name=“Mary”
S.name=“Mary”andand cid=cid
S.ssn
S.ssn==T.ssn
T.ssnand
andT.cid
T.cid==C.cid
C.cid
sid=sid

name=“Mary”

Students Takes Courses

The optimizer chooses the best execution plan for a query


•01/18/21 •Eng. Cawke •21
Database Systems
The big commercial database vendors:
◦ Oracle
◦ IBM (with DB2) bought Informix recently
◦ Microsoft (SQL Server)
◦ Sybase
Some free database systems (Unix) :
◦ Postgres
◦ Mysql
◦ Predator
InCSE444 we use SQL Server. You may use
something else, but you are on your own.

•01/18/21 •Eng. Cawke •22


E N D

•01/18/21 •Eng. Cawke •23

You might also like