Table: race_results_2008_spanish_2
Columns: rider
manufacturer
laps
time
grid

Question: Which Laps have a Time of +23.002, and a Grid smaller than 11?
SQL: SELECT AVG("laps") FROM race_results_2008_spanish_2 WHERE "time" = '+23.002' AND "grid" < 11

Question: Which Laps have a Manufacturer of aprilia, and a Rider of sergio gadea?
SQL: SELECT "laps" FROM race_results_2008_spanish_2 WHERE "manufacturer" = 'aprilia' AND "rider" = 'sergio gadea'

Question: Which Grid that has a Rider of mike di meglio, and Laps larger than 23?
SQL: SELECT AVG("grid") FROM race_results_2008_spanish_2 WHERE "rider" = 'mike di meglio' AND "laps" > 23

Question: Which Manufacturer has a Grid smaller than 9, and a Time of +22.517?
SQL: SELECT "manufacturer" FROM race_results_2008_spanish_2 WHERE "grid" < 9 AND "time" = '+22.517'