SlideShare a Scribd company logo
Miquel Boada Artigas
Model E-R
Miquel Boada Artigas
Database design
What do we need? / Specifications
Conceptual model
Entity-Relationship(ER)
Relational model
Data definition language
Miquel Boada Artigas
Model ER - Elements
●
Entity sets/entities
●
Relationship sets/Relationship
●
Attributes
Miquel Boada Artigas
Entity
●
Object (concrete or abstract) distinguishable from other objects.
●
Example
–40232423, Artur Mas (concrete: particular person)
●
Example
–Vacances a la Costa Brava, des del 03/08/2015 fins el 21/08/2015. (abstract)
Miquel Boada Artigas
Entity sets
●
Set of entities of the same type
●
Examples: Workers, vehicles, buildings ...
●
Examples: Departments, Salaries, holidays ...
Miquel Boada Artigas
Identifiers
●
Distinguish one entity from another.
●
Entity identifiers perform this function.
Miquel Boada Artigas
Exercicis
●
Indica els conjunts d'entitats necessàries per a la gestió d'una botiga d'informàtica.
●
Indica els conjunts d'entitats necessàries per a la gestió del club de Handbol de
Granollers.
●
Indica els conjunts d'entitats necessàries per a la gestió d'un parking.
●
Indica els conjunts d'entitats necessàries per a la gestió d'un joc de rol (informàtic).
Miquel Boada Artigas
Attributes
Miquel Boada Artigas
Attributes
●
Describes a property or characterstic of an entity.
●
An entity set is composed by one or more attributes.
●
It's identified by a name.
●
Two attributes with the same name are not allowed in the same entity
set.
Miquel Boada Artigas
Attributes - Example
SSN, Name, Surname are attributes
Miquel Boada Artigas
Attributes domain
●
Allowed values.
●
Example:
–Attribute: «Week's day»
–Values: sunday, monday, tuesday ….
–Attribute «Age» (persona)
–Values: 0 .. 130.
Miquel Boada Artigas
NULL values
●
Special name for «unknown» value.
●
Space or zero is not NULL (space and zero is a known values).
●
Examples:
–Qualification: NULL. (No results yet).
–Final match result: NULL (Not started).
Miquel Boada Artigas
Derived attribute
●
His value can be obtained from other attributes or related entities.
●
Examples:
–Age → if an attribute «date of birth» exists.
–Matches won → can get this value from an entity set «results».
Miquel Boada Artigas
Composite attribute
●
An attribute is composite if we can divide it on some other attributes.
●
The model ER is clearer.
●
Example:
–Name (person): name , surname.
–Direction: city, address, number ...
–Temperature: value, units.
Miquel Boada Artigas
Attribute hierarchy
●
A composite attribute can be formed by other
composite attributes.
Direction
City
Postal code
Name
Address Number
Simple attributes
Composite attributes
Miquel Boada Artigas
Univalued / multivalued
●
Can store one value => univalued attribute.
●
Can store many values => multivalued attribute.
●
Examples univalued:
–Name, date of birth (person), model (vehicle) …
●
Examples multivalued:
–Telephone, colors (product), languages, ...
Miquel Boada Artigas
Fictitious attributes
●
They don't add any meaning to the entity.
●
They are used like fictious identifiers attributes
●
Their use is not recommended.
●
Their use is acceptable when an entity is identified for 4 or more attributes.
●
Their implementation is based on the use of autonumeric values (1, 2, 3, ….)
Miquel Boada Artigas
Relationship sets
Miquel Boada Artigas
Relationship
●
Is a correlation between two or more entities.
●
Examples
–Pau Pi is learning databases systems.
–Volkswagen is producing a new car model.
–Pau Pi has bought a HP 14z Laptop computer.
Miquel Boada Artigas
Relationship sets
●
Is a correlation between two or more entity sets.
●
Examples
–Teachers and students.
–Customers and invoices.
–Warehouses and articles.
Miquel Boada Artigas
Relationship sets type
●
1 to 1 (1:1)
●
1 to N (1:N)
●
N to 1 (N:1)
●
N to M (N:M)
Miquel Boada Artigas
Relationship sets type (1:1)
●
One entity can be related to only one entity, and viceversa.
●
It is not frequent.
●
Example:
–Country and president
a1
a2
a3
a4
...
an
Entity set A
b1
b2
b3
b4
...
bn
Entity set B
Miquel Boada Artigas
Relationship sets type (1:N) / (N:1)
●
One entity can be related to many entities.
●
(1:N/N:1) depends on the order of entities sets.
●
Example:
–Country and monuments
a1
a2
a3
a4
...
an
Entity set A
b1
b2
b3
b4
...
bn
Entity set B
(1:N)
a1
a2
a3
a4
...
an
Entity set A
b1
b2
b3
b4
...
bn
Entity set B
(N:1)
Miquel Boada Artigas
Relationship sets type (N:M)
●
One entity can be related to many entities and
viceversa.
●
Example:
–Films and actors
a1
a2
a3
a4
...
an
Entity set A
b1
b2
b3
b4
...
bn
Entity set B
Miquel Boada Artigas
Participation
●
Total: all entities are related with another entity.
●
Partial: there're any entities not realet with any entity.
–«A» has a total participation in «B».
–«B» has a partial participation in «A».
a1
a2
a3
a4
...
an
Entity set A
b1
b2
b3
b4
...
bn
Entity set B
Miquel Boada Artigas
Participation - Examples
●
Total
–Vehicle and insurance.
–Book and author.
●
Partial
–Students and companies.
–Workers and computers.
Miquel Boada Artigas
Degree
●
Number of entity sets involved in a relationship.
●
Examples:
–Team has players: binary relationship.
–Players commit fouls in a match: ternary relationship.
Miquel Boada Artigas
Cardinality
●
Cardinality: set a minimun and maximun value to the relationship.
–Basket player commits fouls in a match.
–Relationship set: commit.
–Relationship set type: 1:N (player-fouls)
–Minimun value: 0
–Maximun value: 5
–
Miquel Boada Artigas
Candidate key
●
An entity can be identified by using differents attributes.
●
All the attributes that identifies an entity is a candidate key.
●
Example:
–A worker could be identified by: SSN, NIF. Both attributes are
candidate.
Strong & weak entities
Miquel Boada Artigas
Weak Entities
●
The existence of a weak entity depends on the existence of an identifying entity type (strong entity).
●
A weak entity has a relationship set (1:N or N:1), where 1 is strong entity and N weak entity.
●
Examples:
–Course (strong) and course-offering (weak).
–Match (strong) and goals (weak).
–Customer (strong) and sales (weak).
Miquel Boada Artigas
Graphical representation
Entity set Rel. set
Weak
entity set
Identifying
rel. set
Entity set Rel. setEntity set Rel. set
Entity set Rel. set
Miquel Boada Artigas
Graphical representation
Atr1: Simple, univalued
Atr2: Simple, multivalued
Atr3: Derived (univalued)
Atr4: Key attribute
Atr5: Candidate key
Atr6: Composite
Miquel Boada Artigas
Graphical representation
Miquel Boada Artigas
Graphical representation
Model ER
Examples
Miquel Boada Artigas
Exemple 1
Es necessita dissenyar un model ER que permeti controlar quins mòduls i
unitats formatives fa cada alumne.
Cada mòdul s'identifica per un codi. Altra informació que conforma el mòdul és
el nom associat i el total d'hores de les unitats formatives que el conformen.
De cada unitat formativa s'emmagatzemarà el seu codi, el nom de la unitat
formativa i les hores que la componen.
Miquel Boada Artigas
Biblioteca
Es necessita un model ER per a controlar la gestió d'una
biblioteca. Els socis de la biblioteca poden agafar llibres per un
període determinat. Es vol saber quins llibres té cada soci.
El temps que es pot agafar cada un dels llibres deprendrà del
tipus de llibre.
Reflexive or recursive
relationship
Miquel Boada Artigas
Reflexive relationship
●
Two entities belonging to the same entity set can be related. When
this occurs , we have an reflexive relationship.
●
Examples:
–An employee is supervised by one manager
–A course requires previous courses.
Miquel Boada Artigas
Graphical representation
Ternary relationship sets
Miquel Boada Artigas
Ternary relationship sets
●
A ternary relationship occurs when 3 entity sets are
involved in a relationship.
●
The relationship sets type is set taking two entities
sets and determining the type respect the other one.
Miquel Boada Artigas
Example
SOME ENTITY SETS VALUES
Supplier Part Vehicle
Michelin Wheel Volkswagen
Firestone Motor Renault
Electronic Motors Ford
Tesla Motors
Donada una peça (ex.: roda) i un proveïdor,
es pot suministrar a molts vehicles?
Resposta sí: Supplier/Part → tipus relació N
Miquel Boada Artigas
Example
SOME ENTITY SETS VALUES
Supplier Part Vehicle
Michelin Wheel Volkswagen
Firestone Motor Renault
Electronic Motors Ford
Tesla Motors
Donat un tipus de vehicle i una peça, aquesta
pot ser suministrada per molts proveïdors?
Resposta sí: Vehicle/Part → tipus relació M
N
Miquel Boada Artigas
Example
SOME ENTITY SETS VALUES
Supplier Part Vehicle
Michelin Wheel Volkswagen
Firestone Motor Renault
Electronic Motors Ford
Tesla Motors
Un proveïdor pot suministrar moltes peces per un tiNM
Resposta sí: Vehicle/Supplier → tipus relació P
NM
P
M:N:P
Model ER Extended
Miquel Boada Artigas
Generalization / Specialization
●
Two or more entity sets combines to form a higher level entity sets (generalization)
●
1 entity sets breaks in 2 or more entity sets to form a lower level entity sets
(specialization)
●
Examples:
–An entity sets teacher and student combines to form an entity sets Person (generalization)
–An entity sets vehicle breaks in different entity sets: car, truck, bus ... (specialization)
Miquel Boada Artigas
Generalization / Specialization
●
The attributes of the higher entity sets are inherited to the lower
level entity sets.
●
Each lower level entity sets has they own attribute sets.
–Example: dni is an attribute for person entity sets, while average
qualification is an attribute for student entity sets.
Miquel Boada Artigas
Basic graphical representation
Miquel Boada Artigas
Generalization / Specialization
●
Any entity sets can be related with any other
entity set.
Miquel Boada Artigas
Projectes
Es necessita un model ER per a controlar els projectes d'una empresa. Cada projecte està associat a un tipus (nous
productes, informàtica,...). Cada tipus de projecte té associat a un responsable, que serà l'encarregat de vetllar pel
bon funcionament de tots els projectes associats al tipus en concret. Apart del cap de projectes, a cada projecte hi
estan assignades una sèrie de persones. Una persona pot treballar en varis projectes al mateix temps.
Apart des recursos humans, per a cada un dels projectes es necessiten una sèrie de materials. Cada material
s'identifica per un codi. Un material només es podrà utilitzar en un projecte. Altra informació que es vol
emmagatzemar del material és la quantitat i el preu unitari.
De cada projecte és important saber el total de persones que té associades i el cost del material del mateix.

