SlideShare ist ein Scribd-Unternehmen logo
1 von 22
A2 Databases Employee number  Employee name Rate category Project number Employee number Project number  Project name Rate category Hourly rate employee project employee_project e.g.  Street, Town, City are dependent on Postcode  (and not on the table’s PRIMARY KEY) CustomerID HouseNum Street Town City Postcode dependent   not dependent  3NF
Database Table Field Record Primary key Foreign key Query Relationship Form Report Composite key Entity Attribute  Normalisation
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
Primary key? £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
[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
Normalisation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],e.g.  Order1, Order2, Order3 (consider many-to-many) 1NF first normal form 2NF second normal form ‘ Link’ tables  (from resolved MANY-to-MANY relationships)  have more than one PK PrimaryKey1 PrimaryKey2 OtherField1 OtherField2 OtherField3  dependent?  e.g.  Street, Town, City are dependent on Postcode  (and not on the table’s PRIMARY KEY) CustomerID HouseNum Street Town City Postcode dependent    not dependent   third normal form 3NF
Impossible to do in your database! Needs to be ‘resolved’… a MANY-to-MANY relationship employee project ERD approach: 1. first ERD employee project employee_project Use a ‘link’ table between them 2. second ERD 1NF 2NF employee project employee_project Employee number Employee name Rate category Hourly rate Employee number Project number Project number Project name 3. consider attributes 3NF 4. normalise further  employee project employee_project Employee number Employee name Rate category Employee number Project number Project number Project name rate Rate category Hourly rate
Project number Project name Employee number Employee name Rate category Hourly rate 1. consider single table Other approach: 5. spot attribute not dependent on PK 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 2. assign primary key(s) Project number  Project name Employee number  Employee name Rate category Hourly rate 1NF 3. spot partial dependencies… 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 2NF 3NF
Is this database structure normalised? e.g.  Order1, Order2, Order3 (consider many-to-many) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1NF 2NF 3NF ‘ Link’ tables  (from resolved MANY-to-MANY relationships)  have more than one PK PrimaryKey1 PrimaryKey2 OtherField1 OtherField2 OtherField3  dependent?  e.g.  Street, Town, City are dependent on Postcode  (and not on the table’s PRIMARY KEY) CustomerID HouseNum Street Town City Postcode dependent   not dependent
 
 

Weitere ähnliche Inhalte

Was ist angesagt?

Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
ClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLGeorge Simov
 
Relationships within the relational database
Relationships within the relational databaseRelationships within the relational database
Relationships within the relational databaseJanecatalla
 
Intro To DataBase
Intro To DataBaseIntro To DataBase
Intro To DataBaseDevMix
 

Was ist angesagt? (7)

Mdst 3559-02-24-sql2
Mdst 3559-02-24-sql2Mdst 3559-02-24-sql2
Mdst 3559-02-24-sql2
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
ClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureML
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Relationships within the relational database
Relationships within the relational databaseRelationships within the relational database
Relationships within the relational database
 
5-A Reading
5-A Reading5-A Reading
5-A Reading
 
Intro To DataBase
Intro To DataBaseIntro To DataBase
Intro To DataBase
 

Ähnlich wie A2 databases

databases3b
databases3bdatabases3b
databases3bc.west
 
Nunes database
Nunes databaseNunes database
Nunes databaseRohini17
 
Excel analysis assignment this is an independent assignment me
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
 
Project_2CIS405(GroupProject)
Project_2CIS405(GroupProject)Project_2CIS405(GroupProject)
Project_2CIS405(GroupProject)James Wu
 
Project Management System
Project Management SystemProject Management System
Project Management SystemDivyen Patel
 
ERD merupakan suatu diagram yang berisi komponen- komponen himpunan entitas ...
ERD merupakan suatu diagram yang berisi komponen- 	komponen himpunan entitas ...ERD merupakan suatu diagram yang berisi komponen- 	komponen himpunan entitas ...
ERD merupakan suatu diagram yang berisi komponen- komponen himpunan entitas ...huraitera
 
Normalization
NormalizationNormalization
NormalizationAbuSahama
 
What to do when one size does not fit all?!
What to do when one size does not fit all?!What to do when one size does not fit all?!
What to do when one size does not fit all?!Arjen de Vries
 
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
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.docxhoney725342
 
Database Management System
Database Management System Database Management System
Database Management System FellowBuddy.com
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R NotesLakshmiSarvani6
 
Aen007 Kenigsberg 091807
Aen007 Kenigsberg 091807Aen007 Kenigsberg 091807
Aen007 Kenigsberg 091807Dreamforce07
 

