Plan-of-SQLs (Ours)


Statement: the player with the highest number of league goals is ian robins

Ground-truth: TRUE

Input Table: 1979 - 80 huddersfield town f.c. season

Step 1: Select rows where 'position' is 'fw'.
name position league_apps league_goals fa_cup_apps fa_cup_goals league_cup_apps league_cup_goals total_apps total_goals
jim branagan df 0 0 0 0 0 (1) 0 0 (1) 0
malcolm brown df 46 2 2 0 4 1 52 3
david cowling mf 39 (1) 10 1 0 4 0 44 (1) 10
peter fletcher fw 30 (8) 17 2 0 3 1 35 (8) 18
keith hanvey df 33 2 0 0 4 0 39 2
peter hart mf 46 4 1 1 4 0 51 5
ian holmes mf 6 (4) 3 0 0 4 1 10 (4) 4
steve kindon fw 22 (1) 14 0 0 0 0 22 (1) 14
mick laverick mf 45 4 2 0 4 0 51 4
bernard purdie df 18 (4) 0 2 0 0 0 20 (4) 0
andy rankin gk 24 0 0 0 0 0 24 0
ian robins fw 45 25 2 0 4 2 51 27
fred robinson df 30 1 2 0 4 0 36 1
tommy smith fw 0 0 0 0 1 0 1 0
brian stanton mf 41 9 2 0 0 0 43 9
alan starling gk 22 0 2 0 4 0 28 0
dave sutton df 46 6 2 0 4 1 52 7
chris topping df 13 0 2 0 0 0 15 0

Step 2: Cast to INT and order the table by 'league_goals' in descending order and select the first row.
name position league_apps league_goals fa_cup_apps fa_cup_goals league_cup_apps league_cup_goals total_apps total_goals
peter fletcher fw 30 (8) 17 2 0 3 1 35 (8) 18
steve kindon fw 22 (1) 14 0 0 0 0 22 (1) 14
ian robins fw 45 25 2 0 4 2 51 27
tommy smith fw 0 0 0 0 1 0 1 0

Step 3: Select rows where 'name' is 'ian robins'.
name position league_apps league_goals fa_cup_apps fa_cup_goals league_cup_apps league_cup_goals total_apps total_goals
ian robins fw 45 25 2 0 4 2 51 27

Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.
name position league_apps league_goals fa_cup_apps fa_cup_goals league_cup_apps league_cup_goals total_apps total_goals
ian robins fw 45 25 2 0 4 2 51 27

Final output table:
verification_result
TRUE

Prediction: TRUE

Ground-truth: TRUE