0% found this document useful (0 votes)
3 views45 pages

Course

The document provides an introduction to databases, highlighting the limitations of traditional file management systems, such as information redundancy and dependency between data and programs. It explains the role of Database Management Systems (DBMS) in organizing, accessing, and securing data, while emphasizing objectives like data independence, efficiency, and consistency. Additionally, it outlines the structure of relational databases and the main functions of DBMS, including data manipulation, sharing, and security.

Uploaded by

ibnbiskra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views45 pages

Course

The document provides an introduction to databases, highlighting the limitations of traditional file management systems, such as information redundancy and dependency between data and programs. It explains the role of Database Management Systems (DBMS) in organizing, accessing, and securing data, while emphasizing objectives like data independence, efficiency, and consistency. Additionally, it outlines the structure of relational databases and the main functions of DBMS, including data manipulation, sharing, and security.

Uploaded by

ibnbiskra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Introduction to Data Base

2nd Year, Computer Engineer


DATA VS
INFORMATION VS
KNOWLEDGE
Chapter 1 : Generalities
on Data Bases
Problems posed by traditional
organizations: FMS
The implementation of a computer application in a
company often involved writing a set of programs
designed to operate on a collection of files that also
had to be created.

The main problems with this approach are


information redundancy and the dependency
between data and the programs that manipulate
them.
Problems posed by traditional
organizations: FMS
Information redundancy
Redundancy means that the same information can be found in
multiple distinct files.
For example, an employee identity (name, surname, address,
etc.) may appear in file F1, which belongs to application P1 for
salary calculation, and in file F2, which belongs to application
P2 for managing medical expense reimbursements.
Problems posed by traditional
organizations: FMS

Such a situation complicates update operations because


any updated information in one file must also be
updated in all other files where it exists.

Example: If an employee's address is changed in file F1,


the same change must also be made in all other files
containing this information.
Problems posed by traditional
organizations: FMS
Dependency between data and programs
Generally, creating an application that handles files involves
performing several operations, such as:
- Structuring records: Defining fields, their types, and their order.
- Choosing an organization: Sequential, indexed sequential, direct
access, etc.
- Selecting a storage medium: Hard disk, removable disk, etc.

This means that the data contained in the files is directly linked to
the programs that process them through a description embedded
within these programs themselves.
Problems posed by traditional
organizations: FMS
Example :

If we need to set up a loan management application in which we


assume that a borrower can borrow up to three (3) items, we must
create a file with approximately the following structure

- Last Name
- First Name
- Address
- Book1
- Book2
- Book3
Problems posed by traditional
organizations: FMS

Programs that use such a file provide its description


