Top Banner
Management Information Systems Lection 03 Database management system CLARK UNIVERSITY College of Professional and Continuing Education (COPACE)
58

Management Information Systems

Feb 22, 2016

Download

Documents

kenny

CLARK UNIVERSITY College of Professional and Continuing Education (COPACE). Management Information Systems. Lection 0 3 Database management system. Plan. Term “Database” Architecture of database Data models Normal forms Operations of relation algebra Operations of SQL DBMS. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Management Information Systems

Management Information Systems

Lection 03Database management system

CLARK UNIVERSITY

College of Professional and Continuing Education (COPACE)

Page 2: Management Information Systems

Plan

• Term “Database”• Architecture of database• Data models• Normal forms• Operations of relation algebra• Operations of SQL• DBMS

Page 3: Management Information Systems

Term “Database”

• A huge amount of data is entered into computer systems every day.

• Where does this data go and how is it used?• How can it help you on a job?

Page 4: Management Information Systems

Term “Database”

Widely database is a collection of facts about real world’s objects if some field.

Field is a part of the real world which we learn for managing: company, university, etc.

Page 5: Management Information Systems

Non-structured data

Folder No. 16493, Smith John, 01/01/1976; folder No. 16593, LeVering Barbara, 03/15/1975; folder No. 16693, McCow Robert, 04/14/1976.

Page 6: Management Information Systems

Structured data

Structuring is the introduction of agreements on the ways of presenting data.

Folder No. Surname First name Birth date

16493 Smith John 01/01/1976

16593 LeVering Barbara 03/15/1975

16693 McCow Robert 04/14/1976

Page 7: Management Information Systems

Database definition

• Database (DB) is a named collection of structured data related to a particular subject area.

• Database management system (DBMS) - a set of software and language tools necessary to create databases, keeping them up to date and organize the search in them the necessary information.

Page 8: Management Information Systems

Classification of databases

Centralized

stored in a computer system, which may be the mainframe (access

via terminals) or file server network.

Data processing

Distributedconsists of several parts, which are

stored in different computer network

connection.

Page 9: Management Information Systems

Classification of databases

With local access

Access to data

With network access

Page 10: Management Information Systems

Classification of databases

Centralized database with network access can have the following architecture:

File-server Client-server Two-level model Three-level model

Page 11: Management Information Systems

Architecture “File-level”

Page 12: Management Information Systems

1. Input and Display data

3. Implementation of computing functions on the data

2. Data access and search Criteria

1. Keeping the database file

АрхитектArchitecture “File-level”ура файл-сервер

Page 13: Management Information Systems

1. The absence of very high performance of the server (most importantly - the required amount of disk space)

2. The database is not running and will not being installed on a server

1. High network traffic

2. Lack of special security arrangements file from the DB

Advantages:

Disadvantages:

АрхитектArchitecture “File-level”ура файл-сервер

Page 14: Management Information Systems

Architecture “Client-server”

Page 15: Management Information Systems

1. Input and display data2. Implementation of computing functions on data sets

1. Keeping the database file2. Access to the data and

search for certain criteria

Architecture “Client-server”

Page 16: Management Information Systems

1. Lower network traffic than the file-server model 2. SQL-Server provides functions to ensure the integrity and security of data

1. In certain cases, some data sets may take quite a substantial amount of place

Advantages:

Disadvantages:

Architecture “Client-server”

Page 17: Management Information Systems

1. Input and Display data1. Keeping the database file2. Data access and search by

criteria3. Implementation of computing

procedures on data sets

Two-level architecture

Page 18: Management Information Systems

Advantages:

Disadvantages:

1. High demands on the computer server (disk space and speed)

Two-level architecture

1. Significant reduction in network traffic compared to client server 2. High reliability of data storage and processing

Page 19: Management Information Systems

Three-level architecture suggest the following application components: a client application ("thin client" or a terminal) connected to the application server, which in turn is connected to the database server.

Three-level architecture

Page 20: Management Information Systems

Stored data have a logical structure described by a model of data (data model), supported by the DBMS.

Data model determines the organization of data, constraints and the set of operations that are allowed on the object.

Data models

Page 21: Management Information Systems

Hierarchical model Network model Relational model

Data models

Page 22: Management Information Systems

The hierarchical model has been developed historically in the first turn. Based on this model it was created the first professional DBMS IMS in the late 60's - early 70‘s (IBM).

Hierarchical model

Page 23: Management Information Systems

Links between different entities of data are described by a structured graph or a tree

Hierarchical model

Page 24: Management Information Systems

1. Sufficiently high run-time operations on data

1. Complexity of understanding for the average user 2. The presence of redundancy

Advantage:

Disadvantages:

Hierarchical model

Page 25: Management Information Systems

Link between the data are described by an arbitrary graph

Network model

Page 26: Management Information Systems

1. Minimum redundancy2. Compared to the hierarchical model the network model provides

a great deal in terms of the admissibility of the formation of new links

3. Effective implementation in terms of memory consumption.

1. Complexity of understanding for the average user 2. Weakened control of the accuracy of links

Advantages:

Disadvantages:

Network model

