databases2

C
Review of database basics
Fields Attributes ‘ atomic’ Data types Primary key Validation rules Input masks L: letter A-Z (required) ?: letter A-Z (optional) 0: number 0-9 (required) 9: number (optional) range (or limit) check,  e.g. between 10 and 20, >10 list check,  e.g. ‘a’ OR ‘b’ OR ‘c’ (better as a dropdown list) Design a database to store personal information of 6 th  Form students
tables queries (select some data only) macros forms (on screen) reports (on paper) what the user can see add a new student see all students see all in Year 13 list of all students list of all in Year 13 ? Design a database to store personal information of 6 th  Form students
Primary key? Starter   £4.00 3 13 1125 £2.00 2 12 1125 £4.00 1 13 1124 £3.00 1 14 1123 £2.00 2 12 1123 £4.00 3 13 1122 £2.00 2 12 1122 price quantitySold stockNum orderNum
Database exercise
Project number Project name Employee number Employee name Rate category Hourly rate 1. consider single table Consider the Employees and Projects table on the webpage 2. assign primary key(s)? Project number  Project name Employee number  Employee name Rate category Hourly rate 5. spot another (less obvious) Employee number  Employee name Rate category Hourly rate Project number Employee number 6. …and remove it Employee number  Employee name Rate category Project number Employee number Project number  Project name Rate category Hourly rate 3. spot repeated groups of data… Project number  Project name Employee number  Employee name Rate category Hourly rate 4. …and remove them Employee number  Employee name Rate category Hourly rate Project number Employee number Project number  Project name
Entity-relationship  diagrams
Entity-relationship  diagrams
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
form student  ONE  form(s)  contains   ONE  student(s)  MANY  MANY event world record ONE  event(s)   has   ONE  world record(s) MANY  MANY employee project ONE  employee(s)  can work on   ONE  project(s)  MANY  MANY (  ) (  ) (  ) (  ) (  ) (  )
event world record ONE  event(s)   has   ONE  world record(s) MANY  MANY (  ) (  ) event world record might as well merge into the one table (nothing to be gained from having two) a ONE-to-ONE relationship
form student  ONE  form(s)  contains   ONE  student(s)  MANY  MANY (  ) (  ) This is what you are after It makes your database more efficient a ONE-to-MANY relationship form student
employee project ONE  employee(s)  can work on   ONE  project(s)  MANY  MANY (  ) (  ) Impossible to do in your database! Needs to be resolved… a MANY-to-MANY relationship employee project employee project employee_project Use a ‘link’ table between them  
husband wife mother child ward patient employee company car person main residence publisher book author book film actor film director student A-level course customer product stock item supplier ,[object Object],[object Object],[object Object],[object Object],[object Object]
Hospital ERD exercise A hospital is organised into wards. Each ward has a ward number and a name recorded, along with the number of beds in that ward.  Each ward is staffed by nurses. They have their staff number and name recorded and are assigned to a single ward. Each patient in the hospital has a patient identification number and their name, address and date of birth are recorded. Each patient is under the care of a single consultant and is assigned to a single ward.  Each consultant is responsible for a number of patients. Consultants have their staff number, name and specialism recorded. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Extension: Consider students, teachers and courses in the same way
Police Database exercise A system for tracking the officers on different cases is needed within a police unit. Each officer belongs to a single department. Officers are allocated to cases. Each officer can be allocated to more than one case at any given time and each case could be worked on by a number of officers. Each case has a single supervising officer (or ‘supervisor’) in charge of it who may supervise more than one case at a time. The following information needs to be stored: case ID number; type of case; description of the case; the date a case is opened (and closed); the result of the case; officers’ name, rank, department and gender; supervisors’ name and rank Extension : where would the date an officer was assigned to a case go? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Extension: Consider a library in the same way.
publisher book author film actor director student course customer product stock item supplier staff employee project Others to practice with
Project number Project name Employee number Employee name Rate category Hourly rate 1. consider single table Consider the Employees and Projects table on the webpage 2. assign primary key(s)? Project number  Project name Employee number  Employee name Rate category Hourly rate 5. spot another (less obvious) Employee number  Employee name Rate category Hourly rate Project number Employee number 6. …and remove it Employee number  Employee name Rate category Project number Employee number Project number  Project name Rate category Hourly rate 3. spot repeated groups of data… Project number  Project name Employee number  Employee name Rate category Hourly rate 4. …and remove them Employee number  Employee name Rate category Hourly rate Project number Employee number Project number  Project name
Impossible to do in your database! Needs to be ‘resolved’… a MANY-to-MANY relationship employee project 1. first ERD Consider the Employees and Projects table again: employee project employee_project Use a ‘link’ table between them 2. second ERD employee project employee_project Employee number Employee name Rate category Hourly rate Employee number Project number Project number Project name 3. consider attributes 4. spot repeated group of data and remove  employee project employee_project Employee number Employee name Rate category Employee number Project number Project number Project name rate Rate category Hourly rate
1 von 19

