| COS'E' UNA BASE DI DATI | eng-ita

avatar

image.png

COS'E' UN DATO

Un dato rappresenta una singola unità di informazione...le informazioni invece rappresentano una caratteristica che appunto noi associamo ad un singolo dato, ossia il significato che gli viene attribuito;
Per estrarre queste informazioni si utilizza un processo abbastanza complesso che ora vedremo.

image.png

CHE COSA È UNA BASE DI DATI?

Una base di dati è una collezione di dati che vengono organizzati e memorizzati su supporti fissi all’interno di sistemi informatici;

Questi dati hanno delle proprietà, tra le più importanti abbiamo la Persistenza ovvero possibilità di recuperare dei dati nel tempo grazie a delle memorie che non cambiano nel tempo, questo ci garantisce più sicurezza, dopo di che abbiamo l’inconsistenza...consiste nell’organizzazione dei dati e delle informazioni in modo coerente e connesse fra di loro, Come ultima proprietà abbiamo l’Integrità, serve per la protezione a dei dati da eventuali modifiche da altri utenti o modifiche accidentali.

Per quanto riguarda le basi di dati invece, anche esso hanno delle proprietà...tra le più importanti abbiamo:

  • Scalabilità: ovvero la possibilità di aggiungere dati da memorizzare all’intero sistema senza dover modificare il tutto;

  • Sicurezza: tutelare i dati stessi e il loro accesso;

image.png

SCHEMI E ISTANZE

Lo scopo di una base di dati è quella di raccogliere dati riguardanti uno specifico aspetto della vita reale e di schematizzarlo attraverso uno specifico dominio;

Per rappresentare la realtà, le basi di dati utilizzano delle strutture specifiche i che schematizzano in modo semplificato i loro concetti.

Per rappresentare una base di dati si utilizzano due elementi, gli schemi servono appunto per rappresentare un concetto astratto di in una base, e le istanze che non sono altro che dati da associare gli schemi, quindi un elemento completa l’altro, vediamo un esempio.

MODELLI DI PROGETTAZIONE

Per la progettazione di una base di dati abbiamo a disposizione 4 modelli:

-Modello gerarchico: i concetti sono rappresentati attraverso una struttura ad albero

  • Modello reticolare: i concetti del mondo reale sono rappresentati attraverso un grafo
  • Modello relazionale: i concetti rappresentati attraverso IL DIAGRAMMA E/R (e sta per entità mentre r sta per relazione)
  • Modello a oggetti: i concetti del mondo reale sono rappresentati attraverso il concetto di classe

image.png

Una volta scelto il modello da rappresentare il nostro lavoro si divide i n 3 livelli, nel Livello concettuale si rappresentano i concetti della nostra base di dati con delle le relazioni mediante il diagramma E/R; dopo di che nel livello logico: si trasforma ogni concetto in schema e nel livello fisico si definiscono gli strumenti utilizzati per la creazione dei due livelli precedenti.

IL DIAGRAMMA E-R

Il diagramma E/R è uno schema grafico che ha lo scopo di rappresentare una base di dati,è formato da 3 elementi:

-Entità: oggetti da studiare;
-attributi: Proprietà degli oggetti trovati;
-associazioni: tipo di collegamento tra le varie entità;

All’interno degli attributi è presente un attributo che prende il nome di chiave primaria che ha lo scopo di rappresentare un'entità, ci permette di effettuare il collegamento tra più entità e deve essere obbligatoriamente diversa.

Le relazioni fra delle entità possono essere di più tipi:

-1:1 ->(UNO A UNO)

  • 1: N ->(UNO A MOLTI)
  • N:N ->(MOLTI A MOLTI)

image.png

In questo esercizio abbiamo 4 entità che sono impiegato, dipartimento, progetto e sede...e ogni entità ha degli attributi specifici che possiamo vedere...Se notate bene io ho messo ad ogni entità una chiave primaria diversa.




image.png

WHAT IS DATA

A piece of data represents a single unit of information...instead, information represents a characteristic that we associate with a single piece of data, i.e. the meaning attributed to it;
To extract this information, a fairly complex process is used, which we will now see.

image.png

WHAT IS A DATABASE?

A database is a collection of data that is organized and stored on fixed media within computer systems;

These data have properties, among the most important we have Persistence or the possibility of recovering data over time thanks to memories that do not change over time, this guarantees us more security, after which we have inconsistency ... it consists in organization of data and information in a coherent and connected way, as the last property we have Integrity, it is used to protect data from possible modifications by other users or accidental modifications.

As far as databases are concerned, they too have properties...among the most important we have:

  • Scalability: i.e. the possibility of adding data to be stored to the entire system without having to modify everything;

  • Security: protect the data themselves and their access;
    image.png

SCHEMAS AND INSTANCES

The purpose of a database is to collect data concerning a specific aspect of real life and to schematize it through a specific domain;

To represent reality, databases use specific structures which schematize their concepts in a simplified way.

To represent a database, two elements are used, the schemas serve precisely to represent an abstract concept of in a database, and the instances which are nothing more than data to be associated with the schemas, therefore one element completes the other, let's see an example .

DESIGN MODELS

For the design of a database we have 4 models available:

-Hierarchical model: the concepts are represented through a tree structure

  • Lattice model: real-world concepts are represented through a graph
  • Relational model: the concepts represented through THE E/R DIAGRAM (e stands for entity while r stands for relation)
  • Object model: real world concepts are represented through the concept of class

image.png

Once the model to be represented has been chosen, our work is divided into 3 levels, in the conceptual level the concepts of our database are represented with the relationships through the E/R diagram; after which in the logical level: each concept is transformed into a scheme and in the physical level the tools used for the creation of the two previous levels are defined.

THE E-R DIAGRAM

The E/R diagram is a graphic scheme that has the purpose of representing a database, it is made up of 3 elements:

-Entity: objects to study;
-attributes: Properties of found objects;
-associations: type of connection between the various entities;

Within the attributes there is an attribute that takes the name of primary key which has the purpose of representing an entity, allows us to make the connection between multiple entities and must necessarily be different.

The relationships between entities can be of several types:

-1:1 ->(ONE TO ONE)

  • 1: N ->(ONE TO MANY)
  • N:N ->(MANY TO MANY)

image.png

In this exercise we have 4 entities which are employee, department, project and headquarters...and each entity has specific attributes that we can see...If you notice correctly, I have given each entity a different primary key.



0
0
0.000
4 comments
avatar

Congratulations @fraaaaa! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You published more than 30 posts.
Your next target is to reach 40 posts.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out the last post from @hivebuzz:

HiveBuzz World Cup Contest - Quarterfinals - Recap of Day 2
HiveBuzz World Cup Contest - Quarterfinals - Recap of Day 1
Support the HiveBuzz project. Vote for our proposal!
0
0
0.000