SlideShare a Scribd company logo
1 of 43
Gegevensbanken
(E)ER naar relationeel
       schema
   Prof. Erik Duval en Katrien Verbert
               2011 - 2012




                    1
http://www.slideshare.net/erik.duval




2
•   (E)ER schema afbeelden op relationele model?
    •   entiteitstypes
        (regulier, zwak)
    •   relatietypes
        (binaire of hogere graad)
    •   attributen
        (enkelvoudig, samengesteld, meerwaardig)
    •   restricties

•   ER	

 → relationeel

•   EER	

 → relationeel
                           3
Fname         Minit     Lname                                                                         Number
                                    Salary                                                     Name
             Name                              N      WORKS_FOR                1                            Locations
 Sex                  Address

Ssn                                                               StartDate
              EMPLOYEE                                                                         DEPARTMENT

                                                                              1
Bdate                                          1                                                      1
                                                          MANAGES
                                                                                  Hours         CONTROLS
supervisor                  supervisee
                                                      1
                                                                   N
        1                       N                                                                     N
             SUPERVISES                                                 WORKS_ON          M
                                                    HAS_DEP.
                                                                                                PROJECT

                                                              N
                                                                                        Name                   Location
                                                   DEPENDENT

                                                                                                   Number
                           Name
                                                                         Relationship
                                         Sex         BirthDate

                                                          4
EMPLOYEE
 Fname, Minit, Lname, Ssn, Bdate, Address,
Sex, Salary

DEPARTMENT
 Dname, Dnumber

PROJECT
 Pname, Pnumber, Plocation
                    5
1. voor elk regulier entiteitstype E:
 •   maak relatie R
 •   met alle enkelvoudige attributen van E
 •   kies één van sleutelattributen als primaire sleutel voor R

         EMPLOYEE
          Fname, Minit, Lname, Ssn, Bdate, Address,
         Sex, Salary

         DEPARTMENT
          Dname, Dnumber

         PROJECT
          Pname, Pnumber, Plocation
                               5
DEPENDENT
 Essn, Dependent_Name, Sex, Bdate, Relationship



                       6
stap 2. voor elk zwak entiteitstype W:
 •   maak een relatie R
 •   met alle enkelvoudige attributen van W
 •   en als verwijssleutel de primaire sleutel van eigenaar




     DEPENDENT
      Essn, Dependent_Name, Sex, Bdate, Relationship



                              6
DEPARTMENT
 Dname, Dnumber, Mgr_ssn, Mgr_start_date



                   7
stap 3. voor elk binair 1:1 relatietype R:
 • S en T relaties voor deelnemende entiteitstypes van R
 • neem primaire sleutel van T op als verwijssleutel in S
     (of omgekeerd) - vermijd nul-waarden
 • neem ook enkelvoudige attributen op



         DEPARTMENT
          Dname, Dnumber, Mgr_ssn, Mgr_start_date



                               7
EMPLOYEE
  Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary,
  Super_ssn, Dno

PROJECT
 Pname, Pnumber, Plocation, Dnum


                                  8
stap 4. voor elk binair 1:N relatietype R:
     • S relatie die entiteitstype van N-kant voorstelt
     • voeg in S primaire sleutel relatie aan 1-kant toe
     • neem ook enkelvoudige attributen op

EMPLOYEE
  Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary,
  Super_ssn, Dno

PROJECT
 Pname, Pnumber, Plocation, Dnum


                                  8
WORKS_ON
 Essn, Pno, Hours



        9
stap 5. voor elk binair N:M relatietype R:
 • maak nieuwe relatie S
 • met verwijssleutels primaire sleutels van deelnemende
     relaties
 • met verwijssleutels samen als primaire sleutel
 • neem ook enkelvoudige attributen van R op


                     WORKS_ON
                      Essn, Pno, Hours



                              9
DEPT_LOCATIONS
 Dnumber, Dlocation



        10
stap 6. voor elk meerwaardig attribuut A:
 •   creëer een relatie R
 •   met attribuut dat overeenkomt met A
 •   + verwijssleutel: primaire sleutel K van bijhorende relatie
 •   als primaire sleutel: A en K samen



                    DEPT_LOCATIONS
                     Dnumber, Dlocation



                              10
11
12
Stap 7: voor elk n-air relatietype R (n>2) :
 • maak nieuwe relatie S
 • met verwijssleutels: primaire sleutels van deelnemende
     entiteitstypes
 • met alle enkelvoudige attributen van R
 • met primaire sleutel: alle verwijssleutels samen




                               12
