Sunteți pe pagina 1din 22

Data Bases Management

DU 1: Introduction to DataBases

Mila Daz Ibez

Year 2017/18
Index of Contents

1. DataBases vs. File Systems.

2. Definition of DataBases.

3. Objectives of DataBases.

4. Levels arquitecture in DataBases.

5. Components of DataBases.

6. Centralised and distributed DataBases.


1. Data Bases vs. File Systems. Example

We are going to study an actual system and we are going to


see how the information has been stored throughout the time

We want to save our students school data, the


subjects in which they are enroled and the marks
they have got in each subject.
1. Databases vs. File Systems.
In the sisties, using paper and pen.
1. Databases vs. File Systems.

In the 70s and 80s, using files

Text Files were used to store information:


students.txt
DNI NAME ADDRESS BIRTH DATE
---------------------------------------------------------------
2894512X Jos Jimnez Perez C/ Corredera,34 21-10-90
28924896D Alejandra Gmez Marn C/ Picaso, 23 11-02-91
...

subjects.txt
DNI NAME SUBJECT GRADE
---------------------------------------------------
2894512X Jos Jimnez Perez Matemticas 5
2894512X Jos Jimnez Perez Lengua 8
.....
28924896D Alejandra Gmez Marn Matemticas 7
28924896D Alejandra Gmez Marn Ingls 3
1. DataBases vs. File Systems

From the 90s ..., using DataBases


A DBMS (Data Base Management System) is used to store
information by using the following tables:
Students (DNI, Name, Address, Birth Date)

2894512X Jos Jimnez Perez C/ Corredera,34 21-10-90


28924896D Alejandra Gmez Marn C/ Picaso, 23 11-02-91
...

Subjects (Code, Name)

001 Matemticas
002 Lengua
003 Ingls

Grades (DNI, Subject_code, grade)

2894512X 001 5
2894512X 002 8
28924896D 001 7
28924896D 003 3
1. DataBases vs. File Systems

Evolution
Not computerised
Information
Which is the reason of
Pencil and paper this evolution?

First computerised
Files

Computerised Systems.
Data Bases
1. DataBases vs. File Systems.

Querying information

We want to get the following information: The amount of students


of more than 25 years with an average grade greater than 7 that
are enroled in DataBases I.

Not computerised IS: Getting this information can take too much
time and work. We have to calculate the average and look one
student each time.
Files IS: We can create a program that gets the data, calculates

the average and shows the results to us.


DataBases IS: This query is very easy using a Data Query

Language.
1. DataBases vs. File Systems.
Flexibility to changes

If the IS needings change, what happens in each of the three


models?
For example, we want to save the name of the teacher that
teaches each subject

Not computerised IS: We have to write the name of the teacher in


each card
Files IS: we should change the grades.txt file and type the

information in an additional column.


DataBases IS: we simply would have to add a new field to the
subjects table. And so, we would write the name of the teacher for
each subject once.
1. DataBases vs. File Systems.
Redundancy and inconsistency

Redundancy is the repetition of the saved information.


The objective is to decrease redundancy. So we have
less memory to use and we increase the coherence

Data inconsistency is produced when redundant


information is different in two or more places

Which of the previous models won't have that


problem?
1. DataBases vs. File Systems.
Concurrency: Can several users work at the same time?

For example, we have three employees that are working with the
stored information.

Not computerised IS: It's difficult for the employees to share the
cards
Files IS: If we have the three employees working with programs

that read and write the text files, can happen that one of them is
reading an incorrect information.
DataBases IS: We have transactions and locks, and so the
information is always coherent.
1. DataBases vs. File Systems.
Safety

Nowadays, safety is very important.

Only some people can access to some specific data:


personal data, medical history, and so on...

Is each of the three models safe?


2. DataBases Definition

A Data Base is a structured set of data that is


represented by entities and their relationships.

A Data Base Management System (DBMS) is a set of


related data that are structured and organised and a set
of programs that access and manage this data
3. DBMS's objectives

Allow non-predefined and complex queries.

Offer data flexibility and independence.

Minimize redundancy.

Warrant data and referential integrity.

Allow users concurrency.

Offer information safety.


4. Three Level Architecture in DataBases
The Three Level Architecture has the aim of enabling users to access the same
data but with a personalised view of it. The distancing of the internal level from
the external level means that users do not need to know how the data is
physically stored in the database. This level separation also allows the
Database Administrator (DBA) to change the database storage structures
without affecting the users' views.
External Level (User Views): A user's view of the database describes a part
of the database that is relevant to a particular user. It excludes irrelevant data
as well as data which the user is not authorised to access.
Conceptual Level: The conceptual level is a way of describing what data is
stored within the whole database and how the data is inter-related. The
conceptual level does not specify how the data is physically stored.
Internal Level: The internal level involves how the database is physically
represented on the computer system. It describes how the data is actually
stored in the database and on the computer hardware.
4. Three Level Architecture in DataBases
5. DBMS Components.
A DBMS consists of:

Languages.
The data dictionary.
Security and integrity mechanisms
Human factor.
5. DBMS Components. Languages
The languages of a DBMS must allow:

Create the DataBase structure, including all the objects such


as tables, views, users, triggers, etc. DDL (Data Definition
Language)
Query and modify the information stored in the DataBase.
DML (Data Management Language)
Grant privileges to users, confirm or rollback transactions,...
DCL (Data Control Language)
Sometimes, they also include a 4GL for quick aplication
development (for instance, Access)
5. DBMS Components. The data dictionary.
The data dictionary contains the metadata (data about data) of
the data base, that is:
The definition of all the existing objects: tables with its
columns, views, procedures, triggers, indexes, and so on...
The physical location of the objects and the space asgined to
them.
The privileges granted to the users.
The table constraints
Etc.
5. DBMS Components. Safety and integrity
mechanisms.
A DBMS must provide utilities that allow:
Backup Management.
Warrant data protection with non authorised accesses.
Define integrity constraints to avoid accidental damages to
the data.
Recover the database to a consistent state in case of system
error.
Control concurrent access of the users.
5. DBMS Components. Human factor
A DBMS has got different types of users:

End users: Can access to the information they have been


allowed to.
Developers: make applications to acces the database objects
to let the end users work.
DBAs: Warrant the correct working of the data base and
manage all the resources. They have the highest level of
privileges.
6. Centralised and Distributed DataBases.

Centralised DB: All the DB components are in the same


computer. Data can be accessed from different places
(client/server architecture)
Distributed DB: data belongs logically to the same system
but are physically stored in different computers connected
throw a network.

S-ar putea să vă placă și