Page 27: Management Information Systems

The relational model was proposed by Edgar Cod in 1970.

Based on the concept of relation.

Graphically represented as a ratio of a table.

In a relational database assumes that the user perceives the database as tables.

Relational model

Page 28: Management Information Systems

Relational modelFolder No. Surname First name Birth date Group

16493 Smith John 01/01/1976 111

16593 LeVering Barbara 03/15/1975 111

16693 McCow Robert 04/14/1976 112

Page 29: Management Information Systems

1. Simplicity and clarity for a wide user, which is the reason of its wide distribution.

1. Necessary redundancy because of the relationships between tables.

Advantage:

Disadvantage:

Relational model

Page 30: Management Information Systems

There are alternatives to the terms:

Relational model

Alternative 1 Alternative 1 Alternative 1

Table File Relation

String Record Tuple

Column Field Domain

Page 31: Management Information Systems

Primary key

Primary key is a relation attribute (set of attributes) that uniquely identifies each of its records. Student (FolderNo., Surname, First_name, Birth_date, Group)

Folder No. Surname First name Birth date Group

16493 Smith John 01/01/1976 111

16593 LeVering Barbara 03/15/1975 112

16693 McCow Robert 04/14/1976 113

Page 32: Management Information Systems

Foreign keyWe can link tables by foreign keys.

Foreign key is an attribute (set of attributes) of relation, which is the key of another relation.

Student(FolderNo., Surname, First_name, Birth_date, Group)Group(Number, Specialisation, Head_of_group)

Page 33: Management Information Systems

Indexes

Index is a means to accelerate the search operation records in the table, as well as other operations that use search (retrieval, modification, sorting, etc.)Surname Location Location … Surname

Alekseev 1 1 Alekseev

Afanasiev 4 2 Yakovlev

Kuznecov 1000 3 Mikhailov

Mikhailov 3 4 Afanasiev

… …

Yakovlev 2 1000 Kuznecov

Page 34: Management Information Systems

Types of indexes

Primary

The key field is always indexed, so it doesn’t require an additional

index.

Indexes

Secondary• The are used for enforcing

searching and executing queries

• There might be several secondary indexes

• They might include several fields

• The same field can enter different indexes

Page 35: Management Information Systems

Data redundancy

Folder No. Surname First name Birth date Group Specialization

15345 Ivanov Ivan 04/15/1989 392 Informatics and Management

15349 Medvedeva Anna 02/13/1989 392 Informatics and Management

15310 Petrov Mikhail 11/12/1989 392 Informatics and Management

15259 Sidorov Nicolay 01/26/1987 591 Informatics and English

15263 Sanin Alexander 10/20/1987 591 Informatics and English

Page 36: Management Information Systems

The problem of update Folder

No.Surna

meFirst

nameBirth date

Group

Specialization

Term Course Score

15345 Ivanov Ivan 04/15/1989

492 IM 2 English Good

15345 Ivanov Ivan 04/15/1989

492 IM 2 Theory of algorithms

Excellent

15345 Ivanov Ivan 04/15/1989

392 ?

IM 2 Chemistry Good

15310 Petrov Mikhail 11/12/1989

392 IM 6 English Satisfactory

15310 Petrov Mikhail 11/12/1989

392 IM 6 Theory of algorithms

Satisfactory

15310 Petrov Mikhail 11/12/1989

392 IM 6 Chemistry Good

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Architecture of PC

Excellent

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Computer modeling

Excellent

Page 37: Management Information Systems

The problem of inserting new data Folder

No.Surname First

nameBirth date

Group Speciali-zation

Term Course Score

15345 Ivanov Ivan 04/15/1989

392 IM 2 English Good

15345 Ivanov Ivan 04/15/1989

392 IM 2 Theory of algorithms

Excellent

15345 Ivanov Ivan 04/15/1989

392 IM 2 Chemistry Good

15310 Petrov Mikhail 11/12/1989

392 IM 6 English Satisfactory

15310 Petrov Mikhail 11/12/1989

392 IM 6 Theory of algorithms

Satisfactory

15310 Petrov Mikhail 11/12/1989

392 IM 6 Chemistry Good

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Architecture of PC

Excellent

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Computer modeling

Excellent

15402 Stepanov Andrew 03/29/1991

191 MSIT 1 - -

Page 38: Management Information Systems

Нормализация

The normalization of relations represent rules of such formation of relations (tables) that allow to eliminate duplication, inconsistency stored in the database.

Page 39: Management Information Systems

E. Codd developed three normal forms of relations and the mechanism, which allows to convert any relation to the third normal form.

Нормализация

Page 40: Management Information Systems

Первая нормальная форма (1НФ)

Table is in 1NF if each its cell has always the only atomic value, and there can never be the set of such values.

Page 41: Management Information Systems

The table is not in 1NF

Первая нормальная форма (1НФ)

Folder No.

Surname First name

Birth date

Group Speciali-zation

Term Course Score

15345 Ivanov Ivan 04/15/1989

392 IM 2 English Good

Theory of algorithms

Excellent

Chemistry Good

15310 Petrov Mikhail 11/12/1989