Stap 7: voor elk n-air relatietype R (n>2) :
 • maak nieuwe relatie S
 • met verwijssleutels: primaire sleutels van deelnemende
     entiteitstypes
 • met alle enkelvoudige attributen van R
 • met primaire sleutel: alle verwijssleutels samen




                               12
Stap 7: voor elk n-air relatietype R (n>2) :
 • maak nieuwe relatie S
 • met verwijssleutels: primaire sleutels van deelnemende
     entiteitstypes
 • met alle enkelvoudige attributen van R
 • met primaire sleutel: alle verwijssleutels samen




                               12
ER model                                relationeel model
•   entiteitstype                       •   “entiteits” relatie
•   1:1 of 1:N relationship type        •   verwijssleutel of relatie
•   M:N relationship type               •   relatie met 2 verwijssleutels
•   n-aire relationship type            •   relatie met n verwijssleutels
•   enkelvoudig attribuut               •   attribuut
•   samengesteld attribuut              •   verzameling attributen
•   meerwaardig attribuut               •   relatie of verwijssleutel
•   value set                           •   domein
•   sleutel attribuut                   •   primaire sleutel
                                   13
14
Stap 8: behandeling van super/subklasse-relaties




                              14
Stap 8: behandeling van super/subklasse-relaties
• Elke specialisatie met m subklassen { S1, S2,..., Sm }
    en superklasse C met attributen { k, a1, ..., an }




                                  14
Stap 8: behandeling van super/subklasse-relaties
• Elke specialisatie met m subklassen { S1, S2,..., Sm }
    en superklasse C met attributen { k, a1, ..., an }
• Optie 8A
  • maak relatie L voor C met attr(L) = { k, a1, ..., an }
    • en primaire sleutel PK(L) = k
  • en relaties Li voor elke subklasse Si met
    • attr(Li) = { k } ∪ { attr(Si) }
    • en PK(Li) = k
                                  14
15
16
• Optie 8B
    • maak voor elke subklasse Si een relatie Li
          met attr(Li) = { attr(Si) } ∪ { k, a1, ..., an }
          en PK(Li) = k
      • werkt enkel correct voor disjuncte, totale specialisatie
      • niet totale specialisatie	

 → verlies van gegevens (∉ Si)
      • niet disjuncte specialisatie 	

→ redundantie




                                   16
• Optie 8B
    • maak voor elke subklasse Si een relatie Li
          met attr(Li) = { attr(Si) } ∪ { k, a1, ..., an }
          en PK(Li) = k
      • werkt enkel correct voor disjuncte, totale specialisatie
      • niet totale specialisatie	

 → verlies van gegevens (∉ Si)
      • niet disjuncte specialisatie 	

→ redundantie




                                   16
• Optie 8B
    • maak voor elke subklasse Si een relatie Li
          met attr(Li) = { attr(Si) } ∪ { k, a1, ..., an }
          en PK(Li) = k
      • werkt enkel correct voor disjuncte, totale specialisatie
      • niet totale specialisatie	

 → verlies van gegevens (∉ Si)
      • niet disjuncte specialisatie 	

→ redundantie




                                   16
17
• Optie 8C: één relatie L
   attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en
   PK(L) = k




                                    17
• Optie 8C: één relatie L
   attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en
   PK(L) = k
• waarbij t duidt aan tot welke subklasse elk tupel behoort
  • weggelaten als specialisatie predikaatgedefinieerd
  • enkel voor disjuncte subklassen
  • veel verschillende attributen in subklassen: veel nul




                                    17
• Optie 8C: één relatie L
   attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en
   PK(L) = k
• waarbij t duidt aan tot welke subklasse elk tupel behoort
  • weggelaten als specialisatie predikaatgedefinieerd
  • enkel voor disjuncte subklassen
  • veel verschillende attributen in subklassen: veel nul




                                    17
• Optie 8C: één relatie L
   attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en
   PK(L) = k
• waarbij t duidt aan tot welke subklasse elk tupel behoort
  • weggelaten als specialisatie predikaatgedefinieerd
  • enkel voor disjuncte subklassen
  • veel verschillende attributen in subklassen: veel nul




                                    17
18
• Optie 8D: één relatie L
   met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) }
   ∪ { t1, t2, ..., tm } en PK(L) = k
   • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit




                                    18