Recomendados

databases3b von
databases3bdatabases3b
databases3bc.west
230 views17 Folien
Relational database von
Relational databaseRelational database
Relational databaseSanthiNivas
501 views32 Folien
Sq lite module3 von
Sq lite module3Sq lite module3
Sq lite module3Highervista
77 views68 Folien
Data model von
Data modelData model
Data modelSyed Zaid Irshad
323 views11 Folien
CSPro Workshop P-3 von
CSPro Workshop P-3CSPro Workshop P-3
CSPro Workshop P-3prabhustat
1.9K views15 Folien
physical and logical data independence von
physical and logical data independencephysical and logical data independence
physical and logical data independenceapoorva_upadhyay
68K views19 Folien

Más contenido relacionado

Was ist angesagt?

INF 103(ASH) Learn/newtonhelp.com von
INF 103(ASH) Learn/newtonhelp.comINF 103(ASH) Learn/newtonhelp.com
INF 103(ASH) Learn/newtonhelp.comlechenau48
10 views17 Folien
Entity-Relationship Data Model in DBMS von
Entity-Relationship Data Model in DBMSEntity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSProf Ansari
1.4K views50 Folien
03 Ch3 Notes Revised von
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revisedguest6f408c
3.4K views38 Folien
Data Entry in CSpro von
Data Entry in CSproData Entry in CSpro
Data Entry in CSproprabhustat
6.5K views17 Folien
Data modelingpresentation von
Data modelingpresentationData modelingpresentation
Data modelingpresentationfikirabc
167 views27 Folien
Unit02 dbms von
Unit02 dbmsUnit02 dbms
Unit02 dbmsarnold 7490
5K views49 Folien

Was ist angesagt?(9)

INF 103(ASH) Learn/newtonhelp.com von lechenau48
INF 103(ASH) Learn/newtonhelp.comINF 103(ASH) Learn/newtonhelp.com
INF 103(ASH) Learn/newtonhelp.com
lechenau4810 views
Entity-Relationship Data Model in DBMS von Prof Ansari
Entity-Relationship Data Model in DBMSEntity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMS
Prof Ansari1.4K views
03 Ch3 Notes Revised von guest6f408c
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revised
guest6f408c3.4K views
Data Entry in CSpro von prabhustat
Data Entry in CSproData Entry in CSpro
Data Entry in CSpro
prabhustat6.5K views
Data modelingpresentation von fikirabc
Data modelingpresentationData modelingpresentation
Data modelingpresentation
fikirabc167 views
Introduction to Data Modeling von guest02ff4b5
Introduction to Data ModelingIntroduction to Data Modeling
Introduction to Data Modeling
guest02ff4b53.5K views
Skipl List implementation - Part 2 von Amrith Krishna
Skipl List implementation - Part 2Skipl List implementation - Part 2
Skipl List implementation - Part 2
Amrith Krishna192 views

Destacado

Database management systems 3 - Data Modelling von
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data ModellingNickkisha Farrell
4.4K views33 Folien
Erd for teaching staff von
Erd for teaching staffErd for teaching staff
Erd for teaching staffMrsjalland
1.2K views9 Folien
A2 databases von
A2 databasesA2 databases
A2 databasesc.west
434 views22 Folien
Normalization von
NormalizationNormalization
NormalizationJTHSICT
2.8K views25 Folien
Er diagram practical examples von
Er diagram practical examplesEr diagram practical examples
Er diagram practical examplesRahul Khanwani
32.1K views30 Folien
Entity Relationship Diagram von
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramRakhi Mukherji
11.4K views30 Folien

Destacado(11)