More Related Content

Viewers also liked

Weak and strong forms
Weak and strong formsWeak and strong forms
Weak and strong formsSandy Millin
 
English Phonology
English PhonologyEnglish Phonology
English Phonology
Videoconferencias UTPL
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
sadeenedian08
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
Zaheer Soomro
 
Most common weak forms in english
Most common weak forms in englishMost common weak forms in english
Most common weak forms in englishIbrahem Abdel Ghany
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Typesaakanksha s
 
Connected Speech - Weak forms
Connected Speech - Weak formsConnected Speech - Weak forms
Connected Speech - Weak forms
Jo Gakonga
 
Chapter 7 strong and weak forms
Chapter 7 strong and weak formsChapter 7 strong and weak forms
Chapter 7 strong and weak formsMarta Łopion
 
Descriptions
DescriptionsDescriptions
Descriptions
ERIKASIGRID
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
maryeem
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Shakila Mahjabin
 
Data base management system
Data base management systemData base management system
Data base management systemNavneet Jingar
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
12 u6-future jobs-part e-2
12 u6-future jobs-part e-212 u6-future jobs-part e-2
12 u6-future jobs-part e-2
lunemo
 
Analyzing Types of Bilingual Education
Analyzing Types of Bilingual EducationAnalyzing Types of Bilingual Education
Analyzing Types of Bilingual Education
Steve McCarty
 