392 IM 6 English Satisfactory

Theory of algorithms

Satisfactory

Chemistry Good

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Architecture of PC

Excellent

Computer modeling

Excellent

Page 42: Management Information Systems

Table is in 1NF

Первая нормальная форма (1НФ)

Folder No.

Surname First name

Birth date

Group Speciali-zation

Term Course Score

15345 Ivanov Ivan 04/15/1989

392 IM 2 English Good

15345 Ivanov Ivan 04/15/1989

392 IM 2 Theory of algorithms

Excellent

15345 Ivanov Ivan 04/15/1989

392 IM 2 Chemistry Good

15310 Petrov Mikhail 11/12/1989

392 IM 6 English Satisfactory

15310 Petrov Mikhail 11/12/1989

392 IM 6 Theory of algorithms

Satisfactory

15310 Petrov Mikhail 11/12/1989

392 IM 6 Chemistry Good

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Architecture of PC

Excellent

15259 Sidorov Nicolay 01/26/1987

591 IE 10 Computer modeling

Excellent

Page 43: Management Information Systems

Диаграмма функциональных зависимостей для примера БД

«Студент»

Page 44: Management Information Systems

Table is in 2NF if it does not contain any non-key attributes which are functionally dependent on part of the key

Page 45: Management Information Systems

45

Table is in 3NF if it does not contain any non-key attributes, transitively dependent on the key part

Page 46: Management Information Systems

Результат проектирования БД

«Студент»

Folder No.

Surname First name

Birth date

Group

15345 Ivanov Ivan 04/15/1989

392

15310 Petrov Mikhail 11/12/1989

392

15259 Sidorov Nicolay 01/26/1987

591

Group Speciali-zation

392 IM

591 IE

Folder No. Term Course Score

15345 2 English Good

15345 2 Theory of algorithms Excellent

15345 2 Chemistry Good

15310 6 English Satisfactory

15310 6 Theory of algorithms Satisfactory

15310 6 Chemistry Good

15259 10 Architecture of PC Excellent

15259 10 Computer modeling Excellent

Page 47: Management Information Systems

SQL

A query language SQL (Structured Query Language) provides an access to information contained in relational databases for users, software and computing systems

Page 48: Management Information Systems

Relational algebra

SQL is based on relational algebra operations. Relational Algebra is a set of operations on relations. Relational algebra was developed within the relational model by Codd.Using the relational algebra we can get other relations

Page 49: Management Information Systems

Relational algebra

UnionNo. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

No. Surname Name Birth date Group

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

No. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students of group 392

Students of group 591

Result

Page 50: Management Information Systems

Intersection

Relational algebra

No. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students of groups 392 and 591

No. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

Students of group 392

ResultNo. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

Page 51: Management Information Systems

Substraction

Relational algebraNo. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students of groups 392 and 591

No. Surname Name Birth date Group

15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

Students of group 392

ResultNo. Surname Name Birth date Group

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Page 52: Management Information Systems

Selection

Relational algebra

No. Surname Name Birth date Group15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students of groups 392 and 591

No. Surname Name Birth date Group

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students of group 591

Page 53: Management Information Systems

SELECT – chooseDISTINC – eliminate the same strings in the output fileFROM – from which tablesWHERE – where if condition is trueGROUP BY – grouping strings by some fieldHAVING – grouping under some conditionОRDER BY – sorting

SELECT [DISTINC] elementsFROM table(s)[WHERE condition][GROUP BY field(s) [HAVING condition]][ORDER BY field(s)]

SQL

Page 54: Management Information Systems

SELECT Surname FROM Students

Select surnames of all students

No. Surname Name Birth date Group15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students

SurnameIvanov

Medvedeva

Petrov

Sidorov

Sanin

Page 55: Management Information Systems

SELECT * FROM Students WHERE Group=591

ORDER BY Surname

Select all information about students of group 591, sorting them by surname

No. Surname Name Birth date Group15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students

No. Surname Name Birth date Group15263 Sanin Alexander 10/20/1987 591

15259 Sidorov Nikolay 01/26/1987 591

Result

Page 56: Management Information Systems

SELECT Birth Date FROM Students WHERE Surname=“Petrov”

Select birth date of Petrov

No. Surname Name Birth date Group15345 Ivanov Ivan 04/15/1989 392

15349 Medvedeva Anna 02/13/1989 392

15310 Petrov Mikhail 11/12/1989 392

15259 Sidorov Nikolay 01/26/1987 591

15263 Sanin Alexander 10/20/1987 591

Students

Birth date11/12/1989

Page 57: Management Information Systems

DBMSDatabase management system (DBMS) is a set of software and language tools necessary to create databases, keeping them up to date and organize the search the necessary information.

The term "database server" is generally used to refer to the entire database, based on the "client-server", including the server and client side.

Page 58: Management Information Systems

Types of DBMS

Network DBMS (CronosPlus)Hierarchical DBMS (IMS)Rational (MS Access, Paradox, Interbase, FireBird,

MySQL, Oracle, Ingres)Onject-oriented and object-rational (Oracle Database,

MicroSoft SQL Server)