Table: player_stats_17
Columns: nat
name
since
app_gs_sub
goals
ends
transfer_fee

Question: What is the greatest goals for Curtis Davies if ends is greater than 2012?
SQL: SELECT MAX("goals") FROM player_stats_17 WHERE "name" = 'curtis davies' AND "ends" > 2012

Question: When the transfer fee is £8.5m, what is the total ends?
SQL: SELECT SUM("ends") FROM player_stats_17 WHERE "transfer_fee" = '£8.5m'