Database management systems 3 - Data Modelling von Nickkisha Farrell
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data Modelling
Nickkisha Farrell4.4K views
Erd for teaching staff von Mrsjalland
Erd for teaching staffErd for teaching staff
Erd for teaching staff
Mrsjalland1.2K views
A2 databases von c.west
A2 databasesA2 databases
A2 databases
c.west434 views
Normalization von JTHSICT
NormalizationNormalization
Normalization
JTHSICT2.8K views
Er diagram practical examples von Rahul Khanwani
Er diagram practical examplesEr diagram practical examples
Er diagram practical examples
Rahul Khanwani32.1K views
Entity Relationship Diagram von Rakhi Mukherji
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Rakhi Mukherji11.4K views
Entity Relationship Diagram presentation von Sopov Chan
Entity Relationship Diagram presentationEntity Relationship Diagram presentation
Entity Relationship Diagram presentation
Sopov Chan25.1K views
Entity relationship diagram (erd) von tameemyousaf
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
tameemyousaf214.1K views

Similar a databases2

Excel analysis assignment this is an independent assignment me von
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment mejoney4
51 views31 Folien
Normalization von
NormalizationNormalization
NormalizationAbuSahama
4 views44 Folien
Computer sec2-1st term von
Computer sec2-1st termComputer sec2-1st term
Computer sec2-1st termأمنية وجدى
3K views7 Folien
Introduction to Data Science With R Notes von
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R NotesLakshmiSarvani6
119 views18 Folien
Impersonal Matching von
Impersonal MatchingImpersonal Matching
Impersonal MatchingRikki Wright
2 views78 Folien
Introduction of Database Design and Development von
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and DevelopmentEr. Nawaraj Bhandari
1.3K views56 Folien

Similar a databases2(20)

Excel analysis assignment this is an independent assignment me von joney4
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment me
joney451 views
Introduction to Data Science With R Notes von LakshmiSarvani6
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
LakshmiSarvani6119 views
Object oriented software engineering concepts von Komal Singh
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
Komal Singh42.3K views
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx von honey725342
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
honey72534211 views
Assignment 1.1 Personal Power Profile von Melissa Grant
Assignment 1.1 Personal Power ProfileAssignment 1.1 Personal Power Profile
Assignment 1.1 Personal Power Profile
Melissa Grant2 views
Write a two-page executive summary for your boss explaining how a re.pdf von ezonesolutions
Write a two-page executive summary for your boss explaining how a re.pdfWrite a two-page executive summary for your boss explaining how a re.pdf
Write a two-page executive summary for your boss explaining how a re.pdf
ezonesolutions2 views
Aen007 Kenigsberg 091807 von Dreamforce07
Aen007 Kenigsberg 091807Aen007 Kenigsberg 091807
Aen007 Kenigsberg 091807
Dreamforce07539 views
CIS 515 Enhance teaching / snaptutorial.com von donaldzs56
CIS 515 Enhance teaching / snaptutorial.com CIS 515 Enhance teaching / snaptutorial.com
CIS 515 Enhance teaching / snaptutorial.com
donaldzs5612 views

Más de c.west

Do Review Improve von
Do Review ImproveDo Review Improve
Do Review Improvec.west
431 views4 Folien
Making A Presentation (Student Version) von
Making A Presentation (Student Version)Making A Presentation (Student Version)
Making A Presentation (Student Version)c.west
815 views53 Folien
Reading Level Tools In Word von
Reading Level Tools In WordReading Level Tools In Word
Reading Level Tools In Wordc.west
486 views5 Folien
Software von
SoftwareSoftware
Softwarec.west
634 views7 Folien
Printing & Colour Separation von
Printing & Colour SeparationPrinting & Colour Separation
Printing & Colour Separationc.west
966 views7 Folien
Hardware von
HardwareHardware
Hardwarec.west
588 views9 Folien

Más de c.west(20)