Viewers also liked (17)

Weak and strong forms
Weak and strong formsWeak and strong forms
Weak and strong forms
 
English Phonology
English PhonologyEnglish Phonology
English Phonology
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
 
Most common weak forms in english
Most common weak forms in englishMost common weak forms in english
Most common weak forms in english
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Types
 
Connected Speech - Weak forms
Connected Speech - Weak formsConnected Speech - Weak forms
Connected Speech - Weak forms
 
Chapter 7 strong and weak forms
Chapter 7 strong and weak formsChapter 7 strong and weak forms
Chapter 7 strong and weak forms
 
Descriptions
DescriptionsDescriptions
Descriptions
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Data base management system
Data base management systemData base management system
Data base management system
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
12 u6-future jobs-part e-2
12 u6-future jobs-part e-212 u6-future jobs-part e-2
12 u6-future jobs-part e-2
 
Analyzing Types of Bilingual Education
Analyzing Types of Bilingual EducationAnalyzing Types of Bilingual Education
Analyzing Types of Bilingual Education
 
Weak,Strong Syllables
Weak,Strong SyllablesWeak,Strong Syllables
Weak,Strong Syllables
 

More from Miquel Boada Artigas

Configuracio servei dns_linux
Configuracio servei dns_linuxConfiguracio servei dns_linux
Configuracio servei dns_linux
Miquel Boada Artigas
 
