22

end_station_id number ,
bike_id number ,
subscription_type text ,
zip_code number ,
primary key ( id )
)
insert into trip (id, duration, start_date, start_station_name,
start_station_id, end_date, end_station_name, end_station_id, bike_id,
subscription_type, zip_code) values (900504,384,’8/21/2015 17:03’,’Howard at
2nd’,63,’8/21/2015 17:10’,’San Francisco Caltrain 2 (330 Townsend)’,69,454,
’Subscriber’,94041);

Translate the following question into SQL.

Question: What is the average longitude of stations that never had bike
availability more than 10?

SQL: SELECT AVG(long) FROM station WHERE id NOT IN (SELECT station_id FROM
status GROUP BY station_id HAVING MAX(bikes_available) > 10)

CREATE TABLE allergy_type (
allergy text ,
allergytype text ,
primary key ( allergy )
)
insert into allergy_type (allergy, allergytype) values ( ’Eggs’, ’food’ );
Teaching Large Language Models to Self-Debug