Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro...
Transcript of Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro...
![Page 1: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/1.jpg)
Entity-Relationship Diagrams and FOL
Alessandro Artale
Free University of Bozen-BolzanoFaculty of Computer Sciencehttp://www.inf.unibz.it/˜artale
Descrete Mathematics and Logic — BSc course
Thanks to Prof. Enrico Franconi for provoding the slides
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 2: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/2.jpg)
What is a Conceptual Schema
A conceptual schema is a formal conceptualisation of theworld.A conceptual schema specifies a set of constraints, whichdeclare what should necessarily hold in any possibledatabase.Given a conceptual schema, a legal database is a databasesatisfying the constraints.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 3: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/3.jpg)
The Architecture of a Database
DeductionIntegrity Constraints
QueryResult
Database
LogicalSchema
ConceptualSchema
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 4: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/4.jpg)
Entity-Relationship Diagram
Employee
PaySlipNumber(Integer)Salary(Integer)
Project
ProjectCode(String)Manager
TopManagerAreaManager
×
Works-for
Manages
(1,n)
(1,1)(1,1)
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 5: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/5.jpg)
UML Class Diagram
AreaManager TopManager
Manager ProjectProjectCode:String
EmployeePaySlipNumber:IntegerSalary:Integer
disjoint,complete
1..⋆
Works-for
1..1
1..1
Manages
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 6: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/6.jpg)
Meaning of Basic ConstructsIn a specific legal database:
An entity is a set of abstract instances;a n-ary relationship is a set of n-tuple of abstract instances;an attribute is a set of pairs of an abstract instance and a concretedomain element.
Works-for
Employee Project String
ProjectCode
E1
E2
E3
E4
E5
P1
P2
P3
“P12a"“P02b"
“P2a/1"
“P9"
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 7: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/7.jpg)
Meaning of Basic ConstructsIn a specific legal database:
An entity is a set of abstract instances;a n-ary relationship is a set of n-tuple of abstract instances;an attribute is a set of pairs of an abstract instance and a concretedomain element.
Works-forEmployee Project String
ProjectCode
E1
E2
E3
E4
E5
P1
P2
P3
“P12a"“P02b"
“P2a/1"
“P9"
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 8: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/8.jpg)
Meaning of Basic ConstructsIn a specific legal database:
An entity is a set of abstract instances;a n-ary relationship is a set of n-tuple of abstract instances;an attribute is a set of pairs of an abstract instance and a concretedomain element.
Works-forEmployee Project String
ProjectCode
E1
E2
E3
E4
E5
P1
P2
P3
“P12a"“P02b"
“P2a/1"
“P9"
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 9: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/9.jpg)
Concrete Values Vs. Abstract Instances
To distinguish between concrete and abstract values we partitionthe interpretation domain:
∆ = Ω ∪ ∆D , whereΩ is the set of abstract instances, andD is the set of concrete values, i.e., D = Int ∪ String ∪ . . .
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 10: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/10.jpg)
Relations as Sets of Tuples
E1
E2
E3
E4
E5
P1
P2
P3
⟨E1 ,P1⟩⟨E2 ,P1⟩
⟨E2 ,P2⟩⟨E2 ,P3⟩
⟨E3 ,P1⟩⟨E4 ,P2⟩
⟨E4 ,P3⟩⟨E5 ,P3⟩
Employee Project Works-for
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 11: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/11.jpg)
The Relational Representation
EmployeeemployeeId
E1E2E3E4E5
ProjectprojectId
P1P2P3
Stringanystring
“P12a”“P02b”“P2a/1”
“P9”· · ·
Works-foremployeeId projectId
E1 P1E2 P1E2 P2E2 P3E3 P1E4 P2E4 P3E5 P3
ProjectCodeprojectId pcode
P1 “P12a”P2 “P02b”P3 “P2a/1”
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 12: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/12.jpg)
Meaning of Relationships
Employee Project
A1
Works-for
A2
Works-for ⊆ Employee × Project
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 13: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/13.jpg)
Meaning of Relationships
Employee Project
A1
Works-for
A2
Works-for ⊆ Employee × Project
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 14: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/14.jpg)
Meaning of Relationships
Employee ProjectA1 Works-for A2
Works-for ⊆ Employee × Project
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 15: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/15.jpg)
Meaning of Attributes
An Attribute models a local concrete property of a Class.It is characterized by:
a name (which is unique only in the class it belongs to)a type (a set of possible concrete values, e.g., integer, string,etc.)and possibly a multiplicity (usually it is mandatory).
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 16: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/16.jpg)
Meaning of Attributes (Cont.)
Project
ProjectCode(String)
Project ⊆ e ∈ Ω | ♯ProjectCode ∩ (e × String)≥ 1ProjectCode ∩ (Project × D ) ⊆ Project × D D
Note 1. The notation ♯. . . means the cardinality of the set.Note 2. The same attribute can be used in many entitiespossibly with a different range.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 17: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/17.jpg)
Meaning of Cardinality Constraints
TopManager Project
A1
Manages
A2
(min,max)
TopManager ⊆ e ∈ Ω | max ≥ ♯Manages ∩ (e × Ω) ≥ min
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 18: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/18.jpg)
Meaning of Cardinality Constraints
TopManager ProjectA1 Manages A2(min,max)
TopManager ⊆ e ∈ Ω | max ≥ ♯Manages ∩ (e × Ω) ≥ min
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 19: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/19.jpg)
Meaning of ISA
Employee
Manager
Manager ⊆ Employee
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 20: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/20.jpg)
Meaning of disjoint and total Constraints
Manager
TopManager AreaManager
×
ISA: AreaManager ⊆ ManagerISA: TopManager ⊆ Managerdisjoint: AreaManager ∩ TopManager = ∅total: Manager ⊆ AreaManager ∪ TopManager
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 21: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/21.jpg)
Meaning of disjoint and total Constraints
Manager
TopManager AreaManager
×
ISA: AreaManager ⊆ ManagerISA: TopManager ⊆ Managerdisjoint: AreaManager ∩ TopManager = ∅total: Manager ⊆ AreaManager ∪ TopManager
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 22: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/22.jpg)
Meaning of the initial diagram
Works-for ⊆ Employee × ProjectManages ⊆ TopManager × ProjectEmployee ⊆ e ∈ Ω | ♯PaySlipNumber ∩ (e × Integer) ≥ 1Employee ⊆ e ∈ Ω | ♯Salary ∩ (e × Integer) ≥ 1Project ⊆ e ∈ Ω | ♯ProjectCode ∩ (e × String) ≥ 1TopManager ⊆ e ∈ Ω | 1 ≥ ♯Manages ∩ (e × Ω) ≥ 1Project ⊆ e ∈ Ω | 1 ≥ ♯Manages ∩ (Ω × e) ≥ 1Project ⊆ e ∈ Ω | ♯Works-for ∩ (Ω × e) ≥ 1Manager ⊆ EmployeeAreaManager ⊆ ManagerTopManager ⊆ ManagerAreaManager ∩ TopManager = ∅Manager ⊆ AreaManager ∪ TopManager
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 23: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/23.jpg)
Inferences
Given a collection of constraints, such as an Entity-Relationshipdiagram, it is possible that additional constraints can be inferred.
An entity is inconsistent/unsatisfiable if it denotes the emptyset in any legal database.An entity is a sub-entity of another entity if the formerdenotes a subset of the set denoted by the latter in anylegal database.Two entities are equivalent if they denote the same set inany legal database.A stricter contraint is inferred – e.g., a cardinality contraint– if it holds in in any legal database.. . .
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 24: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/24.jpg)
Inferences (cont.)
Person
Italian English
Lazy LatinLover Gentleman Hooligan
×
×
ImpliesLatinLover = ∅ Then, LatinLover is an inconsistent entity.Italian ⊆ Lazy Then, Italian is a sub-entity of Lazy.Italian ≡ Lazy Then, Italian and Lazy are equivalent entities.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 25: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/25.jpg)
Inferences (cont.)
Person
Italian English
Lazy LatinLover Gentleman Hooligan
×
×
ImpliesLatinLover = ∅ Then, LatinLover is an inconsistent entity.Italian ⊆ Lazy Then, Italian is a sub-entity of Lazy.Italian ≡ Lazy Then, Italian and Lazy are equivalent entities.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 26: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/26.jpg)
Inferences: Reasoning by cases
Italian
Lazy Mafioso LatinLover ItalianProf
×
disjoint
ImpliesItalianProf ⊆ LatinLover Then, ItalianProf is a sub-entity ofLatinLover.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 27: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/27.jpg)
Inferences: Reasoning by cases
Italian
Lazy Mafioso LatinLover ItalianProf
×
disjoint
ImpliesItalianProf ⊆ LatinLover Then, ItalianProf is a sub-entity ofLatinLover.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 28: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/28.jpg)
Inferences: ISA and Inheritance
Employee
Manager
Salary(Integer)
Salary(Integer)
ImpliesManager ⊆ e ∈ Ω | ♯Salary ∩ (e × Integer) ≥ 1
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 29: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/29.jpg)
Inferences: ISA and Inheritance
Employee
Manager
Salary(Integer)
Salary(Integer)
ImpliesManager ⊆ e ∈ Ω | ♯Salary ∩ (e × Integer) ≥ 1
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 30: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/30.jpg)
Bijection bewteen Entities
Natural Number
Even Number
rel
(1,1)
(1,1)
ImpliesSince rel is a one-to-one correspondence, then:“the entities ’Natural Number’ and ’Even Number’ contain thesame number of instances”.If the domain is finite: Natural Number ≡ Even Number
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 31: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/31.jpg)
Bijection bewteen Entities
Natural Number
Even Number
rel
(1,1)
(1,1)
ImpliesSince rel is a one-to-one correspondence, then:“the entities ’Natural Number’ and ’Even Number’ contain thesame number of instances”.
If the domain is finite: Natural Number ≡ Even Number
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 32: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/32.jpg)
Bijection bewteen Entities
Natural Number
Even Number
rel
(1,1)
(1,1)
ImpliesSince rel is a one-to-one correspondence, then:“the entities ’Natural Number’ and ’Even Number’ contain thesame number of instances”.If the domain is finite: Natural Number ≡ Even Number
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 33: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/33.jpg)
Infinite Databases
Root
Node
link
(2,2)
(0,1)
Implies“the classes Root and Node contain an infinite number ofinstances”.Note. If we admit just finite databases the above ER schema isunsatisfiable.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 34: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/34.jpg)
Infinite Databases
Root
Node
link
(2,2)
(0,1)
Implies“the classes Root and Node contain an infinite number ofinstances”.Note. If we admit just finite databases the above ER schema isunsatisfiable.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 35: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/35.jpg)
ER to FOL: Motivations
Show how a Conceptual Data Model can be mapped to a logicalformalism.
Advantages:
A clear semantics for the various ER constructsAbility to express complex integrity constraintsAvailability of decision procedures for consistency andlogical implication in the data model.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 36: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/36.jpg)
Entity-Relationship and First Order Logic
Entity-Relationship is a visual language to specify a set ofconstraints that should be satisfied by the relationaldatabase realising the ER diagram.The interpretation of an ER diagram is defined as thecollection of all the legal databases – i.e., all the (finite)relational structures which conform to the constraintsimposed by the conceptual schema.An ER diagram is mapped into a set of closed First OrderLogic (FOL) formulas in such a way that the mappingpreserves the semantics of the ER diagram:
The legal databases of an ER diagram are all the finiterelational structures in which the translated set of FOLformulas evaluate to true.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 37: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/37.jpg)
ER Vs. FOL: The Alphabet
The Alphabet of the FOL language will have the following set ofPredicate symbols:
unary predicate symbols: E1, E2, . . . , En for each Entity-set;D1, D2, . . . , Dm for each Basic Domain.binary predicate symbols: A1, A2, . . . , Ak for each Attribute.n-ary predicate symbols: R1, R2, . . . , Rp for eachRelationship-set.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 38: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/38.jpg)
FOL Notation
Vector variables indicated as x stand for an n-tuple ofvariables: x = x1, . . . , xn
Counting existential quantifier indicated as ∃≤n or ∃≥n .∃≤nx . ϕ(x ) ≡
∀x1, . . . , xn, xn+1. ϕ(x1) ∧ . . . ∧ ϕ(xn) ∧ ϕ(xn+1) →(x1 = x2) ∨ . . . ∨ (x1 = xn) ∨ (x1 = xn+1) ∨(x2 = x3) ∨ . . . ∨ (x2 = xn) ∨ (x2 = xn+1) ∨. . . . . . ∨ (xn = xn+1)
∃≥nx . ϕ(x ) ≡∃x1, . . . , xn. ϕ(x1) ∧ . . . ∧ ϕ(xn) ∧
¬(x1 = x2) ∧ . . . ∧ ¬(x1 = xn) ∧¬(x2 = x3) ∧ . . . ∧ ¬(x2 = xn) ∧. . . . . . ∧ ¬(xn−1 = xn)
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 39: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/39.jpg)
ER: The Interpretation function
Interpretation: I = ⟨∆, ·I⟩, where ∆ is an arbitrary non-emptyset such that:
∆ = D ∪ Ω, where:D = ∪m
i=1D Di . D Di is the set of values associated with eachbasic domain (i.e., integer, string, etc.); and D Di ∩ D Dj = ∅,∀i , j . i = jΩ is the abstract entity domain such that D ∩ Ω = ∅.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 40: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/40.jpg)
ER: The Formal Semantics for the Atoms
·I is the interpretation function that maps:
Basic Domain Predicates to elements of the relative basicdomain:Di
I = D Di (e.g., StringI = D String).Entity-set Predicates to elements of the entity domain:Ei
I ⊆ Ω.Attribute Predicates to binary relations such that:Ai
I ⊆ Ω × D .Relationship-set Predicates to n-ary relations over theentity domain:Ri
I ⊆ Ω × Ω . . . × Ω = Ωn .
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 41: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/41.jpg)
The Relationship Construct
E1
. . .
EnR
The meaning of this constraint is:
RI ⊆ E1I × . . . × En
I
The FOL translation is the formula:
∀x1, . . . , xn. R(x1, . . . , xn) → E1(x1) ∧ . . . ∧ En(xn)
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 42: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/42.jpg)
The Relationship Construct
E1
. . .
EnR
The meaning of this constraint is:
RI ⊆ E1I × . . . × En
I
The FOL translation is the formula:
∀x1, . . . , xn. R(x1, . . . , xn) → E1(x1) ∧ . . . ∧ En(xn)
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 43: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/43.jpg)
The Attribute Construct
EA D
The meaning of this constraint is:
EI ⊆ e ∈ Ω | ♯AI ∩ (e × D D)≥ 1AI ∩ (EI × D ) ⊆ AI × D D
The FOL translation is the formula:
∀x . E (x ) → ∃y .A(x , y ) ∧ D(y )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 44: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/44.jpg)
The Attribute Construct
EA D
The meaning of this constraint is:
EI ⊆ e ∈ Ω | ♯AI ∩ (e × D D)≥ 1AI ∩ (EI × D ) ⊆ AI × D D
The FOL translation is the formula:
∀x . E (x ) → ∃y .A(x , y ) ∧ D(y )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 45: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/45.jpg)
The Cardinality Construct
E1 E2R(p,q)
The meaning of this constraint is:
E1I ⊆ e ∈ Ω | p ≤ ♯RI ∩ (e × Ω) ≤ q
The FOL translation is the formula:
∀x . E (x ) → ∃≥py . R(x , y ) ∧ ∃≤qy . R(x , y )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 46: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/46.jpg)
The Cardinality Construct
E1 E2R(p,q)
The meaning of this constraint is:
E1I ⊆ e ∈ Ω | p ≤ ♯RI ∩ (e × Ω) ≤ q
The FOL translation is the formula:
∀x . E (x ) → ∃≥py . R(x , y ) ∧ ∃≤qy . R(x , y )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 47: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/47.jpg)
The Cardinality Construct: An Example
Professor StudentSupervises(2,3) (1,1)
A valid Database is:ProfessorprofessorId
AlexBob
StudentstudentId
JohnMaryNickPaulLaura
SupervisesprofessorId studentId
Alex JohnBob LauraAlex MaryBob NickAlex Paul
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 48: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/48.jpg)
The Cardinality Construct: An Example
Professor StudentSupervises(2,3) (1,1)
An invalid Database is:ProfessorprofessorId
AlexBob
StudentstudentId
JohnMaryNickPaulLaura
SupervisesprofessorId studentId
Alex JohnBob LauraAlex MaryBob NickAlex PaulAlex Laura
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 49: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/49.jpg)
The Cardinality Construct: An Example
Professor StudentSupervises(2,3) (1,1)
The FOL translation is:∀x , y . Supervises(x , y ) → Professor(x ) ∧ Student(y )∀x . Professor(x ) → ∃≥2y . Supervises(x , y ) ∧
∃≤3y . Supervises(x , y )∀y . Student(y ) → ∃=1x . Supervises(x , y )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 50: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/50.jpg)
ISA Relations
The ISA relation is a constraint that specifies subentity sets.
We distinguish between the following different ISA relations:Overlapping Partial;Overlapping Total;Disjoint Partial;Disjoint Total.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 51: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/51.jpg)
The Overlapping Partial Construct
E
E1 . . . En
The meaning of this constraint is:
EiI ⊆ EI , for all i = 1, . . . , n.
The FOL translation is the formula:
∀x . Ei (x ) → E (x ), for all i = 1, . . . , n.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 52: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/52.jpg)
The Overlapping Partial Construct
E
E1 . . . En
The meaning of this constraint is:
EiI ⊆ EI , for all i = 1, . . . , n.
The FOL translation is the formula:
∀x . Ei (x ) → E (x ), for all i = 1, . . . , n.
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 53: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/53.jpg)
The Overlapping Total Construct
E
E1 . . . En
The meaning of this constraint is:Ei
I ⊆ EI , for all i = 1, . . . , nEI ⊆ E1
I ∪ . . . ∪ EnI
The FOL translation is the set of formulas:∀x . Ei (x ) → E (x ), for all i = 1, . . . , n∀x . E (x ) → E1(x ) ∨ . . . ∨ En(x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 54: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/54.jpg)
The Overlapping Total Construct
E
E1 . . . En
The meaning of this constraint is:Ei
I ⊆ EI , for all i = 1, . . . , nEI ⊆ E1
I ∪ . . . ∪ EnI
The FOL translation is the set of formulas:∀x . Ei (x ) → E (x ), for all i = 1, . . . , n∀x . E (x ) → E1(x ) ∨ . . . ∨ En(x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 55: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/55.jpg)
The Disjoint Partial ConstructE
E1 . . . En
×
The meaning of this constraint is:Ei
I ⊆ EI for all i = 1, . . . , nEi
I ∩ EjI = ∅ for all i = j
The FOL translation is the set of formulas:∀x . E1(x ) → E (x ) ∧ ¬E2(x ) ∧ . . . ∧ ¬En(x )∀x . E2(x ) → E (x ) ∧ ¬E3(x ) ∧ . . . ∧ ¬En(x )∀x . En−1(x ) → E (x ) ∧ ¬En(x )∀x . En(x ) → E (x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 56: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/56.jpg)
The Disjoint Partial ConstructE
E1 . . . En
×
The meaning of this constraint is:Ei
I ⊆ EI for all i = 1, . . . , nEi
I ∩ EjI = ∅ for all i = j
The FOL translation is the set of formulas:∀x . E1(x ) → E (x ) ∧ ¬E2(x ) ∧ . . . ∧ ¬En(x )∀x . E2(x ) → E (x ) ∧ ¬E3(x ) ∧ . . . ∧ ¬En(x )∀x . En−1(x ) → E (x ) ∧ ¬En(x )∀x . En(x ) → E (x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 57: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/57.jpg)
The Disjoint Total ConstructE
E1 . . . En
×
The meaning of this constraint is:Ei
I ⊆ E I for all i = 1, . . . , nEi
I ∩ EjI = ∅ for all i = j
E I ⊆ E1I ∪ . . . ∪ En
I
The FOL translation is the set of formulas:∀x . E (x ) → E1(x ) ∨ . . . ∨ En
∀x . E1(x ) → E (x ) ∧ ¬E2(x ) ∧ . . . ∧ ¬En(x )∀x . E2(x ) → E (x ) ∧ ¬E3(x ) ∧ . . . ∧ ¬En(x ). . . → . . .∀x . En(x ) → E (x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 58: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/58.jpg)
The Disjoint Total ConstructE
E1 . . . En
×
The meaning of this constraint is:Ei
I ⊆ E I for all i = 1, . . . , nEi
I ∩ EjI = ∅ for all i = j
E I ⊆ E1I ∪ . . . ∪ En
I
The FOL translation is the set of formulas:∀x . E (x ) → E1(x ) ∨ . . . ∨ En
∀x . E1(x ) → E (x ) ∧ ¬E2(x ) ∧ . . . ∧ ¬En(x )∀x . E2(x ) → E (x ) ∧ ¬E3(x ) ∧ . . . ∧ ¬En(x ). . . → . . .∀x . En(x ) → E (x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 59: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/59.jpg)
FOL Translation: An ExampleEmployee
ProjectManager
TopManagerAreaManager
×
Works-for
Manages
(1,n)
(1,1)(1,1)
∀x , y . Works-for(x , y ) → Employee(x ) ∧ Project(y )∀x , y . Manages(x , y ) → Top-Manager(x ) ∧ Project(y )∀y . Project(y ) → ∃x . Works-for(x , y )∀y . Project(y ) → ∃=1x . Manages(x , y )∀x . Top-Manager(x ) → ∃=1y . Manages(x , y )∀x . Manager(x ) → Employee(x )∀x . Manager(x ) → Area-Manager(x ) ∨ Top-Manager(x )∀x . Area-Manager(x ) → Manager(x ) ∧ ¬Top-Manager(x )∀x . Top-Manager(x ) → Manager(x )
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 60: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/60.jpg)
Additional (integrity) constraints
Employee
ProjectManager
TopManagerAreaManager Department InterestGroup
OrganisationalUnit
××
Works-for
Manages
Resp-for
(1,n)
(1,1)
(1,1)
(1,n)
Managers do not work for a project (she/he just manages it).
∀x . Manager(x ) → ∀y . ¬WORKS-FOR(x , y )
If the minimum cardinality for the participation of employeesto the works-for relationship is increased, then . . .If an ISA link is added stating that Interest Groups areDepartments, then . . .
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 61: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/61.jpg)
Additional (integrity) constraints
Employee
ProjectManager
TopManagerAreaManager Department InterestGroup
OrganisationalUnit
××
Works-for
Manages
Resp-for
(1,n)
(1,1)
(1,1)
(1,n)
Managers do not work for a project (she/he just manages it).
∀x . Manager(x ) → ∀y . ¬WORKS-FOR(x , y )
If the minimum cardinality for the participation of employeesto the works-for relationship is increased, then . . .
If an ISA link is added stating that Interest Groups areDepartments, then . . .
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 62: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/62.jpg)
Additional (integrity) constraints
Employee
ProjectManager
TopManagerAreaManager Department InterestGroup
OrganisationalUnit
××
Works-for
Manages
Resp-for
(1,n)
(1,1)
(1,1)
(1,n)
Managers do not work for a project (she/he just manages it).
∀x . Manager(x ) → ∀y . ¬WORKS-FOR(x , y )
If the minimum cardinality for the participation of employeesto the works-for relationship is increased, then . . .If an ISA link is added stating that Interest Groups areDepartments, then . . .
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 63: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/63.jpg)
Key constraints
A key is a set of attributes of an entity whose value uniquelyidentify elements of the entity itself.
Employee
PaySlipNumber(Integer)Salary(Integer)
Project
ProjectCode(String)Manager
TopManagerAreaManager
×
Works-for
Manages
(1,n)
(1,1)(1,1)
∀x.(Project(x) → ∃=1y. ProjectCode(x, y) ∧ String(y)
)
∀y.(∃x. ProjectCode(x, y) → ∃=1x. ProjectCode(x, y) ∧ Project(x)
)
Alessandro Artale Entity-Relationship Diagrams and FOL
![Page 64: Entity-Relationship Diagrams and FOLartale/DML/Lectures/Logic/slides7-er-fol.pdf · Alessandro Artale Entity-Relationship Diagrams and FOL. What is a Conceptual Schema A conceptual](https://reader030.fdocuments.net/reader030/viewer/2022040911/5e854ac2873c7c7d5235cdc8/html5/thumbnails/64.jpg)
Key constraints and relational schema
According to ER modelling, a key must be specified for eachentity.There is a one-to-one correspondence between (tuple)values of key attribute(s) and instances of an entity.This is why entities are mapped into the relational schemadirectly with the keys (which have concrete values) ratherthan with the abstract entity instances.Key values are the concrete representative for the instanceof the entity.
Alessandro Artale Entity-Relationship Diagrams and FOL