Step 1: Select rows where 'sport' is 'wrestling'.
date |
site |
sport |
winning_team |
series |
2007-09-04 |
cedar rapids |
m golf |
iowa state |
iowa state 2 - 0 |
2007-09-08 |
des moines |
volleyball |
iowa state |
iowa state 4 - 0 |
2007-09-09 |
iowa city |
w soccer |
tie |
iowa state 5 - 1 |
2007-09-15 |
ames |
football |
iowa state |
iowa state 8 - 1 |
2007-11-10 |
peoria |
m cross country |
iowa state |
iowa state 10 - 1 |
2007-11-10 |
peoria |
w cross country |
iowa |
iowa state 10 - 3 |
2007-12-05 |
ames |
w basketball |
iowa state |
iowa state 12 - 3 |
2007-12-07 |
ames |
w swimming |
iowa state |
iowa state 14 - 3 |
2007-12-08 |
ames |
m basketball |
iowa state |
iowa state 16 - 3 |
2007-12-09 |
ames |
wrestling |
iowa |
iowa state 16 - 5 |
2008-02-22 |
ames |
w gymnastics |
iowa state |
iowa state 18 - 5 |
2008-03-07 |
iowa city |
w gymnastics |
iowa |
iowa state 18 - 7 |
2008-04-01 |
ames |
softball |
iowa |
iowa state 18 - 9 |
Step 2: Extract the numerical year from the 'date' column to add column 'year' to existing table.
date |
site |
sport |
winning_team |
series |
2007-12-09 |
ames |
wrestling |
iowa |
iowa state 16 - 5 |
Step 3: Select rows where 'year' is 2007.
date |
site |
sport |
winning_team |
series |
year |
2007-12-09 |
ames |
wrestling |
iowa |
iowa state 16 - 5 |
2007 |
Step 4: Cast to DATE and order the table by 'date' in descending order and select the first row.
date |
site |
sport |
winning_team |
series |
year |
2007-12-09 |
ames |
wrestling |
iowa |
iowa state 16 - 5 |
2007 |
Step 5: Select rows where 'sport' is 'wrestling' and 'date' is the same as the date in the previous step.
date |
site |
sport |
winning_team |
series |
year |
formatted_date |
2007-12-09 |
ames |
wrestling |
iowa |
iowa state 16 - 5 |
2007 |
2007 |
Step 6: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.
date |
site |
sport |
winning_team |
series |
year |
formatted_date |
2007-12-09 |
ames |
wrestling |
iowa |
iowa state 16 - 5 |
2007 |
2007 |
Prediction: TRUE
Ground-truth: TRUE