1 / 10

Relationships

Relationships. ER Diagrams, Data Structure Diagrams and Relationship Types using the Footy Tips Database. Reviewing Our Data. We have our data in 3NF – but this can be done in 2NF How do these tables relate to each other?. tblTipsters tblTips tblFixtures. Entity Relationship (ER) Diagrams .

margot
Download Presentation

Relationships

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Relationships ER Diagrams, Data Structure Diagrams and Relationship Types using the Footy Tips Database

  2. Reviewing Our Data • We have our data in 3NF – but this can be done in 2NF • How do these tables relate to each other? tblTipsters tblTips tblFixtures

  3. Entity Relationship (ER) Diagrams • Entities are Database Objects such as tables and reports • We have 3 tables at the moment tblTipsters tblFixtures tblTips

  4. ER Diagram: Attributes • These tables have attributes… (fields in this case!) Round TipsterID Match Firstname tblTipsters tblFixtures Home Away Lastname tblTips Result TipsterID Match Pick

  5. ER Diagrams: Relationships • These tables are related to eachother… TipsterID Round Firstname Match Are used for… tblTipsters tblFixtures Home Away Lastname Makes A… tblTips Result TipsterID Match Pick

  6. ER Diagram Complete • Here is out completed ER Diagram TipsterID Round Firstname Match Are used for… tblTipsters tblFixtures Home Away Lastname Makes A… tblTips Result TipsterID Match Pick

  7. Data Structure Diagram • Now that we can see how the data is related, we can work on our structure • First we need to have the tables in 3NF We just want the table structures from here tblTipsters tblTips tblFixtures

  8. Creating the Relationships • How we find the fields that match between tables… • First, the Tipsters and Tips are related by what? • Answer: TipsterID! • Second, the Fixtures and Tips are related by what? • Answer: Match! tblTipsterstblTipstblFixtures

  9. Relationship Types • We have created our relationships, but what types of relationships have we created? • Question: How many times will a TipsterID be in tblTipsters? • Answer: Once… • Question: How many times will a TipsterID be in tblTips? • Answer: Many… • Question: How many times will a Match by in tblFixtures? • Answer: Once… • Question: How many times will a Match by in tblTips? • Answer: Many… tblTipsterstblTipstblFixtures 1 1 ∞ ∞

  10. Completed Relationship Types • Here we have our final Data Structure Diagram • The tblTipsters – tblTips relationship is One to Many • The tblFixtures – tblTips relationship is One to Many tblTipsterstblTipstblFixtures 1 1 ∞ ∞

More Related