• Optie 8D: één relatie L
   met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) }
   ∪ { t1, t2, ..., tm } en PK(L) = k
   • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit
• gebruikt voor overlappende subklassen




                                    18
• Optie 8D: één relatie L
   met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) }
   ∪ { t1, t2, ..., tm } en PK(L) = k
   • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit
• gebruikt voor overlappende subklassen
• ook hier gevaar voor veel nulwaarden




                                    18
• Optie 8D: één relatie L
   met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) }
   ∪ { t1, t2, ..., tm } en PK(L) = k
   • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit
• gebruikt voor overlappende subklassen
• ook hier gevaar voor veel nulwaarden




                                    18
• Optie 8D: één relatie L
   met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) }
   ∪ { t1, t2, ..., tm } en PK(L) = k
   • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit
• gebruikt voor overlappende subklassen
• ook hier gevaar voor veel nulwaarden




                                    18
Vragen...?

    19

More Related Content

More from Katrien Verbert

Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Katrien Verbert
 
Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Katrien Verbert
 
Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?Katrien Verbert
 
Explaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspectiveExplaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspectiveKatrien Verbert
 
Explaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learnedExplaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learnedKatrien Verbert
 
Designing Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons LearnedDesigning Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons LearnedKatrien Verbert
 
Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...Katrien Verbert
 
Explainable AI for non-expert users
Explainable AI for non-expert usersExplainable AI for non-expert users
Explainable AI for non-expert usersKatrien Verbert
 
Towards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methodsTowards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methodsKatrien Verbert
 
Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...Katrien Verbert
 
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...Katrien Verbert
 
Learning analytics for feedback at scale
Learning analytics for feedback at scaleLearning analytics for feedback at scale
Learning analytics for feedback at scaleKatrien Verbert
 
Interactive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learningInteractive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learningKatrien Verbert
 
Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”Katrien Verbert
 
Interactive Recommender Systems
Interactive Recommender SystemsInteractive Recommender Systems
Interactive Recommender SystemsKatrien Verbert
 
Web Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTMLWeb Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTMLKatrien Verbert
 
Information Visualisation: perception and principles
Information Visualisation: perception and principlesInformation Visualisation: perception and principles
Information Visualisation: perception and principlesKatrien Verbert
 
Web Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionWeb Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionKatrien Verbert
 
Information Visualisation: Introduction
Information Visualisation: IntroductionInformation Visualisation: Introduction
Information Visualisation: IntroductionKatrien Verbert
 

More from Katrien Verbert (20)

Explainability methods
Explainability methodsExplainability methods
Explainability methods
 
Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?
 
Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?Human-centered AI: how can we support end-users to interact with AI?
Human-centered AI: how can we support end-users to interact with AI?
 
Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?Human-centered AI: how can we support lay users to understand AI?
Human-centered AI: how can we support lay users to understand AI?
 
Explaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspectiveExplaining job recommendations: a human-centred perspective
Explaining job recommendations: a human-centred perspective
 
Explaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learnedExplaining recommendations: design implications and lessons learned
Explaining recommendations: design implications and lessons learned
 
Designing Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons LearnedDesigning Learning Analytics Dashboards: Lessons Learned
Designing Learning Analytics Dashboards: Lessons Learned
 
Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...Human-centered AI: towards the next generation of interactive and adaptive ex...
Human-centered AI: towards the next generation of interactive and adaptive ex...
 
Explainable AI for non-expert users
Explainable AI for non-expert usersExplainable AI for non-expert users
Explainable AI for non-expert users
 
Towards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methodsTowards the next generation of interactive and adaptive explanation methods
Towards the next generation of interactive and adaptive explanation methods
 
Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...Personalized food recommendations: combining recommendation, visualization an...
Personalized food recommendations: combining recommendation, visualization an...
 
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
Explaining and Exploring Job Recommendations: a User-driven Approach for Inte...
 
Learning analytics for feedback at scale
Learning analytics for feedback at scaleLearning analytics for feedback at scale
Learning analytics for feedback at scale
 
Interactive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learningInteractive recommender systems and dashboards for learning
Interactive recommender systems and dashboards for learning
 
Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”Interactive recommender systems: opening up the “black box”
Interactive recommender systems: opening up the “black box”
 
Interactive Recommender Systems
Interactive Recommender SystemsInteractive Recommender Systems
Interactive Recommender Systems
 
Web Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTMLWeb Information Systems Lecture 2: HTML
Web Information Systems Lecture 2: HTML
 