Configuracio servei dns Windows
Configuracio servei dns WindowsConfiguracio servei dns Windows
Configuracio servei dns Windows
Miquel Boada Artigas
 
Configuració d'un sistema d'auditoria amb Windows Server
Configuració d'un sistema d'auditoria amb Windows ServerConfiguració d'un sistema d'auditoria amb Windows Server
Configuració d'un sistema d'auditoria amb Windows Server
Miquel Boada Artigas
 
Monitorització en sistemes informàtics. Windows i Linux.
Monitorització en sistemes informàtics. Windows i Linux.Monitorització en sistemes informàtics. Windows i Linux.
Monitorització en sistemes informàtics. Windows i Linux.
Miquel Boada Artigas
 
LLenguatge SQL. Consultes utilitzant having
LLenguatge SQL. Consultes utilitzant havingLLenguatge SQL. Consultes utilitzant having
LLenguatge SQL. Consultes utilitzant having
Miquel Boada Artigas
 
LLenguatge SQL. Consultes amb agrupació de files.
LLenguatge SQL. Consultes amb agrupació de files. LLenguatge SQL. Consultes amb agrupació de files.
LLenguatge SQL. Consultes amb agrupació de files.
Miquel Boada Artigas
 
Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...
Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...
Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...
Miquel Boada Artigas
 
Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...
Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...
Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...
Miquel Boada Artigas
 
Creació de taules amb integritat referencial.
Creació de taules amb integritat referencial.Creació de taules amb integritat referencial.
Creació de taules amb integritat referencial.
Miquel Boada Artigas
 
Creació de base de dades utilitzant llenguatge SQL.
Creació de base de dades utilitzant llenguatge SQL.Creació de base de dades utilitzant llenguatge SQL.
Creació de base de dades utilitzant llenguatge SQL.
Miquel Boada Artigas
 