Ähnlich wie A2 databases (20)

databases3b
databases3bdatabases3b
databases3b
 
Nunes database
Nunes databaseNunes database
Nunes database
 
Computer sec2-1st term
Computer sec2-1st termComputer sec2-1st term
Computer sec2-1st term
 
Excel analysis assignment this is an independent assignment me
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
 
Project_2CIS405(GroupProject)
Project_2CIS405(GroupProject)Project_2CIS405(GroupProject)
Project_2CIS405(GroupProject)
 
SA Chapter 10
SA Chapter 10SA Chapter 10
SA Chapter 10
 
Project Management System
Project Management SystemProject Management System
Project Management System
 
ERD_01.ppt
ERD_01.pptERD_01.ppt
ERD_01.ppt
 
ERD_01.ppt
ERD_01.pptERD_01.ppt
ERD_01.ppt
 
ERD merupakan suatu diagram yang berisi komponen- komponen himpunan entitas ...
ERD merupakan suatu diagram yang berisi komponen- 	komponen himpunan entitas ...ERD merupakan suatu diagram yang berisi komponen- 	komponen himpunan entitas ...
ERD merupakan suatu diagram yang berisi komponen- komponen himpunan entitas ...
 
Normalization
NormalizationNormalization
Normalization
 
Sq lite module4
Sq lite module4Sq lite module4
Sq lite module4
 
ER Modeling.ppt
ER Modeling.pptER Modeling.ppt
ER Modeling.ppt
 
What to do when one size does not fit all?!
What to do when one size does not fit all?!What to do when one size does not fit all?!
What to do when one size does not fit all?!
 
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
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
 
Database Management System
Database Management System Database Management System
Database Management System
 
Database part3-
Database part3-Database part3-
Database part3-
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
 
Aen007 Kenigsberg 091807
Aen007 Kenigsberg 091807Aen007 Kenigsberg 091807
Aen007 Kenigsberg 091807
 
Data modelling interview question
Data modelling interview questionData modelling interview question
Data modelling interview question
 

Mehr von c.west

Do Review Improve
Do Review ImproveDo Review Improve
Do Review Improvec.west
 
Making A Presentation (Student Version)
Making A Presentation (Student Version)Making A Presentation (Student Version)
Making A Presentation (Student Version)c.west
 
Reading Level Tools In Word
Reading Level Tools In WordReading Level Tools In Word
Reading Level Tools In Wordc.west
 
Software
SoftwareSoftware
Softwarec.west
 
Printing & Colour Separation
Printing & Colour SeparationPrinting & Colour Separation
Printing & Colour Separationc.west
 
Hardware
HardwareHardware
Hardwarec.west
 
Stage 3 - Creating your project
Stage 3 - Creating your projectStage 3 - Creating your project
Stage 3 - Creating your projectc.west
 
Stage 2 - Deciding on a project
Stage 2 - Deciding on a projectStage 2 - Deciding on a project
Stage 2 - Deciding on a projectc.west
 
Stage 1 - Finding out
Stage 1 - Finding outStage 1 - Finding out
Stage 1 - Finding outc.west
 
Environment Collages G2
Environment Collages G2Environment Collages G2
Environment Collages G2c.west
 
Environment Collages G1
Environment Collages G1Environment Collages G1
Environment Collages G1c.west
 
Unit 6 Poster And Advert Design
Unit 6   Poster And Advert DesignUnit 6   Poster And Advert Design
Unit 6 Poster And Advert Designc.west
 
Unit 5 Page Design
Unit 5   Page DesignUnit 5   Page Design
Unit 5 Page Designc.west
 
Unit 4 Using The Internet
Unit 4   Using The InternetUnit 4   Using The Internet
Unit 4 Using The Internetc.west
 
Unit 3 Spreadsheets
Unit 3   SpreadsheetsUnit 3   Spreadsheets
Unit 3 Spreadsheetsc.west
 
Unit 2 Business Documents
Unit 2   Business DocumentsUnit 2   Business Documents
Unit 2 Business Documentsc.west
 
Unit 1 Logo Design
Unit 1   Logo DesignUnit 1   Logo Design
Unit 1 Logo Designc.west
 
5. Production Form
5. Production Form5. Production Form
5. Production Formc.west
 
4. Delivery Notes
4. Delivery Notes4. Delivery Notes
4. Delivery Notesc.west
 
3. Order Form
3. Order Form3. Order Form
3. Order Formc.west
 