Do Review Improve von c.west
Do Review ImproveDo Review Improve
Do Review Improve
c.west431 views
Making A Presentation (Student Version) von c.west
Making A Presentation (Student Version)Making A Presentation (Student Version)
Making A Presentation (Student Version)
c.west815 views
Reading Level Tools In Word von c.west
Reading Level Tools In WordReading Level Tools In Word
Reading Level Tools In Word
c.west486 views
Software von c.west
SoftwareSoftware
Software
c.west634 views
Printing & Colour Separation von c.west
Printing & Colour SeparationPrinting & Colour Separation
Printing & Colour Separation
c.west966 views
Hardware von c.west
HardwareHardware
Hardware
c.west588 views
Stage 3 - Creating your project von c.west
Stage 3 - Creating your projectStage 3 - Creating your project
Stage 3 - Creating your project
c.west530 views
Stage 2 - Deciding on a project von c.west
Stage 2 - Deciding on a projectStage 2 - Deciding on a project
Stage 2 - Deciding on a project
c.west692 views
Stage 1 - Finding out von c.west
Stage 1 - Finding outStage 1 - Finding out
Stage 1 - Finding out
c.west320 views
Environment Collages G2 von c.west
Environment Collages G2Environment Collages G2
Environment Collages G2
c.west13.5K views
Environment Collages G1 von c.west
Environment Collages G1Environment Collages G1
Environment Collages G1
c.west35.8K views
Unit 6 Poster And Advert Design von c.west
Unit 6   Poster And Advert DesignUnit 6   Poster And Advert Design
Unit 6 Poster And Advert Design
c.west903 views
Unit 5 Page Design von c.west
Unit 5   Page DesignUnit 5   Page Design
Unit 5 Page Design
c.west373 views
Unit 4 Using The Internet von c.west
Unit 4   Using The InternetUnit 4   Using The Internet
Unit 4 Using The Internet
c.west262 views
Unit 3 Spreadsheets von c.west
Unit 3   SpreadsheetsUnit 3   Spreadsheets
Unit 3 Spreadsheets
c.west291 views
Unit 2 Business Documents von c.west
Unit 2   Business DocumentsUnit 2   Business Documents
Unit 2 Business Documents
c.west419 views
Unit 1 Logo Design von c.west
Unit 1   Logo DesignUnit 1   Logo Design
Unit 1 Logo Design
c.west971 views
5. Production Form von c.west
5. Production Form5. Production Form
5. Production Form
c.west236 views
4. Delivery Notes von c.west
4. Delivery Notes4. Delivery Notes
4. Delivery Notes
c.west581 views
3. Order Form von c.west
3. Order Form3. Order Form
3. Order Form
c.west266 views

Último

MemVerge: Gismo (Global IO-free Shared Memory Objects) von
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)CXL Forum
112 views16 Folien
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad... von
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad..."Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...Fwdays
40 views30 Folien
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum... von
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...NUS-ISS
28 views35 Folien
The details of description: Techniques, tips, and tangents on alternative tex... von
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...BookNet Canada
110 views24 Folien
Web Dev - 1 PPT.pdf von
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdfgdsczhcet
52 views45 Folien
Empathic Computing: Delivering the Potential of the Metaverse von
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
449 views80 Folien

Último(20)

MemVerge: Gismo (Global IO-free Shared Memory Objects) von CXL Forum
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)
CXL Forum112 views
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad... von Fwdays
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad..."Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
Fwdays40 views
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum... von NUS-ISS
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
NUS-ISS28 views
The details of description: Techniques, tips, and tangents on alternative tex... von BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada110 views
Web Dev - 1 PPT.pdf von gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet52 views
Empathic Computing: Delivering the Potential of the Metaverse von Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa... von The Digital Insurer
Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa...Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa...
Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa...
Transcript: The Details of Description Techniques tips and tangents on altern... von BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada119 views
MemVerge: Memory Viewer Software von CXL Forum
MemVerge: Memory Viewer SoftwareMemVerge: Memory Viewer Software
MemVerge: Memory Viewer Software
CXL Forum118 views
TE Connectivity: Card Edge Interconnects von CXL Forum
TE Connectivity: Card Edge InterconnectsTE Connectivity: Card Edge Interconnects
TE Connectivity: Card Edge Interconnects
CXL Forum96 views
"Fast Start to Building on AWS", Igor Ivaniuk von Fwdays
"Fast Start to Building on AWS", Igor Ivaniuk"Fast Start to Building on AWS", Igor Ivaniuk
"Fast Start to Building on AWS", Igor Ivaniuk
Fwdays36 views
Business Analyst Series 2023 - Week 3 Session 5 von DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10165 views
GigaIO: The March of Composability Onward to Memory with CXL von CXL Forum
GigaIO: The March of Composability Onward to Memory with CXLGigaIO: The March of Composability Onward to Memory with CXL
GigaIO: The March of Composability Onward to Memory with CXL
CXL Forum126 views
Combining Orchestration and Choreography for a Clean Architecture von ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
CXL at OCP von CXL Forum
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum208 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... von Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin70 views
Photowave Presentation Slides - 11.8.23.pptx von CXL Forum
Photowave Presentation Slides - 11.8.23.pptxPhotowave Presentation Slides - 11.8.23.pptx
Photowave Presentation Slides - 11.8.23.pptx
CXL Forum126 views