Tema 01 - Creació de taules amb SQL.
Tema 01 - Creació de taules amb SQL.Tema 01 - Creació de taules amb SQL.
Tema 01 - Creació de taules amb SQL.
Miquel Boada Artigas
 
Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...
Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...
Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...
Miquel Boada Artigas
 
Model relacional i normalització
Model relacional i normalitzacióModel relacional i normalització
Model relacional i normalització
Miquel Boada Artigas
 
Transformació model entitat-relació al model relacional
Transformació model entitat-relació al model relacionalTransformació model entitat-relació al model relacional
Transformació model entitat-relació al model relacional
Miquel Boada Artigas
 
Model entitat relació extès (Extended Entity Relationship)
Model entitat relació extès (Extended Entity Relationship)Model entitat relació extès (Extended Entity Relationship)
Model entitat relació extès (Extended Entity Relationship)
Miquel Boada Artigas
 
Model entitat relació (ER)
Model entitat relació (ER)Model entitat relació (ER)
Model entitat relació (ER)
Miquel Boada Artigas
 
Introducció bases de dades distribuides
Introducció bases de dades distribuidesIntroducció bases de dades distribuides
Introducció bases de dades distribuides
Miquel Boada Artigas
 
Introducció bases de dades centralitzades
Introducció bases de dades centralitzadesIntroducció bases de dades centralitzades
Introducció bases de dades centralitzades
Miquel Boada Artigas
 
Sistemes gestors de bases de dades
Sistemes gestors de bases de dadesSistemes gestors de bases de dades
Sistemes gestors de bases de dades
Miquel Boada Artigas
 
Emmagatzematge de la informació
Emmagatzematge de la informacióEmmagatzematge de la informació
Emmagatzematge de la informació
Miquel Boada Artigas
 

More from Miquel Boada Artigas (20)

Configuracio servei dns_linux
Configuracio servei dns_linuxConfiguracio servei dns_linux
Configuracio servei dns_linux
 
Configuracio servei dns Windows
Configuracio servei dns WindowsConfiguracio servei dns Windows
Configuracio servei dns Windows
 
Configuració d'un sistema d'auditoria amb Windows Server
Configuració d'un sistema d'auditoria amb Windows ServerConfiguració d'un sistema d'auditoria amb Windows Server
Configuració d'un sistema d'auditoria amb Windows Server
 
Monitorització en sistemes informàtics. Windows i Linux.
Monitorització en sistemes informàtics. Windows i Linux.Monitorització en sistemes informàtics. Windows i Linux.
Monitorització en sistemes informàtics. Windows i Linux.
 
LLenguatge SQL. Consultes utilitzant having
LLenguatge SQL. Consultes utilitzant havingLLenguatge SQL. Consultes utilitzant having
LLenguatge SQL. Consultes utilitzant having
 
LLenguatge SQL. Consultes amb agrupació de files.
LLenguatge SQL. Consultes amb agrupació de files. LLenguatge SQL. Consultes amb agrupació de files.
LLenguatge SQL. Consultes amb agrupació de files.
 
Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...
Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...
Consultes amb múltiples taules utilitzant left, right i inner join. Funcionam...
 
Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...
Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...
Consultes simples mitjançant llenguatge SQL. Filtres, ordenació i aplicació d...
 
Creació de taules amb integritat referencial.
Creació de taules amb integritat referencial.Creació de taules amb integritat referencial.
Creació de taules amb integritat referencial.
 
Creació de base de dades utilitzant llenguatge SQL.
Creació de base de dades utilitzant llenguatge SQL.Creació de base de dades utilitzant llenguatge SQL.
Creació de base de dades utilitzant llenguatge SQL.
 
Tema 01 - Creació de taules amb SQL.
Tema 01 - Creació de taules amb SQL.Tema 01 - Creació de taules amb SQL.
Tema 01 - Creació de taules amb SQL.
 
Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...
Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...
Instal·lació MySQL Server i Workbench. Creació de base de dades. Tipus de dad...
 
Model relacional i normalització
Model relacional i normalitzacióModel relacional i normalització
Model relacional i normalització
 
