By De Wen Zhong.  This database holds data about the teams that are involved in the AFL  There are eight tables altogether each holding data about various.

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Minister Bob Cameron (Victorian Government) and Dane Swan (Collingwood FC)
0 © Australian Football League This document is confidential and intended solely for the use and information of the addressee National AFL listed.
The Essendon Football Club By Jess Duff History of the club Premierships Essendon team Captain/coach Anzac Day Dreamtime The fans Game day Thanks for.
 The North Melbourne Football Club, is the fourth oldest football club in the Australian Football League (AFL).  It is one of the oldest sporting.
In 1879 the first recorded game of soccer in Australia took place. It took place in Hobart, Tasmania when the Cricketers Football Club played a scratch.
© red ©
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
SLIDE 1 SLIDE 2 SLIDE 3 SLIDE 4 SLIDE 5 SLIDE 6  The Australian Football League (AFL) is the highest-level professional competition in the sport of.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
+ SQL, HTML, PHP Week Review and Questions Topics from last lecture Terminology Questions?
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
Electrical Power Distribution in America % Coal 20.4% Nuclear 20.3% Natural Gas 6% Hydro Electric 3.4% Other
COLOURS.
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
The Carnie_MyCareer Case Study Peter Ebeid Dane Harris Stephanie Ho Chris Zaharia Distinction Assignment, Autumn 2007 Presented by.
FOOTBALL. ABOUT FOOTY  AFL stands for Australian Football League its also known as Aussie rules or just footy. The sport is played between two teams.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
SQL Server 7.0 Maintaining Referential Integrity.
AFL By Kobe Bryant History. AFL The AFL is currently the fourth-most attended professional sports league in the world in terms of attendance per match,
“National Electoral Division Profiles” Case Study Vincent Tang High Distinction Assignment, Autumn 2007.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
Melbourne Football Club. About Melbourne FC 1. Melbourne was made in They have one of the best players that was Jim Stynes 3.We have won 12 premiships.
Richmond footy club By Hayley. Hall of fame Kevin Sheedy Played 1967 – 1979 Goals 91 Games 251 Premierships: 1969, 1973, 1974 Best & Fairest: 1976 RFC.
RDBMSSection Relational DBMS DATABASE DEVELOPMENT And Franchise Colleges By MANSHA NAWAZ.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
WHITE YELLOW GREEN BLUE RED PINK BLACK BROWN ORANGE.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
MICHAEL MALTHOUSE ! COLLINGWOOD Mick ( Michael) Malthouse was born o the 17 th of August 1953 making him 58 years of age. He is a former Aussie.
FootballAFL. AFL Football is a sport that uses the combinations of the sports soccer, basketball and rugby. It is played on a oval field with goal posts.
Soompi Music By: Karen Sin. Introduction to Soompi Music This database models from the various artists and group data gathered from the Korean based English.
Moshtix Case Study High Distinction assignment By Annie Tran.
NORTH STAFFS REFS QUIZ SEPTEMBER 2014 QUIZ North Staffs Refs Club.
Netball case study Harryanto Surjani. domain Team names Team locations – where they’re based Game venues – Venue name and what the stadium is called Draw.
Sing the song Red,blue, yellow and green are all the colours I know.
You can sort Access data so you can view records in the order you want to view them, and you can filter data so you only see the records you want to see.
DBAdmin D D D D D a a a a a t t t t t a a a a a b b b b b a a a a a s s s s s e e e e eAdministration / Embedded SQL by: Glen Orsburn Chapter 6.
Session 1 Module 1: Introduction to Data Integrity
Monkey, Monkey In the Tree. Monkey, monkey in the tree Throw the yellow coconut down to me!
PORT MELBOURNE FOOTBALL CLUB IN SEASON 2016 SPONSORSHIP PROPOSAL – GROUND NAMING RIGHTS.
PORT MELBOURNE FOOTBALL CLUB IN SEASON 2016 SPONSORSHIP PROPOSAL.
Jenny Jirathammakul High Distinction Assignment Database Principles Autumn, 2007 Melbourne City Toyota.
Chapter 4. Colours… Let’s read the names of colours…
By Antonio Molluso football Go to slide 3 Got to slide 2 Go to slide 4 Go to slide 5 GO SLIDE 6 TO.
Databases Introduction - concepts. Concepts of Relational Databases.
Question 1 Who won in the AFL 2013 grand final? A. Geelong Geelong B. Hawks Hawks C. Fremantle Fremantle.
Charts Chart. Choosing what to show in a Chart To show cost of individual spend in Leeds: Highlight items and price ONLY (no headings or totals).
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Guess the colour Mix the colours Evaluation Group with work.
Database Constraints ICT 011. Database Constraints Database constraints are restrictions on the contents of the database or on database operations Database.
Overview * Victorian Football League (AFL Victoria)
Wayne Carey Bravo Management Pty Ltd Level 1, 435 Malvern Rd
RALPH ROBERTSON MEMORIAL LECTURE 2007
What colour is it / are they?
Carlton Football Club.
How to Enter My ONLINE Roster.
South African Flag The South African flag contains the most colours of any national flag. Can you colour it in here? RED WHITE YELLOW WHITE BLACK GREEN.
My team assignment BY SHANNON.
ART HISTORY QUIZ #1 FRIDAY, NOVEMBER 6th.
Data Analysis in the Australian Football League
Like.
Colours.
Good ……… ……………name is Peter. ………………meet you. My Nice to
Welcome To The AFL Club Theme Song Quiz
Creating and Managing Database Tables
What Color is it?.
What colour is it / are they?
Presentation transcript:

By De Wen Zhong

 This database holds data about the teams that are involved in the AFL  There are eight tables altogether each holding data about various things related to each team.  There is a table that contains data on each of the teams such as when they joined the league and how many premierships they have won in the past.  Has information about players and what teams they play for at the moment as well as the team they may have transferred from.  Has coach information such as who they coach and what type of coach they are (Head or Assistant).  Information in each team’s home grounds in which they play at such as the capacity and location.  Also has information on what the team colours are for each team.

ColoursColourIDColourName TeamColoursTeamName*ColourID* TeamsTeamNameTeamStartTeamPremiershipsTeamMascot VenueDetailsVenueIDVenueNameLocationCapacity TeamVenueTeamName*VenueID* TeamPlayerTeamName*PlayerID*PastClubs* PlayerDetailsPlayerIDPlayerLastNamePlayerFirstNameDebutDOB CoachDetailsCoachIDTeamName*CoachLastNameCoachFirstNameCoachTypeFirstYearCoachPremierships

 One team can have many coaches coachlastname | teamname coachlastname | teamname Clarkson | Hawthorn Clarkson | Hawthorn Connelly | Fremantle Connelly | Fremantle Craig | Adelaide Craig | Adelaide Daniher | Melbourne Daniher | Melbourne Eade | Footscray Eade | Footscray Laidley | North Melbourne Laidley | North Melbourne Lyon | St Kilda Lyon | St Kilda Malthouse | Collingwood Malthouse | Collingwood Matthews | Brisbane/Fitzroy Matthews | Brisbane/Fitzroy Pagan | Carlton Pagan | Carlton Roos | Sydney/South Melbourne Roos | Sydney/South Melbourne Sheedy | Essendon Sheedy | Essendon Thompson | Geelong Thompson | Geelong Wallace | Richmond Wallace | Richmond Williams | Port Adelaide Williams | Port Adelaide Worsfold | West Coast Worsfold | West Coast Longmire | Sydney/South Melbourne Longmire | Sydney/South Melbourne Blakey | Sydney/South Melbourne Blakey | Sydney/South Melbourne Berbakov | Sydney/South Melbourne Berbakov | Sydney/South Melbourne Allison | Sydney/South Melbourne Allison | Sydney/South Melbourne (20 rows) TeamsTeamNameTeamStartTeamPremiershipsTeamMascot CoachDetailsCoachIDTeamName*CoachLastNameCoachFirstNameCoachTypeFirstYearCoachPremierships Foreign Key Primary key

 One team can have many colours while many teams can share one colour ColoursColourIDColourName TeamColoursTeamName*ColourID* TeamsTeamNameTeamStartTeamPremiershipsTeamMascot Primary Key Foriegn Key Primary Key Foriegn Key

 One team can have many colours while many teams can share one colour colourid | colourname colourid | colourname | Black 1 | Black 2 | Blue 2 | Blue 3 | Brown 3 | Brown 4 | Green 4 | Green 5 | Maroon 5 | Maroon 6 | Navy Blue 6 | Navy Blue 7 | Red 7 | Red 8 | Teal 8 | Teal 9 | Yellow 9 | Yellow 10 | White 10 | White (10 rows) teamname | other columns teamname | other columns Adelaide |... Adelaide |... Brisbane/Fitzroy |... Brisbane/Fitzroy |... Carlton |... Carlton |... Collingwood |... Collingwood |... Essendon |... Essendon |... Fremantle |... Fremantle |... Geelong |... Geelong | |... (16 rows) teamname | colourid teamname | colourid Adelaide | 1 Adelaide | 1 Adelaide | 7 Adelaide | 7 Adelaide | 9 Adelaide | 9 Brisbane/Fitzroy | 9 Brisbane/Fitzroy | 9 Brisbane/Fitzroy | 5 Brisbane/Fitzroy | 5 Carlton | 10 Carlton | 10 Carlton | 6 Carlton | 6 Collingwood | 1 Collingwood | 1 Collingwood | 10 Collingwood | | |... (39 rows) Colours TeamColours Teams ColourID comes from Colours table TeamName comes from Teams table

 Show all the teams that have won more than 2 premierships SELECT teamname, teamstart, teampremierships FROM teams WHERE teampremierships >2; teamname | teamstart | teampremierships teamname | teamstart | teampremierships Brisbane/Fitzroy | 1983 | 11 Brisbane/Fitzroy | 1983 | 11 Carlton | 1897 | 16 Carlton | 1897 | 16 Collingwood | 1897 | 14 Collingwood | 1897 | 14 Essendon | 1897 | 16 Essendon | 1897 | 16 Geelong | 1859 | 6 Geelong | 1859 | 6 Hawthorn | 1873 | 9 Hawthorn | 1873 | 9 North Melbourne | 1869 | 4 North Melbourne | 1869 | 4 Melbourne | 1856 | 12 Melbourne | 1856 | 12 Richmond | 1908 | 10 Richmond | 1908 | 10 Sydney/South Melbourne | 1897 | 4 Sydney/South Melbourne | 1897 | 4 West Coast | 1987 | 3 West Coast | 1987 | 3 (11 rows)

 Show the coaches who are coaching Sydney/South Melbourne SELECT teamname, coachlastname, coachfirstname, coachtype FROM teams NATURAL JOIN coachdetails WHERE teamname = ‘Sydney/South Melbourne’; teamname | coachlastname | coachfirstname | coachtype teamname | coachlastname | coachfirstname | coachtype Sydney/South Melbourne | Roos | Paul | Head Coach Sydney/South Melbourne | Roos | Paul | Head Coach Sydney/South Melbourne | Longmire | John | Assistant Coach Sydney/South Melbourne | Longmire | John | Assistant Coach Sydney/South Melbourne | Blakey | John | Assistant Coach Sydney/South Melbourne | Blakey | John | Assistant Coach Sydney/South Melbourne | Berbakov | Peter | Assistant Coach Sydney/South Melbourne | Berbakov | Peter | Assistant Coach Sydney/South Melbourne | Allison | Brett | Assistant Coach Sydney/South Melbourne | Allison | Brett | Assistant Coach (5 rows)

 Show which coach is coaching which team SELECT teams.teamname, coachlastname, coachfirstname, coachtype FROM teams, coachdetails WHERE teams.teamname = coachdetails.teamname AND teams.teamname = ‘Sydney/South Melbourne’; teamname | coachlastname | coachfirstname | coachtype teamname | coachlastname | coachfirstname | coachtype Sydney/South Melbourne | Roos | Paul | Head Coach Sydney/South Melbourne | Roos | Paul | Head Coach Sydney/South Melbourne | Longmire | John | Assistant Coach Sydney/South Melbourne | Longmire | John | Assistant Coach Sydney/South Melbourne | Blakey | John | Assistant Coach Sydney/South Melbourne | Blakey | John | Assistant Coach Sydney/South Melbourne | Berbakov | Peter | Assistant Coach Sydney/South Melbourne | Berbakov | Peter | Assistant Coach Sydney/South Melbourne | Allison | Brett | Assistant Coach Sydney/South Melbourne | Allison | Brett | Assistant Coach (5 rows)

 Show the amount of home grounds a team has given they have more than 1 SELECT teamname, count(*) as amount FROM teamvenue GROUP BY teamname HAVING count(*) >1; teamname | amount teamname | amount Footscray | 4 Footscray | 4 Essendon | 2 Essendon | 2 Collingwood | 2 Collingwood | 2 Hawthorn | 2 Hawthorn | 2 Sydney/South Melbourne | 2 Sydney/South Melbourne | 2 North Melbourne | 3 North Melbourne | 3 Richmond | 2 Richmond | 2 Carlton | 2 Carlton | 2 Melbourne | 3 Melbourne | 3 (9 rows)

 Find the players who have played in the same previous club as ‘Barry Hall’ SELECT playerfirstname, playerlastname, pastclubs FROM teamplayer NATURAL JOIN playerdetails WHERE pastclubs = ( SELECT pastclubs FROM teamplayer NATURAL JOIN playerdetails WHERE playerfirstname = ‘Barry’ AND playerlastname = ‘Hall’; WHERE playerfirstname = ‘Barry’ AND playerlastname = ‘Hall’; playerlastname | playerfirstname playerlastname | playerfirstname Everitt | Peter Everitt | Peter Hall | Barry Hall | Barry (2 rows)

 Find the players who have played in the same previous club as ‘Barry Hall’ SELECT p1.playerfirstname, p1.playerlastname, t1.pastclubs FROM teamplayer t1, teamplayer t2, playerdetails p1, playerdetails p2 WHERE p2.playerfirstname = ‘Barry’ AND p2.playerlastname = ‘Hall’ AND t1.playerno = p1.playerno AND t2.playerno = p2.playerno AND t1.pastclubs = t2.pastclubs; playerlastname | playerfirstname playerlastname | playerfirstname Everitt | Peter Everitt | Peter Hall | Barry Hall | Barry (2 rows)

 CHECK statements makes sure the user does not enter in invalid data  To check for a valid year for a team to join the league CONSTRAINT TeamStart CHECK(TeamStart >= 1856)  Check for a valid capacity for a venue (more then people but less than people) CONSTRAINT Capacity CHECK((Capacity > 10000) AND (Capacity 10000) AND (Capacity < ))  Check for a valid debut year for a player (after 1970) CONSTRAINT Debut CHECK(Debut >= 1970)  Check for a valid date of birth for a player (after 1950) CONSTRAINT DOB CHECK(DOB >= 1950)

 Check the coachtype will be either head coach or assistant coach CONSTRAINT CoachType CHECK((CoachType = 'Head Coach') OR (CoachType = 'Assistant Coach'))  Check the first year of the coach coaching is after 1950 CONSTRAINT FirstYear CHECK(FirstYear >= 1950)

 Make sure to retain the integrity of the database  When one record is dependent an another, when the main record is deleted, delete the dependent record as well  When one record is dependent an another, when the main record is being changed, change the dependent record as well CONSTRAINT TeamNameFK FOREIGN KEY (TeamName) REFERENCEs Teams ON DELETE CASCADE ON UPDATE CASCADE, ON UPDATE CASCADE,

 Show all the venues that Footscray plays on as a home ground CREATE VIEW footscrayvenues (venuename, location, capacity) CREATE VIEW footscrayvenues (venuename, location, capacity) AS SELECT venuename, location, capacity FROM teamvenue natural join venuedetails WHERE teamname = 'Footscray'; venuename | location | capacity venuename | location | capacity Melbourne Cricket Ground | Melbourne | Melbourne Cricket Ground | Melbourne | Telstra Dome | Melbourne | Telstra Dome | Melbourne | Manuka Oval | Canberra | Manuka Oval | Canberra | Marrara Oval | Darwin | Marrara Oval | Darwin | (4 rows)

 Show all the venues that Footscray plays on as a home ground that has a capacity of over SELECT * FROM footscrayvenues SELECT * FROM footscrayvenues WHERE capacity > 50000; venuename | location | capacity venuename | location | capacity Melbourne Cricket Ground | Melbourne | Melbourne Cricket Ground | Melbourne | Telstra Dome | Melbourne | Telstra Dome | Melbourne | (2 rows)