databases2

  • 2. Fields Attributes ‘ atomic’ Data types Primary key Validation rules Input masks L: letter A-Z (required) ?: letter A-Z (optional) 0: number 0-9 (required) 9: number (optional) range (or limit) check, e.g. between 10 and 20, >10 list check, e.g. ‘a’ OR ‘b’ OR ‘c’ (better as a dropdown list) Design a database to store personal information of 6 th Form students
  • 3. tables queries (select some data only) macros forms (on screen) reports (on paper) what the user can see add a new student see all students see all in Year 13 list of all students list of all in Year 13 ? Design a database to store personal information of 6 th Form students
  • 4. Primary key? Starter £4.00 3 13 1125 £2.00 2 12 1125 £4.00 1 13 1124 £3.00 1 14 1123 £2.00 2 12 1123 £4.00 3 13 1122 £2.00 2 12 1122 price quantitySold stockNum orderNum
  • 6. Project number Project name Employee number Employee name Rate category Hourly rate 1. consider single table Consider the Employees and Projects table on the webpage 2. assign primary key(s)? Project number Project name Employee number Employee name Rate category Hourly rate 5. spot another (less obvious) Employee number Employee name Rate category Hourly rate Project number Employee number 6. …and remove it Employee number Employee name Rate category Project number Employee number Project number Project name Rate category Hourly rate 3. spot repeated groups of data… Project number Project name Employee number Employee name Rate category Hourly rate 4. …and remove them Employee number Employee name Rate category Hourly rate Project number Employee number Project number Project name
  • 9.
  • 10. form student ONE form(s) contains ONE student(s) MANY MANY event world record ONE event(s) has ONE world record(s) MANY MANY employee project ONE employee(s) can work on ONE project(s) MANY MANY ( ) ( ) ( ) ( ) ( ) ( )
  • 11. event world record ONE event(s) has ONE world record(s) MANY MANY ( ) ( ) event world record might as well merge into the one table (nothing to be gained from having two) a ONE-to-ONE relationship
  • 12. form student ONE form(s) contains ONE student(s) MANY MANY ( ) ( ) This is what you are after It makes your database more efficient a ONE-to-MANY relationship form student
  • 13. employee project ONE employee(s) can work on ONE project(s) MANY MANY ( ) ( ) Impossible to do in your database! Needs to be resolved… a MANY-to-MANY relationship employee project employee project employee_project Use a ‘link’ table between them  
  • 14.
  • 15.
  • 16.
  • 17. publisher book author film actor director student course customer product stock item supplier staff employee project Others to practice with
  • 18. Project number Project name Employee number Employee name Rate category Hourly rate 1. consider single table Consider the Employees and Projects table on the webpage 2. assign primary key(s)? Project number Project name Employee number Employee name Rate category Hourly rate 5. spot another (less obvious) Employee number Employee name Rate category Hourly rate Project number Employee number 6. …and remove it Employee number Employee name Rate category Project number Employee number Project number Project name Rate category Hourly rate 3. spot repeated groups of data… Project number Project name Employee number Employee name Rate category Hourly rate 4. …and remove them Employee number Employee name Rate category Hourly rate Project number Employee number Project number Project name
  • 19. Impossible to do in your database! Needs to be ‘resolved’… a MANY-to-MANY relationship employee project 1. first ERD Consider the Employees and Projects table again: employee project employee_project Use a ‘link’ table between them 2. second ERD employee project employee_project Employee number Employee name Rate category Hourly rate Employee number Project number Project number Project name 3. consider attributes 4. spot repeated group of data and remove employee project employee_project Employee number Employee name Rate category Employee number Project number Project number Project name rate Rate category Hourly rate