Transformació model entitat-relació al model relacional
Transformació model entitat-relació al model relacionalTransformació model entitat-relació al model relacional
Transformació model entitat-relació al model relacional
 
Model entitat relació extès (Extended Entity Relationship)
Model entitat relació extès (Extended Entity Relationship)Model entitat relació extès (Extended Entity Relationship)
Model entitat relació extès (Extended Entity Relationship)
 
Model entitat relació (ER)
Model entitat relació (ER)Model entitat relació (ER)
Model entitat relació (ER)
 
Introducció bases de dades distribuides
Introducció bases de dades distribuidesIntroducció bases de dades distribuides
Introducció bases de dades distribuides
 
Introducció bases de dades centralitzades
Introducció bases de dades centralitzadesIntroducció bases de dades centralitzades
Introducció bases de dades centralitzades
 
Sistemes gestors de bases de dades
Sistemes gestors de bases de dadesSistemes gestors de bases de dades
Sistemes gestors de bases de dades
 
Emmagatzematge de la informació
Emmagatzematge de la informacióEmmagatzematge de la informació
Emmagatzematge de la informació
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

Entity-Relationship Model - Model Entitat Relació (ER)

  • 2. Miquel Boada Artigas Database design What do we need? / Specifications Conceptual model Entity-Relationship(ER) Relational model Data definition language
  • 3. Miquel Boada Artigas Model ER - Elements ● Entity sets/entities ● Relationship sets/Relationship ● Attributes
  • 4. Miquel Boada Artigas Entity ● Object (concrete or abstract) distinguishable from other objects. ● Example –40232423, Artur Mas (concrete: particular person) ● Example –Vacances a la Costa Brava, des del 03/08/2015 fins el 21/08/2015. (abstract)
  • 5. Miquel Boada Artigas Entity sets ● Set of entities of the same type ● Examples: Workers, vehicles, buildings ... ● Examples: Departments, Salaries, holidays ...
  • 6. Miquel Boada Artigas Identifiers ● Distinguish one entity from another. ● Entity identifiers perform this function.
  • 7. Miquel Boada Artigas Exercicis ● Indica els conjunts d'entitats necessàries per a la gestió d'una botiga d'informàtica. ● Indica els conjunts d'entitats necessàries per a la gestió del club de Handbol de Granollers. ● Indica els conjunts d'entitats necessàries per a la gestió d'un parking. ● Indica els conjunts d'entitats necessàries per a la gestió d'un joc de rol (informàtic).
  • 9. Miquel Boada Artigas Attributes ● Describes a property or characterstic of an entity. ● An entity set is composed by one or more attributes. ● It's identified by a name. ● Two attributes with the same name are not allowed in the same entity set.
  • 10. Miquel Boada Artigas Attributes - Example SSN, Name, Surname are attributes
  • 11. Miquel Boada Artigas Attributes domain ● Allowed values. ● Example: –Attribute: «Week's day» –Values: sunday, monday, tuesday …. –Attribute «Age» (persona) –Values: 0 .. 130.
  • 12. Miquel Boada Artigas NULL values ● Special name for «unknown» value. ● Space or zero is not NULL (space and zero is a known values). ● Examples: –Qualification: NULL. (No results yet). –Final match result: NULL (Not started).
  • 13. Miquel Boada Artigas Derived attribute ● His value can be obtained from other attributes or related entities. ● Examples: –Age → if an attribute «date of birth» exists. –Matches won → can get this value from an entity set «results».
  • 14. Miquel Boada Artigas Composite attribute ● An attribute is composite if we can divide it on some other attributes. ● The model ER is clearer. ● Example: –Name (person): name , surname. –Direction: city, address, number ... –Temperature: value, units.
  • 15. Miquel Boada Artigas Attribute hierarchy ● A composite attribute can be formed by other composite attributes. Direction City Postal code Name Address Number Simple attributes Composite attributes
  • 16. Miquel Boada Artigas Univalued / multivalued ● Can store one value => univalued attribute. ● Can store many values => multivalued attribute. ● Examples univalued: –Name, date of birth (person), model (vehicle) … ● Examples multivalued: –Telephone, colors (product), languages, ...
  • 17. Miquel Boada Artigas Fictitious attributes ● They don't add any meaning to the entity. ● They are used like fictious identifiers attributes ● Their use is not recommended. ● Their use is acceptable when an entity is identified for 4 or more attributes. ● Their implementation is based on the use of autonumeric values (1, 2, 3, ….)
  • 19. Miquel Boada Artigas Relationship ● Is a correlation between two or more entities. ● Examples –Pau Pi is learning databases systems. –Volkswagen is producing a new car model. –Pau Pi has bought a HP 14z Laptop computer.
  • 20. Miquel Boada Artigas Relationship sets ● Is a correlation between two or more entity sets. ● Examples –Teachers and students. –Customers and invoices. –Warehouses and articles.
  • 21. Miquel Boada Artigas Relationship sets type ● 1 to 1 (1:1) ● 1 to N (1:N) ● N to 1 (N:1) ● N to M (N:M)
  • 22. Miquel Boada Artigas Relationship sets type (1:1) ● One entity can be related to only one entity, and viceversa. ● It is not frequent. ● Example: –Country and president a1 a2 a3 a4 ... an Entity set A b1 b2 b3 b4 ... bn Entity set B
  • 23. Miquel Boada Artigas Relationship sets type (1:N) / (N:1) ● One entity can be related to many entities. ● (1:N/N:1) depends on the order of entities sets. ● Example: –Country and monuments a1 a2 a3 a4 ... an Entity set A b1 b2 b3 b4 ... bn Entity set B (1:N) a1 a2 a3 a4 ... an Entity set A b1 b2 b3 b4 ... bn Entity set B (N:1)
  • 24. Miquel Boada Artigas Relationship sets type (N:M) ● One entity can be related to many entities and viceversa. ● Example: –Films and actors a1 a2 a3 a4 ... an Entity set A b1 b2 b3 b4 ... bn Entity set B
  • 25. Miquel Boada Artigas Participation ● Total: all entities are related with another entity. ● Partial: there're any entities not realet with any entity. –«A» has a total participation in «B». –«B» has a partial participation in «A». a1 a2 a3 a4 ... an Entity set A b1 b2 b3 b4 ... bn Entity set B
  • 26. Miquel Boada Artigas Participation - Examples ● Total –Vehicle and insurance. –Book and author. ● Partial –Students and companies. –Workers and computers.
  • 27. Miquel Boada Artigas Degree ● Number of entity sets involved in a relationship. ● Examples: –Team has players: binary relationship. –Players commit fouls in a match: ternary relationship.
  • 28. Miquel Boada Artigas Cardinality ● Cardinality: set a minimun and maximun value to the relationship. –Basket player commits fouls in a match. –Relationship set: commit. –Relationship set type: 1:N (player-fouls) –Minimun value: 0 –Maximun value: 5 –
  • 29. Miquel Boada Artigas Candidate key ● An entity can be identified by using differents attributes. ● All the attributes that identifies an entity is a candidate key. ● Example: –A worker could be identified by: SSN, NIF. Both attributes are candidate.
  • 30. Strong & weak entities
  • 31. Miquel Boada Artigas Weak Entities ● The existence of a weak entity depends on the existence of an identifying entity type (strong entity). ● A weak entity has a relationship set (1:N or N:1), where 1 is strong entity and N weak entity. ● Examples: –Course (strong) and course-offering (weak). –Match (strong) and goals (weak). –Customer (strong) and sales (weak).
  • 32. Miquel Boada Artigas Graphical representation Entity set Rel. set Weak entity set Identifying rel. set Entity set Rel. setEntity set Rel. set Entity set Rel. set
  • 33. Miquel Boada Artigas Graphical representation Atr1: Simple, univalued Atr2: Simple, multivalued Atr3: Derived (univalued) Atr4: Key attribute Atr5: Candidate key Atr6: Composite
  • 37. Miquel Boada Artigas Exemple 1 Es necessita dissenyar un model ER que permeti controlar quins mòduls i unitats formatives fa cada alumne. Cada mòdul s'identifica per un codi. Altra informació que conforma el mòdul és el nom associat i el total d'hores de les unitats formatives que el conformen. De cada unitat formativa s'emmagatzemarà el seu codi, el nom de la unitat formativa i les hores que la componen.
  • 38. Miquel Boada Artigas Biblioteca Es necessita un model ER per a controlar la gestió d'una biblioteca. Els socis de la biblioteca poden agafar llibres per un període determinat. Es vol saber quins llibres té cada soci. El temps que es pot agafar cada un dels llibres deprendrà del tipus de llibre.
  • 40. Miquel Boada Artigas Reflexive relationship ● Two entities belonging to the same entity set can be related. When this occurs , we have an reflexive relationship. ● Examples: –An employee is supervised by one manager –A course requires previous courses.
  • 43. Miquel Boada Artigas Ternary relationship sets ● A ternary relationship occurs when 3 entity sets are involved in a relationship. ● The relationship sets type is set taking two entities sets and determining the type respect the other one.
  • 44. Miquel Boada Artigas Example SOME ENTITY SETS VALUES Supplier Part Vehicle Michelin Wheel Volkswagen Firestone Motor Renault Electronic Motors Ford Tesla Motors Donada una peça (ex.: roda) i un proveïdor, es pot suministrar a molts vehicles? Resposta sí: Supplier/Part → tipus relació N
  • 45. Miquel Boada Artigas Example SOME ENTITY SETS VALUES Supplier Part Vehicle Michelin Wheel Volkswagen Firestone Motor Renault Electronic Motors Ford Tesla Motors Donat un tipus de vehicle i una peça, aquesta pot ser suministrada per molts proveïdors? Resposta sí: Vehicle/Part → tipus relació M N
  • 46. Miquel Boada Artigas Example SOME ENTITY SETS VALUES Supplier Part Vehicle Michelin Wheel Volkswagen Firestone Motor Renault Electronic Motors Ford Tesla Motors Un proveïdor pot suministrar moltes peces per un tiNM Resposta sí: Vehicle/Supplier → tipus relació P NM P M:N:P
  • 48. Miquel Boada Artigas Generalization / Specialization ● Two or more entity sets combines to form a higher level entity sets (generalization) ● 1 entity sets breaks in 2 or more entity sets to form a lower level entity sets (specialization) ● Examples: –An entity sets teacher and student combines to form an entity sets Person (generalization) –An entity sets vehicle breaks in different entity sets: car, truck, bus ... (specialization)
  • 49. Miquel Boada Artigas Generalization / Specialization ● The attributes of the higher entity sets are inherited to the lower level entity sets. ● Each lower level entity sets has they own attribute sets. –Example: dni is an attribute for person entity sets, while average qualification is an attribute for student entity sets.
  • 50. Miquel Boada Artigas Basic graphical representation
  • 51. Miquel Boada Artigas Generalization / Specialization ● Any entity sets can be related with any other entity set.
  • 52. Miquel Boada Artigas Projectes Es necessita un model ER per a controlar els projectes d'una empresa. Cada projecte està associat a un tipus (nous productes, informàtica,...). Cada tipus de projecte té associat a un responsable, que serà l'encarregat de vetllar pel bon funcionament de tots els projectes associats al tipus en concret. Apart del cap de projectes, a cada projecte hi estan assignades una sèrie de persones. Una persona pot treballar en varis projectes al mateix temps. Apart des recursos humans, per a cada un dels projectes es necessiten una sèrie de materials. Cada material s'identifica per un codi. Un material només es podrà utilitzar en un projecte. Altra informació que es vol emmagatzemar del material és la quantitat i el preu unitari. De cada projecte és important saber el total de persones que té associades i el cost del material del mateix.