Step 1: Extract the numerical month from the 'date' column then add column 'month' to existing table.
home_team |
home_team_score |
away_team |
away_team_score |
venue |
crowd |
date |
melbourne |
11.18 (84) |
st kilda |
11.6 (72) |
mcg |
48952 |
1962-06-23 |
essendon |
15.17 (107) |
geelong |
10.7 (67) |
windy hill |
35000 |
1962-06-23 |
collingwood |
10.14 (74) |
fitzroy |
9.11 (65) |
victoria park |
26488 |
1962-06-23 |
carlton |
12.9 (81) |
footscray |
9.10 (64) |
princes park |
32400 |
1962-06-23 |
south melbourne |
10.13 (73) |
richmond |
11.13 (79) |
lake oval |
17000 |
1962-06-23 |
north melbourne |
10.8 (68) |
hawthorn |
10.7 (67) |
arden street oval |
8470 |
1962-06-23 |
Step 2: Select rows where 'month' is July.
home_team |
home_team_score |
away_team |
away_team_score |
venue |
crowd |
date |
month |
melbourne |
11.18 (84) |
st kilda |
11.6 (72) |
mcg |
48952 |
1962-06-23 |
6 |
essendon |
15.17 (107) |
geelong |
10.7 (67) |
windy hill |
35000 |
1962-06-23 |
6 |
collingwood |
10.14 (74) |
fitzroy |
9.11 (65) |
victoria park |
26488 |
1962-06-23 |
6 |
carlton |
12.9 (81) |
footscray |
9.10 (64) |
princes park |
32400 |
1962-06-23 |
6 |
south melbourne |
10.13 (73) |
richmond |
11.13 (79) |
lake oval |
17000 |
1962-06-23 |
6 |
north melbourne |
10.8 (68) |
hawthorn |
10.7 (67) |
arden street oval |
8470 |
1962-06-23 |
6 |
Step 3: Use a `CASE` statement to return TRUE if the number of rows is equal to 0, otherwise return FALSE.
home_team |
home_team_score |
away_team |
away_team_score |
venue |
crowd |
date |
month |