Mehr von c.west (20)

Do Review Improve
Do Review ImproveDo Review Improve
Do Review Improve
 
Making A Presentation (Student Version)
Making A Presentation (Student Version)Making A Presentation (Student Version)
Making A Presentation (Student Version)
 
Reading Level Tools In Word
Reading Level Tools In WordReading Level Tools In Word
Reading Level Tools In Word
 
Software
SoftwareSoftware
Software
 
Printing & Colour Separation
Printing & Colour SeparationPrinting & Colour Separation
Printing & Colour Separation
 
Hardware
HardwareHardware
Hardware
 
Stage 3 - Creating your project
Stage 3 - Creating your projectStage 3 - Creating your project
Stage 3 - Creating your project
 
Stage 2 - Deciding on a project
Stage 2 - Deciding on a projectStage 2 - Deciding on a project
Stage 2 - Deciding on a project
 
Stage 1 - Finding out
Stage 1 - Finding outStage 1 - Finding out
Stage 1 - Finding out
 
Environment Collages G2
Environment Collages G2Environment Collages G2
Environment Collages G2
 
Environment Collages G1
Environment Collages G1Environment Collages G1
Environment Collages G1
 
Unit 6 Poster And Advert Design
Unit 6   Poster And Advert DesignUnit 6   Poster And Advert Design
Unit 6 Poster And Advert Design
 
Unit 5 Page Design
Unit 5   Page DesignUnit 5   Page Design
Unit 5 Page Design
 
Unit 4 Using The Internet
Unit 4   Using The InternetUnit 4   Using The Internet
Unit 4 Using The Internet
 
Unit 3 Spreadsheets
Unit 3   SpreadsheetsUnit 3   Spreadsheets
Unit 3 Spreadsheets
 
Unit 2 Business Documents
Unit 2   Business DocumentsUnit 2   Business Documents
Unit 2 Business Documents
 
Unit 1 Logo Design
Unit 1   Logo DesignUnit 1   Logo Design
Unit 1 Logo Design
 
5. Production Form
5. Production Form5. Production Form
5. Production Form
 
4. Delivery Notes
4. Delivery Notes4. Delivery Notes
4. Delivery Notes
 
3. Order Form
3. Order Form3. Order Form
3. Order Form
 

Kürzlich hochgeladen

Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessSeta Wicaksana
 
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCRashishs7044
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...lizamodels9
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCRashishs7044
 
/:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In...
/:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In.../:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In...
/:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In...lizamodels9
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfpollardmorgan
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckHajeJanKamps
 
Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfJos Voskuil
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...lizamodels9
 

Kürzlich hochgeladen (20)

Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful Business
 
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR
 
/:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In...
/:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In.../:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In...
/:Call Girls In Indirapuram Ghaziabad ➥9990211544 Independent Best Escorts In...
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
 
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
 
Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdf
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
 

A2 databases

  • 1. A2 Databases Employee number Employee name Rate category Project number Employee number Project number Project name Rate category Hourly rate employee project employee_project e.g. Street, Town, City are dependent on Postcode (and not on the table’s PRIMARY KEY) CustomerID HouseNum Street Town City Postcode dependent  not dependent 3NF
  • 2. Database Table Field Record Primary key Foreign key Query Relationship Form Report Composite key Entity Attribute Normalisation
  • 3. 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
  • 5. Primary key? £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.
  • 7. 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 ( ) ( ) ( ) ( ) ( ) ( )
  • 8. 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
  • 9. 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
  • 10. 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  
  • 11.
  • 12.
  • 13.
  • 14. publisher book author film actor director student course customer product stock item supplier staff employee project Others to practice with
  • 15. 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
  • 16. 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
  • 17.
  • 18. Impossible to do in your database! Needs to be ‘resolved’… a MANY-to-MANY relationship employee project ERD approach: 1. first ERD employee project employee_project Use a ‘link’ table between them 2. second ERD 1NF 2NF employee project employee_project Employee number Employee name Rate category Hourly rate Employee number Project number Project number Project name 3. consider attributes 3NF 4. normalise further employee project employee_project Employee number Employee name Rate category Employee number Project number Project number Project name rate Rate category Hourly rate
  • 19. Project number Project name Employee number Employee name Rate category Hourly rate 1. consider single table Other approach: 5. spot attribute not dependent on PK 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 2. assign primary key(s) Project number Project name Employee number Employee name Rate category Hourly rate 1NF 3. spot partial dependencies… 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 2NF 3NF
  • 20.
  • 21.  
  • 22.