within the program itself.
If this file is used by programs P1, P2, P3 and it needs to
be modified for the needs of P2 (for example, taking the
borrower's age into account!), P1 and P3 will also need
to be modified accordingly. This is because all the
programs see the file in the same way, even though
they do not all need the same information.
Problems posed by traditional
organizations: FMS

- Similarly, a change in the file organization on disk for the


needs of a program Pi (for example, switching from a
sequential organization to a direct organization to optimize
Pi’s access times) will force the other programs to take this
change into account and, in a way, follow Pi, even if they
do not really need this type of organization.
Problems posed by traditional
organizations: FMS

Similarly, a reorganization of the fields in the record


(changing the order of the fields within the record) will
result in modifications to the programs and a
reconstruction of the file on the storage medium.
Limitations of the file system approach
Redundant information
Ex. Financial institution
Address and telephone number of an employee x is stored (i) in the salary
system file and (ii) in the personnel management file
Painful update
Ex. Change of address (you have to change it everywhere)
Difficulty accessing data
A specific program is required for any new request for information.
Dependency between data and programs
Security: Data security and unauthorized access are not guaranteed.
Ex. Staff should not have access to the salary program.
Data integrity:
Ex. Give some example from ???
Data Bases

A database is a collection of data that is structured, organized and


stored in a storage medium.

A database is a structured collection of data that is organized to ensure


sufficient exhaustiveness, containing all necessary information for a
given system, while maintaining minimal redundancy through efficient
data modeling.
It allows for easy access, management, and retrieval of data while
optimizing storage, consistency, and performance.
Data Bases

The purpose of organizing data is that when we want to


extract certain data, the system must provide it quickly and
without errors.
Data Bases

A Database is mainly characterized by the sharing


of a single description of the data which can be
used by all programs. The latter is provided by
software called DBMS.
Data Bases: Objectives

Among the main objectives of a database, we can cite:

Information sharing
A database allows the sharing of a single set of information by
multiple users.

Organization of data independently of programs


To construct a set of non-redundant structured information that can
be shared by several users, it is necessary to ignore the processing
of this or that user (or program) to try to organize the information
according to their nature and the real links that exist between them.
Data Bases: Applications
Data Base Management System

The operation of a database requires the implementation of a computer


system commonly called: database management system

 A DBMS is software that allows the creation, manipulation and


storage of a database.

 A DBMS represents a coordinated set of software making it possible


to describe, store, manipulate, process and query the sets of data
constituting the base.
DBMS

PostgreSQL, MySQL, Oracle, Microsoft SQL Server, Sybase, Informix


DBMS: Objectives
1. Data Independency
- Physical Independence:
 Independence between data structures and storage structures,
 A DBMS allows data to be described in a logical way without
worrying about how this will be done physically in the files.
- Logical Independence:
 The same set of data can be seen differently by different users.
 All these personal visions (views) of data must be integrated into a
global vision.
2. Manipulations by non-IT specialists:
It is required to be able to access data without knowing how to program,
which implies using query languages.
DBMS: Objectives

3. Efficiency of data access:


 Used languages must make it possible to obtain answers to questions in a
“reasonable” time.
 They must therefore be optimized and minimize disk access.

4. Data consistency:
 The data is subject to a certain number of constraints and rules,
 It must be able to be expressed simply and checked automatically each time
data is inserted, modified or deleted, for example:
- A person's age greater than zero, salary > 0, etc.
- As soon as we try to enter a value that does not respect this constraint, the
DBMS refuses this value.
SGBD: Objectives

5. Centralized data administration


 Different views of data (among other things) are more easily resolved
if the data is administered in a central manner.
6. Data sharing
 Allow multiple users to access the same data at the same time. If this
problem is simple to resolve when it is only a question of queries and
when we are in a single-user context, this is no longer the case when it
is a question of modifications in a multi-user context.
So
- Allow two (or more) users to modify the same data “at the same time”
- Ensure a consistent query result for one user viewing a table while
another is modifying it.
DBMS: Objectives

7. Non-redundancy of data:

To avoid problems during updates, each piece of data


must only be present once in the database.

8. Data security:
Data must be able to be protected against
unauthorized access.
9. Fault resistance:
A DBMS must integrate recovery mechanisms after
failure (power outage for example)
Questions
Different types of DBMS users

It is therefore a question of seeing the different roles that an individual or


a group of individuals must play to design, create, implement and
operate a database.
The database administrator: He is responsible for describing the
entities in the database and indicating the connections existing between
these entities, using the DDL offered by the DBMS.
The application programmer: He is responsible for developing the
programs to use the database according to the description that was made
by the application administrator. The application programmer uses the
DML offered by the DBMS as well as other subprograms generally kept
in a library (i.e., subprogram library).
The user: This involves characterizing the person who simply uses the
database and who is commonly called the end user.
Different types of DBMS users

Example
In an airline ticket reservation agency, the person who types a few
commands on their terminal to make a reservation is a user in the same
way as a business manager who also requests from time to time from his
company's database a certain amount of information reflecting the state
of his company (unsold products, pending orders, etc.).
Levels of data description in a DBMS

Consider an ABC company which is made up of four departments:


- Purchases
- Sales
- Finance
- HR

All employees in their daily tasks use and manipulate data which is
stored in a database on the servers of this company using a DBMS.
This database contains data from the 4 departments.
Levels of data description in a DBMS

An important thing is that employees must only access the data that
concerns them. For example, a manager of the HR department must
only access HR data and must not have access to Finance department
data. Same thing which should only have access to financial data and
should not access HR data.

So, each user must only have access to part of the data and must only
view the tables that concern their function. This corresponds to the
external level of data.

We commonly distinguish three levels of description of a DB in a


DBMS:

1. Conceptual level
2. External level
3. Internal level
Levels of data description in a DBMS

External Schema

Describes how a user or program sees the data to which it has access.
View: subset of a diagrams
View1: HR data
View2: financial data
Levels of data description in a DBMS
Conceptual Schema

Describe in a formal and understandable manner the enterprise data that


will be used by its Information System.
There are four main classes of data models which are distinguished by the
nature of the associations that they allow to model. These are :
-Hierarchical models
-Network models
-Relational models
-Object models

 The conceptual diagram makes it possible to describe:


- Real-world objects.
- Properties of real-world objects
- Connections between objects
Levels of data description in a DBMS
Internal Schema

The internal schema defines the physical storage structure of the database.
The internal schema is a very low-level representation of the entire
database. It contains multiple occurrences of multiple internal record types.

- Describe the data as it is stored in the machine


- The storage space reserved for each piece of information
- The files containing the data and their location
- Representation of data in the form of bits
Relational DBMS
A database is made up of a set of tables. A table is
structured in rows and columns: the rows are the records,
and the columns are the fields or attributes.

Definition of a Relational Database Management System


A relational DBMS (RDBMS) is a DBMS whose database is organized in the form
of relational tables following the relational model.

RDBMS Example
ORACLE
SQL SERVER
MYSQL
Relational DBMS Architecture

Unlike hierarchical and network DBMSs, the relational approach unifies the
definition, manipulation and control functions of the database in a single
language (see SQL).
Main Functions of DBMS

A DBMS is a set of software allowing:


- The description of the data and the relationships concerning them,
- Querying the database,
- The update,
- Data sharing,
- Protection of database data.
- etc.
Main Functions of DBMS

Currently RDBMSs often use SQL (Structured Query


Language) to perform the main functions of a DBMS.

Data description
The DBMS offers a data description language (DDL) to describe data
(Type, Length, Nature, etc.), relationships between data, management
rules, value domains, etc.

This description is made according to a data model.


A data model is a set of concepts used to describe the structure of a
database. Most data models include operations for updating and querying
the database. The most used data model is the relational model
Main Functions of DBMS

Data Manipulation

Data Manipulation Language: The DBMS must be


equipped with a data manipulation language (DML)
allowing data insertion, deletion and modification
operations to be performed. It also allows data querying.
Main Functions of DBMS
Control (sharing, integrity, confidentiality, security)

Data sharing: access to the same information by several


users at the same time. The DBMS includes a concurrency
control mechanism based on data locking techniques (to
prevent, for example, information that is being updated from
being able to be read)
Data integrity through setting constraints on data. The
DBMS ensures that all constraints are checked each time data
is inserted, deleted, or modified.
Main Functions of DBMS

Confidentiality: several users can use a database at the same time,


the problem of data confidentiality arises. Rights must be managed
on the data, reading, updating, creation rights; ...which allow us to
refine.
(manage data access)

Security: a database is often vital to the functioning of an


organization, and it is not tolerable that a failure could call into
question its functioning in a durable manner. DBMSs provide
mechanisms to ensure this security.
Functional Architecture of a Relational DBMS
Functional Architecture of a Relational DBMS

Users interact with the database with SQL commands,


either by writing queries directly in an SQL interface or by
incorporating queries into an application.

The commands are evaluated in a query evaluation engine,


First they are parsed syntactically then an algebraic tree is
generated.
Functional Architecture of a Relational DBMS

The optimizer allows you to optimize the execution path of


the operations of a query (since the same query can have
several execution paths, the optimizer allows you to choose
the best one).
Functional Architecture of a Relational DBMS

The concurrent access manager module ensures concurrent


access of several users to the database and generates
access conflicts.

The recovery manager ensures the maintenance of a log of


the different instructions that execute on the DB to ensure
the recovery of a DB in the event of a failure.

The physical space manager generates the memory and


ensures data storage and access to this data.

You might also like