Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "ER Diagrams, Data Structure Diagrams and Relationship Types using the Footy Tips Database."— Presentation transcript:

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

2 Reviewing Our Data Tipster ID Pick 1H Tipster ID MatchPick 11H MatchRound Home Team Away TeamResult 11GeelongSt KildaH Tipster ID First Name Last Name 1MattWilson tblTipsters tblTips tblFixtures We have our data in 3NF – but this can be done in 2NF How do these tables relate to each other?

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!) tblTipsters tblFixtures tblTips TipsterID Match Pick Match Round Home Away Result Firstname TipsterID Lastname

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

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

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 MatchRound Home Team Away TeamResult 11GeelongSt KildaH Tipster ID First Name Last Name 1MattWilson tblTipsters tblTips tblFixtures Tipster ID MatchPick 11H Field TipsterID First Name Last Name Field TipsterID Match Pick Field Match Round Home Team Away Team Result We just want the table structures from here

8 Creating the Relationships How we find the fields that match between tables… First, the Tipsters and Tips are related by what? Answer: TipsterID! Field TipsterID First Name Last Name Field TipsterID Match Pick Field Match Round Home Team Away Team Result tblTipsters tblTips tblFixtures Second, the Fixtures and Tips are related by what? Answer: Match!

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… Field TipsterID First Name Last Name Field TipsterID Match Pick Field Match Round Home Team Away Team Result tblTipsters tblTips tblFixtures 1 Question: How many times will a TipsterID be in tblTips? Answer: Many… ∞ Question: How many times will a Match by in tblFixtures? Answer: Once… 1 Question: How many times will a Match by in tblTips? Answer: Many… ∞

10 Completed Relationship Types Field TipsterID First Name Last Name Field TipsterID Match Pick Field Match Round Home Team Away Team Result tblTipsters tblTips tblFixtures 1 ∞ 1 ∞ Here we have our final Data Structure Diagram The tblTipsters – tblTips relationship is One to Many The tblFixtures – tblTips relationship is One to Many


Download ppt "ER Diagrams, Data Structure Diagrams and Relationship Types using the Footy Tips Database."

Similar presentations


Ads by Google