Information Visualisation: perception and principles
Information Visualisation: perception and principlesInformation Visualisation: perception and principles
Information Visualisation: perception and principles
 
Web Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionWeb Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: Introduction
 
Information Visualisation: Introduction
Information Visualisation: IntroductionInformation Visualisation: Introduction
Information Visualisation: Introduction
 

(E)ER naar relationeel schema


  • 1. Gegevensbanken (E)ER naar relationeel schema Prof. Erik Duval en Katrien Verbert 2011 - 2012 1
  • 3. (E)ER schema afbeelden op relationele model? • entiteitstypes (regulier, zwak) • relatietypes (binaire of hogere graad) • attributen (enkelvoudig, samengesteld, meerwaardig) • restricties • ER → relationeel • EER → relationeel 3
  • 4. Fname Minit Lname Number Salary Name Name N WORKS_FOR 1 Locations Sex Address Ssn StartDate EMPLOYEE DEPARTMENT 1 Bdate 1 1 MANAGES Hours CONTROLS supervisor supervisee 1 N 1 N N SUPERVISES WORKS_ON M HAS_DEP. PROJECT N Name Location DEPENDENT Number Name Relationship Sex BirthDate 4
  • 5. EMPLOYEE Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary DEPARTMENT Dname, Dnumber PROJECT Pname, Pnumber, Plocation 5
  • 6. 1. voor elk regulier entiteitstype E: • maak relatie R • met alle enkelvoudige attributen van E • kies één van sleutelattributen als primaire sleutel voor R EMPLOYEE Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary DEPARTMENT Dname, Dnumber PROJECT Pname, Pnumber, Plocation 5
  • 7. DEPENDENT Essn, Dependent_Name, Sex, Bdate, Relationship 6
  • 8. stap 2. voor elk zwak entiteitstype W: • maak een relatie R • met alle enkelvoudige attributen van W • en als verwijssleutel de primaire sleutel van eigenaar DEPENDENT Essn, Dependent_Name, Sex, Bdate, Relationship 6
  • 9. DEPARTMENT Dname, Dnumber, Mgr_ssn, Mgr_start_date 7
  • 10. stap 3. voor elk binair 1:1 relatietype R: • S en T relaties voor deelnemende entiteitstypes van R • neem primaire sleutel van T op als verwijssleutel in S (of omgekeerd) - vermijd nul-waarden • neem ook enkelvoudige attributen op DEPARTMENT Dname, Dnumber, Mgr_ssn, Mgr_start_date 7
  • 11. EMPLOYEE Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, Super_ssn, Dno PROJECT Pname, Pnumber, Plocation, Dnum 8
  • 12. stap 4. voor elk binair 1:N relatietype R: • S relatie die entiteitstype van N-kant voorstelt • voeg in S primaire sleutel relatie aan 1-kant toe • neem ook enkelvoudige attributen op EMPLOYEE Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, Super_ssn, Dno PROJECT Pname, Pnumber, Plocation, Dnum 8
  • 14. stap 5. voor elk binair N:M relatietype R: • maak nieuwe relatie S • met verwijssleutels primaire sleutels van deelnemende relaties • met verwijssleutels samen als primaire sleutel • neem ook enkelvoudige attributen van R op WORKS_ON Essn, Pno, Hours 9
  • 16. stap 6. voor elk meerwaardig attribuut A: • creëer een relatie R • met attribuut dat overeenkomt met A • + verwijssleutel: primaire sleutel K van bijhorende relatie • als primaire sleutel: A en K samen DEPT_LOCATIONS Dnumber, Dlocation 10
  • 17. 11
  • 18. 12
  • 19. Stap 7: voor elk n-air relatietype R (n>2) : • maak nieuwe relatie S • met verwijssleutels: primaire sleutels van deelnemende entiteitstypes • met alle enkelvoudige attributen van R • met primaire sleutel: alle verwijssleutels samen 12
  • 20. Stap 7: voor elk n-air relatietype R (n>2) : • maak nieuwe relatie S • met verwijssleutels: primaire sleutels van deelnemende entiteitstypes • met alle enkelvoudige attributen van R • met primaire sleutel: alle verwijssleutels samen 12
  • 21. Stap 7: voor elk n-air relatietype R (n>2) : • maak nieuwe relatie S • met verwijssleutels: primaire sleutels van deelnemende entiteitstypes • met alle enkelvoudige attributen van R • met primaire sleutel: alle verwijssleutels samen 12
  • 22. ER model relationeel model • entiteitstype • “entiteits” relatie • 1:1 of 1:N relationship type • verwijssleutel of relatie • M:N relationship type • relatie met 2 verwijssleutels • n-aire relationship type • relatie met n verwijssleutels • enkelvoudig attribuut • attribuut • samengesteld attribuut • verzameling attributen • meerwaardig attribuut • relatie of verwijssleutel • value set • domein • sleutel attribuut • primaire sleutel 13
  • 23. 14
  • 24. Stap 8: behandeling van super/subklasse-relaties 14
  • 25. Stap 8: behandeling van super/subklasse-relaties • Elke specialisatie met m subklassen { S1, S2,..., Sm } en superklasse C met attributen { k, a1, ..., an } 14
  • 26. Stap 8: behandeling van super/subklasse-relaties • Elke specialisatie met m subklassen { S1, S2,..., Sm } en superklasse C met attributen { k, a1, ..., an } • Optie 8A • maak relatie L voor C met attr(L) = { k, a1, ..., an } • en primaire sleutel PK(L) = k • en relaties Li voor elke subklasse Si met • attr(Li) = { k } ∪ { attr(Si) } • en PK(Li) = k 14
  • 27. 15
  • 28. 16
  • 29. • Optie 8B • maak voor elke subklasse Si een relatie Li met attr(Li) = { attr(Si) } ∪ { k, a1, ..., an } en PK(Li) = k • werkt enkel correct voor disjuncte, totale specialisatie • niet totale specialisatie → verlies van gegevens (∉ Si) • niet disjuncte specialisatie → redundantie 16
  • 30. • Optie 8B • maak voor elke subklasse Si een relatie Li met attr(Li) = { attr(Si) } ∪ { k, a1, ..., an } en PK(Li) = k • werkt enkel correct voor disjuncte, totale specialisatie • niet totale specialisatie → verlies van gegevens (∉ Si) • niet disjuncte specialisatie → redundantie 16
  • 31. • Optie 8B • maak voor elke subklasse Si een relatie Li met attr(Li) = { attr(Si) } ∪ { k, a1, ..., an } en PK(Li) = k • werkt enkel correct voor disjuncte, totale specialisatie • niet totale specialisatie → verlies van gegevens (∉ Si) • niet disjuncte specialisatie → redundantie 16
  • 32. 17
  • 33. • Optie 8C: één relatie L attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en PK(L) = k 17
  • 34. • Optie 8C: één relatie L attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en PK(L) = k • waarbij t duidt aan tot welke subklasse elk tupel behoort • weggelaten als specialisatie predikaatgedefinieerd • enkel voor disjuncte subklassen • veel verschillende attributen in subklassen: veel nul 17
  • 35. • Optie 8C: één relatie L attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en PK(L) = k • waarbij t duidt aan tot welke subklasse elk tupel behoort • weggelaten als specialisatie predikaatgedefinieerd • enkel voor disjuncte subklassen • veel verschillende attributen in subklassen: veel nul 17
  • 36. • Optie 8C: één relatie L attr(L) = { k,a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t } en PK(L) = k • waarbij t duidt aan tot welke subklasse elk tupel behoort • weggelaten als specialisatie predikaatgedefinieerd • enkel voor disjuncte subklassen • veel verschillende attributen in subklassen: veel nul 17
  • 37. 18
  • 38. • Optie 8D: één relatie L met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t1, t2, ..., tm } en PK(L) = k • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit 18
  • 39. • Optie 8D: één relatie L met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t1, t2, ..., tm } en PK(L) = k • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit • gebruikt voor overlappende subklassen 18
  • 40. • Optie 8D: één relatie L met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t1, t2, ..., tm } en PK(L) = k • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit • gebruikt voor overlappende subklassen • ook hier gevaar voor veel nulwaarden 18
  • 41. • Optie 8D: één relatie L met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t1, t2, ..., tm } en PK(L) = k • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit • gebruikt voor overlappende subklassen • ook hier gevaar voor veel nulwaarden 18
  • 42. • Optie 8D: één relatie L met attr(L) = { k, a1, ..., an } ∪ { attr(S1) } ∪ ... ∪ { attr(Sm) } ∪ { t1, t2, ..., tm } en PK(L) = k • ti, 1≤ i ≤ m is boolean die aangeeft of entiteit in Si zit • gebruikt voor overlappende subklassen • ook hier gevaar voor veel nulwaarden 18

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n