{"instruction":"Name the home team for carlton away team","input":"CREATE TABLE table_name_77 (\n home_team VARCHAR,\n away_team VARCHAR\n)","response":"SELECT home_team FROM table_name_77 WHERE away_team = \"carlton\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the home team for carlton away team ### Input: CREATE TABLE table_name_77 (\n home_team VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT home_team FROM table_name_77 WHERE away_team = \"carlton\""} {"instruction":"what will the population of Asia be when Latin America\/Caribbean is 783 (7.5%)?","input":"CREATE TABLE table_22767 (\n \"Year\" real,\n \"World\" real,\n \"Asia\" text,\n \"Africa\" text,\n \"Europe\" text,\n \"Latin America\/Caribbean\" text,\n \"Northern America\" text,\n \"Oceania\" text\n)","response":"SELECT \"Asia\" FROM table_22767 WHERE \"Latin America\/Caribbean\" = '783 (7.5%)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what will the population of Asia be when Latin America\/Caribbean is 783 (7.5%)? ### Input: CREATE TABLE table_22767 (\n \"Year\" real,\n \"World\" real,\n \"Asia\" text,\n \"Africa\" text,\n \"Europe\" text,\n \"Latin America\/Caribbean\" text,\n \"Northern America\" text,\n \"Oceania\" text\n) ### Response: SELECT \"Asia\" FROM table_22767 WHERE \"Latin America\/Caribbean\" = '783 (7.5%)'"} {"instruction":"How many faculty members do we have for each gender? Draw a bar chart, order by the Y-axis in descending.","input":"CREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Activity (\n actid INTEGER,\n activity_name varchar(25)\n)\n\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER\n)","response":"SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members do we have for each gender? Draw a bar chart, order by the Y-axis in descending. ### Input: CREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Activity (\n actid INTEGER,\n activity_name varchar(25)\n)\n\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER\n) ### Response: SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY COUNT(*) DESC"} {"instruction":"List the record of 0-1 from the table?","input":"CREATE TABLE table_14656147_2 (\n week VARCHAR,\n record VARCHAR\n)","response":"SELECT week FROM table_14656147_2 WHERE record = \"0-1\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the record of 0-1 from the table? ### Input: CREATE TABLE table_14656147_2 (\n week VARCHAR,\n record VARCHAR\n) ### Response: SELECT week FROM table_14656147_2 WHERE record = \"0-1\""} {"instruction":"Which silver has a Gold smaller than 12, a Rank smaller than 5, and a Bronze of 5?","input":"CREATE TABLE table_name_24 (\n silver VARCHAR,\n bronze VARCHAR,\n gold VARCHAR,\n rank VARCHAR\n)","response":"SELECT silver FROM table_name_24 WHERE gold < 12 AND rank < 5 AND bronze = 5","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which silver has a Gold smaller than 12, a Rank smaller than 5, and a Bronze of 5? ### Input: CREATE TABLE table_name_24 (\n silver VARCHAR,\n bronze VARCHAR,\n gold VARCHAR,\n rank VARCHAR\n) ### Response: SELECT silver FROM table_name_24 WHERE gold < 12 AND rank < 5 AND bronze = 5"} {"instruction":"When did Samsung Electronics Co LTD make the GT-i9100?","input":"CREATE TABLE table_47482 (\n \"Company name\" text,\n \"Hardware Model\" text,\n \"Accreditation type\" text,\n \"Accreditation level\" text,\n \"Date\" text\n)","response":"SELECT \"Date\" FROM table_47482 WHERE \"Company name\" = 'samsung electronics co ltd' AND \"Hardware Model\" = 'gt-i9100'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did Samsung Electronics Co LTD make the GT-i9100? ### Input: CREATE TABLE table_47482 (\n \"Company name\" text,\n \"Hardware Model\" text,\n \"Accreditation type\" text,\n \"Accreditation level\" text,\n \"Date\" text\n) ### Response: SELECT \"Date\" FROM table_47482 WHERE \"Company name\" = 'samsung electronics co ltd' AND \"Hardware Model\" = 'gt-i9100'"} {"instruction":"what are the early morning flights from BOSTON to DENVER","input":"CREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 0 AND 800","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the early morning flights from BOSTON to DENVER ### Input: CREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 0 AND 800"} {"instruction":"Name the most 3 credits","input":"CREATE TABLE table_148535_2 (\n Id VARCHAR\n)","response":"SELECT MIN(3 AS _credits) FROM table_148535_2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most 3 credits ### Input: CREATE TABLE table_148535_2 (\n Id VARCHAR\n) ### Response: SELECT MIN(3 AS _credits) FROM table_148535_2"} {"instruction":"What is every yellow jersey entry for the distance 125?","input":"CREATE TABLE table_3791 (\n \"Year\" text,\n \"Stage\" real,\n \"Start of stage\" text,\n \"Distance (km)\" text,\n \"Category of climb\" text,\n \"Stage winner\" text,\n \"Nationality\" text,\n \"Yellow jersey\" text,\n \"Bend\" real\n)","response":"SELECT \"Yellow jersey\" FROM table_3791 WHERE \"Distance (km)\" = '125'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every yellow jersey entry for the distance 125? ### Input: CREATE TABLE table_3791 (\n \"Year\" text,\n \"Stage\" real,\n \"Start of stage\" text,\n \"Distance (km)\" text,\n \"Category of climb\" text,\n \"Stage winner\" text,\n \"Nationality\" text,\n \"Yellow jersey\" text,\n \"Bend\" real\n) ### Response: SELECT \"Yellow jersey\" FROM table_3791 WHERE \"Distance (km)\" = '125'"} {"instruction":"In what years was there a rank lower than 9, under 84 goals, and more than 158 matches?","input":"CREATE TABLE table_name_63 (\n years VARCHAR,\n goals VARCHAR,\n matches VARCHAR,\n rank VARCHAR\n)","response":"SELECT years FROM table_name_63 WHERE matches > 158 AND rank > 9 AND goals < 84","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what years was there a rank lower than 9, under 84 goals, and more than 158 matches? ### Input: CREATE TABLE table_name_63 (\n years VARCHAR,\n goals VARCHAR,\n matches VARCHAR,\n rank VARCHAR\n) ### Response: SELECT years FROM table_name_63 WHERE matches > 158 AND rank > 9 AND goals < 84"} {"instruction":"What aired at 10:00 when Flashpoint aired at 9:30?","input":"CREATE TABLE table_43208 (\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"9:30\" text,\n \"10:00\" text\n)","response":"SELECT \"10:00\" FROM table_43208 WHERE \"9:30\" = 'flashpoint'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What aired at 10:00 when Flashpoint aired at 9:30? ### Input: CREATE TABLE table_43208 (\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"9:30\" text,\n \"10:00\" text\n) ### Response: SELECT \"10:00\" FROM table_43208 WHERE \"9:30\" = 'flashpoint'"} {"instruction":"count the number of patients whose insurance is government and procedure short title is rt\/left heart card cath?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Government\" AND procedures.short_title = \"Rt\/left heart card cath\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose insurance is government and procedure short title is rt\/left heart card cath? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Government\" AND procedures.short_title = \"Rt\/left heart card cath\""} {"instruction":"What was the record of the game in which Dydek (10) did the most high rebounds?","input":"CREATE TABLE table_18904831_5 (\n record VARCHAR,\n high_rebounds VARCHAR\n)","response":"SELECT record FROM table_18904831_5 WHERE high_rebounds = \"Dydek (10)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record of the game in which Dydek (10) did the most high rebounds? ### Input: CREATE TABLE table_18904831_5 (\n record VARCHAR,\n high_rebounds VARCHAR\n) ### Response: SELECT record FROM table_18904831_5 WHERE high_rebounds = \"Dydek (10)\""} {"instruction":"When was the game played at glenferrie oval?","input":"CREATE TABLE table_10130 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Date\" FROM table_10130 WHERE \"Venue\" = 'glenferrie oval'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the game played at glenferrie oval? ### Input: CREATE TABLE table_10130 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Date\" FROM table_10130 WHERE \"Venue\" = 'glenferrie oval'"} {"instruction":"What is the highest K 2 O, when Na 2 O is greater than 1.87, when Fe 2 O 3 is greater than 0.07, when Objects is Ritual Disk, and when Al 2 O 3 is less than 0.62?","input":"CREATE TABLE table_7207 (\n \"Objects\" text,\n \"Date\" text,\n \"SiO 2\" real,\n \"Al 2 O 3\" real,\n \"Fe 2 O 3\" real,\n \"K 2 O\" real,\n \"Na 2 O\" real\n)","response":"SELECT MAX(\"K 2 O\") FROM table_7207 WHERE \"Na 2 O\" > '1.87' AND \"Fe 2 O 3\" > '0.07' AND \"Objects\" = 'ritual disk' AND \"Al 2 O 3\" < '0.62'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest K 2 O, when Na 2 O is greater than 1.87, when Fe 2 O 3 is greater than 0.07, when Objects is Ritual Disk, and when Al 2 O 3 is less than 0.62? ### Input: CREATE TABLE table_7207 (\n \"Objects\" text,\n \"Date\" text,\n \"SiO 2\" real,\n \"Al 2 O 3\" real,\n \"Fe 2 O 3\" real,\n \"K 2 O\" real,\n \"Na 2 O\" real\n) ### Response: SELECT MAX(\"K 2 O\") FROM table_7207 WHERE \"Na 2 O\" > '1.87' AND \"Fe 2 O 3\" > '0.07' AND \"Objects\" = 'ritual disk' AND \"Al 2 O 3\" < '0.62'"} {"instruction":"what is the total number of patients diagnosed with icd9 code 45620 who had a blood test.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = \"45620\" AND lab.fluid = \"Blood\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of patients diagnosed with icd9 code 45620 who had a blood test. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = \"45620\" AND lab.fluid = \"Blood\""} {"instruction":"count the number of patients whose primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis and year of death is less than or equal to 2168?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS\" AND demographic.dod_year <= \"2168.0\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis and year of death is less than or equal to 2168? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS\" AND demographic.dod_year <= \"2168.0\""} {"instruction":"Which section is in the 6th position?","input":"CREATE TABLE table_72013 (\n \"Season\" text,\n \"Level\" text,\n \"Division\" text,\n \"Section\" text,\n \"Position\" text\n)","response":"SELECT \"Section\" FROM table_72013 WHERE \"Position\" = '6th'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which section is in the 6th position? ### Input: CREATE TABLE table_72013 (\n \"Season\" text,\n \"Level\" text,\n \"Division\" text,\n \"Section\" text,\n \"Position\" text\n) ### Response: SELECT \"Section\" FROM table_72013 WHERE \"Position\" = '6th'"} {"instruction":"What is the area of the coed school with a state authority and a roll number of 122?","input":"CREATE TABLE table_69300 (\n \"Name\" text,\n \"Years\" text,\n \"Gender\" text,\n \"Area\" text,\n \"Authority\" text,\n \"Decile\" real,\n \"Roll\" real\n)","response":"SELECT \"Area\" FROM table_69300 WHERE \"Authority\" = 'state' AND \"Gender\" = 'coed' AND \"Roll\" = '122'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the area of the coed school with a state authority and a roll number of 122? ### Input: CREATE TABLE table_69300 (\n \"Name\" text,\n \"Years\" text,\n \"Gender\" text,\n \"Area\" text,\n \"Authority\" text,\n \"Decile\" real,\n \"Roll\" real\n) ### Response: SELECT \"Area\" FROM table_69300 WHERE \"Authority\" = 'state' AND \"Gender\" = 'coed' AND \"Roll\" = '122'"} {"instruction":"Which type of institution is in Amherst, MA?","input":"CREATE TABLE table_name_1 (\n type VARCHAR,\n location VARCHAR\n)","response":"SELECT type FROM table_name_1 WHERE location = \"amherst, ma\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which type of institution is in Amherst, MA? ### Input: CREATE TABLE table_name_1 (\n type VARCHAR,\n location VARCHAR\n) ### Response: SELECT type FROM table_name_1 WHERE location = \"amherst, ma\""} {"instruction":"What years did Birger Ruud win the FIS Nordic World Ski Championships?","input":"CREATE TABLE table_21696 (\n \"Winner\" text,\n \"Country\" text,\n \"Winter Olympics\" text,\n \"FIS Nordic World Ski Championships\" text,\n \"Holmenkollen\" text\n)","response":"SELECT \"FIS Nordic World Ski Championships\" FROM table_21696 WHERE \"Winner\" = 'Birger Ruud'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years did Birger Ruud win the FIS Nordic World Ski Championships? ### Input: CREATE TABLE table_21696 (\n \"Winner\" text,\n \"Country\" text,\n \"Winter Olympics\" text,\n \"FIS Nordic World Ski Championships\" text,\n \"Holmenkollen\" text\n) ### Response: SELECT \"FIS Nordic World Ski Championships\" FROM table_21696 WHERE \"Winner\" = 'Birger Ruud'"} {"instruction":"how many members of estonia 's men 's national volleyball team were born in 1988 ?","input":"CREATE TABLE table_203_116 (\n id number,\n \"no.\" number,\n \"player\" text,\n \"birth date\" text,\n \"weight\" number,\n \"height\" number,\n \"position\" text,\n \"current club\" text\n)","response":"SELECT COUNT(\"player\") FROM table_203_116 WHERE \"birth date\" = 1988","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many members of estonia 's men 's national volleyball team were born in 1988 ? ### Input: CREATE TABLE table_203_116 (\n id number,\n \"no.\" number,\n \"player\" text,\n \"birth date\" text,\n \"weight\" number,\n \"height\" number,\n \"position\" text,\n \"current club\" text\n) ### Response: SELECT COUNT(\"player\") FROM table_203_116 WHERE \"birth date\" = 1988"} {"instruction":"What episoe number in the season originally aired on February 11, 1988?","input":"CREATE TABLE table_2818164_5 (\n no_in_season VARCHAR,\n original_air_date VARCHAR\n)","response":"SELECT no_in_season FROM table_2818164_5 WHERE original_air_date = \"February 11, 1988\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What episoe number in the season originally aired on February 11, 1988? ### Input: CREATE TABLE table_2818164_5 (\n no_in_season VARCHAR,\n original_air_date VARCHAR\n) ### Response: SELECT no_in_season FROM table_2818164_5 WHERE original_air_date = \"February 11, 1988\""} {"instruction":"What date was the match against adri n men ndez-maceiras?","input":"CREATE TABLE table_60686 (\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n)","response":"SELECT \"Date\" FROM table_60686 WHERE \"Opponent\" = 'adri\u00e1n men\u00e9ndez-maceiras'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date was the match against adri n men ndez-maceiras? ### Input: CREATE TABLE table_60686 (\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n) ### Response: SELECT \"Date\" FROM table_60686 WHERE \"Opponent\" = 'adri\u00e1n men\u00e9ndez-maceiras'"} {"instruction":"did shoko goto make more films in 2004 or 2005 ?","input":"CREATE TABLE table_203_365 (\n id number,\n \"released\" text,\n \"video title\" text,\n \"company\" text,\n \"director\" text,\n \"notes\" text\n)","response":"SELECT \"released\" FROM table_203_365 WHERE \"released\" IN (2004, 2005) GROUP BY \"released\" ORDER BY COUNT(\"video title\") DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did shoko goto make more films in 2004 or 2005 ? ### Input: CREATE TABLE table_203_365 (\n id number,\n \"released\" text,\n \"video title\" text,\n \"company\" text,\n \"director\" text,\n \"notes\" text\n) ### Response: SELECT \"released\" FROM table_203_365 WHERE \"released\" IN (2004, 2005) GROUP BY \"released\" ORDER BY COUNT(\"video title\") DESC LIMIT 1"} {"instruction":"What venue listed is dated February 22, 2003?","input":"CREATE TABLE table_65116 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n)","response":"SELECT \"Venue\" FROM table_65116 WHERE \"Date\" = 'february 22, 2003'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What venue listed is dated February 22, 2003? ### Input: CREATE TABLE table_65116 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n) ### Response: SELECT \"Venue\" FROM table_65116 WHERE \"Date\" = 'february 22, 2003'"} {"instruction":"provide the number of patients whose admission type is emergency and lab test name is rbc, csf?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND lab.label = \"RBC, CSF\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission type is emergency and lab test name is rbc, csf? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND lab.label = \"RBC, CSF\""} {"instruction":"How often does the course POLSCI 659 meet ?","input":"CREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)","response":"SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'POLSCI' AND course.number = 659 AND semester.semester = 'WN' AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How often does the course POLSCI 659 meet ? ### Input: CREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n) ### Response: SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'POLSCI' AND course.number = 659 AND semester.semester = 'WN' AND semester.year = 2016"} {"instruction":"Which couple participated in the Contemporary style of dance?","input":"CREATE TABLE table_40395 (\n \"Couple\" text,\n \"Style\" text,\n \"Music\" text,\n \"Choreographer(s)\" text,\n \"Results\" text\n)","response":"SELECT \"Couple\" FROM table_40395 WHERE \"Style\" = 'contemporary'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which couple participated in the Contemporary style of dance? ### Input: CREATE TABLE table_40395 (\n \"Couple\" text,\n \"Style\" text,\n \"Music\" text,\n \"Choreographer(s)\" text,\n \"Results\" text\n) ### Response: SELECT \"Couple\" FROM table_40395 WHERE \"Style\" = 'contemporary'"} {"instruction":"Name the metrical equivalence for linha","input":"CREATE TABLE table_28772 (\n \"Portuguese name\" text,\n \"English name\" text,\n \"Subdivides in\" text,\n \"Equivalence in Varas\" text,\n \"Metrical equivalence\" text\n)","response":"SELECT \"Metrical equivalence\" FROM table_28772 WHERE \"Portuguese name\" = 'Linha'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the metrical equivalence for linha ### Input: CREATE TABLE table_28772 (\n \"Portuguese name\" text,\n \"English name\" text,\n \"Subdivides in\" text,\n \"Equivalence in Varas\" text,\n \"Metrical equivalence\" text\n) ### Response: SELECT \"Metrical equivalence\" FROM table_28772 WHERE \"Portuguese name\" = 'Linha'"} {"instruction":"If the college is SMU, what is the position?","input":"CREATE TABLE table_27132791_3 (\n position VARCHAR,\n college VARCHAR\n)","response":"SELECT position FROM table_27132791_3 WHERE college = \"SMU\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the college is SMU, what is the position? ### Input: CREATE TABLE table_27132791_3 (\n position VARCHAR,\n college VARCHAR\n) ### Response: SELECT position FROM table_27132791_3 WHERE college = \"SMU\""} {"instruction":"What was the represented team on June 27?","input":"CREATE TABLE table_21876 (\n \"Season\" real,\n \"Date\" text,\n \"Winning Driver\" text,\n \"Car #\" real,\n \"Sponsor\" text,\n \"Make\" text,\n \"Team\" text,\n \"Avg Speed\" text,\n \"Margin of Victory\" text\n)","response":"SELECT \"Team\" FROM table_21876 WHERE \"Date\" = 'June 27'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the represented team on June 27? ### Input: CREATE TABLE table_21876 (\n \"Season\" real,\n \"Date\" text,\n \"Winning Driver\" text,\n \"Car #\" real,\n \"Sponsor\" text,\n \"Make\" text,\n \"Team\" text,\n \"Avg Speed\" text,\n \"Margin of Victory\" text\n) ### Response: SELECT \"Team\" FROM table_21876 WHERE \"Date\" = 'June 27'"} {"instruction":"Please show the songs that have result 'nominated' at music festivals.","input":"CREATE TABLE artist (\n artist_id number,\n artist text,\n age number,\n famous_title text,\n famous_release_date text\n)\n\nCREATE TABLE music_festival (\n id number,\n music_festival text,\n date_of_ceremony text,\n category text,\n volume number,\n result text\n)\n\nCREATE TABLE volume (\n volume_id number,\n volume_issue text,\n issue_date text,\n weeks_on_top number,\n song text,\n artist_id number\n)","response":"SELECT T2.song FROM music_festival AS T1 JOIN volume AS T2 ON T1.volume = T2.volume_id WHERE T1.result = \"Nominated\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please show the songs that have result 'nominated' at music festivals. ### Input: CREATE TABLE artist (\n artist_id number,\n artist text,\n age number,\n famous_title text,\n famous_release_date text\n)\n\nCREATE TABLE music_festival (\n id number,\n music_festival text,\n date_of_ceremony text,\n category text,\n volume number,\n result text\n)\n\nCREATE TABLE volume (\n volume_id number,\n volume_issue text,\n issue_date text,\n weeks_on_top number,\n song text,\n artist_id number\n) ### Response: SELECT T2.song FROM music_festival AS T1 JOIN volume AS T2 ON T1.volume = T2.volume_id WHERE T1.result = \"Nominated\""} {"instruction":"Which teams had more than 3 eliminations?","input":"CREATE TABLE elimination (\n elimination_id text,\n wrestler_id text,\n team text,\n eliminated_by text,\n elimination_move text,\n time text\n)\n\nCREATE TABLE wrestler (\n wrestler_id number,\n name text,\n reign text,\n days_held text,\n location text,\n event text\n)","response":"SELECT team FROM elimination GROUP BY team HAVING COUNT(*) > 3","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which teams had more than 3 eliminations? ### Input: CREATE TABLE elimination (\n elimination_id text,\n wrestler_id text,\n team text,\n eliminated_by text,\n elimination_move text,\n time text\n)\n\nCREATE TABLE wrestler (\n wrestler_id number,\n name text,\n reign text,\n days_held text,\n location text,\n event text\n) ### Response: SELECT team FROM elimination GROUP BY team HAVING COUNT(*) > 3"} {"instruction":"how many athletes had a better result than tatyana bocharova ?","input":"CREATE TABLE table_204_910 (\n id number,\n \"rank\" number,\n \"name\" text,\n \"nationality\" text,\n \"result\" number,\n \"notes\" text\n)","response":"SELECT COUNT(\"name\") FROM table_204_910 WHERE \"result\" > (SELECT \"result\" FROM table_204_910 WHERE \"name\" = 'tatyana bocharova')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many athletes had a better result than tatyana bocharova ? ### Input: CREATE TABLE table_204_910 (\n id number,\n \"rank\" number,\n \"name\" text,\n \"nationality\" text,\n \"result\" number,\n \"notes\" text\n) ### Response: SELECT COUNT(\"name\") FROM table_204_910 WHERE \"result\" > (SELECT \"result\" FROM table_204_910 WHERE \"name\" = 'tatyana bocharova')"} {"instruction":"Which Type has a Capacity of 28 passengers, and a Number of 16?","input":"CREATE TABLE table_8430 (\n \"Number\" text,\n \"Builder\" text,\n \"Type\" text,\n \"Date\" real,\n \"Length\" text,\n \"Capacity\" text\n)","response":"SELECT \"Type\" FROM table_8430 WHERE \"Capacity\" = '28 passengers' AND \"Number\" = '16'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Type has a Capacity of 28 passengers, and a Number of 16? ### Input: CREATE TABLE table_8430 (\n \"Number\" text,\n \"Builder\" text,\n \"Type\" text,\n \"Date\" real,\n \"Length\" text,\n \"Capacity\" text\n) ### Response: SELECT \"Type\" FROM table_8430 WHERE \"Capacity\" = '28 passengers' AND \"Number\" = '16'"} {"instruction":"Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.","input":"CREATE TABLE people (\n people_id number,\n district text,\n name text,\n party text,\n age number\n)\n\nCREATE TABLE debate_people (\n debate_id number,\n affirmative number,\n negative number,\n if_affirmative_win others\n)\n\nCREATE TABLE debate (\n debate_id number,\n date text,\n venue text,\n num_of_audience number\n)","response":"SELECT T3.name, T2.date, T2.venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.debate_id = T2.debate_id JOIN people AS T3 ON T1.negative = T3.people_id ORDER BY T3.name","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name. ### Input: CREATE TABLE people (\n people_id number,\n district text,\n name text,\n party text,\n age number\n)\n\nCREATE TABLE debate_people (\n debate_id number,\n affirmative number,\n negative number,\n if_affirmative_win others\n)\n\nCREATE TABLE debate (\n debate_id number,\n date text,\n venue text,\n num_of_audience number\n) ### Response: SELECT T3.name, T2.date, T2.venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.debate_id = T2.debate_id JOIN people AS T3 ON T1.negative = T3.people_id ORDER BY T3.name"} {"instruction":"is a 2 credit full house the same as a 5 credit three of a kind ?","input":"CREATE TABLE table_203_564 (\n id number,\n \"hand\" text,\n \"1 credit\" number,\n \"2 credits\" number,\n \"3 credits\" number,\n \"4 credits\" number,\n \"5 credits\" number\n)","response":"SELECT (SELECT \"2 credits\" FROM table_203_564 WHERE \"hand\" = 'full house') = (SELECT \"5 credits\" FROM table_203_564 WHERE \"hand\" = 'three of a kind')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is a 2 credit full house the same as a 5 credit three of a kind ? ### Input: CREATE TABLE table_203_564 (\n id number,\n \"hand\" text,\n \"1 credit\" number,\n \"2 credits\" number,\n \"3 credits\" number,\n \"4 credits\" number,\n \"5 credits\" number\n) ### Response: SELECT (SELECT \"2 credits\" FROM table_203_564 WHERE \"hand\" = 'full house') = (SELECT \"5 credits\" FROM table_203_564 WHERE \"hand\" = 'three of a kind')"} {"instruction":"Next semester , what time does the EDUC 510 lecture begin ?","input":"CREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)","response":"SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EDUC' AND course.number = 510 AND semester.semester = 'FA' AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Next semester , what time does the EDUC 510 lecture begin ? ### Input: CREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n) ### Response: SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EDUC' AND course.number = 510 AND semester.semester = 'FA' AND semester.year = 2016"} {"instruction":"For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of code , and group by attribute name, sort total number of code in asc order.","input":"CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)","response":"SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of code , and group by attribute name, sort total number of code in asc order. ### Input: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n) ### Response: SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code"} {"instruction":"What was the highest round that had northwestern?","input":"CREATE TABLE table_name_18 (\n round INTEGER,\n school VARCHAR\n)","response":"SELECT MAX(round) FROM table_name_18 WHERE school = \"northwestern\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest round that had northwestern? ### Input: CREATE TABLE table_name_18 (\n round INTEGER,\n school VARCHAR\n) ### Response: SELECT MAX(round) FROM table_name_18 WHERE school = \"northwestern\""} {"instruction":"What is the smallest Wins with a Position of 20th, and Poles smaller than 0?","input":"CREATE TABLE table_name_19 (\n wins INTEGER,\n position VARCHAR,\n poles VARCHAR\n)","response":"SELECT MIN(wins) FROM table_name_19 WHERE position = \"20th\" AND poles < 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest Wins with a Position of 20th, and Poles smaller than 0? ### Input: CREATE TABLE table_name_19 (\n wins INTEGER,\n position VARCHAR,\n poles VARCHAR\n) ### Response: SELECT MIN(wins) FROM table_name_19 WHERE position = \"20th\" AND poles < 0"} {"instruction":"Who is listed under mens singles when womens has wang nan zhang yining?","input":"CREATE TABLE table_30306 (\n \"Year Location\" text,\n \"Mens Singles\" text,\n \"Womens Singles\" text,\n \"Mens Doubles\" text,\n \"Womens Doubles\" text\n)","response":"SELECT \"Mens Singles\" FROM table_30306 WHERE \"Womens Doubles\" = 'Wang Nan Zhang Yining'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is listed under mens singles when womens has wang nan zhang yining? ### Input: CREATE TABLE table_30306 (\n \"Year Location\" text,\n \"Mens Singles\" text,\n \"Womens Singles\" text,\n \"Mens Doubles\" text,\n \"Womens Doubles\" text\n) ### Response: SELECT \"Mens Singles\" FROM table_30306 WHERE \"Womens Doubles\" = 'Wang Nan Zhang Yining'"} {"instruction":"What are the start and end dates for incidents with incident type code 'NOISE'?","input":"CREATE TABLE Behavior_Incident (\n date_incident_start VARCHAR,\n date_incident_end VARCHAR,\n incident_type_code VARCHAR\n)","response":"SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = \"NOISE\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the start and end dates for incidents with incident type code 'NOISE'? ### Input: CREATE TABLE Behavior_Incident (\n date_incident_start VARCHAR,\n date_incident_end VARCHAR,\n incident_type_code VARCHAR\n) ### Response: SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = \"NOISE\""} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, display by the the average of manager id in ascending please.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)","response":"SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, display by the the average of manager id in ascending please. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n) ### Response: SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)"} {"instruction":"who is listed as the last responsible mister -lrb- s -rrb- on this chart ?","input":"CREATE TABLE table_204_988 (\n id number,\n \"responsible minister(s)\" text,\n \"crown entities\" text,\n \"monitoring department(s)\" text,\n \"category \/ type\" text,\n \"empowering legislation\" text\n)","response":"SELECT \"responsible minister(s)\" FROM table_204_988 ORDER BY id DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is listed as the last responsible mister -lrb- s -rrb- on this chart ? ### Input: CREATE TABLE table_204_988 (\n id number,\n \"responsible minister(s)\" text,\n \"crown entities\" text,\n \"monitoring department(s)\" text,\n \"category \/ type\" text,\n \"empowering legislation\" text\n) ### Response: SELECT \"responsible minister(s)\" FROM table_204_988 ORDER BY id DESC LIMIT 1"} {"instruction":"Users with highest reputation both in SO and Math ( geometric mean = average digits).","input":"CREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"SELECT s.DisplayName, s.Reputation AS RepSO, m.Reputation AS RepMath, (LOG10(s.Reputation) + LOG10(m.Reputation)) \/ 2 AS RepAvDigits FROM \"stackexchange.math\".Users AS m, \"stackoverflow\".Users AS s WHERE s.Reputation > 10000 AND m.Reputation > 10000 AND s.AccountId = m.AccountId ORDER BY 4 DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users with highest reputation both in SO and Math ( geometric mean = average digits). ### Input: CREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: SELECT s.DisplayName, s.Reputation AS RepSO, m.Reputation AS RepMath, (LOG10(s.Reputation) + LOG10(m.Reputation)) \/ 2 AS RepAvDigits FROM \"stackexchange.math\".Users AS m, \"stackoverflow\".Users AS s WHERE s.Reputation > 10000 AND m.Reputation > 10000 AND s.AccountId = m.AccountId ORDER BY 4 DESC"} {"instruction":"What is the series # when the director is john showalter?","input":"CREATE TABLE table_29747178_2 (\n series__number VARCHAR,\n directed_by VARCHAR\n)","response":"SELECT series__number FROM table_29747178_2 WHERE directed_by = \"John Showalter\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the series # when the director is john showalter? ### Input: CREATE TABLE table_29747178_2 (\n series__number VARCHAR,\n directed_by VARCHAR\n) ### Response: SELECT series__number FROM table_29747178_2 WHERE directed_by = \"John Showalter\""} {"instruction":"provide the number of patients whose admission type is emergency and diagnosis long title is other drugs and medicinal substances causing adverse effects in therapeutic use.","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND diagnoses.long_title = \"Other drugs and medicinal substances causing adverse effects in therapeutic use\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission type is emergency and diagnosis long title is other drugs and medicinal substances causing adverse effects in therapeutic use. ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND diagnoses.long_title = \"Other drugs and medicinal substances causing adverse effects in therapeutic use\""} {"instruction":"What was the regular season standings for the year when the playoffs reached the conference semifinals and the team did not qualify for the US Open Cup?","input":"CREATE TABLE table_19191 (\n \"Year\" real,\n \"League\" text,\n \"Reg. Season\" text,\n \"Playoffs\" text,\n \"US Open Cup\" text,\n \"Avg. Attendance\" real\n)","response":"SELECT \"Reg. Season\" FROM table_19191 WHERE \"Playoffs\" = 'Conference Semifinals' AND \"US Open Cup\" = 'Did not qualify'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the regular season standings for the year when the playoffs reached the conference semifinals and the team did not qualify for the US Open Cup? ### Input: CREATE TABLE table_19191 (\n \"Year\" real,\n \"League\" text,\n \"Reg. Season\" text,\n \"Playoffs\" text,\n \"US Open Cup\" text,\n \"Avg. Attendance\" real\n) ### Response: SELECT \"Reg. Season\" FROM table_19191 WHERE \"Playoffs\" = 'Conference Semifinals' AND \"US Open Cup\" = 'Did not qualify'"} {"instruction":"How much Long has a Loss larger than 2, and a Gain of 157, and an Avg\/G smaller than 129?","input":"CREATE TABLE table_37490 (\n \"Name\" text,\n \"Gain\" real,\n \"Loss\" real,\n \"Long\" real,\n \"Avg\/G\" real\n)","response":"SELECT SUM(\"Long\") FROM table_37490 WHERE \"Loss\" > '2' AND \"Gain\" = '157' AND \"Avg\/G\" < '129'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Long has a Loss larger than 2, and a Gain of 157, and an Avg\/G smaller than 129? ### Input: CREATE TABLE table_37490 (\n \"Name\" text,\n \"Gain\" real,\n \"Loss\" real,\n \"Long\" real,\n \"Avg\/G\" real\n) ### Response: SELECT SUM(\"Long\") FROM table_37490 WHERE \"Loss\" > '2' AND \"Gain\" = '157' AND \"Avg\/G\" < '129'"} {"instruction":"How many pages does the edition with a volume # smaller than 8 and an ISBM of 1-40122-892-5 have?","input":"CREATE TABLE table_7363 (\n \"Vol. #\" real,\n \"Title\" text,\n \"Material collected\" text,\n \"Pages\" real,\n \"ISBN\" text\n)","response":"SELECT SUM(\"Pages\") FROM table_7363 WHERE \"Vol. #\" < '8' AND \"ISBN\" = '1-40122-892-5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many pages does the edition with a volume # smaller than 8 and an ISBM of 1-40122-892-5 have? ### Input: CREATE TABLE table_7363 (\n \"Vol. #\" real,\n \"Title\" text,\n \"Material collected\" text,\n \"Pages\" real,\n \"ISBN\" text\n) ### Response: SELECT SUM(\"Pages\") FROM table_7363 WHERE \"Vol. #\" < '8' AND \"ISBN\" = '1-40122-892-5'"} {"instruction":"Ranking of questions by score.","input":"CREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT Posts.Id AS \"post_link\", Posts.Title, Posts.Score AS Score FROM Posts ORDER BY Posts.Score DESC LIMIT 100","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Ranking of questions by score. ### Input: CREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT Posts.Id AS \"post_link\", Posts.Title, Posts.Score AS Score FROM Posts ORDER BY Posts.Score DESC LIMIT 100"} {"instruction":"Which Game has a Score of w 90 82 (ot)?","input":"CREATE TABLE table_name_40 (\n game VARCHAR,\n score VARCHAR\n)","response":"SELECT game FROM table_name_40 WHERE score = \"w 90\u201382 (ot)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Game has a Score of w 90 82 (ot)? ### Input: CREATE TABLE table_name_40 (\n game VARCHAR,\n score VARCHAR\n) ### Response: SELECT game FROM table_name_40 WHERE score = \"w 90\u201382 (ot)\""} {"instruction":"What was the largest crowd when Collingwood was the away team?","input":"CREATE TABLE table_name_67 (\n crowd INTEGER,\n away_team VARCHAR\n)","response":"SELECT MAX(crowd) FROM table_name_67 WHERE away_team = \"collingwood\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the largest crowd when Collingwood was the away team? ### Input: CREATE TABLE table_name_67 (\n crowd INTEGER,\n away_team VARCHAR\n) ### Response: SELECT MAX(crowd) FROM table_name_67 WHERE away_team = \"collingwood\""} {"instruction":"Name the number of cancelled for turnham green","input":"CREATE TABLE table_24185 (\n \"Station\" text,\n \"Line\" text,\n \"Planned\" real,\n \"Cancelled\" real,\n \"Proposal\" text,\n \"Details\" text\n)","response":"SELECT COUNT(\"Cancelled\") FROM table_24185 WHERE \"Station\" = 'Turnham Green'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of cancelled for turnham green ### Input: CREATE TABLE table_24185 (\n \"Station\" text,\n \"Line\" text,\n \"Planned\" real,\n \"Cancelled\" real,\n \"Proposal\" text,\n \"Details\" text\n) ### Response: SELECT COUNT(\"Cancelled\") FROM table_24185 WHERE \"Station\" = 'Turnham Green'"} {"instruction":"What is the highest attendance of the match with a 2:0 score and vida as the away team?","input":"CREATE TABLE table_name_59 (\n attendance INTEGER,\n score VARCHAR,\n away VARCHAR\n)","response":"SELECT MAX(attendance) FROM table_name_59 WHERE score = \"2:0\" AND away = \"vida\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest attendance of the match with a 2:0 score and vida as the away team? ### Input: CREATE TABLE table_name_59 (\n attendance INTEGER,\n score VARCHAR,\n away VARCHAR\n) ### Response: SELECT MAX(attendance) FROM table_name_59 WHERE score = \"2:0\" AND away = \"vida\""} {"instruction":"Visualize a pie chart with what are the names and seatings for all tracks opened after 2000?","input":"CREATE TABLE track (\n Track_ID int,\n Name text,\n Location text,\n Seating real,\n Year_Opened real\n)\n\nCREATE TABLE race (\n Race_ID int,\n Name text,\n Class text,\n Date text,\n Track_ID text\n)","response":"SELECT Name, Seating FROM track WHERE Year_Opened > 2000","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a pie chart with what are the names and seatings for all tracks opened after 2000? ### Input: CREATE TABLE track (\n Track_ID int,\n Name text,\n Location text,\n Seating real,\n Year_Opened real\n)\n\nCREATE TABLE race (\n Race_ID int,\n Name text,\n Class text,\n Date text,\n Track_ID text\n) ### Response: SELECT Name, Seating FROM track WHERE Year_Opened > 2000"} {"instruction":"Show the name for regions and the number of storms for each region by a bar chart, and sort from high to low by the X-axis.","input":"CREATE TABLE storm (\n Storm_ID int,\n Name text,\n Dates_active text,\n Max_speed int,\n Damage_millions_USD real,\n Number_Deaths int\n)\n\nCREATE TABLE region (\n Region_id int,\n Region_code text,\n Region_name text\n)\n\nCREATE TABLE affected_region (\n Region_id int,\n Storm_ID int,\n Number_city_affected real\n)","response":"SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name for regions and the number of storms for each region by a bar chart, and sort from high to low by the X-axis. ### Input: CREATE TABLE storm (\n Storm_ID int,\n Name text,\n Dates_active text,\n Max_speed int,\n Damage_millions_USD real,\n Number_Deaths int\n)\n\nCREATE TABLE region (\n Region_id int,\n Region_code text,\n Region_name text\n)\n\nCREATE TABLE affected_region (\n Region_id int,\n Storm_ID int,\n Number_city_affected real\n) ### Response: SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name DESC"} {"instruction":"What is the Attendance of the game with a Record of 37 21 12 and less than 86 Points?","input":"CREATE TABLE table_name_44 (\n attendance INTEGER,\n record VARCHAR,\n points VARCHAR\n)","response":"SELECT AVG(attendance) FROM table_name_44 WHERE record = \"37\u201321\u201312\" AND points < 86","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Attendance of the game with a Record of 37 21 12 and less than 86 Points? ### Input: CREATE TABLE table_name_44 (\n attendance INTEGER,\n record VARCHAR,\n points VARCHAR\n) ### Response: SELECT AVG(attendance) FROM table_name_44 WHERE record = \"37\u201321\u201312\" AND points < 86"} {"instruction":"How many yards per attempt have net yards greater than 631?","input":"CREATE TABLE table_name_17 (\n yards_per_attempt INTEGER,\n net_yards INTEGER\n)","response":"SELECT SUM(yards_per_attempt) FROM table_name_17 WHERE net_yards > 631","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many yards per attempt have net yards greater than 631? ### Input: CREATE TABLE table_name_17 (\n yards_per_attempt INTEGER,\n net_yards INTEGER\n) ### Response: SELECT SUM(yards_per_attempt) FROM table_name_17 WHERE net_yards > 631"} {"instruction":"What is the primary disease and diagnosis icd9 code of Josette Orr?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = \"Josette Orr\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the primary disease and diagnosis icd9 code of Josette Orr? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = \"Josette Orr\""} {"instruction":"Name the scores for david baddiel and maureen lipman","input":"CREATE TABLE table_23575917_2 (\n scores VARCHAR,\n davids_team VARCHAR\n)","response":"SELECT COUNT(scores) FROM table_23575917_2 WHERE davids_team = \"David Baddiel and Maureen Lipman\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the scores for david baddiel and maureen lipman ### Input: CREATE TABLE table_23575917_2 (\n scores VARCHAR,\n davids_team VARCHAR\n) ### Response: SELECT COUNT(scores) FROM table_23575917_2 WHERE davids_team = \"David Baddiel and Maureen Lipman\""} {"instruction":"Name the role for mono studio and title of paradise canyon","input":"CREATE TABLE table_name_62 (\n role VARCHAR,\n studio VARCHAR,\n title VARCHAR\n)","response":"SELECT role FROM table_name_62 WHERE studio = \"mono\" AND title = \"paradise canyon\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the role for mono studio and title of paradise canyon ### Input: CREATE TABLE table_name_62 (\n role VARCHAR,\n studio VARCHAR,\n title VARCHAR\n) ### Response: SELECT role FROM table_name_62 WHERE studio = \"mono\" AND title = \"paradise canyon\""} {"instruction":"Name the total with finish of t22","input":"CREATE TABLE table_name_24 (\n total VARCHAR,\n finish VARCHAR\n)","response":"SELECT total FROM table_name_24 WHERE finish = \"t22\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total with finish of t22 ### Input: CREATE TABLE table_name_24 (\n total VARCHAR,\n finish VARCHAR\n) ### Response: SELECT total FROM table_name_24 WHERE finish = \"t22\""} {"instruction":"If the opponent was @ Boston Bruins, what was the Location\/Attendance?","input":"CREATE TABLE table_3782 (\n \"Game\" real,\n \"January\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Decision\" text,\n \"Location\/Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Location\/Attendance\" FROM table_3782 WHERE \"Opponent\" = '@ Boston Bruins'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the opponent was @ Boston Bruins, what was the Location\/Attendance? ### Input: CREATE TABLE table_3782 (\n \"Game\" real,\n \"January\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Decision\" text,\n \"Location\/Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Location\/Attendance\" FROM table_3782 WHERE \"Opponent\" = '@ Boston Bruins'"} {"instruction":"What was the ticket price on September 16, 1986?","input":"CREATE TABLE table_64443 (\n \"Date(s)\" text,\n \"Venue\" text,\n \"City\" text,\n \"Ticket price(s)\" text,\n \"Ticket sold \/ available\" text,\n \"Ticket grossing\" text\n)","response":"SELECT \"Ticket price(s)\" FROM table_64443 WHERE \"Date(s)\" = 'september 16, 1986'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the ticket price on September 16, 1986? ### Input: CREATE TABLE table_64443 (\n \"Date(s)\" text,\n \"Venue\" text,\n \"City\" text,\n \"Ticket price(s)\" text,\n \"Ticket sold \/ available\" text,\n \"Ticket grossing\" text\n) ### Response: SELECT \"Ticket price(s)\" FROM table_64443 WHERE \"Date(s)\" = 'september 16, 1986'"} {"instruction":"Name the high rebounds for memphis","input":"CREATE TABLE table_17060277_7 (\n high_rebounds VARCHAR,\n team VARCHAR\n)","response":"SELECT high_rebounds FROM table_17060277_7 WHERE team = \"Memphis\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the high rebounds for memphis ### Input: CREATE TABLE table_17060277_7 (\n high_rebounds VARCHAR,\n team VARCHAR\n) ### Response: SELECT high_rebounds FROM table_17060277_7 WHERE team = \"Memphis\""} {"instruction":"Tell me the the date when the first claim was made.","input":"CREATE TABLE settlements (\n settlement_id number,\n claim_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number,\n customer_policy_id number\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_details text\n)\n\nCREATE TABLE claims (\n claim_id number,\n policy_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number\n)\n\nCREATE TABLE payments (\n payment_id number,\n settlement_id number,\n payment_method_code text,\n date_payment_made time,\n amount_payment number\n)\n\nCREATE TABLE customer_policies (\n policy_id number,\n customer_id number,\n policy_type_code text,\n start_date time,\n end_date time\n)","response":"SELECT date_claim_made FROM claims ORDER BY date_claim_made LIMIT 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the the date when the first claim was made. ### Input: CREATE TABLE settlements (\n settlement_id number,\n claim_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number,\n customer_policy_id number\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_details text\n)\n\nCREATE TABLE claims (\n claim_id number,\n policy_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number\n)\n\nCREATE TABLE payments (\n payment_id number,\n settlement_id number,\n payment_method_code text,\n date_payment_made time,\n amount_payment number\n)\n\nCREATE TABLE customer_policies (\n policy_id number,\n customer_id number,\n policy_type_code text,\n start_date time,\n end_date time\n) ### Response: SELECT date_claim_made FROM claims ORDER BY date_claim_made LIMIT 1"} {"instruction":"Tell me the outgoing manager for 22 november date of vacancy","input":"CREATE TABLE table_77878 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n)","response":"SELECT \"Outgoing manager\" FROM table_77878 WHERE \"Date of vacancy\" = '22 november'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the outgoing manager for 22 november date of vacancy ### Input: CREATE TABLE table_77878 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n) ### Response: SELECT \"Outgoing manager\" FROM table_77878 WHERE \"Date of vacancy\" = '22 november'"} {"instruction":"For those products with a price between 60 and 120, return a bar chart about the distribution of name and manufacturer , and sort in desc by the y-axis.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those products with a price between 60 and 120, return a bar chart about the distribution of name and manufacturer , and sort in desc by the y-axis. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer DESC"} {"instruction":"Who won the FIS Nordic World Ski Championships in 1972?","input":"CREATE TABLE table_50927 (\n \"Winner\" text,\n \"Country\" text,\n \"Winter Olympics\" real,\n \"FIS Nordic World Ski Championships\" text,\n \"Holmenkollen\" text\n)","response":"SELECT \"Winner\" FROM table_50927 WHERE \"FIS Nordic World Ski Championships\" = '1972'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who won the FIS Nordic World Ski Championships in 1972? ### Input: CREATE TABLE table_50927 (\n \"Winner\" text,\n \"Country\" text,\n \"Winter Olympics\" real,\n \"FIS Nordic World Ski Championships\" text,\n \"Holmenkollen\" text\n) ### Response: SELECT \"Winner\" FROM table_50927 WHERE \"FIS Nordic World Ski Championships\" = '1972'"} {"instruction":"For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the job_id , and group by attribute job_id, show x-axis in descending order.","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the job_id , and group by attribute job_id, show x-axis in descending order. ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC"} {"instruction":"Name the listed owners for brevak racing","input":"CREATE TABLE table_2187178_1 (\n listed_owner_s_ VARCHAR,\n team VARCHAR\n)","response":"SELECT listed_owner_s_ FROM table_2187178_1 WHERE team = \"Brevak Racing\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the listed owners for brevak racing ### Input: CREATE TABLE table_2187178_1 (\n listed_owner_s_ VARCHAR,\n team VARCHAR\n) ### Response: SELECT listed_owner_s_ FROM table_2187178_1 WHERE team = \"Brevak Racing\""} {"instruction":"What is the sum total of all the years with a bell that weighed 857 kilograms?","input":"CREATE TABLE table_7061 (\n \"Year\" real,\n \"Foundry\" text,\n \"Diameter (mm)\" real,\n \"Weight (kg)\" text,\n \"Nominal Tone\" text\n)","response":"SELECT SUM(\"Year\") FROM table_7061 WHERE \"Weight (kg)\" = '857'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum total of all the years with a bell that weighed 857 kilograms? ### Input: CREATE TABLE table_7061 (\n \"Year\" real,\n \"Foundry\" text,\n \"Diameter (mm)\" real,\n \"Weight (kg)\" text,\n \"Nominal Tone\" text\n) ### Response: SELECT SUM(\"Year\") FROM table_7061 WHERE \"Weight (kg)\" = '857'"} {"instruction":"Questions with 'Magento' in title.","input":"CREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)","response":"SELECT Id AS \"post_link\" FROM Posts WHERE Title LIKE '%Magento%'","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions with 'Magento' in title. ### Input: CREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n) ### Response: SELECT Id AS \"post_link\" FROM Posts WHERE Title LIKE '%Magento%'"} {"instruction":"What is Chris Riley's Money?","input":"CREATE TABLE table_name_46 (\n money___$__ VARCHAR,\n player VARCHAR\n)","response":"SELECT money___$__ FROM table_name_46 WHERE player = \"chris riley\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Chris Riley's Money? ### Input: CREATE TABLE table_name_46 (\n money___$__ VARCHAR,\n player VARCHAR\n) ### Response: SELECT money___$__ FROM table_name_46 WHERE player = \"chris riley\""} {"instruction":"What are the speeds of the longest roller coaster?","input":"CREATE TABLE country (\n country_id number,\n name text,\n population number,\n area number,\n languages text\n)\n\nCREATE TABLE roller_coaster (\n roller_coaster_id number,\n name text,\n park text,\n country_id number,\n length number,\n height number,\n speed text,\n opened text,\n status text\n)","response":"SELECT speed FROM roller_coaster ORDER BY length DESC LIMIT 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the speeds of the longest roller coaster? ### Input: CREATE TABLE country (\n country_id number,\n name text,\n population number,\n area number,\n languages text\n)\n\nCREATE TABLE roller_coaster (\n roller_coaster_id number,\n name text,\n park text,\n country_id number,\n length number,\n height number,\n speed text,\n opened text,\n status text\n) ### Response: SELECT speed FROM roller_coaster ORDER BY length DESC LIMIT 1"} {"instruction":"What are the lowest points with 2013 as the year, and goals less than 0?","input":"CREATE TABLE table_name_48 (\n points INTEGER,\n year VARCHAR,\n goals VARCHAR\n)","response":"SELECT MIN(points) FROM table_name_48 WHERE year = \"2013\" AND goals < 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the lowest points with 2013 as the year, and goals less than 0? ### Input: CREATE TABLE table_name_48 (\n points INTEGER,\n year VARCHAR,\n goals VARCHAR\n) ### Response: SELECT MIN(points) FROM table_name_48 WHERE year = \"2013\" AND goals < 0"} {"instruction":"Who were the runner(s)-up when Tiger won by 11 strokes?","input":"CREATE TABLE table_16888 (\n \"Year\" real,\n \"Championship\" text,\n \"54 holes\" text,\n \"Winning score\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n)","response":"SELECT \"Runner(s)-up\" FROM table_16888 WHERE \"Margin of victory\" = '11 strokes'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the runner(s)-up when Tiger won by 11 strokes? ### Input: CREATE TABLE table_16888 (\n \"Year\" real,\n \"Championship\" text,\n \"54 holes\" text,\n \"Winning score\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n) ### Response: SELECT \"Runner(s)-up\" FROM table_16888 WHERE \"Margin of victory\" = '11 strokes'"} {"instruction":"Name the segment a for 8-08","input":"CREATE TABLE table_15187735_8 (\n segment_a VARCHAR,\n series_ep VARCHAR\n)","response":"SELECT segment_a FROM table_15187735_8 WHERE series_ep = \"8-08\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the segment a for 8-08 ### Input: CREATE TABLE table_15187735_8 (\n segment_a VARCHAR,\n series_ep VARCHAR\n) ### Response: SELECT segment_a FROM table_15187735_8 WHERE series_ep = \"8-08\""} {"instruction":"How many outputs are there for solid state, battery operated for portable use listed in notes?","input":"CREATE TABLE table_25276250_3 (\n outputs VARCHAR,\n notes VARCHAR\n)","response":"SELECT COUNT(outputs) FROM table_25276250_3 WHERE notes = \"Solid state, battery operated for portable use\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many outputs are there for solid state, battery operated for portable use listed in notes? ### Input: CREATE TABLE table_25276250_3 (\n outputs VARCHAR,\n notes VARCHAR\n) ### Response: SELECT COUNT(outputs) FROM table_25276250_3 WHERE notes = \"Solid state, battery operated for portable use\""} {"instruction":"If the rank is 17, what are the names?","input":"CREATE TABLE table_24990183_7 (\n name VARCHAR,\n rank VARCHAR\n)","response":"SELECT name FROM table_24990183_7 WHERE rank = 17","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the rank is 17, what are the names? ### Input: CREATE TABLE table_24990183_7 (\n name VARCHAR,\n rank VARCHAR\n) ### Response: SELECT name FROM table_24990183_7 WHERE rank = 17"} {"instruction":"What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9?","input":"CREATE TABLE table_name_51 (\n reservation VARCHAR\n)","response":"SELECT SUM(1979) FROM table_name_51 WHERE reservation = \"standing rock indian reservation\" AND 1989 < 54.9","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9? ### Input: CREATE TABLE table_name_51 (\n reservation VARCHAR\n) ### Response: SELECT SUM(1979) FROM table_name_51 WHERE reservation = \"standing rock indian reservation\" AND 1989 < 54.9"} {"instruction":"What is Opponent, when Attendance is 58,836?","input":"CREATE TABLE table_49308 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" text\n)","response":"SELECT \"Opponent\" FROM table_49308 WHERE \"Attendance\" = '58,836'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Opponent, when Attendance is 58,836? ### Input: CREATE TABLE table_49308 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Opponent\" FROM table_49308 WHERE \"Attendance\" = '58,836'"} {"instruction":"What is the mean huc example code when the example name's lower snake, there are 6 digits, and less than 3 levels?","input":"CREATE TABLE table_41893 (\n \"Name\" text,\n \"Level\" real,\n \"Digits\" real,\n \"Average size (square miles)\" text,\n \"Number of HUs (approximate)\" real,\n \"Example name\" text,\n \"Example code (HUC)\" real\n)","response":"SELECT AVG(\"Example code (HUC)\") FROM table_41893 WHERE \"Example name\" = 'lower snake' AND \"Digits\" = '6' AND \"Level\" < '3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mean huc example code when the example name's lower snake, there are 6 digits, and less than 3 levels? ### Input: CREATE TABLE table_41893 (\n \"Name\" text,\n \"Level\" real,\n \"Digits\" real,\n \"Average size (square miles)\" text,\n \"Number of HUs (approximate)\" real,\n \"Example name\" text,\n \"Example code (HUC)\" real\n) ### Response: SELECT AVG(\"Example code (HUC)\") FROM table_41893 WHERE \"Example name\" = 'lower snake' AND \"Digits\" = '6' AND \"Level\" < '3'"} {"instruction":"What is the quarterfinal week for Austin Anderson?","input":"CREATE TABLE table_29572 (\n \"Name\/Name of Act\" text,\n \"Age(s)\" text,\n \"Genre\" text,\n \"Act\" text,\n \"Hometown\" text,\n \"Qtr. Final (Week)\" real,\n \"Semi Final (Week)\" text,\n \"Position Reached\" text\n)","response":"SELECT MIN(\"Qtr. Final (Week)\") FROM table_29572 WHERE \"Name\/Name of Act\" = 'Austin Anderson'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the quarterfinal week for Austin Anderson? ### Input: CREATE TABLE table_29572 (\n \"Name\/Name of Act\" text,\n \"Age(s)\" text,\n \"Genre\" text,\n \"Act\" text,\n \"Hometown\" text,\n \"Qtr. Final (Week)\" real,\n \"Semi Final (Week)\" text,\n \"Position Reached\" text\n) ### Response: SELECT MIN(\"Qtr. Final (Week)\") FROM table_29572 WHERE \"Name\/Name of Act\" = 'Austin Anderson'"} {"instruction":"What is the volume when the resrvoir is Tanes?","input":"CREATE TABLE table_30696 (\n \"Reservoir\" text,\n \"Basin\" text,\n \"Location\" text,\n \"Type\" text,\n \"Height (m)\" text,\n \"Length along the top (m)\" text,\n \"Drainage basin (km\\u00b2)\" text,\n \"Reservoir surface (ha)\" text,\n \"Volume (hm\\u00b3)\" text\n)","response":"SELECT \"Volume (hm\\u00b3)\" FROM table_30696 WHERE \"Reservoir\" = 'Tanes'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the volume when the resrvoir is Tanes? ### Input: CREATE TABLE table_30696 (\n \"Reservoir\" text,\n \"Basin\" text,\n \"Location\" text,\n \"Type\" text,\n \"Height (m)\" text,\n \"Length along the top (m)\" text,\n \"Drainage basin (km\\u00b2)\" text,\n \"Reservoir surface (ha)\" text,\n \"Volume (hm\\u00b3)\" text\n) ### Response: SELECT \"Volume (hm\\u00b3)\" FROM table_30696 WHERE \"Reservoir\" = 'Tanes'"} {"instruction":"provide the number of patients whose days of hospital stay is greater than 23 and drug code is acyc400?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > \"23\" AND prescriptions.formulary_drug_cd = \"ACYC400\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose days of hospital stay is greater than 23 and drug code is acyc400? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > \"23\" AND prescriptions.formulary_drug_cd = \"ACYC400\""} {"instruction":"What's the title of the audio book with story number 91?","input":"CREATE TABLE table_23576 (\n \"Story #\" real,\n \"Target #\" text,\n \"Title\" text,\n \"Author\" text,\n \"Reader\" text,\n \"Format\" text,\n \"Company\" text,\n \"Release Date\" text,\n \"Notes\" text\n)","response":"SELECT \"Title\" FROM table_23576 WHERE \"Story #\" = '91'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the title of the audio book with story number 91? ### Input: CREATE TABLE table_23576 (\n \"Story #\" real,\n \"Target #\" text,\n \"Title\" text,\n \"Author\" text,\n \"Reader\" text,\n \"Format\" text,\n \"Company\" text,\n \"Release Date\" text,\n \"Notes\" text\n) ### Response: SELECT \"Title\" FROM table_23576 WHERE \"Story #\" = '91'"} {"instruction":"What class is ERP W of 800?","input":"CREATE TABLE table_name_9 (\n class VARCHAR,\n erp_w VARCHAR\n)","response":"SELECT class FROM table_name_9 WHERE erp_w = 800","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What class is ERP W of 800? ### Input: CREATE TABLE table_name_9 (\n class VARCHAR,\n erp_w VARCHAR\n) ### Response: SELECT class FROM table_name_9 WHERE erp_w = 800"} {"instruction":"tell me the cost of the diagnosis for smoking cessation counseling given?","input":"CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'smoking cessation counseling given')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the cost of the diagnosis for smoking cessation counseling given? ### Input: CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'smoking cessation counseling given')"} {"instruction":"what is the total number of patients who were diagnosed with icd9 code 2254?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = \"2254\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of patients who were diagnosed with icd9 code 2254? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = \"2254\""} {"instruction":"Give me the maximum low temperature and average precipitation at the Amersham station.","input":"CREATE TABLE station (\n id number,\n network_name text,\n services text,\n local_authority text\n)\n\nCREATE TABLE route (\n train_id number,\n station_id number\n)\n\nCREATE TABLE weekly_weather (\n station_id number,\n day_of_week text,\n high_temperature number,\n low_temperature number,\n precipitation number,\n wind_speed_mph number\n)\n\nCREATE TABLE train (\n id number,\n train_number number,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n)","response":"SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = \"Amersham\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the maximum low temperature and average precipitation at the Amersham station. ### Input: CREATE TABLE station (\n id number,\n network_name text,\n services text,\n local_authority text\n)\n\nCREATE TABLE route (\n train_id number,\n station_id number\n)\n\nCREATE TABLE weekly_weather (\n station_id number,\n day_of_week text,\n high_temperature number,\n low_temperature number,\n precipitation number,\n wind_speed_mph number\n)\n\nCREATE TABLE train (\n id number,\n train_number number,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n) ### Response: SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = \"Amersham\""} {"instruction":"Which event was held at Manly Beach?","input":"CREATE TABLE table_name_20 (\n event VARCHAR,\n location VARCHAR\n)","response":"SELECT event FROM table_name_20 WHERE location = \"manly beach\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which event was held at Manly Beach? ### Input: CREATE TABLE table_name_20 (\n event VARCHAR,\n location VARCHAR\n) ### Response: SELECT event FROM table_name_20 WHERE location = \"manly beach\""} {"instruction":"Who was the home team against the Bolton Wanderers?","input":"CREATE TABLE table_43959 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Attendance\" text\n)","response":"SELECT \"Home team\" FROM table_43959 WHERE \"Away team\" = 'bolton wanderers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team against the Bolton Wanderers? ### Input: CREATE TABLE table_43959 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Home team\" FROM table_43959 WHERE \"Away team\" = 'bolton wanderers'"} {"instruction":"All Info About Mobile Android Testing.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)","response":"SELECT P.OwnerUserId, P.Title, P.Tags, P.ViewCount, P.Score, P.AnswerCount, P.CreationDate FROM Posts AS P WHERE (P.Tags LIKE '%android-testing%') OR (P.Tags LIKE '%robotium%') OR (P.Tags LIKE '%androidviewclient%') OR (P.Tags LIKE '%monkeyrunner%') OR (P.Tags LIKE '%android-espresso%') OR (P.Tags LIKE '%android-emulator%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%uiautomator%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%appium%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%calabash%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%test%') ORDER BY P.Score DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: All Info About Mobile Android Testing. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n) ### Response: SELECT P.OwnerUserId, P.Title, P.Tags, P.ViewCount, P.Score, P.AnswerCount, P.CreationDate FROM Posts AS P WHERE (P.Tags LIKE '%android-testing%') OR (P.Tags LIKE '%robotium%') OR (P.Tags LIKE '%androidviewclient%') OR (P.Tags LIKE '%monkeyrunner%') OR (P.Tags LIKE '%android-espresso%') OR (P.Tags LIKE '%android-emulator%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%uiautomator%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%appium%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%calabash%') OR (P.Tags LIKE '%android%' AND P.Tags LIKE '%test%') ORDER BY P.Score DESC"} {"instruction":"Tell me the away team score for away team of south melbourne","input":"CREATE TABLE table_51600 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team score\" FROM table_51600 WHERE \"Away team\" = 'south melbourne'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the away team score for away team of south melbourne ### Input: CREATE TABLE table_51600 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team score\" FROM table_51600 WHERE \"Away team\" = 'south melbourne'"} {"instruction":"What year was the downy woodpecker coin created?","input":"CREATE TABLE table_55306 (\n \"Year\" real,\n \"Animal\" text,\n \"Artist\" text,\n \"Finish\" text,\n \"Mintage\" real,\n \"Issue Price\" text\n)","response":"SELECT SUM(\"Year\") FROM table_55306 WHERE \"Animal\" = 'downy woodpecker'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the downy woodpecker coin created? ### Input: CREATE TABLE table_55306 (\n \"Year\" real,\n \"Animal\" text,\n \"Artist\" text,\n \"Finish\" text,\n \"Mintage\" real,\n \"Issue Price\" text\n) ### Response: SELECT SUM(\"Year\") FROM table_55306 WHERE \"Animal\" = 'downy woodpecker'"} {"instruction":"What model has a launch of September 3, 2010?","input":"CREATE TABLE table_28269 (\n \"Model\" text,\n \"Launch\" text,\n \"Code name\" text,\n \"Transistors (million)\" real,\n \"Die size (mm 2 )\" real,\n \"Bus interface\" text,\n \"Memory ( MB )\" text,\n \"SM count\" real,\n \"Core config 1,3\" text,\n \"Core ( MHz )\" real,\n \"Shader ( MHz )\" real,\n \"Memory ( MHz )\" text,\n \"Pixel ( GP \/s)\" text,\n \"Texture ( GT \/s)\" text,\n \"Bandwidth ( GB \/s)\" text,\n \"DRAM type\" text,\n \"Bus width ( bit )\" real,\n \"GFLOPS (FMA) 2\" text,\n \"TDP (watts)\" real,\n \"Release price (USD)\" text\n)","response":"SELECT \"Model\" FROM table_28269 WHERE \"Launch\" = 'September 3, 2010'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What model has a launch of September 3, 2010? ### Input: CREATE TABLE table_28269 (\n \"Model\" text,\n \"Launch\" text,\n \"Code name\" text,\n \"Transistors (million)\" real,\n \"Die size (mm 2 )\" real,\n \"Bus interface\" text,\n \"Memory ( MB )\" text,\n \"SM count\" real,\n \"Core config 1,3\" text,\n \"Core ( MHz )\" real,\n \"Shader ( MHz )\" real,\n \"Memory ( MHz )\" text,\n \"Pixel ( GP \/s)\" text,\n \"Texture ( GT \/s)\" text,\n \"Bandwidth ( GB \/s)\" text,\n \"DRAM type\" text,\n \"Bus width ( bit )\" real,\n \"GFLOPS (FMA) 2\" text,\n \"TDP (watts)\" real,\n \"Release price (USD)\" text\n) ### Response: SELECT \"Model\" FROM table_28269 WHERE \"Launch\" = 'September 3, 2010'"} {"instruction":"Which opponent has a save of smith (22)?","input":"CREATE TABLE table_name_65 (\n opponent VARCHAR,\n save VARCHAR\n)","response":"SELECT opponent FROM table_name_65 WHERE save = \"smith (22)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which opponent has a save of smith (22)? ### Input: CREATE TABLE table_name_65 (\n opponent VARCHAR,\n save VARCHAR\n) ### Response: SELECT opponent FROM table_name_65 WHERE save = \"smith (22)\""} {"instruction":"What was the result of the home game against Derby County?","input":"CREATE TABLE table_name_71 (\n win_draw_lose VARCHAR,\n venue VARCHAR,\n team VARCHAR\n)","response":"SELECT win_draw_lose FROM table_name_71 WHERE venue = \"home\" AND team = \"derby county\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the home game against Derby County? ### Input: CREATE TABLE table_name_71 (\n win_draw_lose VARCHAR,\n venue VARCHAR,\n team VARCHAR\n) ### Response: SELECT win_draw_lose FROM table_name_71 WHERE venue = \"home\" AND team = \"derby county\""} {"instruction":"tell me the average arterial bp [systolic] of patient 16472 until 08\/15\/2105?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)","response":"SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16472)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) <= '2105-08-15'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the average arterial bp [systolic] of patient 16472 until 08\/15\/2105? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n) ### Response: SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16472)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) <= '2105-08-15'"} {"instruction":"Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals of 1?","input":"CREATE TABLE table_43812 (\n \"Club\" text,\n \"League goals\" text,\n \"FA Cup goals\" text,\n \"League Cup goals\" text,\n \"Total\" real\n)","response":"SELECT SUM(\"Total\") FROM table_43812 WHERE \"Club\" = 'darlington' AND \"League goals\" = '13' AND \"League Cup goals\" = '1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals of 1? ### Input: CREATE TABLE table_43812 (\n \"Club\" text,\n \"League goals\" text,\n \"FA Cup goals\" text,\n \"League Cup goals\" text,\n \"Total\" real\n) ### Response: SELECT SUM(\"Total\") FROM table_43812 WHERE \"Club\" = 'darlington' AND \"League goals\" = '13' AND \"League Cup goals\" = '1'"} {"instruction":"Top SO users from germany.","input":"CREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)","response":"SELECT DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%germany%' OR Location LIKE '%Germany%' OR Location LIKE N'%DE%' OR Location LIKE N'%de%' OR Location LIKE N'%deutschland%' ORDER BY Reputation DESC LIMIT 3000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top SO users from germany. ### Input: CREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n) ### Response: SELECT DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%germany%' OR Location LIKE '%Germany%' OR Location LIKE N'%DE%' OR Location LIKE N'%de%' OR Location LIKE N'%deutschland%' ORDER BY Reputation DESC LIMIT 3000"} {"instruction":"age 65 years and older","input":"CREATE TABLE table_train_103 (\n \"id\" int,\n \"systolic_blood_pressure_sbp\" int,\n \"epilepsy\" bool,\n \"diastolic_blood_pressure_dbp\" int,\n \"heart_rate\" int,\n \"seizure_disorder\" bool,\n \"age\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_103 WHERE age >= 65","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: age 65 years and older ### Input: CREATE TABLE table_train_103 (\n \"id\" int,\n \"systolic_blood_pressure_sbp\" int,\n \"epilepsy\" bool,\n \"diastolic_blood_pressure_dbp\" int,\n \"heart_rate\" int,\n \"seizure_disorder\" bool,\n \"age\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_103 WHERE age >= 65"} {"instruction":"Which Location has a Frequency of 102.5 fm?","input":"CREATE TABLE table_name_4 (\n location VARCHAR,\n frequency VARCHAR\n)","response":"SELECT location FROM table_name_4 WHERE frequency = \"102.5 fm\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Location has a Frequency of 102.5 fm? ### Input: CREATE TABLE table_name_4 (\n location VARCHAR,\n frequency VARCHAR\n) ### Response: SELECT location FROM table_name_4 WHERE frequency = \"102.5 fm\""} {"instruction":"What is the smallest crowd for victoria park?","input":"CREATE TABLE table_name_89 (\n crowd INTEGER,\n venue VARCHAR\n)","response":"SELECT MIN(crowd) FROM table_name_89 WHERE venue = \"victoria park\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest crowd for victoria park? ### Input: CREATE TABLE table_name_89 (\n crowd INTEGER,\n venue VARCHAR\n) ### Response: SELECT MIN(crowd) FROM table_name_89 WHERE venue = \"victoria park\""} {"instruction":"What episode number in the season is titled 'stray'?","input":"CREATE TABLE table_73846 (\n \"Season no.\" real,\n \"Series no.\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text\n)","response":"SELECT MAX(\"Season no.\") FROM table_73846 WHERE \"Title\" = 'Stray'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What episode number in the season is titled 'stray'? ### Input: CREATE TABLE table_73846 (\n \"Season no.\" real,\n \"Series no.\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text\n) ### Response: SELECT MAX(\"Season no.\") FROM table_73846 WHERE \"Title\" = 'Stray'"} {"instruction":"What is the position for the pick number 17?","input":"CREATE TABLE table_439 (\n \"Overall Pick #\" real,\n \"AFL Team\" text,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT \"Position\" FROM table_439 WHERE \"Overall Pick #\" = '17'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the position for the pick number 17? ### Input: CREATE TABLE table_439 (\n \"Overall Pick #\" real,\n \"AFL Team\" text,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT \"Position\" FROM table_439 WHERE \"Overall Pick #\" = '17'"} {"instruction":"WHAT WAS THE NUMBER OF THE ONLY FORWARD-CENTER TO MAKE THE ROSTER?","input":"CREATE TABLE table_15621965_18 (\n no INTEGER,\n position VARCHAR\n)","response":"SELECT MIN(no) FROM table_15621965_18 WHERE position = \"Forward-Center\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHAT WAS THE NUMBER OF THE ONLY FORWARD-CENTER TO MAKE THE ROSTER? ### Input: CREATE TABLE table_15621965_18 (\n no INTEGER,\n position VARCHAR\n) ### Response: SELECT MIN(no) FROM table_15621965_18 WHERE position = \"Forward-Center\""} {"instruction":"What was the class position of the team that was in the 4th position?","input":"CREATE TABLE table_77295 (\n \"Year\" real,\n \"Team\" text,\n \"Co-Drivers\" text,\n \"Class\" text,\n \"Laps\" real,\n \"Pos.\" text,\n \"Class Pos.\" text\n)","response":"SELECT \"Class Pos.\" FROM table_77295 WHERE \"Pos.\" = '4th'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the class position of the team that was in the 4th position? ### Input: CREATE TABLE table_77295 (\n \"Year\" real,\n \"Team\" text,\n \"Co-Drivers\" text,\n \"Class\" text,\n \"Laps\" real,\n \"Pos.\" text,\n \"Class Pos.\" text\n) ### Response: SELECT \"Class Pos.\" FROM table_77295 WHERE \"Pos.\" = '4th'"} {"instruction":"How many accounts for each customer? Show a bar chart that groups by customer's last name.","input":"CREATE TABLE Product_Categories (\n production_type_code VARCHAR(15),\n product_type_description VARCHAR(80),\n vat_rating DECIMAL(19,4)\n)\n\nCREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n date_account_opened DATETIME,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(50),\n customer_middle_initial VARCHAR(1),\n customer_last_name VARCHAR(50),\n gender VARCHAR(1),\n email_address VARCHAR(255),\n login_name VARCHAR(80),\n login_password VARCHAR(20),\n phone_number VARCHAR(255),\n town_city VARCHAR(50),\n state_county_province VARCHAR(50),\n country VARCHAR(50)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n account_id INTEGER,\n invoice_number INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DECIMAL(19,4),\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Line_Items (\n order_item_id INTEGER,\n invoice_number INTEGER,\n product_id INTEGER,\n product_title VARCHAR(80),\n product_quantity VARCHAR(50),\n product_price DECIMAL(19,4),\n derived_product_cost DECIMAL(19,4),\n derived_vat_payable DECIMAL(19,4),\n derived_total_cost DECIMAL(19,4)\n)\n\nCREATE TABLE Invoices (\n invoice_number INTEGER,\n order_id INTEGER,\n invoice_date DATETIME\n)\n\nCREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n product_quantity VARCHAR(50),\n other_order_item_details VARCHAR(255)\n)\n\nCREATE TABLE Orders (\n order_id INTEGER,\n customer_id INTEGER,\n date_order_placed DATETIME,\n order_details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n parent_product_id INTEGER,\n production_type_code VARCHAR(15),\n unit_price DECIMAL(19,4),\n product_name VARCHAR(80),\n product_color VARCHAR(20),\n product_size VARCHAR(20)\n)","response":"SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many accounts for each customer? Show a bar chart that groups by customer's last name. ### Input: CREATE TABLE Product_Categories (\n production_type_code VARCHAR(15),\n product_type_description VARCHAR(80),\n vat_rating DECIMAL(19,4)\n)\n\nCREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n date_account_opened DATETIME,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(50),\n customer_middle_initial VARCHAR(1),\n customer_last_name VARCHAR(50),\n gender VARCHAR(1),\n email_address VARCHAR(255),\n login_name VARCHAR(80),\n login_password VARCHAR(20),\n phone_number VARCHAR(255),\n town_city VARCHAR(50),\n state_county_province VARCHAR(50),\n country VARCHAR(50)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n account_id INTEGER,\n invoice_number INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DECIMAL(19,4),\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Line_Items (\n order_item_id INTEGER,\n invoice_number INTEGER,\n product_id INTEGER,\n product_title VARCHAR(80),\n product_quantity VARCHAR(50),\n product_price DECIMAL(19,4),\n derived_product_cost DECIMAL(19,4),\n derived_vat_payable DECIMAL(19,4),\n derived_total_cost DECIMAL(19,4)\n)\n\nCREATE TABLE Invoices (\n invoice_number INTEGER,\n order_id INTEGER,\n invoice_date DATETIME\n)\n\nCREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n product_quantity VARCHAR(50),\n other_order_item_details VARCHAR(255)\n)\n\nCREATE TABLE Orders (\n order_id INTEGER,\n customer_id INTEGER,\n date_order_placed DATETIME,\n order_details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n parent_product_id INTEGER,\n production_type_code VARCHAR(15),\n unit_price DECIMAL(19,4),\n product_name VARCHAR(80),\n product_color VARCHAR(20),\n product_size VARCHAR(20)\n) ### Response: SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id"} {"instruction":"Name the date for eastern creek raceway","input":"CREATE TABLE table_2446333_2 (\n date VARCHAR,\n circuit VARCHAR\n)","response":"SELECT date FROM table_2446333_2 WHERE circuit = \"Eastern Creek Raceway\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the date for eastern creek raceway ### Input: CREATE TABLE table_2446333_2 (\n date VARCHAR,\n circuit VARCHAR\n) ### Response: SELECT date FROM table_2446333_2 WHERE circuit = \"Eastern Creek Raceway\""} {"instruction":"Name the least total kurdistan list","input":"CREATE TABLE table_26850 (\n \"Governorate\" text,\n \"Kurdistan Democratic Party\" real,\n \"Patriotic Union of Kurdistan\" real,\n \"Total Kurdistan List\" real,\n \"Total Governorate Seats\" real\n)","response":"SELECT MIN(\"Total Kurdistan List\") FROM table_26850","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least total kurdistan list ### Input: CREATE TABLE table_26850 (\n \"Governorate\" text,\n \"Kurdistan Democratic Party\" real,\n \"Patriotic Union of Kurdistan\" real,\n \"Total Kurdistan List\" real,\n \"Total Governorate Seats\" real\n) ### Response: SELECT MIN(\"Total Kurdistan List\") FROM table_26850"} {"instruction":"What is the earliest week that shows a record of 8 5?","input":"CREATE TABLE table_name_40 (\n week INTEGER,\n record VARCHAR\n)","response":"SELECT MIN(week) FROM table_name_40 WHERE record = \"8\u20135\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the earliest week that shows a record of 8 5? ### Input: CREATE TABLE table_name_40 (\n week INTEGER,\n record VARCHAR\n) ### Response: SELECT MIN(week) FROM table_name_40 WHERE record = \"8\u20135\""} {"instruction":"Create a pie chart showing the number of carrier across carrier.","input":"CREATE TABLE market (\n Market_ID int,\n District text,\n Num_of_employees int,\n Num_of_shops real,\n Ranking int\n)\n\nCREATE TABLE phone (\n Name text,\n Phone_ID int,\n Memory_in_G int,\n Carrier text,\n Price real\n)\n\nCREATE TABLE phone_market (\n Market_ID int,\n Phone_ID text,\n Num_of_stock int\n)","response":"SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a pie chart showing the number of carrier across carrier. ### Input: CREATE TABLE market (\n Market_ID int,\n District text,\n Num_of_employees int,\n Num_of_shops real,\n Ranking int\n)\n\nCREATE TABLE phone (\n Name text,\n Phone_ID int,\n Memory_in_G int,\n Carrier text,\n Price real\n)\n\nCREATE TABLE phone_market (\n Market_ID int,\n Phone_ID text,\n Num_of_stock int\n) ### Response: SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier"} {"instruction":"how many patients whose admission type is emergency and diagnoses icd9 code is 56210?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND diagnoses.icd9_code = \"56210\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is emergency and diagnoses icd9 code is 56210? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND diagnoses.icd9_code = \"56210\""} {"instruction":"How many series originally aired before 1999 with more than 7 episodes and a DVD Region 1 release date of 16 april 2013?","input":"CREATE TABLE table_45278 (\n \"Series Number\" real,\n \"Number of Episodes\" real,\n \"Original Air Date\" real,\n \"DVD Region 2 release date\" text,\n \"DVD Region 1 release date\" text\n)","response":"SELECT COUNT(\"Series Number\") FROM table_45278 WHERE \"Original Air Date\" < '1999' AND \"Number of Episodes\" > '7' AND \"DVD Region 1 release date\" = '16 april 2013'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many series originally aired before 1999 with more than 7 episodes and a DVD Region 1 release date of 16 april 2013? ### Input: CREATE TABLE table_45278 (\n \"Series Number\" real,\n \"Number of Episodes\" real,\n \"Original Air Date\" real,\n \"DVD Region 2 release date\" text,\n \"DVD Region 1 release date\" text\n) ### Response: SELECT COUNT(\"Series Number\") FROM table_45278 WHERE \"Original Air Date\" < '1999' AND \"Number of Episodes\" > '7' AND \"DVD Region 1 release date\" = '16 april 2013'"} {"instruction":"What away is there for the q3 round?","input":"CREATE TABLE table_name_68 (\n away VARCHAR,\n round VARCHAR\n)","response":"SELECT away FROM table_name_68 WHERE round = \"q3\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What away is there for the q3 round? ### Input: CREATE TABLE table_name_68 (\n away VARCHAR,\n round VARCHAR\n) ### Response: SELECT away FROM table_name_68 WHERE round = \"q3\""} {"instruction":"how many competitions had a score of 1-0 at most ?","input":"CREATE TABLE table_203_652 (\n id number,\n \"goal\" number,\n \"date\" text,\n \"venue\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n)","response":"SELECT COUNT(*) FROM table_203_652 WHERE \"score\" = '1-0'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many competitions had a score of 1-0 at most ? ### Input: CREATE TABLE table_203_652 (\n id number,\n \"goal\" number,\n \"date\" text,\n \"venue\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n) ### Response: SELECT COUNT(*) FROM table_203_652 WHERE \"score\" = '1-0'"} {"instruction":"What is the total number of Silver for the Nation with more than 1 Bronze and a Rank less than 5?","input":"CREATE TABLE table_66695 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT COUNT(\"Silver\") FROM table_66695 WHERE \"Bronze\" > '1' AND \"Rank\" < '5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Silver for the Nation with more than 1 Bronze and a Rank less than 5? ### Input: CREATE TABLE table_66695 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT COUNT(\"Silver\") FROM table_66695 WHERE \"Bronze\" > '1' AND \"Rank\" < '5'"} {"instruction":"who was the sooners opponent after usc ?","input":"CREATE TABLE table_204_617 (\n id number,\n \"date\" text,\n \"opponent#\" text,\n \"rank#\" text,\n \"site\" text,\n \"tv\" text,\n \"result\" text,\n \"attendance\" number\n)","response":"SELECT \"opponent#\" FROM table_204_617 WHERE \"date\" > (SELECT \"date\" FROM table_204_617 WHERE \"opponent#\" = 'usc') ORDER BY \"date\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the sooners opponent after usc ? ### Input: CREATE TABLE table_204_617 (\n id number,\n \"date\" text,\n \"opponent#\" text,\n \"rank#\" text,\n \"site\" text,\n \"tv\" text,\n \"result\" text,\n \"attendance\" number\n) ### Response: SELECT \"opponent#\" FROM table_204_617 WHERE \"date\" > (SELECT \"date\" FROM table_204_617 WHERE \"opponent#\" = 'usc') ORDER BY \"date\" LIMIT 1"} {"instruction":"list the top five most common drugs that patients were prescribed within 2 months after being prescribed oxycodone (sustained release) since 1 year ago.","input":"CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxycodone (sustained release)' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.startdate < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.startdate) AND DATETIME(t1.startdate, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the top five most common drugs that patients were prescribed within 2 months after being prescribed oxycodone (sustained release) since 1 year ago. ### Input: CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxycodone (sustained release)' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.startdate < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.startdate) AND DATETIME(t1.startdate, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5"} {"instruction":"list all flights on sunday from SAN FRANCISCO to PITTSBURGH nonstop","input":"CREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.stops = 0) AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all flights on sunday from SAN FRANCISCO to PITTSBURGH nonstop ### Input: CREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.stops = 0) AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"How many times was the high rebounds by marcus camby (18)?","input":"CREATE TABLE table_29902 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT COUNT(\"Date\") FROM table_29902 WHERE \"High rebounds\" = 'Marcus Camby (18)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times was the high rebounds by marcus camby (18)? ### Input: CREATE TABLE table_29902 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT COUNT(\"Date\") FROM table_29902 WHERE \"High rebounds\" = 'Marcus Camby (18)'"} {"instruction":"What sponsor has the head coach Samad Marfavi?","input":"CREATE TABLE table_29469 (\n \"Team\" text,\n \"Head coach\" text,\n \"Team captain\" text,\n \"Kit maker\" text,\n \"Shirt sponsor\" text,\n \"Past Season\" text\n)","response":"SELECT \"Shirt sponsor\" FROM table_29469 WHERE \"Head coach\" = 'Samad Marfavi'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What sponsor has the head coach Samad Marfavi? ### Input: CREATE TABLE table_29469 (\n \"Team\" text,\n \"Head coach\" text,\n \"Team captain\" text,\n \"Kit maker\" text,\n \"Shirt sponsor\" text,\n \"Past Season\" text\n) ### Response: SELECT \"Shirt sponsor\" FROM table_29469 WHERE \"Head coach\" = 'Samad Marfavi'"} {"instruction":"what is date of birth and primary disease of subject name brian brock?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = \"Brian Brock\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is date of birth and primary disease of subject name brian brock? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = \"Brian Brock\""} {"instruction":"Find the number of the enrollment date for all the tests that have 'Pass' result, and could you order x axis from high to low order please?","input":"CREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)","response":"SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Pass\" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of the enrollment date for all the tests that have 'Pass' result, and could you order x axis from high to low order please? ### Input: CREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n) ### Response: SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Pass\" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC"} {"instruction":"What is the Opponent at the Honda Center on March 29?","input":"CREATE TABLE table_61636 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text,\n \"Arena\" text,\n \"Points\" real\n)","response":"SELECT \"Opponent\" FROM table_61636 WHERE \"Arena\" = 'honda center' AND \"Date\" = 'march 29'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Opponent at the Honda Center on March 29? ### Input: CREATE TABLE table_61636 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text,\n \"Arena\" text,\n \"Points\" real\n) ### Response: SELECT \"Opponent\" FROM table_61636 WHERE \"Arena\" = 'honda center' AND \"Date\" = 'march 29'"} {"instruction":"Which team drafted Ron Annear?","input":"CREATE TABLE table_2850912_10 (\n nhl_team VARCHAR,\n player VARCHAR\n)","response":"SELECT nhl_team FROM table_2850912_10 WHERE player = \"Ron Annear\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team drafted Ron Annear? ### Input: CREATE TABLE table_2850912_10 (\n nhl_team VARCHAR,\n player VARCHAR\n) ### Response: SELECT nhl_team FROM table_2850912_10 WHERE player = \"Ron Annear\""} {"instruction":"How many wins has a podiums greater than 1 and 9 as the races with a season after 1984?","input":"CREATE TABLE table_name_13 (\n wins VARCHAR,\n season VARCHAR,\n podiums VARCHAR,\n races VARCHAR\n)","response":"SELECT COUNT(wins) FROM table_name_13 WHERE podiums > 1 AND races = 9 AND season > 1984","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many wins has a podiums greater than 1 and 9 as the races with a season after 1984? ### Input: CREATE TABLE table_name_13 (\n wins VARCHAR,\n season VARCHAR,\n podiums VARCHAR,\n races VARCHAR\n) ### Response: SELECT COUNT(wins) FROM table_name_13 WHERE podiums > 1 AND races = 9 AND season > 1984"} {"instruction":"how many album entries are there ?","input":"CREATE TABLE table_204_244 (\n id number,\n \"year\" number,\n \"album\" text,\n \"peak\\nus\" number,\n \"peak\\nus\\nholiday\" number,\n \"certifications\\n(sales threshold)\" text\n)","response":"SELECT COUNT(\"album\") FROM table_204_244","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many album entries are there ? ### Input: CREATE TABLE table_204_244 (\n id number,\n \"year\" number,\n \"album\" text,\n \"peak\\nus\" number,\n \"peak\\nus\\nholiday\" number,\n \"certifications\\n(sales threshold)\" text\n) ### Response: SELECT COUNT(\"album\") FROM table_204_244"} {"instruction":"What is the highest value for col(m) when prominence(m) is 3755?","input":"CREATE TABLE table_22713 (\n \"Rank\" real,\n \"Peak\" text,\n \"Country\" text,\n \"Island\" text,\n \"Elevation (m)\" real,\n \"Prominence (m)\" real,\n \"Col (m)\" real\n)","response":"SELECT MAX(\"Col (m)\") FROM table_22713 WHERE \"Prominence (m)\" = '3755'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest value for col(m) when prominence(m) is 3755? ### Input: CREATE TABLE table_22713 (\n \"Rank\" real,\n \"Peak\" text,\n \"Country\" text,\n \"Island\" text,\n \"Elevation (m)\" real,\n \"Prominence (m)\" real,\n \"Col (m)\" real\n) ### Response: SELECT MAX(\"Col (m)\") FROM table_22713 WHERE \"Prominence (m)\" = '3755'"} {"instruction":"what is the monthly minimum output (ml)-closed\/suction drain right abdomen bulb 19 fr. output that patient 027-203413 has had since 11\/07\/2104?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.celllabel = 'output (ml)-closed\/suction drain right abdomen bulb 19 fr.' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2104-11-07' GROUP BY STRFTIME('%y-%m', intakeoutput.intakeoutputtime)","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the monthly minimum output (ml)-closed\/suction drain right abdomen bulb 19 fr. output that patient 027-203413 has had since 11\/07\/2104? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.celllabel = 'output (ml)-closed\/suction drain right abdomen bulb 19 fr.' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2104-11-07' GROUP BY STRFTIME('%y-%m', intakeoutput.intakeoutputtime)"} {"instruction":"How many times is the ethnic group other: total?","input":"CREATE TABLE table_282413_3 (\n ethnic_group VARCHAR\n)","response":"SELECT COUNT(2001 AS __percentage) FROM table_282413_3 WHERE ethnic_group = \"Other: Total\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times is the ethnic group other: total? ### Input: CREATE TABLE table_282413_3 (\n ethnic_group VARCHAR\n) ### Response: SELECT COUNT(2001 AS __percentage) FROM table_282413_3 WHERE ethnic_group = \"Other: Total\""} {"instruction":"Where is bobby jones (a)?","input":"CREATE TABLE table_50184 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real,\n \"Money ( $ )\" text\n)","response":"SELECT \"Place\" FROM table_50184 WHERE \"Player\" = 'bobby jones (a)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is bobby jones (a)? ### Input: CREATE TABLE table_50184 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real,\n \"Money ( $ )\" text\n) ### Response: SELECT \"Place\" FROM table_50184 WHERE \"Player\" = 'bobby jones (a)'"} {"instruction":"Find the number of students whose age is younger than the average age and group by students' last name in a bar chart, could you display by the x-axis from high to low?","input":"CREATE TABLE Lives_in (\n stuid INTEGER,\n dormid INTEGER,\n room_number INTEGER\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Has_amenity (\n dormid INTEGER,\n amenid INTEGER\n)\n\nCREATE TABLE Dorm (\n dormid INTEGER,\n dorm_name VARCHAR(20),\n student_capacity INTEGER,\n gender VARCHAR(1)\n)\n\nCREATE TABLE Dorm_amenity (\n amenid INTEGER,\n amenity_name VARCHAR(25)\n)","response":"SELECT LName, COUNT(LName) FROM Student WHERE Age < (SELECT AVG(Age) FROM Student) GROUP BY LName ORDER BY LName DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of students whose age is younger than the average age and group by students' last name in a bar chart, could you display by the x-axis from high to low? ### Input: CREATE TABLE Lives_in (\n stuid INTEGER,\n dormid INTEGER,\n room_number INTEGER\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Has_amenity (\n dormid INTEGER,\n amenid INTEGER\n)\n\nCREATE TABLE Dorm (\n dormid INTEGER,\n dorm_name VARCHAR(20),\n student_capacity INTEGER,\n gender VARCHAR(1)\n)\n\nCREATE TABLE Dorm_amenity (\n amenid INTEGER,\n amenity_name VARCHAR(25)\n) ### Response: SELECT LName, COUNT(LName) FROM Student WHERE Age < (SELECT AVG(Age) FROM Student) GROUP BY LName ORDER BY LName DESC"} {"instruction":"What is Goals, when Assists is greater than 28, and when Player is Steve Walker?","input":"CREATE TABLE table_name_89 (\n goals VARCHAR,\n assists VARCHAR,\n player VARCHAR\n)","response":"SELECT goals FROM table_name_89 WHERE assists > 28 AND player = \"steve walker\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Goals, when Assists is greater than 28, and when Player is Steve Walker? ### Input: CREATE TABLE table_name_89 (\n goals VARCHAR,\n assists VARCHAR,\n player VARCHAR\n) ### Response: SELECT goals FROM table_name_89 WHERE assists > 28 AND player = \"steve walker\""} {"instruction":"What is the average Byes that has Ballarat FL of Sunbury against more than 1167?","input":"CREATE TABLE table_name_70 (\n byes INTEGER,\n ballarat_fl VARCHAR,\n against VARCHAR\n)","response":"SELECT AVG(byes) FROM table_name_70 WHERE ballarat_fl = \"sunbury\" AND against > 1167","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Byes that has Ballarat FL of Sunbury against more than 1167? ### Input: CREATE TABLE table_name_70 (\n byes INTEGER,\n ballarat_fl VARCHAR,\n against VARCHAR\n) ### Response: SELECT AVG(byes) FROM table_name_70 WHERE ballarat_fl = \"sunbury\" AND against > 1167"} {"instruction":"Name the gdp world rank for asian rank being 20","input":"CREATE TABLE table_2249029_1 (\n gdp_world_rank VARCHAR,\n asian_rank VARCHAR\n)","response":"SELECT gdp_world_rank FROM table_2249029_1 WHERE asian_rank = 20","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the gdp world rank for asian rank being 20 ### Input: CREATE TABLE table_2249029_1 (\n gdp_world_rank VARCHAR,\n asian_rank VARCHAR\n) ### Response: SELECT gdp_world_rank FROM table_2249029_1 WHERE asian_rank = 20"} {"instruction":"List all the MCs with 5 appearances who were inducted in 2007?","input":"CREATE TABLE table_29160596_1 (\n top_mc VARCHAR,\n appearances VARCHAR,\n year_inducted VARCHAR\n)","response":"SELECT top_mc FROM table_29160596_1 WHERE appearances = 5 AND year_inducted = 2007","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all the MCs with 5 appearances who were inducted in 2007? ### Input: CREATE TABLE table_29160596_1 (\n top_mc VARCHAR,\n appearances VARCHAR,\n year_inducted VARCHAR\n) ### Response: SELECT top_mc FROM table_29160596_1 WHERE appearances = 5 AND year_inducted = 2007"} {"instruction":"what comes after fiskeby if","input":"CREATE TABLE table_204_361 (\n id number,\n \"tie no\" number,\n \"home team\" text,\n \"score\" text,\n \"away team\" text\n)","response":"SELECT \"home team\" FROM table_204_361 WHERE id = (SELECT id FROM table_204_361 WHERE \"home team\" = 'fiskeby if') + 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what comes after fiskeby if ### Input: CREATE TABLE table_204_361 (\n id number,\n \"tie no\" number,\n \"home team\" text,\n \"score\" text,\n \"away team\" text\n) ### Response: SELECT \"home team\" FROM table_204_361 WHERE id = (SELECT id FROM table_204_361 WHERE \"home team\" = 'fiskeby if') + 1"} {"instruction":"since 1 year ago what were the three most frequent medications prescribed during the same hospital visit to the patients of age 40s after they had been diagnosed with alcohol withdrawal?","input":"CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'alcohol withdrawal') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.age BETWEEN 40 AND 49 AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 1 year ago what were the three most frequent medications prescribed during the same hospital visit to the patients of age 40s after they had been diagnosed with alcohol withdrawal? ### Input: CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'alcohol withdrawal') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.age BETWEEN 40 AND 49 AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3"} {"instruction":"For what country does the golfer play who has a score of 72-65=137?","input":"CREATE TABLE table_name_47 (\n country VARCHAR,\n score VARCHAR\n)","response":"SELECT country FROM table_name_47 WHERE score = 72 - 65 = 137","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For what country does the golfer play who has a score of 72-65=137? ### Input: CREATE TABLE table_name_47 (\n country VARCHAR,\n score VARCHAR\n) ### Response: SELECT country FROM table_name_47 WHERE score = 72 - 65 = 137"} {"instruction":"When was the runner-up Jane Geddes?","input":"CREATE TABLE table_name_35 (\n year VARCHAR,\n runner_up VARCHAR\n)","response":"SELECT year FROM table_name_35 WHERE runner_up = \"jane geddes\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the runner-up Jane Geddes? ### Input: CREATE TABLE table_name_35 (\n year VARCHAR,\n runner_up VARCHAR\n) ### Response: SELECT year FROM table_name_35 WHERE runner_up = \"jane geddes\""} {"instruction":"what is the nationality when the ship is willerby?","input":"CREATE TABLE table_45309 (\n \"Date\" text,\n \"Ship\" text,\n \"Type\" text,\n \"Nationality\" text,\n \"Tonnage GRT\" real,\n \"Fate\" text\n)","response":"SELECT \"Nationality\" FROM table_45309 WHERE \"Ship\" = 'willerby'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the nationality when the ship is willerby? ### Input: CREATE TABLE table_45309 (\n \"Date\" text,\n \"Ship\" text,\n \"Type\" text,\n \"Nationality\" text,\n \"Tonnage GRT\" real,\n \"Fate\" text\n) ### Response: SELECT \"Nationality\" FROM table_45309 WHERE \"Ship\" = 'willerby'"} {"instruction":"What are the examples for the Australian ?","input":"CREATE TABLE table_60037 (\n \"Letter\" text,\n \"American\" text,\n \"British\" text,\n \"Australian\" text,\n \"Examples\" text\n)","response":"SELECT \"Examples\" FROM table_60037 WHERE \"Australian\" = '\u00e6'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the examples for the Australian ? ### Input: CREATE TABLE table_60037 (\n \"Letter\" text,\n \"American\" text,\n \"British\" text,\n \"Australian\" text,\n \"Examples\" text\n) ### Response: SELECT \"Examples\" FROM table_60037 WHERE \"Australian\" = '\u00e6'"} {"instruction":"What is the Date with a Leading scorer with maurice williams (25), and a Score with 102 105?","input":"CREATE TABLE table_57891 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Record\" text\n)","response":"SELECT \"Date\" FROM table_57891 WHERE \"Leading scorer\" = 'maurice williams (25)' AND \"Score\" = '102\u2013105'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date with a Leading scorer with maurice williams (25), and a Score with 102 105? ### Input: CREATE TABLE table_57891 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Record\" text\n) ### Response: SELECT \"Date\" FROM table_57891 WHERE \"Leading scorer\" = 'maurice williams (25)' AND \"Score\" = '102\u2013105'"} {"instruction":"when was patient 030-52395 received an intake for the first time since 03\/26\/2102.","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52395')) AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2102-03-26' ORDER BY intakeoutput.intakeoutputtime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 030-52395 received an intake for the first time since 03\/26\/2102. ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52395')) AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2102-03-26' ORDER BY intakeoutput.intakeoutputtime LIMIT 1"} {"instruction":"What's the highest capacity for a position of 5 in 2004?","input":"CREATE TABLE table_name_81 (\n capacity INTEGER,\n position_in_2004 VARCHAR\n)","response":"SELECT MAX(capacity) FROM table_name_81 WHERE position_in_2004 = \"5\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the highest capacity for a position of 5 in 2004? ### Input: CREATE TABLE table_name_81 (\n capacity INTEGER,\n position_in_2004 VARCHAR\n) ### Response: SELECT MAX(capacity) FROM table_name_81 WHERE position_in_2004 = \"5\""} {"instruction":"what is discharge time of subject id 6983?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = \"6983\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is discharge time of subject id 6983? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = \"6983\""} {"instruction":"What is the NBA draft for ohio state?","input":"CREATE TABLE table_51428 (\n \"Player\" text,\n \"Height\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text,\n \"NBA Draft\" text\n)","response":"SELECT \"NBA Draft\" FROM table_51428 WHERE \"College\" = 'ohio state'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the NBA draft for ohio state? ### Input: CREATE TABLE table_51428 (\n \"Player\" text,\n \"Height\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text,\n \"NBA Draft\" text\n) ### Response: SELECT \"NBA Draft\" FROM table_51428 WHERE \"College\" = 'ohio state'"} {"instruction":"what country won the same number of bronze as great britain , yet did not win a gold medal ?","input":"CREATE TABLE table_203_206 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT \"nation\" FROM table_203_206 WHERE \"nation\" <> 'great britain' AND \"bronze\" = (SELECT \"bronze\" FROM table_203_206 WHERE \"nation\" = 'great britain') AND \"gold\" = 0","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what country won the same number of bronze as great britain , yet did not win a gold medal ? ### Input: CREATE TABLE table_203_206 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT \"nation\" FROM table_203_206 WHERE \"nation\" <> 'great britain' AND \"bronze\" = (SELECT \"bronze\" FROM table_203_206 WHERE \"nation\" = 'great britain') AND \"gold\" = 0"} {"instruction":"when was patient 015-96048 last prescribed for tylenol on their last hospital visit?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND medication.drugname = 'tylenol' ORDER BY medication.drugstarttime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 015-96048 last prescribed for tylenol on their last hospital visit? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND medication.drugname = 'tylenol' ORDER BY medication.drugstarttime DESC LIMIT 1"} {"instruction":"What is the incumbent for pennsylvania 15","input":"CREATE TABLE table_1342013_37 (\n incumbent VARCHAR,\n district VARCHAR\n)","response":"SELECT incumbent FROM table_1342013_37 WHERE district = \"Pennsylvania 15\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the incumbent for pennsylvania 15 ### Input: CREATE TABLE table_1342013_37 (\n incumbent VARCHAR,\n district VARCHAR\n) ### Response: SELECT incumbent FROM table_1342013_37 WHERE district = \"Pennsylvania 15\""} {"instruction":"At what Venue was the Home team score 17.19 (121)?","input":"CREATE TABLE table_55019 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Venue\" FROM table_55019 WHERE \"Home team score\" = '17.19 (121)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: At what Venue was the Home team score 17.19 (121)? ### Input: CREATE TABLE table_55019 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Venue\" FROM table_55019 WHERE \"Home team score\" = '17.19 (121)'"} {"instruction":"What was the playoff result where the league did not qualify in the Open Cup in 1998?","input":"CREATE TABLE table_2402864_1 (\n playoffs VARCHAR,\n open_cup VARCHAR,\n year VARCHAR\n)","response":"SELECT playoffs FROM table_2402864_1 WHERE open_cup = \"Did not qualify\" AND year = 1998","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the playoff result where the league did not qualify in the Open Cup in 1998? ### Input: CREATE TABLE table_2402864_1 (\n playoffs VARCHAR,\n open_cup VARCHAR,\n year VARCHAR\n) ### Response: SELECT playoffs FROM table_2402864_1 WHERE open_cup = \"Did not qualify\" AND year = 1998"} {"instruction":"Who was the driver in 1964?","input":"CREATE TABLE table_name_83 (\n driver VARCHAR,\n year VARCHAR\n)","response":"SELECT driver FROM table_name_83 WHERE year = \"1964\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the driver in 1964? ### Input: CREATE TABLE table_name_83 (\n driver VARCHAR,\n year VARCHAR\n) ### Response: SELECT driver FROM table_name_83 WHERE year = \"1964\""} {"instruction":"which is the first church located in los angeles ?","input":"CREATE TABLE table_203_274 (\n id number,\n \"church name\" text,\n \"address\" text,\n \"community\" text,\n \"school\" text\n)","response":"SELECT \"church name\" FROM table_203_274 WHERE \"community\" = 'los angeles' ORDER BY id LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which is the first church located in los angeles ? ### Input: CREATE TABLE table_203_274 (\n id number,\n \"church name\" text,\n \"address\" text,\n \"community\" text,\n \"school\" text\n) ### Response: SELECT \"church name\" FROM table_203_274 WHERE \"community\" = 'los angeles' ORDER BY id LIMIT 1"} {"instruction":"what is the lowest round2 when round5 is 71 and round4 is more than 64?","input":"CREATE TABLE table_8511 (\n \"Rank\" real,\n \"Team\" text,\n \"Round1\" real,\n \"Round2\" real,\n \"Round3\" real,\n \"Round4\" real,\n \"Round5\" real,\n \"Total Points\" real\n)","response":"SELECT MIN(\"Round2\") FROM table_8511 WHERE \"Round5\" = '71' AND \"Round4\" > '64'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the lowest round2 when round5 is 71 and round4 is more than 64? ### Input: CREATE TABLE table_8511 (\n \"Rank\" real,\n \"Team\" text,\n \"Round1\" real,\n \"Round2\" real,\n \"Round3\" real,\n \"Round4\" real,\n \"Round5\" real,\n \"Total Points\" real\n) ### Response: SELECT MIN(\"Round2\") FROM table_8511 WHERE \"Round5\" = '71' AND \"Round4\" > '64'"} {"instruction":"What was the attendance for the game against miami dolphins?","input":"CREATE TABLE table_66129 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Record\" text,\n \"TV Time\" text,\n \"Attendance\" text\n)","response":"SELECT \"Attendance\" FROM table_66129 WHERE \"Opponent\" = 'miami dolphins'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the attendance for the game against miami dolphins? ### Input: CREATE TABLE table_66129 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Record\" text,\n \"TV Time\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Attendance\" FROM table_66129 WHERE \"Opponent\" = 'miami dolphins'"} {"instruction":"What was the score of the game on December 11?","input":"CREATE TABLE table_17360840_6 (\n score VARCHAR,\n date VARCHAR\n)","response":"SELECT score FROM table_17360840_6 WHERE date = \"December 11\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the game on December 11? ### Input: CREATE TABLE table_17360840_6 (\n score VARCHAR,\n date VARCHAR\n) ### Response: SELECT score FROM table_17360840_6 WHERE date = \"December 11\""} {"instruction":"What is the date they played against fitzroy?","input":"CREATE TABLE table_name_10 (\n date VARCHAR,\n away_team VARCHAR\n)","response":"SELECT date FROM table_name_10 WHERE away_team = \"fitzroy\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date they played against fitzroy? ### Input: CREATE TABLE table_name_10 (\n date VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT date FROM table_name_10 WHERE away_team = \"fitzroy\""} {"instruction":"What is the place of the song 'Never Change'?","input":"CREATE TABLE table_40447 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Result\" text,\n \"Place\" real\n)","response":"SELECT SUM(\"Place\") FROM table_40447 WHERE \"Song\" = 'never change'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the place of the song 'Never Change'? ### Input: CREATE TABLE table_40447 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Result\" text,\n \"Place\" real\n) ### Response: SELECT SUM(\"Place\") FROM table_40447 WHERE \"Song\" = 'never change'"} {"instruction":"For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, rank in descending by the the number of job id.","input":"CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)","response":"SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, rank in descending by the the number of job id. ### Input: CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n) ### Response: SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC"} {"instruction":"Show the number of companies whose headquarters are not from USA fpr each main industry in a bar chart, show X-axis in ascending order please.","input":"CREATE TABLE company (\n Company_ID int,\n Rank int,\n Company text,\n Headquarters text,\n Main_Industry text,\n Sales_billion real,\n Profits_billion real,\n Assets_billion real,\n Market_Value real\n)\n\nCREATE TABLE station_company (\n Station_ID int,\n Company_ID int,\n Rank_of_the_Year int\n)\n\nCREATE TABLE gas_station (\n Station_ID int,\n Open_Year int,\n Location text,\n Manager_Name text,\n Vice_Manager_Name text,\n Representative_Name text\n)","response":"SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY Main_Industry","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of companies whose headquarters are not from USA fpr each main industry in a bar chart, show X-axis in ascending order please. ### Input: CREATE TABLE company (\n Company_ID int,\n Rank int,\n Company text,\n Headquarters text,\n Main_Industry text,\n Sales_billion real,\n Profits_billion real,\n Assets_billion real,\n Market_Value real\n)\n\nCREATE TABLE station_company (\n Station_ID int,\n Company_ID int,\n Rank_of_the_Year int\n)\n\nCREATE TABLE gas_station (\n Station_ID int,\n Open_Year int,\n Location text,\n Manager_Name text,\n Vice_Manager_Name text,\n Representative_Name text\n) ### Response: SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY Main_Industry"} {"instruction":"What song placed higher than#4?","input":"CREATE TABLE table_64035 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Percentage\" text,\n \"Place\" real\n)","response":"SELECT \"Song\" FROM table_64035 WHERE \"Place\" > '4'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What song placed higher than#4? ### Input: CREATE TABLE table_64035 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Percentage\" text,\n \"Place\" real\n) ### Response: SELECT \"Song\" FROM table_64035 WHERE \"Place\" > '4'"} {"instruction":"What year was the Beaudesert suburb club founded","input":"CREATE TABLE table_name_95 (\n founded VARCHAR,\n suburb VARCHAR\n)","response":"SELECT founded FROM table_name_95 WHERE suburb = \"beaudesert\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the Beaudesert suburb club founded ### Input: CREATE TABLE table_name_95 (\n founded VARCHAR,\n suburb VARCHAR\n) ### Response: SELECT founded FROM table_name_95 WHERE suburb = \"beaudesert\""} {"instruction":"Visualize a bar chart about the distribution of date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by weekday.","input":"CREATE TABLE Ref_Detention_Type (\n detention_type_code VARCHAR(10),\n detention_type_description VARCHAR(80)\n)\n\nCREATE TABLE Detention (\n detention_id INTEGER,\n detention_type_code VARCHAR(10),\n teacher_id INTEGER,\n datetime_detention_start DATETIME,\n datetime_detention_end DATETIME,\n detention_summary VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Assessment_Notes (\n notes_id INTEGER,\n student_id INTEGER,\n teacher_id INTEGER,\n date_of_notes DATETIME,\n text_of_notes VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Addresses (\n address_id INTEGER,\n line_1 VARCHAR(120),\n line_2 VARCHAR(120),\n line_3 VARCHAR(120),\n city VARCHAR(80),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50),\n other_address_details VARCHAR(255)\n)\n\nCREATE TABLE Teachers (\n teacher_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(80),\n last_name VARCHAR(80),\n gender VARCHAR(1),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Behavior_Incident (\n incident_id INTEGER,\n incident_type_code VARCHAR(10),\n student_id INTEGER,\n date_incident_start DATETIME,\n date_incident_end DATETIME,\n incident_summary VARCHAR(255),\n recommendations VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Students_in_Detention (\n student_id INTEGER,\n detention_id INTEGER,\n incident_id INTEGER\n)\n\nCREATE TABLE Ref_Incident_Type (\n incident_type_code VARCHAR(10),\n incident_type_description VARCHAR(80)\n)\n\nCREATE TABLE Student_Addresses (\n student_id INTEGER,\n address_id INTEGER,\n date_address_from DATETIME,\n date_address_to DATETIME,\n monthly_rental DECIMAL(19,4),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Address_Types (\n address_type_code VARCHAR(15),\n address_type_description VARCHAR(80)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(40),\n last_name VARCHAR(40),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n date_first_rental DATETIME,\n date_left_university DATETIME,\n other_student_details VARCHAR(255)\n)","response":"SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by weekday. ### Input: CREATE TABLE Ref_Detention_Type (\n detention_type_code VARCHAR(10),\n detention_type_description VARCHAR(80)\n)\n\nCREATE TABLE Detention (\n detention_id INTEGER,\n detention_type_code VARCHAR(10),\n teacher_id INTEGER,\n datetime_detention_start DATETIME,\n datetime_detention_end DATETIME,\n detention_summary VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Assessment_Notes (\n notes_id INTEGER,\n student_id INTEGER,\n teacher_id INTEGER,\n date_of_notes DATETIME,\n text_of_notes VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Addresses (\n address_id INTEGER,\n line_1 VARCHAR(120),\n line_2 VARCHAR(120),\n line_3 VARCHAR(120),\n city VARCHAR(80),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50),\n other_address_details VARCHAR(255)\n)\n\nCREATE TABLE Teachers (\n teacher_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(80),\n last_name VARCHAR(80),\n gender VARCHAR(1),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Behavior_Incident (\n incident_id INTEGER,\n incident_type_code VARCHAR(10),\n student_id INTEGER,\n date_incident_start DATETIME,\n date_incident_end DATETIME,\n incident_summary VARCHAR(255),\n recommendations VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Students_in_Detention (\n student_id INTEGER,\n detention_id INTEGER,\n incident_id INTEGER\n)\n\nCREATE TABLE Ref_Incident_Type (\n incident_type_code VARCHAR(10),\n incident_type_description VARCHAR(80)\n)\n\nCREATE TABLE Student_Addresses (\n student_id INTEGER,\n address_id INTEGER,\n date_address_from DATETIME,\n date_address_to DATETIME,\n monthly_rental DECIMAL(19,4),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Address_Types (\n address_type_code VARCHAR(15),\n address_type_description VARCHAR(80)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(40),\n last_name VARCHAR(40),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n date_first_rental DATETIME,\n date_left_university DATETIME,\n other_student_details VARCHAR(255)\n) ### Response: SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC"} {"instruction":"How was the player in the position of Center acquired?","input":"CREATE TABLE table_41725 (\n \"Name\" text,\n \"Position\" text,\n \"Number\" real,\n \"School\/Club Team\" text,\n \"Season\" text,\n \"Acquisition via\" text\n)","response":"SELECT \"Acquisition via\" FROM table_41725 WHERE \"Position\" = 'center'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How was the player in the position of Center acquired? ### Input: CREATE TABLE table_41725 (\n \"Name\" text,\n \"Position\" text,\n \"Number\" real,\n \"School\/Club Team\" text,\n \"Season\" text,\n \"Acquisition via\" text\n) ### Response: SELECT \"Acquisition via\" FROM table_41725 WHERE \"Position\" = 'center'"} {"instruction":"Catalog Nebdj068 was released when?","input":"CREATE TABLE table_39879 (\n \"Region\" text,\n \"Date\" text,\n \"Label\" text,\n \"Format\" text,\n \"Catalog\" text\n)","response":"SELECT \"Date\" FROM table_39879 WHERE \"Catalog\" = 'nebdj068'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Catalog Nebdj068 was released when? ### Input: CREATE TABLE table_39879 (\n \"Region\" text,\n \"Date\" text,\n \"Label\" text,\n \"Format\" text,\n \"Catalog\" text\n) ### Response: SELECT \"Date\" FROM table_39879 WHERE \"Catalog\" = 'nebdj068'"} {"instruction":"What is average age for different job title Visualize by bar chart, I want to rank by the bars from low to high.","input":"CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n)","response":"SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is average age for different job title Visualize by bar chart, I want to rank by the bars from low to high. ### Input: CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n) ### Response: SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job"} {"instruction":"What was the To par score for the tournament with a margin of victory of 1 stroke?","input":"CREATE TABLE table_40653 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"To par\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n)","response":"SELECT \"To par\" FROM table_40653 WHERE \"Margin of victory\" = '1 stroke'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the To par score for the tournament with a margin of victory of 1 stroke? ### Input: CREATE TABLE table_40653 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"To par\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n) ### Response: SELECT \"To par\" FROM table_40653 WHERE \"Margin of victory\" = '1 stroke'"} {"instruction":"On what date did the Brisbane Lions (1) win?","input":"CREATE TABLE table_56418 (\n \"Season\" text,\n \"Cup FinalDate\" text,\n \"WinningTeam\" text,\n \"Score\" text,\n \"LosingTeam\" text,\n \"Cup Final Attendance\" text\n)","response":"SELECT \"Cup FinalDate\" FROM table_56418 WHERE \"WinningTeam\" = 'brisbane lions (1)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did the Brisbane Lions (1) win? ### Input: CREATE TABLE table_56418 (\n \"Season\" text,\n \"Cup FinalDate\" text,\n \"WinningTeam\" text,\n \"Score\" text,\n \"LosingTeam\" text,\n \"Cup Final Attendance\" text\n) ### Response: SELECT \"Cup FinalDate\" FROM table_56418 WHERE \"WinningTeam\" = 'brisbane lions (1)'"} {"instruction":"What is the winning span for the name of bernard gallacher?","input":"CREATE TABLE table_23078 (\n \"Rank\" text,\n \"Name\" text,\n \"Lifespan\" text,\n \"Country\" text,\n \"Wins\" real,\n \"Majors\" real,\n \"Winning span\" text,\n \"Span (years)\" real\n)","response":"SELECT \"Winning span\" FROM table_23078 WHERE \"Name\" = 'Bernard Gallacher'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the winning span for the name of bernard gallacher? ### Input: CREATE TABLE table_23078 (\n \"Rank\" text,\n \"Name\" text,\n \"Lifespan\" text,\n \"Country\" text,\n \"Wins\" real,\n \"Majors\" real,\n \"Winning span\" text,\n \"Span (years)\" real\n) ### Response: SELECT \"Winning span\" FROM table_23078 WHERE \"Name\" = 'Bernard Gallacher'"} {"instruction":"count the number of patients whose ethnicity is black\/african american and year of birth is less than 2076?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"BLACK\/AFRICAN AMERICAN\" AND demographic.dob_year < \"2076\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose ethnicity is black\/african american and year of birth is less than 2076? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"BLACK\/AFRICAN AMERICAN\" AND demographic.dob_year < \"2076\""} {"instruction":"What is every year where opponent in the final is John Mcenroe at Wimbledon?","input":"CREATE TABLE table_23235767_1 (\n year VARCHAR,\n opponent_in_the_final VARCHAR,\n championship VARCHAR\n)","response":"SELECT year FROM table_23235767_1 WHERE opponent_in_the_final = \"John McEnroe\" AND championship = \"Wimbledon\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every year where opponent in the final is John Mcenroe at Wimbledon? ### Input: CREATE TABLE table_23235767_1 (\n year VARCHAR,\n opponent_in_the_final VARCHAR,\n championship VARCHAR\n) ### Response: SELECT year FROM table_23235767_1 WHERE opponent_in_the_final = \"John McEnroe\" AND championship = \"Wimbledon\""} {"instruction":"What was the home team for the game with more than 25,000 crowd?","input":"CREATE TABLE table_33727 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team\" FROM table_33727 WHERE \"Crowd\" > '25,000'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team for the game with more than 25,000 crowd? ### Input: CREATE TABLE table_33727 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team\" FROM table_33727 WHERE \"Crowd\" > '25,000'"} {"instruction":"What's the performance of Dire Tune?","input":"CREATE TABLE table_name_89 (\n performance VARCHAR,\n athlete VARCHAR\n)","response":"SELECT performance FROM table_name_89 WHERE athlete = \"dire tune\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the performance of Dire Tune? ### Input: CREATE TABLE table_name_89 (\n performance VARCHAR,\n athlete VARCHAR\n) ### Response: SELECT performance FROM table_name_89 WHERE athlete = \"dire tune\""} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of last_name and salary , show in descending by the X.","input":"CREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of last_name and salary , show in descending by the X. ### Input: CREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC"} {"instruction":"What circuit had rnd 3?","input":"CREATE TABLE table_26503 (\n \"Rnd\" real,\n \"Circuit\" text,\n \"LMP Winning Team\" text,\n \"LMPC Winning Team\" text,\n \"GT Winning Team\" text,\n \"GTC Winning Team\" text,\n \"Results\" text\n)","response":"SELECT \"Circuit\" FROM table_26503 WHERE \"Rnd\" = '3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What circuit had rnd 3? ### Input: CREATE TABLE table_26503 (\n \"Rnd\" real,\n \"Circuit\" text,\n \"LMP Winning Team\" text,\n \"LMPC Winning Team\" text,\n \"GT Winning Team\" text,\n \"GTC Winning Team\" text,\n \"Results\" text\n) ### Response: SELECT \"Circuit\" FROM table_26503 WHERE \"Rnd\" = '3'"} {"instruction":"Which date released had a Democratic Alternative value of 1% and Labour of 34%?","input":"CREATE TABLE table_66678 (\n \"Date(s) Released\" text,\n \"Polling institute\" text,\n \"Nationalist\" text,\n \"Labour\" text,\n \"Democratic Alternative\" text,\n \"Undecided\/ No answer\" text,\n \"Lead\" text\n)","response":"SELECT \"Date(s) Released\" FROM table_66678 WHERE \"Democratic Alternative\" = '1%' AND \"Labour\" = '34%'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which date released had a Democratic Alternative value of 1% and Labour of 34%? ### Input: CREATE TABLE table_66678 (\n \"Date(s) Released\" text,\n \"Polling institute\" text,\n \"Nationalist\" text,\n \"Labour\" text,\n \"Democratic Alternative\" text,\n \"Undecided\/ No answer\" text,\n \"Lead\" text\n) ### Response: SELECT \"Date(s) Released\" FROM table_66678 WHERE \"Democratic Alternative\" = '1%' AND \"Labour\" = '34%'"} {"instruction":"What was the score in the match against Kim Tiilikainen?","input":"CREATE TABLE table_68453 (\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n)","response":"SELECT \"Score\" FROM table_68453 WHERE \"Opponent\" = 'kim tiilikainen'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score in the match against Kim Tiilikainen? ### Input: CREATE TABLE table_68453 (\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n) ### Response: SELECT \"Score\" FROM table_68453 WHERE \"Opponent\" = 'kim tiilikainen'"} {"instruction":"What is the wattage\/TDP associated with model name 4x0?","input":"CREATE TABLE table_26575 (\n \"Processor\" text,\n \"Brand name\" text,\n \"Model (list)\" text,\n \"Cores\" real,\n \"L2 Cache\" text,\n \"Socket\" text,\n \"TDP\" text\n)","response":"SELECT \"TDP\" FROM table_26575 WHERE \"Model (list)\" = '4x0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the wattage\/TDP associated with model name 4x0? ### Input: CREATE TABLE table_26575 (\n \"Processor\" text,\n \"Brand name\" text,\n \"Model (list)\" text,\n \"Cores\" real,\n \"L2 Cache\" text,\n \"Socket\" text,\n \"TDP\" text\n) ### Response: SELECT \"TDP\" FROM table_26575 WHERE \"Model (list)\" = '4x0'"} {"instruction":"Name a music director, belonging to a year after 2003?","input":"CREATE TABLE table_name_86 (\n music_director VARCHAR,\n year INTEGER\n)","response":"SELECT music_director FROM table_name_86 WHERE year > 2003","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name a music director, belonging to a year after 2003? ### Input: CREATE TABLE table_name_86 (\n music_director VARCHAR,\n year INTEGER\n) ### Response: SELECT music_director FROM table_name_86 WHERE year > 2003"} {"instruction":"Find the average age of students living in each city with a bar chart.","input":"CREATE TABLE Lives_in (\n stuid INTEGER,\n dormid INTEGER,\n room_number INTEGER\n)\n\nCREATE TABLE Dorm (\n dormid INTEGER,\n dorm_name VARCHAR(20),\n student_capacity INTEGER,\n gender VARCHAR(1)\n)\n\nCREATE TABLE Has_amenity (\n dormid INTEGER,\n amenid INTEGER\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Dorm_amenity (\n amenid INTEGER,\n amenity_name VARCHAR(25)\n)","response":"SELECT city_code, AVG(Age) FROM Student GROUP BY city_code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the average age of students living in each city with a bar chart. ### Input: CREATE TABLE Lives_in (\n stuid INTEGER,\n dormid INTEGER,\n room_number INTEGER\n)\n\nCREATE TABLE Dorm (\n dormid INTEGER,\n dorm_name VARCHAR(20),\n student_capacity INTEGER,\n gender VARCHAR(1)\n)\n\nCREATE TABLE Has_amenity (\n dormid INTEGER,\n amenid INTEGER\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Dorm_amenity (\n amenid INTEGER,\n amenity_name VARCHAR(25)\n) ### Response: SELECT city_code, AVG(Age) FROM Student GROUP BY city_code"} {"instruction":"What are the reigns and days held of all wrestlers?","input":"CREATE TABLE elimination (\n elimination_id text,\n wrestler_id text,\n team text,\n eliminated_by text,\n elimination_move text,\n time text\n)\n\nCREATE TABLE wrestler (\n wrestler_id number,\n name text,\n reign text,\n days_held text,\n location text,\n event text\n)","response":"SELECT reign, days_held FROM wrestler","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the reigns and days held of all wrestlers? ### Input: CREATE TABLE elimination (\n elimination_id text,\n wrestler_id text,\n team text,\n eliminated_by text,\n elimination_move text,\n time text\n)\n\nCREATE TABLE wrestler (\n wrestler_id number,\n name text,\n reign text,\n days_held text,\n location text,\n event text\n) ### Response: SELECT reign, days_held FROM wrestler"} {"instruction":"what was the first drug that was prescribed to patient 030-56105 through im route in 03\/last year?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-56105')) AND medication.routeadmin = 'im' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', medication.drugstarttime) = '03' ORDER BY medication.drugstarttime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first drug that was prescribed to patient 030-56105 through im route in 03\/last year? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-56105')) AND medication.routeadmin = 'im' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', medication.drugstarttime) = '03' ORDER BY medication.drugstarttime LIMIT 1"} {"instruction":"how many days has passed since patient 14671 had a creatinine laboratory test for the last time in the current hospital encounter?","input":"CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days has passed since patient 14671 had a creatinine laboratory test for the last time in the current hospital encounter? ### Input: CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1"} {"instruction":"what was the prescription drug that patient 27172 had received two or more times in 10\/this year?","input":"CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', prescriptions.startdate) = '10' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the prescription drug that patient 27172 had received two or more times in 10\/this year? ### Input: CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', prescriptions.startdate) = '10' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2"} {"instruction":"What is the verb meaning for Saugen in part 1?","input":"CREATE TABLE table_44583 (\n \"Class\" text,\n \"Part 1\" text,\n \"Part 2\" text,\n \"Part 3\" text,\n \"Part 4\" text,\n \"Verb meaning\" text\n)","response":"SELECT \"Verb meaning\" FROM table_44583 WHERE \"Part 1\" = 'saugen'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the verb meaning for Saugen in part 1? ### Input: CREATE TABLE table_44583 (\n \"Class\" text,\n \"Part 1\" text,\n \"Part 2\" text,\n \"Part 3\" text,\n \"Part 4\" text,\n \"Verb meaning\" text\n) ### Response: SELECT \"Verb meaning\" FROM table_44583 WHERE \"Part 1\" = 'saugen'"} {"instruction":"What date did the away team Mansfield Town play?","input":"CREATE TABLE table_name_56 (\n date VARCHAR,\n away_team VARCHAR\n)","response":"SELECT date FROM table_name_56 WHERE away_team = \"mansfield town\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did the away team Mansfield Town play? ### Input: CREATE TABLE table_name_56 (\n date VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT date FROM table_name_56 WHERE away_team = \"mansfield town\""} {"instruction":"count the number of patients who were diagnosed with valvular stenosis - aortic but did not come back to hospital within 2 months until 1 year ago.","input":"CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular stenosis - aortic' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular stenosis - aortic' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year') AND DATETIME(patient.hospitaladmittime) BETWEEN DATETIME(t2.diagnosistime) AND DATETIME(t2.diagnosistime, '+2 month'))","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who were diagnosed with valvular stenosis - aortic but did not come back to hospital within 2 months until 1 year ago. ### Input: CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular stenosis - aortic' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular stenosis - aortic' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year') AND DATETIME(patient.hospitaladmittime) BETWEEN DATETIME(t2.diagnosistime) AND DATETIME(t2.diagnosistime, '+2 month'))"} {"instruction":"When was the team, whose captain is Matt Smith, founded?","input":"CREATE TABLE table_17914 (\n \"Team\" text,\n \"Location\" text,\n \"Stadium\" text,\n \"Founded\" real,\n \"Joined\" real,\n \"Head Coach\" text,\n \"Captain\" text\n)","response":"SELECT \"Founded\" FROM table_17914 WHERE \"Captain\" = 'Matt Smith'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the team, whose captain is Matt Smith, founded? ### Input: CREATE TABLE table_17914 (\n \"Team\" text,\n \"Location\" text,\n \"Stadium\" text,\n \"Founded\" real,\n \"Joined\" real,\n \"Head Coach\" text,\n \"Captain\" text\n) ### Response: SELECT \"Founded\" FROM table_17914 WHERE \"Captain\" = 'Matt Smith'"} {"instruction":"List the physicians' employee ids together with their primary affiliation departments' ids. Plot them as scatter chart.","input":"CREATE TABLE Room (\n RoomNumber INTEGER,\n RoomType VARCHAR(30),\n BlockFloor INTEGER,\n BlockCode INTEGER,\n Unavailable BOOLEAN\n)\n\nCREATE TABLE Affiliated_With (\n Physician INTEGER,\n Department INTEGER,\n PrimaryAffiliation BOOLEAN\n)\n\nCREATE TABLE Appointment (\n AppointmentID INTEGER,\n Patient INTEGER,\n PrepNurse INTEGER,\n Physician INTEGER,\n Start DATETIME,\n End DATETIME,\n ExaminationRoom TEXT\n)\n\nCREATE TABLE Department (\n DepartmentID INTEGER,\n Name VARCHAR(30),\n Head INTEGER\n)\n\nCREATE TABLE On_Call (\n Nurse INTEGER,\n BlockFloor INTEGER,\n BlockCode INTEGER,\n OnCallStart DATETIME,\n OnCallEnd DATETIME\n)\n\nCREATE TABLE Stay (\n StayID INTEGER,\n Patient INTEGER,\n Room INTEGER,\n StayStart DATETIME,\n StayEnd DATETIME\n)\n\nCREATE TABLE Physician (\n EmployeeID INTEGER,\n Name VARCHAR(30),\n Position VARCHAR(30),\n SSN INTEGER\n)\n\nCREATE TABLE Procedures (\n Code INTEGER,\n Name VARCHAR(30),\n Cost REAL\n)\n\nCREATE TABLE Trained_In (\n Physician INTEGER,\n Treatment INTEGER,\n CertificationDate DATETIME,\n CertificationExpires DATETIME\n)\n\nCREATE TABLE Patient (\n SSN INTEGER,\n Name VARCHAR(30),\n Address VARCHAR(30),\n Phone VARCHAR(30),\n InsuranceID INTEGER,\n PCP INTEGER\n)\n\nCREATE TABLE Undergoes (\n Patient INTEGER,\n Procedures INTEGER,\n Stay INTEGER,\n DateUndergoes DATETIME,\n Physician INTEGER,\n AssistingNurse INTEGER\n)\n\nCREATE TABLE Block (\n BlockFloor INTEGER,\n BlockCode INTEGER\n)\n\nCREATE TABLE Prescribes (\n Physician INTEGER,\n Patient INTEGER,\n Medication INTEGER,\n Date DATETIME,\n Appointment INTEGER,\n Dose VARCHAR(30)\n)\n\nCREATE TABLE Medication (\n Code INTEGER,\n Name VARCHAR(30),\n Brand VARCHAR(30),\n Description VARCHAR(30)\n)\n\nCREATE TABLE Nurse (\n EmployeeID INTEGER,\n Name VARCHAR(30),\n Position VARCHAR(30),\n Registered BOOLEAN,\n SSN INTEGER\n)","response":"SELECT Physician, Department FROM Affiliated_With WHERE PrimaryAffiliation = 1","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the physicians' employee ids together with their primary affiliation departments' ids. Plot them as scatter chart. ### Input: CREATE TABLE Room (\n RoomNumber INTEGER,\n RoomType VARCHAR(30),\n BlockFloor INTEGER,\n BlockCode INTEGER,\n Unavailable BOOLEAN\n)\n\nCREATE TABLE Affiliated_With (\n Physician INTEGER,\n Department INTEGER,\n PrimaryAffiliation BOOLEAN\n)\n\nCREATE TABLE Appointment (\n AppointmentID INTEGER,\n Patient INTEGER,\n PrepNurse INTEGER,\n Physician INTEGER,\n Start DATETIME,\n End DATETIME,\n ExaminationRoom TEXT\n)\n\nCREATE TABLE Department (\n DepartmentID INTEGER,\n Name VARCHAR(30),\n Head INTEGER\n)\n\nCREATE TABLE On_Call (\n Nurse INTEGER,\n BlockFloor INTEGER,\n BlockCode INTEGER,\n OnCallStart DATETIME,\n OnCallEnd DATETIME\n)\n\nCREATE TABLE Stay (\n StayID INTEGER,\n Patient INTEGER,\n Room INTEGER,\n StayStart DATETIME,\n StayEnd DATETIME\n)\n\nCREATE TABLE Physician (\n EmployeeID INTEGER,\n Name VARCHAR(30),\n Position VARCHAR(30),\n SSN INTEGER\n)\n\nCREATE TABLE Procedures (\n Code INTEGER,\n Name VARCHAR(30),\n Cost REAL\n)\n\nCREATE TABLE Trained_In (\n Physician INTEGER,\n Treatment INTEGER,\n CertificationDate DATETIME,\n CertificationExpires DATETIME\n)\n\nCREATE TABLE Patient (\n SSN INTEGER,\n Name VARCHAR(30),\n Address VARCHAR(30),\n Phone VARCHAR(30),\n InsuranceID INTEGER,\n PCP INTEGER\n)\n\nCREATE TABLE Undergoes (\n Patient INTEGER,\n Procedures INTEGER,\n Stay INTEGER,\n DateUndergoes DATETIME,\n Physician INTEGER,\n AssistingNurse INTEGER\n)\n\nCREATE TABLE Block (\n BlockFloor INTEGER,\n BlockCode INTEGER\n)\n\nCREATE TABLE Prescribes (\n Physician INTEGER,\n Patient INTEGER,\n Medication INTEGER,\n Date DATETIME,\n Appointment INTEGER,\n Dose VARCHAR(30)\n)\n\nCREATE TABLE Medication (\n Code INTEGER,\n Name VARCHAR(30),\n Brand VARCHAR(30),\n Description VARCHAR(30)\n)\n\nCREATE TABLE Nurse (\n EmployeeID INTEGER,\n Name VARCHAR(30),\n Position VARCHAR(30),\n Registered BOOLEAN,\n SSN INTEGER\n) ### Response: SELECT Physician, Department FROM Affiliated_With WHERE PrimaryAffiliation = 1"} {"instruction":"What is the lowest number of three pointers in games where the number of rebounds was 178?","input":"CREATE TABLE table_22824324_2 (\n three_pointers INTEGER,\n rebounds VARCHAR\n)","response":"SELECT MIN(three_pointers) FROM table_22824324_2 WHERE rebounds = 178","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of three pointers in games where the number of rebounds was 178? ### Input: CREATE TABLE table_22824324_2 (\n three_pointers INTEGER,\n rebounds VARCHAR\n) ### Response: SELECT MIN(three_pointers) FROM table_22824324_2 WHERE rebounds = 178"} {"instruction":"What is the grand slam in 1987, when round shows first round, and Ivan Lendl won?","input":"CREATE TABLE table_62130 (\n \"Year\" real,\n \"Grand Slam\" text,\n \"Round\" text,\n \"Winner\" text,\n \"Loser\" text\n)","response":"SELECT \"Grand Slam\" FROM table_62130 WHERE \"Year\" = '1987' AND \"Round\" = 'first round' AND \"Winner\" = 'ivan lendl'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the grand slam in 1987, when round shows first round, and Ivan Lendl won? ### Input: CREATE TABLE table_62130 (\n \"Year\" real,\n \"Grand Slam\" text,\n \"Round\" text,\n \"Winner\" text,\n \"Loser\" text\n) ### Response: SELECT \"Grand Slam\" FROM table_62130 WHERE \"Year\" = '1987' AND \"Round\" = 'first round' AND \"Winner\" = 'ivan lendl'"} {"instruction":"How many faculty is there in total in the year of 2002?","input":"CREATE TABLE faculty (\n faculty INTEGER,\n YEAR VARCHAR\n)","response":"SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty is there in total in the year of 2002? ### Input: CREATE TABLE faculty (\n faculty INTEGER,\n YEAR VARCHAR\n) ### Response: SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002"} {"instruction":"What is the traffic direction of 70th street?","input":"CREATE TABLE table_56945 (\n \"Street\" text,\n \"West\" text,\n \"East\" text,\n \"# of lanes\" text,\n \"Traffic direction\" text\n)","response":"SELECT \"Traffic direction\" FROM table_56945 WHERE \"Street\" = '70th street'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the traffic direction of 70th street? ### Input: CREATE TABLE table_56945 (\n \"Street\" text,\n \"West\" text,\n \"East\" text,\n \"# of lanes\" text,\n \"Traffic direction\" text\n) ### Response: SELECT \"Traffic direction\" FROM table_56945 WHERE \"Street\" = '70th street'"} {"instruction":"show me all flights from TORONTO","input":"CREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'TORONTO' AND flight.from_airport = airport_service.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all flights from TORONTO ### Input: CREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'TORONTO' AND flight.from_airport = airport_service.airport_code"} {"instruction":"Find Answer by Text and UserId.","input":"CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)","response":"SELECT * FROM Posts WHERE OwnerUserId = '##UserId##' AND ParentId > 0 AND Body LIKE '%##Text##%'","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find Answer by Text and UserId. ### Input: CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n) ### Response: SELECT * FROM Posts WHERE OwnerUserId = '##UserId##' AND ParentId > 0 AND Body LIKE '%##Text##%'"} {"instruction":"What school had a team name of the Trojans?","input":"CREATE TABLE table_37988 (\n \"School\" text,\n \"Team Name\" text,\n \"Town\" text,\n \"County\" text,\n \"School Enrollment (2008\\u201310)\" real,\n \"Football?\" text\n)","response":"SELECT \"School\" FROM table_37988 WHERE \"Team Name\" = 'trojans'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What school had a team name of the Trojans? ### Input: CREATE TABLE table_37988 (\n \"School\" text,\n \"Team Name\" text,\n \"Town\" text,\n \"County\" text,\n \"School Enrollment (2008\\u201310)\" real,\n \"Football?\" text\n) ### Response: SELECT \"School\" FROM table_37988 WHERE \"Team Name\" = 'trojans'"} {"instruction":"how many patients whose admission year is less than 2166 and drug name is loperamide?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < \"2166\" AND prescriptions.drug = \"Loperamide\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission year is less than 2166 and drug name is loperamide? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < \"2166\" AND prescriptions.drug = \"Loperamide\""} {"instruction":"How many tree species are in the kitechura reserve?","input":"CREATE TABLE table_16577990_1 (\n tree_species VARCHAR,\n central_forest_reserve VARCHAR\n)","response":"SELECT tree_species FROM table_16577990_1 WHERE central_forest_reserve = \"Kitechura\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many tree species are in the kitechura reserve? ### Input: CREATE TABLE table_16577990_1 (\n tree_species VARCHAR,\n central_forest_reserve VARCHAR\n) ### Response: SELECT tree_species FROM table_16577990_1 WHERE central_forest_reserve = \"Kitechura\""} {"instruction":"Tell me the horse when the faults are 9 and the total is 46.36","input":"CREATE TABLE table_12013 (\n \"Rider\" text,\n \"Horse\" text,\n \"Faults\" text,\n \"Round 1 + 2A Points\" text,\n \"Total\" real\n)","response":"SELECT \"Horse\" FROM table_12013 WHERE \"Faults\" = '9' AND \"Total\" = '46.36'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the horse when the faults are 9 and the total is 46.36 ### Input: CREATE TABLE table_12013 (\n \"Rider\" text,\n \"Horse\" text,\n \"Faults\" text,\n \"Round 1 + 2A Points\" text,\n \"Total\" real\n) ### Response: SELECT \"Horse\" FROM table_12013 WHERE \"Faults\" = '9' AND \"Total\" = '46.36'"} {"instruction":"What average total has 0 as the gold, with 6 as the rank?","input":"CREATE TABLE table_name_69 (\n total INTEGER,\n gold VARCHAR,\n rank VARCHAR\n)","response":"SELECT AVG(total) FROM table_name_69 WHERE gold = 0 AND rank = \"6\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What average total has 0 as the gold, with 6 as the rank? ### Input: CREATE TABLE table_name_69 (\n total INTEGER,\n gold VARCHAR,\n rank VARCHAR\n) ### Response: SELECT AVG(total) FROM table_name_69 WHERE gold = 0 AND rank = \"6\""} {"instruction":"does patient 85169 had any drain out #1 jackson pratt output?","input":"CREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)","response":"SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85169)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain out #1 jackson pratt' AND d_items.linksto = 'outputevents')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does patient 85169 had any drain out #1 jackson pratt output? ### Input: CREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n) ### Response: SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85169)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain out #1 jackson pratt' AND d_items.linksto = 'outputevents')"} {"instruction":"What are the different names of the colleges involved in the tryout in alphabetical order?","input":"CREATE TABLE tryout (\n pid number,\n cname text,\n ppos text,\n decision text\n)\n\nCREATE TABLE player (\n pid number,\n pname text,\n ycard text,\n hs number\n)\n\nCREATE TABLE college (\n cname text,\n state text,\n enr number\n)","response":"SELECT DISTINCT cname FROM tryout ORDER BY cname","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the different names of the colleges involved in the tryout in alphabetical order? ### Input: CREATE TABLE tryout (\n pid number,\n cname text,\n ppos text,\n decision text\n)\n\nCREATE TABLE player (\n pid number,\n pname text,\n ycard text,\n hs number\n)\n\nCREATE TABLE college (\n cname text,\n state text,\n enr number\n) ### Response: SELECT DISTINCT cname FROM tryout ORDER BY cname"} {"instruction":"what is the place when the score is 68-70-68=206?","input":"CREATE TABLE table_name_3 (\n place VARCHAR,\n score VARCHAR\n)","response":"SELECT place FROM table_name_3 WHERE score = 68 - 70 - 68 = 206","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the place when the score is 68-70-68=206? ### Input: CREATE TABLE table_name_3 (\n place VARCHAR,\n score VARCHAR\n) ### Response: SELECT place FROM table_name_3 WHERE score = 68 - 70 - 68 = 206"} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and commission_pct , order in ascending by the total number.","input":"CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and commission_pct , order in ascending by the total number. ### Input: CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT"} {"instruction":"what year did the rush allow the most goals ?","input":"CREATE TABLE table_204_32 (\n id number,\n \"season\" number,\n \"division\" text,\n \"w-l\" text,\n \"finish\" text,\n \"home\" text,\n \"road\" text,\n \"gf\" number,\n \"ga\" number,\n \"coach\" text,\n \"playoffs\" text,\n \"avg attendance\" number\n)","response":"SELECT \"season\" FROM table_204_32 ORDER BY \"ga\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what year did the rush allow the most goals ? ### Input: CREATE TABLE table_204_32 (\n id number,\n \"season\" number,\n \"division\" text,\n \"w-l\" text,\n \"finish\" text,\n \"home\" text,\n \"road\" text,\n \"gf\" number,\n \"ga\" number,\n \"coach\" text,\n \"playoffs\" text,\n \"avg attendance\" number\n) ### Response: SELECT \"season\" FROM table_204_32 ORDER BY \"ga\" DESC LIMIT 1"} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and I want to order from low to high by the y axis.","input":"CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and I want to order from low to high by the y axis. ### Input: CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)"} {"instruction":"How many of the female patients belonged to a black\/cape verdean ethnic origin?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = \"F\" AND demographic.ethnicity = \"BLACK\/CAPE VERDEAN\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many of the female patients belonged to a black\/cape verdean ethnic origin? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = \"F\" AND demographic.ethnicity = \"BLACK\/CAPE VERDEAN\""} {"instruction":"what are the five most frequently prescribed drugs in 2101 for patients prescribed with dexmedetomidine hcl at the same time?","input":"CREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)","response":"SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'dexmedetomidine hcl' AND STRFTIME('%y', prescriptions.startdate) = '2101') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', prescriptions.startdate) = '2101') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequently prescribed drugs in 2101 for patients prescribed with dexmedetomidine hcl at the same time? ### Input: CREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'dexmedetomidine hcl' AND STRFTIME('%y', prescriptions.startdate) = '2101') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', prescriptions.startdate) = '2101') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5"} {"instruction":"Return a bar chart on how many movie reviews does each director get?, and order in asc by the bars.","input":"CREATE TABLE Movie (\n mID int,\n title text,\n year int,\n director text\n)\n\nCREATE TABLE Reviewer (\n rID int,\n name text\n)\n\nCREATE TABLE Rating (\n rID int,\n mID int,\n stars int,\n ratingDate date\n)","response":"SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY director","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on how many movie reviews does each director get?, and order in asc by the bars. ### Input: CREATE TABLE Movie (\n mID int,\n title text,\n year int,\n director text\n)\n\nCREATE TABLE Reviewer (\n rID int,\n name text\n)\n\nCREATE TABLE Rating (\n rID int,\n mID int,\n stars int,\n ratingDate date\n) ### Response: SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY director"} {"instruction":"Total weeks of 49,980 attendance?","input":"CREATE TABLE table_name_55 (\n week INTEGER,\n attendance VARCHAR\n)","response":"SELECT SUM(week) FROM table_name_55 WHERE attendance = 49 OFFSET 980","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Total weeks of 49,980 attendance? ### Input: CREATE TABLE table_name_55 (\n week INTEGER,\n attendance VARCHAR\n) ### Response: SELECT SUM(week) FROM table_name_55 WHERE attendance = 49 OFFSET 980"} {"instruction":"Name the 2008 for 2012 of sf","input":"CREATE TABLE table_name_41 (\n Id VARCHAR\n)","response":"SELECT 2008 FROM table_name_41 WHERE 2012 = \"sf\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the 2008 for 2012 of sf ### Input: CREATE TABLE table_name_41 (\n Id VARCHAR\n) ### Response: SELECT 2008 FROM table_name_41 WHERE 2012 = \"sf\""} {"instruction":"nejat konuk and dervi ş ero ğ lu are from which party ?","input":"CREATE TABLE table_203_694 (\n id number,\n \"#\" number,\n \"name\" text,\n \"took office\" text,\n \"left office\" text,\n \"party\" text\n)","response":"SELECT \"party\" FROM table_203_694 WHERE \"name\" IN ('nejat konuk', 'dervis eroglu')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: nejat konuk and dervi ş ero ğ lu are from which party ? ### Input: CREATE TABLE table_203_694 (\n id number,\n \"#\" number,\n \"name\" text,\n \"took office\" text,\n \"left office\" text,\n \"party\" text\n) ### Response: SELECT \"party\" FROM table_203_694 WHERE \"name\" IN ('nejat konuk', 'dervis eroglu')"} {"instruction":"How many ansi codes are there for longitude 46.415037?","input":"CREATE TABLE table_18600760_20 (\n ansi_code VARCHAR,\n latitude VARCHAR\n)","response":"SELECT COUNT(ansi_code) FROM table_18600760_20 WHERE latitude = \"46.415037\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many ansi codes are there for longitude 46.415037? ### Input: CREATE TABLE table_18600760_20 (\n ansi_code VARCHAR,\n latitude VARCHAR\n) ### Response: SELECT COUNT(ansi_code) FROM table_18600760_20 WHERE latitude = \"46.415037\""} {"instruction":"What's the railway number of a D(rebuild) class?","input":"CREATE TABLE table_name_28 (\n railway_number_s_ VARCHAR,\n class VARCHAR\n)","response":"SELECT railway_number_s_ FROM table_name_28 WHERE class = \"d(rebuild)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the railway number of a D(rebuild) class? ### Input: CREATE TABLE table_name_28 (\n railway_number_s_ VARCHAR,\n class VARCHAR\n) ### Response: SELECT railway_number_s_ FROM table_name_28 WHERE class = \"d(rebuild)\""} {"instruction":"screening egfr < 60 ml \/ min \/ 1.73 m2","input":"CREATE TABLE table_train_169 (\n \"id\" int,\n \"leukocytes\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"urine_albumin_excretion\" int,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"glucola_beverage_gct\" int,\n \"age\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_169 WHERE estimated_glomerular_filtration_rate_egfr < 60","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: screening egfr < 60 ml \/ min \/ 1.73 m2 ### Input: CREATE TABLE table_train_169 (\n \"id\" int,\n \"leukocytes\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"urine_albumin_excretion\" int,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"glucola_beverage_gct\" int,\n \"age\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_169 WHERE estimated_glomerular_filtration_rate_egfr < 60"} {"instruction":"what is the name of the drug that patient 002-41152 has been prescribed two or more times last month?","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') GROUP BY medication.drugname) AS t1 WHERE t1.c1 >= 2","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the drug that patient 002-41152 has been prescribed two or more times last month? ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') GROUP BY medication.drugname) AS t1 WHERE t1.c1 >= 2"} {"instruction":"What is the average number lost when the PCT is more than 0.7334 and the total number of games is larger than 48?","input":"CREATE TABLE table_10468 (\n \"Independent\" text,\n \"Lost\" real,\n \"Tied\" real,\n \"Pct.\" real,\n \"Years\" real,\n \"Total Games\" real\n)","response":"SELECT AVG(\"Lost\") FROM table_10468 WHERE \"Pct.\" > '0.7334' AND \"Total Games\" > '48'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number lost when the PCT is more than 0.7334 and the total number of games is larger than 48? ### Input: CREATE TABLE table_10468 (\n \"Independent\" text,\n \"Lost\" real,\n \"Tied\" real,\n \"Pct.\" real,\n \"Years\" real,\n \"Total Games\" real\n) ### Response: SELECT AVG(\"Lost\") FROM table_10468 WHERE \"Pct.\" > '0.7334' AND \"Total Games\" > '48'"} {"instruction":"how many times did patient 010-6098 since 128 months ago receive crystalloids?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-6098')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'crystalloids' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-128 month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did patient 010-6098 since 128 months ago receive crystalloids? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-6098')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'crystalloids' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-128 month')"} {"instruction":"how much does the minimum hospital cost including a procedure called hypotonic fluid administration - d5w until 1 year ago?","input":"CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'hypotonic fluid administration - d5w')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY cost.patienthealthsystemstayid) AS t1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much does the minimum hospital cost including a procedure called hypotonic fluid administration - d5w until 1 year ago? ### Input: CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'hypotonic fluid administration - d5w')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY cost.patienthealthsystemstayid) AS t1"} {"instruction":"How much is the lowest Operating Expenditures when Contributions are more than 8,245,241?","input":"CREATE TABLE table_54361 (\n \"Candidate\" text,\n \"Contributions\" real,\n \"Loans Received\" real,\n \"All Receipts\" real,\n \"Operating Expenditures\" real,\n \"All Disbursements\" real\n)","response":"SELECT MIN(\"Operating Expenditures\") FROM table_54361 WHERE \"Contributions\" > '8,245,241'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much is the lowest Operating Expenditures when Contributions are more than 8,245,241? ### Input: CREATE TABLE table_54361 (\n \"Candidate\" text,\n \"Contributions\" real,\n \"Loans Received\" real,\n \"All Receipts\" real,\n \"Operating Expenditures\" real,\n \"All Disbursements\" real\n) ### Response: SELECT MIN(\"Operating Expenditures\") FROM table_54361 WHERE \"Contributions\" > '8,245,241'"} {"instruction":"what is the daily maximum amount of the foley of patient 14458 during their first hospital visit?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14458 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_items.linksto = 'outputevents') GROUP BY STRFTIME('%y-%m-%d', outputevents.charttime)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the daily maximum amount of the foley of patient 14458 during their first hospital visit? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14458 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_items.linksto = 'outputevents') GROUP BY STRFTIME('%y-%m-%d', outputevents.charttime)"} {"instruction":"How many gold medals does the country ranked higher than 2 with more than 8 bronze have?","input":"CREATE TABLE table_70723 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT SUM(\"Gold\") FROM table_70723 WHERE \"Rank\" < '2' AND \"Bronze\" > '8'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many gold medals does the country ranked higher than 2 with more than 8 bronze have? ### Input: CREATE TABLE table_70723 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT SUM(\"Gold\") FROM table_70723 WHERE \"Rank\" < '2' AND \"Bronze\" > '8'"} {"instruction":"total number of models created .","input":"CREATE TABLE table_203_873 (\n id number,\n \"model name\" text,\n \"length\" text,\n \"width\" text,\n \"height\" text,\n \"riders\" number,\n \"capacity\" number,\n \"description\" text,\n \"portable\" text,\n \"notes\" number\n)","response":"SELECT COUNT(DISTINCT \"model name\") FROM table_203_873","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: total number of models created . ### Input: CREATE TABLE table_203_873 (\n id number,\n \"model name\" text,\n \"length\" text,\n \"width\" text,\n \"height\" text,\n \"riders\" number,\n \"capacity\" number,\n \"description\" text,\n \"portable\" text,\n \"notes\" number\n) ### Response: SELECT COUNT(DISTINCT \"model name\") FROM table_203_873"} {"instruction":"Which engine has a Year larger than 1969?","input":"CREATE TABLE table_name_7 (\n engine VARCHAR,\n year INTEGER\n)","response":"SELECT engine FROM table_name_7 WHERE year > 1969","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which engine has a Year larger than 1969? ### Input: CREATE TABLE table_name_7 (\n engine VARCHAR,\n year INTEGER\n) ### Response: SELECT engine FROM table_name_7 WHERE year > 1969"} {"instruction":"Who was the home team when the away team was Footscray?","input":"CREATE TABLE table_53738 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team\" FROM table_53738 WHERE \"Away team\" = 'footscray'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team when the away team was Footscray? ### Input: CREATE TABLE table_53738 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team\" FROM table_53738 WHERE \"Away team\" = 'footscray'"} {"instruction":"Which position was active in Jazz in 2002-03?","input":"CREATE TABLE table_name_59 (\n position VARCHAR,\n years_for_jazz VARCHAR\n)","response":"SELECT position FROM table_name_59 WHERE years_for_jazz = \"2002-03\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which position was active in Jazz in 2002-03? ### Input: CREATE TABLE table_name_59 (\n position VARCHAR,\n years_for_jazz VARCHAR\n) ### Response: SELECT position FROM table_name_59 WHERE years_for_jazz = \"2002-03\""} {"instruction":"on this month\/27 what was the respiration minimum value of patient 005-87465?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND NOT vitalperiodic.respiration IS NULL AND DATETIME(vitalperiodic.observationtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', vitalperiodic.observationtime) = '27'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on this month\/27 what was the respiration minimum value of patient 005-87465? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND NOT vitalperiodic.respiration IS NULL AND DATETIME(vitalperiodic.observationtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', vitalperiodic.observationtime) = '27'"} {"instruction":"Which actor won in 1966?","input":"CREATE TABLE table_name_43 (\n actor VARCHAR,\n year VARCHAR\n)","response":"SELECT actor FROM table_name_43 WHERE year = 1966","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which actor won in 1966? ### Input: CREATE TABLE table_name_43 (\n actor VARCHAR,\n year VARCHAR\n) ### Response: SELECT actor FROM table_name_43 WHERE year = 1966"} {"instruction":"i would like the earliest morning flight from ATLANTA to PHILADELPHIA on wednesday morning","input":"CREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias1, days AS DAYSalias1, flight AS FLIGHTalias1 WHERE ((CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'PHILADELPHIA' AND DATE_DAYalias1.day_number = 23 AND DATE_DAYalias1.month_number = 4 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'ATLANTA' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) AND FLIGHTalias1.departure_time BETWEEN 0 AND 1200)","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i would like the earliest morning flight from ATLANTA to PHILADELPHIA on wednesday morning ### Input: CREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias1, days AS DAYSalias1, flight AS FLIGHTalias1 WHERE ((CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'PHILADELPHIA' AND DATE_DAYalias1.day_number = 23 AND DATE_DAYalias1.month_number = 4 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'ATLANTA' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) AND FLIGHTalias1.departure_time BETWEEN 0 AND 1200)"} {"instruction":"For outgoing manager is alberto malesani mention all the applicable replaced by person","input":"CREATE TABLE table_3703 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n)","response":"SELECT \"Replaced by\" FROM table_3703 WHERE \"Outgoing manager\" = 'Alberto Malesani'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For outgoing manager is alberto malesani mention all the applicable replaced by person ### Input: CREATE TABLE table_3703 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n) ### Response: SELECT \"Replaced by\" FROM table_3703 WHERE \"Outgoing manager\" = 'Alberto Malesani'"} {"instruction":"How many losses are there for team tembetary?","input":"CREATE TABLE table_18703133_6 (\n losses VARCHAR,\n team VARCHAR\n)","response":"SELECT losses FROM table_18703133_6 WHERE team = \"Tembetary\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many losses are there for team tembetary? ### Input: CREATE TABLE table_18703133_6 (\n losses VARCHAR,\n team VARCHAR\n) ### Response: SELECT losses FROM table_18703133_6 WHERE team = \"Tembetary\""} {"instruction":"What is the main presenter of bulgaria?","input":"CREATE TABLE table_1053802_1 (\n main_presenters VARCHAR,\n region_country VARCHAR\n)","response":"SELECT main_presenters FROM table_1053802_1 WHERE region_country = \"Bulgaria\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the main presenter of bulgaria? ### Input: CREATE TABLE table_1053802_1 (\n main_presenters VARCHAR,\n region_country VARCHAR\n) ### Response: SELECT main_presenters FROM table_1053802_1 WHERE region_country = \"Bulgaria\""} {"instruction":"What is the original artist when the vocal percussionist is Alexei Kalveks?","input":"CREATE TABLE table_28715942_5 (\n original_artist VARCHAR,\n vocal_percussionist VARCHAR\n)","response":"SELECT original_artist FROM table_28715942_5 WHERE vocal_percussionist = \"Alexei Kalveks\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the original artist when the vocal percussionist is Alexei Kalveks? ### Input: CREATE TABLE table_28715942_5 (\n original_artist VARCHAR,\n vocal_percussionist VARCHAR\n) ### Response: SELECT original_artist FROM table_28715942_5 WHERE vocal_percussionist = \"Alexei Kalveks\""} {"instruction":"How many documents in different ending date? Return a line chart grouping by ending date.","input":"CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)","response":"SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many documents in different ending date? Return a line chart grouping by ending date. ### Input: CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n) ### Response: SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To"} {"instruction":"What is the sum of all total medals with more than 2 bronze medals and more than 1 gold medal for the United States?","input":"CREATE TABLE table_name_27 (\n total INTEGER,\n gold VARCHAR,\n bronze VARCHAR,\n nation VARCHAR\n)","response":"SELECT SUM(total) FROM table_name_27 WHERE bronze > 2 AND nation = \"united states\" AND gold > 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of all total medals with more than 2 bronze medals and more than 1 gold medal for the United States? ### Input: CREATE TABLE table_name_27 (\n total INTEGER,\n gold VARCHAR,\n bronze VARCHAR,\n nation VARCHAR\n) ### Response: SELECT SUM(total) FROM table_name_27 WHERE bronze > 2 AND nation = \"united states\" AND gold > 1"} {"instruction":"What was the winning score of the Buy.com Siouxland Open?","input":"CREATE TABLE table_70472 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n)","response":"SELECT \"Winning score\" FROM table_70472 WHERE \"Tournament\" = 'buy.com siouxland open'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the winning score of the Buy.com Siouxland Open? ### Input: CREATE TABLE table_70472 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n) ### Response: SELECT \"Winning score\" FROM table_70472 WHERE \"Tournament\" = 'buy.com siouxland open'"} {"instruction":"Provide me the number of patients born before 1846 who have an abnormal lab test status.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < \"1846\" AND lab.flag = \"abnormal\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Provide me the number of patients born before 1846 who have an abnormal lab test status. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < \"1846\" AND lab.flag = \"abnormal\""} {"instruction":"What is Country, when Previous Team (League) is 'Kingston Frontenacs ( OHL )', and when Player is 'Anthony Stewart Category:Articles with hCards'?","input":"CREATE TABLE table_59768 (\n \"Year\" real,\n \"Pick\" text,\n \"Player\" text,\n \"Position\" text,\n \"Country\" text,\n \"Previous team (League)\" text\n)","response":"SELECT \"Country\" FROM table_59768 WHERE \"Previous team (League)\" = 'kingston frontenacs ( ohl )' AND \"Player\" = 'anthony stewart category:articles with hcards'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Country, when Previous Team (League) is 'Kingston Frontenacs ( OHL )', and when Player is 'Anthony Stewart Category:Articles with hCards'? ### Input: CREATE TABLE table_59768 (\n \"Year\" real,\n \"Pick\" text,\n \"Player\" text,\n \"Position\" text,\n \"Country\" text,\n \"Previous team (League)\" text\n) ### Response: SELECT \"Country\" FROM table_59768 WHERE \"Previous team (League)\" = 'kingston frontenacs ( ohl )' AND \"Player\" = 'anthony stewart category:articles with hcards'"} {"instruction":"Find the title and star rating of the movie that got the least rating star for each reviewer.","input":"CREATE TABLE rating (\n rid number,\n mid number,\n stars number,\n ratingdate time\n)\n\nCREATE TABLE reviewer (\n rid number,\n name text\n)\n\nCREATE TABLE movie (\n mid number,\n title text,\n year number,\n director text\n)","response":"SELECT T2.title, T1.rid, T1.stars, MIN(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.rid","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the title and star rating of the movie that got the least rating star for each reviewer. ### Input: CREATE TABLE rating (\n rid number,\n mid number,\n stars number,\n ratingdate time\n)\n\nCREATE TABLE reviewer (\n rid number,\n name text\n)\n\nCREATE TABLE movie (\n mid number,\n title text,\n year number,\n director text\n) ### Response: SELECT T2.title, T1.rid, T1.stars, MIN(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.rid"} {"instruction":"List roles that have more than one employee. List the role description and number of employees.","input":"CREATE TABLE ref_document_status (\n document_status_code text,\n document_status_description text\n)\n\nCREATE TABLE circulation_history (\n document_id number,\n draft_number number,\n copy_number number,\n employee_id number\n)\n\nCREATE TABLE documents (\n document_id number,\n document_status_code text,\n document_type_code text,\n shipping_agent_code text,\n receipt_date time,\n receipt_number text,\n other_details text\n)\n\nCREATE TABLE documents_mailed (\n document_id number,\n mailed_to_address_id number,\n mailing_date time\n)\n\nCREATE TABLE document_drafts (\n document_id number,\n draft_number number,\n draft_details text\n)\n\nCREATE TABLE roles (\n role_code text,\n role_description text\n)\n\nCREATE TABLE ref_shipping_agents (\n shipping_agent_code text,\n shipping_agent_name text,\n shipping_agent_description text\n)\n\nCREATE TABLE ref_document_types (\n document_type_code text,\n document_type_description text\n)\n\nCREATE TABLE addresses (\n address_id number,\n address_details text\n)\n\nCREATE TABLE employees (\n employee_id number,\n role_code text,\n employee_name text,\n other_details text\n)\n\nCREATE TABLE draft_copies (\n document_id number,\n draft_number number,\n copy_number number\n)","response":"SELECT roles.role_description, COUNT(employees.employee_id) FROM roles JOIN employees ON employees.role_code = roles.role_code GROUP BY employees.role_code HAVING COUNT(employees.employee_id) > 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List roles that have more than one employee. List the role description and number of employees. ### Input: CREATE TABLE ref_document_status (\n document_status_code text,\n document_status_description text\n)\n\nCREATE TABLE circulation_history (\n document_id number,\n draft_number number,\n copy_number number,\n employee_id number\n)\n\nCREATE TABLE documents (\n document_id number,\n document_status_code text,\n document_type_code text,\n shipping_agent_code text,\n receipt_date time,\n receipt_number text,\n other_details text\n)\n\nCREATE TABLE documents_mailed (\n document_id number,\n mailed_to_address_id number,\n mailing_date time\n)\n\nCREATE TABLE document_drafts (\n document_id number,\n draft_number number,\n draft_details text\n)\n\nCREATE TABLE roles (\n role_code text,\n role_description text\n)\n\nCREATE TABLE ref_shipping_agents (\n shipping_agent_code text,\n shipping_agent_name text,\n shipping_agent_description text\n)\n\nCREATE TABLE ref_document_types (\n document_type_code text,\n document_type_description text\n)\n\nCREATE TABLE addresses (\n address_id number,\n address_details text\n)\n\nCREATE TABLE employees (\n employee_id number,\n role_code text,\n employee_name text,\n other_details text\n)\n\nCREATE TABLE draft_copies (\n document_id number,\n draft_number number,\n copy_number number\n) ### Response: SELECT roles.role_description, COUNT(employees.employee_id) FROM roles JOIN employees ON employees.role_code = roles.role_code GROUP BY employees.role_code HAVING COUNT(employees.employee_id) > 1"} {"instruction":"What nations participated in 2007?","input":"CREATE TABLE table_66466 (\n \"Sport\" text,\n \"Body\" text,\n \"Year\" text,\n \"Event type\" text,\n \"Location\" text,\n \"Nations\" text\n)","response":"SELECT \"Nations\" FROM table_66466 WHERE \"Year\" = '2007'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What nations participated in 2007? ### Input: CREATE TABLE table_66466 (\n \"Sport\" text,\n \"Body\" text,\n \"Year\" text,\n \"Event type\" text,\n \"Location\" text,\n \"Nations\" text\n) ### Response: SELECT \"Nations\" FROM table_66466 WHERE \"Year\" = '2007'"} {"instruction":"How many tourists visited the country that had 2.5 million tourists in 2011?","input":"CREATE TABLE table_34550 (\n \"Rank\" real,\n \"Country\" text,\n \"International tourist arrivals (2012)\" text,\n \"International tourist arrivals (2011)\" text,\n \"Change (2011 to 2012)\" text,\n \"Change (2010 to 2011)\" text\n)","response":"SELECT \"International tourist arrivals (2012)\" FROM table_34550 WHERE \"International tourist arrivals (2011)\" = '2.5 million'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many tourists visited the country that had 2.5 million tourists in 2011? ### Input: CREATE TABLE table_34550 (\n \"Rank\" real,\n \"Country\" text,\n \"International tourist arrivals (2012)\" text,\n \"International tourist arrivals (2011)\" text,\n \"Change (2011 to 2012)\" text,\n \"Change (2010 to 2011)\" text\n) ### Response: SELECT \"International tourist arrivals (2012)\" FROM table_34550 WHERE \"International tourist arrivals (2011)\" = '2.5 million'"} {"instruction":"What stage did team Carrera Jeans-Tassoni have when Mario Cipollini won and Claudio Chiappucci had the points?","input":"CREATE TABLE table_11219 (\n \"Stage\" text,\n \"Winner\" text,\n \"General classification\" text,\n \"Points classification\" text,\n \"Trofeo Fast Team\" text\n)","response":"SELECT \"Stage\" FROM table_11219 WHERE \"Trofeo Fast Team\" = 'carrera jeans-tassoni' AND \"Winner\" = 'mario cipollini' AND \"Points classification\" = 'claudio chiappucci'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What stage did team Carrera Jeans-Tassoni have when Mario Cipollini won and Claudio Chiappucci had the points? ### Input: CREATE TABLE table_11219 (\n \"Stage\" text,\n \"Winner\" text,\n \"General classification\" text,\n \"Points classification\" text,\n \"Trofeo Fast Team\" text\n) ### Response: SELECT \"Stage\" FROM table_11219 WHERE \"Trofeo Fast Team\" = 'carrera jeans-tassoni' AND \"Winner\" = 'mario cipollini' AND \"Points classification\" = 'claudio chiappucci'"} {"instruction":"Name the replaced by for august 9","input":"CREATE TABLE table_27597 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Position in table\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n)","response":"SELECT \"Replaced by\" FROM table_27597 WHERE \"Date of vacancy\" = 'August 9' AND \"Date of appointment\" = 'August 9'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the replaced by for august 9 ### Input: CREATE TABLE table_27597 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Position in table\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n) ### Response: SELECT \"Replaced by\" FROM table_27597 WHERE \"Date of vacancy\" = 'August 9' AND \"Date of appointment\" = 'August 9'"} {"instruction":"What venue was on 27 May 2000?","input":"CREATE TABLE table_name_81 (\n venue VARCHAR,\n date VARCHAR\n)","response":"SELECT venue FROM table_name_81 WHERE date = \"27 may 2000\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What venue was on 27 May 2000? ### Input: CREATE TABLE table_name_81 (\n venue VARCHAR,\n date VARCHAR\n) ### Response: SELECT venue FROM table_name_81 WHERE date = \"27 may 2000\""} {"instruction":"has patient 029-584 ever had a medication prescribed the last year?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-584')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 029-584 ever had a medication prescribed the last year? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-584')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')"} {"instruction":"What is Socket, when Part Number(s) is au80610003495aa?","input":"CREATE TABLE table_9828 (\n \"Model number\" text,\n \"sSpec number\" text,\n \"Frequency\" text,\n \"GPU frequency\" text,\n \"L2 cache\" text,\n \"I\/O bus\" text,\n \"Memory\" text,\n \"Voltage\" text,\n \"Socket\" text,\n \"Release date\" text,\n \"Part number(s)\" text\n)","response":"SELECT \"Socket\" FROM table_9828 WHERE \"Part number(s)\" = 'au80610003495aa'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Socket, when Part Number(s) is au80610003495aa? ### Input: CREATE TABLE table_9828 (\n \"Model number\" text,\n \"sSpec number\" text,\n \"Frequency\" text,\n \"GPU frequency\" text,\n \"L2 cache\" text,\n \"I\/O bus\" text,\n \"Memory\" text,\n \"Voltage\" text,\n \"Socket\" text,\n \"Release date\" text,\n \"Part number(s)\" text\n) ### Response: SELECT \"Socket\" FROM table_9828 WHERE \"Part number(s)\" = 'au80610003495aa'"} {"instruction":"how many hours have passed since the patient 95057 was admitted to the hospital?","input":"CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)","response":"SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 95057 AND admissions.dischtime IS NULL","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours have passed since the patient 95057 was admitted to the hospital? ### Input: CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 95057 AND admissions.dischtime IS NULL"} {"instruction":"how many of the patients aged below 76 had migraine unspecified w\/o ntrc mgrn?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < \"76\" AND diagnoses.short_title = \"Migrne unsp wo ntrc mgrn\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the patients aged below 76 had migraine unspecified w\/o ntrc mgrn? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < \"76\" AND diagnoses.short_title = \"Migrne unsp wo ntrc mgrn\""} {"instruction":"Which To par has a Year of 1994?","input":"CREATE TABLE table_name_24 (\n to_par VARCHAR,\n year VARCHAR\n)","response":"SELECT to_par FROM table_name_24 WHERE year = 1994","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which To par has a Year of 1994? ### Input: CREATE TABLE table_name_24 (\n to_par VARCHAR,\n year VARCHAR\n) ### Response: SELECT to_par FROM table_name_24 WHERE year = 1994"} {"instruction":"Draw a bar chart about the distribution of meter_700 and ID , and rank meter_700 in desc order.","input":"CREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n)","response":"SELECT meter_700, ID FROM swimmer ORDER BY meter_700 DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of meter_700 and ID , and rank meter_700 in desc order. ### Input: CREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n) ### Response: SELECT meter_700, ID FROM swimmer ORDER BY meter_700 DESC"} {"instruction":"Which year was the peter jackson classic?","input":"CREATE TABLE table_name_36 (\n year VARCHAR,\n championship VARCHAR\n)","response":"SELECT year FROM table_name_36 WHERE championship = \"peter jackson classic\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which year was the peter jackson classic? ### Input: CREATE TABLE table_name_36 (\n year VARCHAR,\n championship VARCHAR\n) ### Response: SELECT year FROM table_name_36 WHERE championship = \"peter jackson classic\""} {"instruction":"TOTAL number of SUCCESSFUL questions.","input":"CREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT COUNT(DISTINCT p.Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: TOTAL number of SUCCESSFUL questions. ### Input: CREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT COUNT(DISTINCT p.Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL"} {"instruction":"when did patient 19040 first get a procedure on their first hospital visit?","input":"CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19040 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 19040 first get a procedure on their first hospital visit? ### Input: CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19040 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1"} {"instruction":"what are the procedures that are the top four most commonly received?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the procedures that are the top four most commonly received? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4"} {"instruction":"what is the number of patients whose gender is f and primary disease is st elevated myocardial infarction\\cardiac cath?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = \"F\" AND demographic.diagnosis = \"ST ELEVATED MYOCARDIAL INFARCTION\\CARDIAC CATH\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose gender is f and primary disease is st elevated myocardial infarction\\cardiac cath? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = \"F\" AND demographic.diagnosis = \"ST ELEVATED MYOCARDIAL INFARCTION\\CARDIAC CATH\""} {"instruction":"give me the number of patients whose diagnoses short title is enterococcus group d?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = \"Enterococcus group d\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose diagnoses short title is enterococcus group d? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = \"Enterococcus group d\""} {"instruction":"What district has a constituency of 60?","input":"CREATE TABLE table_name_27 (\n district VARCHAR,\n constituency_number VARCHAR\n)","response":"SELECT district FROM table_name_27 WHERE constituency_number = \"60\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What district has a constituency of 60? ### Input: CREATE TABLE table_name_27 (\n district VARCHAR,\n constituency_number VARCHAR\n) ### Response: SELECT district FROM table_name_27 WHERE constituency_number = \"60\""} {"instruction":"When were there less than 1 point with a cosworth v8 engine in jolly club switzerland?","input":"CREATE TABLE table_14553 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n)","response":"SELECT \"Year\" FROM table_14553 WHERE \"Points\" < '1' AND \"Engine\" = 'cosworth v8' AND \"Entrant\" = 'jolly club switzerland'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When were there less than 1 point with a cosworth v8 engine in jolly club switzerland? ### Input: CREATE TABLE table_14553 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n) ### Response: SELECT \"Year\" FROM table_14553 WHERE \"Points\" < '1' AND \"Engine\" = 'cosworth v8' AND \"Entrant\" = 'jolly club switzerland'"} {"instruction":"For the flyers, what's the minimum capacity?","input":"CREATE TABLE table_20718 (\n \"Institution\" text,\n \"Location\" text,\n \"Team Nickname\" text,\n \"Joined TSCHL\" real,\n \"Home Arena\" text,\n \"Capacity\" real,\n \"Team Website\" text\n)","response":"SELECT MIN(\"Capacity\") FROM table_20718 WHERE \"Team Nickname\" = 'Flyers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the flyers, what's the minimum capacity? ### Input: CREATE TABLE table_20718 (\n \"Institution\" text,\n \"Location\" text,\n \"Team Nickname\" text,\n \"Joined TSCHL\" real,\n \"Home Arena\" text,\n \"Capacity\" real,\n \"Team Website\" text\n) ### Response: SELECT MIN(\"Capacity\") FROM table_20718 WHERE \"Team Nickname\" = 'Flyers'"} {"instruction":"give the number of patients who are born before 2180 with a ivpca drug route.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < \"2180\" AND prescriptions.route = \"IVPCA\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients who are born before 2180 with a ivpca drug route. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < \"2180\" AND prescriptions.route = \"IVPCA\""} {"instruction":"You can return a bar chart with employees' first names and their salaries, display by the y axis from high to low.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: You can return a bar chart with employees' first names and their salaries, display by the y axis from high to low. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY DESC"} {"instruction":"Name the scores for chris ramsey and carol vorderman","input":"CREATE TABLE table_23292220_17 (\n scores VARCHAR,\n seans_team VARCHAR\n)","response":"SELECT scores FROM table_23292220_17 WHERE seans_team = \"Chris Ramsey and Carol Vorderman\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the scores for chris ramsey and carol vorderman ### Input: CREATE TABLE table_23292220_17 (\n scores VARCHAR,\n seans_team VARCHAR\n) ### Response: SELECT scores FROM table_23292220_17 WHERE seans_team = \"Chris Ramsey and Carol Vorderman\""} {"instruction":"What is the number of games for the season with 10 ties?","input":"CREATE TABLE table_name_86 (\n games VARCHAR,\n tied VARCHAR\n)","response":"SELECT games FROM table_name_86 WHERE tied = 10","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of games for the season with 10 ties? ### Input: CREATE TABLE table_name_86 (\n games VARCHAR,\n tied VARCHAR\n) ### Response: SELECT games FROM table_name_86 WHERE tied = 10"} {"instruction":"What year did she place 8th in the junior race?","input":"CREATE TABLE table_name_9 (\n year VARCHAR,\n event VARCHAR,\n position VARCHAR\n)","response":"SELECT year FROM table_name_9 WHERE event = \"junior race\" AND position = \"8th\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year did she place 8th in the junior race? ### Input: CREATE TABLE table_name_9 (\n year VARCHAR,\n event VARCHAR,\n position VARCHAR\n) ### Response: SELECT year FROM table_name_9 WHERE event = \"junior race\" AND position = \"8th\""} {"instruction":"A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and rank y-axis in ascending order.","input":"CREATE TABLE Ref_Characteristic_Types (\n characteristic_type_code VARCHAR(15),\n characteristic_type_description VARCHAR(80)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n color_code VARCHAR(15),\n product_category_code VARCHAR(15),\n product_name VARCHAR(80),\n typical_buying_price VARCHAR(20),\n typical_selling_price VARCHAR(20),\n product_description VARCHAR(255),\n other_product_details VARCHAR(255)\n)\n\nCREATE TABLE Product_Characteristics (\n product_id INTEGER,\n characteristic_id INTEGER,\n product_characteristic_value VARCHAR(50)\n)\n\nCREATE TABLE Characteristics (\n characteristic_id INTEGER,\n characteristic_type_code VARCHAR(15),\n characteristic_data_type VARCHAR(10),\n characteristic_name VARCHAR(80),\n other_characteristic_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Colors (\n color_code VARCHAR(15),\n color_description VARCHAR(80)\n)\n\nCREATE TABLE Ref_Product_Categories (\n product_category_code VARCHAR(15),\n product_category_description VARCHAR(80),\n unit_of_measure VARCHAR(20)\n)","response":"SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and rank y-axis in ascending order. ### Input: CREATE TABLE Ref_Characteristic_Types (\n characteristic_type_code VARCHAR(15),\n characteristic_type_description VARCHAR(80)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n color_code VARCHAR(15),\n product_category_code VARCHAR(15),\n product_name VARCHAR(80),\n typical_buying_price VARCHAR(20),\n typical_selling_price VARCHAR(20),\n product_description VARCHAR(255),\n other_product_details VARCHAR(255)\n)\n\nCREATE TABLE Product_Characteristics (\n product_id INTEGER,\n characteristic_id INTEGER,\n product_characteristic_value VARCHAR(50)\n)\n\nCREATE TABLE Characteristics (\n characteristic_id INTEGER,\n characteristic_type_code VARCHAR(15),\n characteristic_data_type VARCHAR(10),\n characteristic_name VARCHAR(80),\n other_characteristic_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Colors (\n color_code VARCHAR(15),\n color_description VARCHAR(80)\n)\n\nCREATE TABLE Ref_Product_Categories (\n product_category_code VARCHAR(15),\n product_category_description VARCHAR(80),\n unit_of_measure VARCHAR(20)\n) ### Response: SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description)"} {"instruction":"What is the smallest Earnings that has a Money list rank of 6 and Starts smaller than 22?","input":"CREATE TABLE table_56530 (\n \"Year\" text,\n \"Starts\" real,\n \"Cuts made\" real,\n \"Wins\" real,\n \"Top 10\" real,\n \"Top 25\" real,\n \"Earnings ($)\" real,\n \"Money list rank\" text\n)","response":"SELECT MIN(\"Earnings ($)\") FROM table_56530 WHERE \"Money list rank\" = '6' AND \"Starts\" < '22'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest Earnings that has a Money list rank of 6 and Starts smaller than 22? ### Input: CREATE TABLE table_56530 (\n \"Year\" text,\n \"Starts\" real,\n \"Cuts made\" real,\n \"Wins\" real,\n \"Top 10\" real,\n \"Top 25\" real,\n \"Earnings ($)\" real,\n \"Money list rank\" text\n) ### Response: SELECT MIN(\"Earnings ($)\") FROM table_56530 WHERE \"Money list rank\" = '6' AND \"Starts\" < '22'"} {"instruction":"What year had 32 moves?","input":"CREATE TABLE table_8509 (\n \"White\" text,\n \"Black\" text,\n \"Year\" real,\n \"Result\" text,\n \"Moves\" real,\n \"Tournament\" text,\n \"Opening\" text\n)","response":"SELECT SUM(\"Year\") FROM table_8509 WHERE \"Moves\" = '32'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year had 32 moves? ### Input: CREATE TABLE table_8509 (\n \"White\" text,\n \"Black\" text,\n \"Year\" real,\n \"Result\" text,\n \"Moves\" real,\n \"Tournament\" text,\n \"Opening\" text\n) ### Response: SELECT SUM(\"Year\") FROM table_8509 WHERE \"Moves\" = '32'"} {"instruction":"how long was the m1894 rifle 's barrel ?","input":"CREATE TABLE table_204_343 (\n id number,\n \"nation\" text,\n \"model\" text,\n \"length\" text,\n \"barrel length\" text,\n \"weight\" text\n)","response":"SELECT \"barrel length\" FROM table_204_343 WHERE \"model\" = 'm1894 rifle'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how long was the m1894 rifle 's barrel ? ### Input: CREATE TABLE table_204_343 (\n id number,\n \"nation\" text,\n \"model\" text,\n \"length\" text,\n \"barrel length\" text,\n \"weight\" text\n) ### Response: SELECT \"barrel length\" FROM table_204_343 WHERE \"model\" = 'm1894 rifle'"} {"instruction":"How many Atts that have Yards of 43 and a Long larger than 43?","input":"CREATE TABLE table_name_65 (\n att INTEGER,\n yards VARCHAR,\n long VARCHAR\n)","response":"SELECT SUM(att) FROM table_name_65 WHERE yards = 43 AND long > 43","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Atts that have Yards of 43 and a Long larger than 43? ### Input: CREATE TABLE table_name_65 (\n att INTEGER,\n yards VARCHAR,\n long VARCHAR\n) ### Response: SELECT SUM(att) FROM table_name_65 WHERE yards = 43 AND long > 43"} {"instruction":"How many times are listed for 31 May for the rider ranked 5?","input":"CREATE TABLE table_25220821_4 (\n mon_31_may VARCHAR,\n rank VARCHAR\n)","response":"SELECT COUNT(mon_31_may) FROM table_25220821_4 WHERE rank = 5","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times are listed for 31 May for the rider ranked 5? ### Input: CREATE TABLE table_25220821_4 (\n mon_31_may VARCHAR,\n rank VARCHAR\n) ### Response: SELECT COUNT(mon_31_may) FROM table_25220821_4 WHERE rank = 5"} {"instruction":"Plot how many name by grouped by name as a bar graph, and sort by the total number in descending.","input":"CREATE TABLE train (\n id int,\n train_number int,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n)\n\nCREATE TABLE weekly_weather (\n station_id int,\n day_of_week text,\n high_temperature int,\n low_temperature int,\n precipitation real,\n wind_speed_mph int\n)\n\nCREATE TABLE route (\n train_id int,\n station_id int\n)\n\nCREATE TABLE station (\n id int,\n network_name text,\n services text,\n local_authority text\n)","response":"SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot how many name by grouped by name as a bar graph, and sort by the total number in descending. ### Input: CREATE TABLE train (\n id int,\n train_number int,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n)\n\nCREATE TABLE weekly_weather (\n station_id int,\n day_of_week text,\n high_temperature int,\n low_temperature int,\n precipitation real,\n wind_speed_mph int\n)\n\nCREATE TABLE route (\n train_id int,\n station_id int\n)\n\nCREATE TABLE station (\n id int,\n network_name text,\n services text,\n local_authority text\n) ### Response: SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) DESC"} {"instruction":"Which constructor has a Time\/Retired of +37.311?","input":"CREATE TABLE table_56316 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT \"Constructor\" FROM table_56316 WHERE \"Time\/Retired\" = '+37.311'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which constructor has a Time\/Retired of +37.311? ### Input: CREATE TABLE table_56316 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT \"Constructor\" FROM table_56316 WHERE \"Time\/Retired\" = '+37.311'"} {"instruction":"What is the 2007 result when the 2010 result was 2r, at the US Open?","input":"CREATE TABLE table_name_91 (\n tournament VARCHAR\n)","response":"SELECT 2007 FROM table_name_91 WHERE 2010 = \"2r\" AND tournament = \"us open\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2007 result when the 2010 result was 2r, at the US Open? ### Input: CREATE TABLE table_name_91 (\n tournament VARCHAR\n) ### Response: SELECT 2007 FROM table_name_91 WHERE 2010 = \"2r\" AND tournament = \"us open\""} {"instruction":"when does the train arriving at bourne at 11.45 departure","input":"CREATE TABLE table_22277 (\n \"Departure\" text,\n \"Going to\" text,\n \"Calling at\" text,\n \"Arrival\" text,\n \"Operator\" text\n)","response":"SELECT \"Departure\" FROM table_22277 WHERE \"Going to\" = 'Bourne' AND \"Arrival\" = '11.45'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when does the train arriving at bourne at 11.45 departure ### Input: CREATE TABLE table_22277 (\n \"Departure\" text,\n \"Going to\" text,\n \"Calling at\" text,\n \"Arrival\" text,\n \"Operator\" text\n) ### Response: SELECT \"Departure\" FROM table_22277 WHERE \"Going to\" = 'Bourne' AND \"Arrival\" = '11.45'"} {"instruction":"Users with close-vote privileges ordered by last access date..","input":"CREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)","response":"SELECT ROW_NUMBER() OVER (ORDER BY LastAccessDate DESC) AS \" \", Id AS \"user_link\", LastAccessDate FROM Users WHERE Reputation > 3000 ORDER BY LastAccessDate DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users with close-vote privileges ordered by last access date.. ### Input: CREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY LastAccessDate DESC) AS \" \", Id AS \"user_link\", LastAccessDate FROM Users WHERE Reputation > 3000 ORDER BY LastAccessDate DESC"} {"instruction":"Which Time\/Retired has a Grid smaller than 3, and a Driver of mika h kkinen?","input":"CREATE TABLE table_name_58 (\n time_retired VARCHAR,\n grid VARCHAR,\n driver VARCHAR\n)","response":"SELECT time_retired FROM table_name_58 WHERE grid < 3 AND driver = \"mika h\u00e4kkinen\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Time\/Retired has a Grid smaller than 3, and a Driver of mika h kkinen? ### Input: CREATE TABLE table_name_58 (\n time_retired VARCHAR,\n grid VARCHAR,\n driver VARCHAR\n) ### Response: SELECT time_retired FROM table_name_58 WHERE grid < 3 AND driver = \"mika h\u00e4kkinen\""} {"instruction":"What was the higest attendance on November 9, 1958?","input":"CREATE TABLE table_name_4 (\n attendance INTEGER,\n date VARCHAR\n)","response":"SELECT MAX(attendance) FROM table_name_4 WHERE date = \"november 9, 1958\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the higest attendance on November 9, 1958? ### Input: CREATE TABLE table_name_4 (\n attendance INTEGER,\n date VARCHAR\n) ### Response: SELECT MAX(attendance) FROM table_name_4 WHERE date = \"november 9, 1958\""} {"instruction":"How many losses did the team with 22 goals for andmore than 8 games played have?","input":"CREATE TABLE table_78521 (\n \"Team\" text,\n \"Games Played\" real,\n \"Wins\" real,\n \"Losses\" real,\n \"Ties\" real,\n \"Goals For\" real,\n \"Goals Against\" real\n)","response":"SELECT COUNT(\"Losses\") FROM table_78521 WHERE \"Goals For\" = '22' AND \"Games Played\" > '8'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many losses did the team with 22 goals for andmore than 8 games played have? ### Input: CREATE TABLE table_78521 (\n \"Team\" text,\n \"Games Played\" real,\n \"Wins\" real,\n \"Losses\" real,\n \"Ties\" real,\n \"Goals For\" real,\n \"Goals Against\" real\n) ### Response: SELECT COUNT(\"Losses\") FROM table_78521 WHERE \"Goals For\" = '22' AND \"Games Played\" > '8'"} {"instruction":"What is the largest overall number of major hurricanes?","input":"CREATE TABLE table_2930244_3 (\n number_of_major_hurricanes INTEGER\n)","response":"SELECT MAX(number_of_major_hurricanes) FROM table_2930244_3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest overall number of major hurricanes? ### Input: CREATE TABLE table_2930244_3 (\n number_of_major_hurricanes INTEGER\n) ### Response: SELECT MAX(number_of_major_hurricanes) FROM table_2930244_3"} {"instruction":"count the number of patients whose primary disease is morbid obesity\/sda and drug name is soln.?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = \"MORBID OBESITY\/SDA\" AND prescriptions.drug = \"Soln.\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose primary disease is morbid obesity\/sda and drug name is soln.? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = \"MORBID OBESITY\/SDA\" AND prescriptions.drug = \"Soln.\""} {"instruction":"What is Position, when Caps is Example, and When Player is Shane Kelly?","input":"CREATE TABLE table_41531 (\n \"Player\" text,\n \"Position\" text,\n \"Date of Birth (Age)\" text,\n \"Caps\" text,\n \"Province \/ Club\" text\n)","response":"SELECT \"Position\" FROM table_41531 WHERE \"Caps\" = 'example' AND \"Player\" = 'shane kelly'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Position, when Caps is Example, and When Player is Shane Kelly? ### Input: CREATE TABLE table_41531 (\n \"Player\" text,\n \"Position\" text,\n \"Date of Birth (Age)\" text,\n \"Caps\" text,\n \"Province \/ Club\" text\n) ### Response: SELECT \"Position\" FROM table_41531 WHERE \"Caps\" = 'example' AND \"Player\" = 'shane kelly'"} {"instruction":"Which Proto-Austronesian has a Proto-Oceanic of *lima?","input":"CREATE TABLE table_name_97 (\n proto_austronesian VARCHAR,\n proto_oceanic VARCHAR\n)","response":"SELECT proto_austronesian FROM table_name_97 WHERE proto_oceanic = \"*lima\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Proto-Austronesian has a Proto-Oceanic of *lima? ### Input: CREATE TABLE table_name_97 (\n proto_austronesian VARCHAR,\n proto_oceanic VARCHAR\n) ### Response: SELECT proto_austronesian FROM table_name_97 WHERE proto_oceanic = \"*lima\""} {"instruction":"What is the Away team at the Wolverhampton Wanderers Home game with a Score of 2 0?","input":"CREATE TABLE table_60349 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n)","response":"SELECT \"Away team\" FROM table_60349 WHERE \"Score\" = '2\u20130' AND \"Home team\" = 'wolverhampton wanderers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Away team at the Wolverhampton Wanderers Home game with a Score of 2 0? ### Input: CREATE TABLE table_60349 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n) ### Response: SELECT \"Away team\" FROM table_60349 WHERE \"Score\" = '2\u20130' AND \"Home team\" = 'wolverhampton wanderers'"} {"instruction":"The match against Oleg Taktarov had what result?","input":"CREATE TABLE table_name_19 (\n res VARCHAR,\n opponent VARCHAR\n)","response":"SELECT res FROM table_name_19 WHERE opponent = \"oleg taktarov\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The match against Oleg Taktarov had what result? ### Input: CREATE TABLE table_name_19 (\n res VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT res FROM table_name_19 WHERE opponent = \"oleg taktarov\""} {"instruction":"what is the four most frequently ordered procedure for a patient with an age 40s?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)","response":"SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the four most frequently ordered procedure for a patient with an age 40s? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n) ### Response: SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4"} {"instruction":"What was the featured in Engine through rounds 10-13?","input":"CREATE TABLE table_55779 (\n \"Entrant\" text,\n \"Constructor\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyres\" text,\n \"Driver\" text,\n \"Rounds\" text\n)","response":"SELECT \"Engine\" FROM table_55779 WHERE \"Rounds\" = '10-13'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the featured in Engine through rounds 10-13? ### Input: CREATE TABLE table_55779 (\n \"Entrant\" text,\n \"Constructor\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyres\" text,\n \"Driver\" text,\n \"Rounds\" text\n) ### Response: SELECT \"Engine\" FROM table_55779 WHERE \"Rounds\" = '10-13'"} {"instruction":"What was Laurel's division record?","input":"CREATE TABLE table_67113 (\n \"School\" text,\n \"Team\" text,\n \"Division Record\" text,\n \"Overall Record\" text,\n \"Season Outcome\" text\n)","response":"SELECT \"Division Record\" FROM table_67113 WHERE \"School\" = 'laurel'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Laurel's division record? ### Input: CREATE TABLE table_67113 (\n \"School\" text,\n \"Team\" text,\n \"Division Record\" text,\n \"Overall Record\" text,\n \"Season Outcome\" text\n) ### Response: SELECT \"Division Record\" FROM table_67113 WHERE \"School\" = 'laurel'"} {"instruction":"What is the lowest Games, when Name is Jeremiah Massey, and when Points is less than 340?","input":"CREATE TABLE table_name_91 (\n games INTEGER,\n name VARCHAR,\n points VARCHAR\n)","response":"SELECT MIN(games) FROM table_name_91 WHERE name = \"jeremiah massey\" AND points < 340","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest Games, when Name is Jeremiah Massey, and when Points is less than 340? ### Input: CREATE TABLE table_name_91 (\n games INTEGER,\n name VARCHAR,\n points VARCHAR\n) ### Response: SELECT MIN(games) FROM table_name_91 WHERE name = \"jeremiah massey\" AND points < 340"} {"instruction":"How many people wrote the episode directed by Arvin Brown?","input":"CREATE TABLE table_30030227_1 (\n written_by VARCHAR,\n directed_by VARCHAR\n)","response":"SELECT COUNT(written_by) FROM table_30030227_1 WHERE directed_by = \"Arvin Brown\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people wrote the episode directed by Arvin Brown? ### Input: CREATE TABLE table_30030227_1 (\n written_by VARCHAR,\n directed_by VARCHAR\n) ### Response: SELECT COUNT(written_by) FROM table_30030227_1 WHERE directed_by = \"Arvin Brown\""} {"instruction":"How many years was ensign n180b a Chassis with 4 points?","input":"CREATE TABLE table_70406 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n)","response":"SELECT SUM(\"Year\") FROM table_70406 WHERE \"Points\" = '4' AND \"Chassis\" = 'ensign n180b'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many years was ensign n180b a Chassis with 4 points? ### Input: CREATE TABLE table_70406 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n) ### Response: SELECT SUM(\"Year\") FROM table_70406 WHERE \"Points\" = '4' AND \"Chassis\" = 'ensign n180b'"} {"instruction":"among patients who were diagnosed with routine circumcision during a year before, what are the top three most frequent procedures that followed afterwards within 2 months?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)","response":"SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'routine circumcision') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.icd9_code, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients who were diagnosed with routine circumcision during a year before, what are the top three most frequent procedures that followed afterwards within 2 months? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n) ### Response: SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'routine circumcision') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.icd9_code, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)"} {"instruction":"Which Opponent has an Away of 1 1, and a Home of 3 3?","input":"CREATE TABLE table_75827 (\n \"Season\" text,\n \"Competition\" text,\n \"Round\" text,\n \"Opponent\" text,\n \"Home\" text,\n \"Away\" text,\n \"Series\" text\n)","response":"SELECT \"Opponent\" FROM table_75827 WHERE \"Away\" = '1\u20131' AND \"Home\" = '3\u20133'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Opponent has an Away of 1 1, and a Home of 3 3? ### Input: CREATE TABLE table_75827 (\n \"Season\" text,\n \"Competition\" text,\n \"Round\" text,\n \"Opponent\" text,\n \"Home\" text,\n \"Away\" text,\n \"Series\" text\n) ### Response: SELECT \"Opponent\" FROM table_75827 WHERE \"Away\" = '1\u20131' AND \"Home\" = '3\u20133'"} {"instruction":"what is marital status and primary disease of subject id 74032?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.subject_id = \"74032\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is marital status and primary disease of subject id 74032? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.subject_id = \"74032\""} {"instruction":"What was the venue that had a friendly match competition?","input":"CREATE TABLE table_name_49 (\n venue VARCHAR,\n competition VARCHAR\n)","response":"SELECT venue FROM table_name_49 WHERE competition = \"friendly match\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the venue that had a friendly match competition? ### Input: CREATE TABLE table_name_49 (\n venue VARCHAR,\n competition VARCHAR\n) ### Response: SELECT venue FROM table_name_49 WHERE competition = \"friendly match\""} {"instruction":"count the number of patients diagnosed with acute respiratory failure who did not come back to the hospital within 2 months of the diagnosis.","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure') AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND DATETIME(patient.hospitaladmittime) BETWEEN DATETIME(t2.diagnosistime) AND DATETIME(t2.diagnosistime, '+2 month'))","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients diagnosed with acute respiratory failure who did not come back to the hospital within 2 months of the diagnosis. ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure') AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND DATETIME(patient.hospitaladmittime) BETWEEN DATETIME(t2.diagnosistime) AND DATETIME(t2.diagnosistime, '+2 month'))"} {"instruction":"A bar chart shows the distribution of All_Games and School_ID , and could you list by the bars in desc?","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of All_Games and School_ID , and could you list by the bars in desc? ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games DESC"} {"instruction":"How many faculty members participate in each activity? Return the activity names and the number of faculty members by a bar chart, and display Y-axis in asc order.","input":"CREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Activity (\n actid INTEGER,\n activity_name varchar(25)\n)\n\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER\n)","response":"SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members participate in each activity? Return the activity names and the number of faculty members by a bar chart, and display Y-axis in asc order. ### Input: CREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Activity (\n actid INTEGER,\n activity_name varchar(25)\n)\n\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER\n) ### Response: SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*)"} {"instruction":"what is the population where municipality is san jacinto?","input":"CREATE TABLE table_1691800_2 (\n population__2010_ VARCHAR,\n municipality VARCHAR\n)","response":"SELECT population__2010_ FROM table_1691800_2 WHERE municipality = \"San Jacinto\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the population where municipality is san jacinto? ### Input: CREATE TABLE table_1691800_2 (\n population__2010_ VARCHAR,\n municipality VARCHAR\n) ### Response: SELECT population__2010_ FROM table_1691800_2 WHERE municipality = \"San Jacinto\""} {"instruction":"What is the NBA Draft for the School Bishop O'Connell High School?","input":"CREATE TABLE table_name_10 (\n nba_draft VARCHAR,\n school VARCHAR\n)","response":"SELECT nba_draft FROM table_name_10 WHERE school = \"bishop o'connell high school\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the NBA Draft for the School Bishop O'Connell High School? ### Input: CREATE TABLE table_name_10 (\n nba_draft VARCHAR,\n school VARCHAR\n) ### Response: SELECT nba_draft FROM table_name_10 WHERE school = \"bishop o'connell high school\""} {"instruction":"What is the average round in which a Safety with an overall rank higher than 89 was drafted?","input":"CREATE TABLE table_33305 (\n \"Round\" real,\n \"Overall\" real,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT AVG(\"Round\") FROM table_33305 WHERE \"Position\" = 'safety' AND \"Overall\" > '89'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average round in which a Safety with an overall rank higher than 89 was drafted? ### Input: CREATE TABLE table_33305 (\n \"Round\" real,\n \"Overall\" real,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT AVG(\"Round\") FROM table_33305 WHERE \"Position\" = 'safety' AND \"Overall\" > '89'"} {"instruction":"What is the average Worst score for Mario Lopez as the Best dancer and Tango as the Dance?","input":"CREATE TABLE table_33270 (\n \"Dance\" text,\n \"Best dancer\" text,\n \"Best score\" real,\n \"Worst dancer\" text,\n \"Worst score\" real\n)","response":"SELECT AVG(\"Worst score\") FROM table_33270 WHERE \"Best dancer\" = 'mario lopez' AND \"Dance\" = 'tango'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Worst score for Mario Lopez as the Best dancer and Tango as the Dance? ### Input: CREATE TABLE table_33270 (\n \"Dance\" text,\n \"Best dancer\" text,\n \"Best score\" real,\n \"Worst dancer\" text,\n \"Worst score\" real\n) ### Response: SELECT AVG(\"Worst score\") FROM table_33270 WHERE \"Best dancer\" = 'mario lopez' AND \"Dance\" = 'tango'"} {"instruction":"what lab test did patient 006-207754 last receive since 97 months ago?","input":"CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-207754')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-97 month') ORDER BY lab.labresulttime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what lab test did patient 006-207754 last receive since 97 months ago? ### Input: CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-207754')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-97 month') ORDER BY lab.labresulttime DESC LIMIT 1"} {"instruction":"Show the different statuses and the numbers of roller coasters for each status.","input":"CREATE TABLE roller_coaster (\n Status VARCHAR\n)","response":"SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the different statuses and the numbers of roller coasters for each status. ### Input: CREATE TABLE roller_coaster (\n Status VARCHAR\n) ### Response: SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status"} {"instruction":"Which character was nominated in the 2010 Indian Television Academy Awards?","input":"CREATE TABLE table_name_1 (\n character VARCHAR,\n year VARCHAR,\n award_ceremony VARCHAR\n)","response":"SELECT character FROM table_name_1 WHERE year = 2010 AND award_ceremony = \"indian television academy awards\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which character was nominated in the 2010 Indian Television Academy Awards? ### Input: CREATE TABLE table_name_1 (\n character VARCHAR,\n year VARCHAR,\n award_ceremony VARCHAR\n) ### Response: SELECT character FROM table_name_1 WHERE year = 2010 AND award_ceremony = \"indian television academy awards\""} {"instruction":"What was the score on May 3?","input":"CREATE TABLE table_name_35 (\n score VARCHAR,\n date VARCHAR\n)","response":"SELECT score FROM table_name_35 WHERE date = \"may 3\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score on May 3? ### Input: CREATE TABLE table_name_35 (\n score VARCHAR,\n date VARCHAR\n) ### Response: SELECT score FROM table_name_35 WHERE date = \"may 3\""} {"instruction":"which rider completed all 21 laps of the 2008 malaysian motorcycle grand prixwith the longest time ?","input":"CREATE TABLE table_203_166 (\n id number,\n \"pos\" text,\n \"no\" number,\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" number,\n \"time\" text,\n \"grid\" number,\n \"points\" number\n)","response":"SELECT \"rider\" FROM table_203_166 WHERE \"laps\" = 21 ORDER BY \"pos\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which rider completed all 21 laps of the 2008 malaysian motorcycle grand prixwith the longest time ? ### Input: CREATE TABLE table_203_166 (\n id number,\n \"pos\" text,\n \"no\" number,\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" number,\n \"time\" text,\n \"grid\" number,\n \"points\" number\n) ### Response: SELECT \"rider\" FROM table_203_166 WHERE \"laps\" = 21 ORDER BY \"pos\" DESC LIMIT 1"} {"instruction":"Who directed the episode with the production code 176252?","input":"CREATE TABLE table_19654 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" real\n)","response":"SELECT \"Directed by\" FROM table_19654 WHERE \"Production code\" = '176252'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed the episode with the production code 176252? ### Input: CREATE TABLE table_19654 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" real\n) ### Response: SELECT \"Directed by\" FROM table_19654 WHERE \"Production code\" = '176252'"} {"instruction":"who won more gold medals , brazil or china ?","input":"CREATE TABLE table_203_630 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT \"nation\" FROM table_203_630 WHERE \"nation\" IN ('brazil', 'china') ORDER BY \"gold\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who won more gold medals , brazil or china ? ### Input: CREATE TABLE table_203_630 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT \"nation\" FROM table_203_630 WHERE \"nation\" IN ('brazil', 'china') ORDER BY \"gold\" DESC LIMIT 1"} {"instruction":"New answers or questions from specific period.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)","response":"SELECT Q.Id AS \"post_link\", Q.LastActivityDate FROM Posts AS Q WHERE Q.PostTypeId = 1 AND NOT Q.Tags LIKE @Pattern AND Q.LastActivityDate BETWEEN @SubFrom AND @SubTo AND (Q.CreationDate BETWEEN @From AND @To OR EXISTS(SELECT * FROM Posts AS A WHERE A.PostTypeId = 2 AND A.ParentId = Q.Id AND A.CreationDate BETWEEN @From AND @To)) ORDER BY Q.LastActivityDate","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: New answers or questions from specific period. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT Q.Id AS \"post_link\", Q.LastActivityDate FROM Posts AS Q WHERE Q.PostTypeId = 1 AND NOT Q.Tags LIKE @Pattern AND Q.LastActivityDate BETWEEN @SubFrom AND @SubTo AND (Q.CreationDate BETWEEN @From AND @To OR EXISTS(SELECT * FROM Posts AS A WHERE A.PostTypeId = 2 AND A.ParentId = Q.Id AND A.CreationDate BETWEEN @From AND @To)) ORDER BY Q.LastActivityDate"} {"instruction":"Find the name of female patients who had a granular casts lab test.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = \"F\" AND lab.label = \"Granular Casts\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the name of female patients who had a granular casts lab test. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = \"F\" AND lab.label = \"Granular Casts\""} {"instruction":"What date was the game played at Punt Road Oval?","input":"CREATE TABLE table_53058 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Date\" FROM table_53058 WHERE \"Venue\" = 'punt road oval'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date was the game played at Punt Road Oval? ### Input: CREATE TABLE table_53058 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Date\" FROM table_53058 WHERE \"Venue\" = 'punt road oval'"} {"instruction":"What is the series number when al horford (10) had the high rebounds?","input":"CREATE TABLE table_3873 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Series\" text\n)","response":"SELECT \"Series\" FROM table_3873 WHERE \"High rebounds\" = 'Al Horford (10)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the series number when al horford (10) had the high rebounds? ### Input: CREATE TABLE table_3873 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Series\" text\n) ### Response: SELECT \"Series\" FROM table_3873 WHERE \"High rebounds\" = 'Al Horford (10)'"} {"instruction":"what is ethnicity of subject id 16438?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = \"16438\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is ethnicity of subject id 16438? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = \"16438\""} {"instruction":"what is the name of the drug which patient 004-29334 was allergic to since 03\/2104?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-29334')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2104-03'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the drug which patient 004-29334 was allergic to since 03\/2104? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-29334')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2104-03'"} {"instruction":"What was the manner of departure for notts county with an incoming manager of martin allen","input":"CREATE TABLE table_26914759_3 (\n manner_of_departure VARCHAR,\n team VARCHAR,\n incoming_manager VARCHAR\n)","response":"SELECT manner_of_departure FROM table_26914759_3 WHERE team = \"Notts County\" AND incoming_manager = \"Martin Allen\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the manner of departure for notts county with an incoming manager of martin allen ### Input: CREATE TABLE table_26914759_3 (\n manner_of_departure VARCHAR,\n team VARCHAR,\n incoming_manager VARCHAR\n) ### Response: SELECT manner_of_departure FROM table_26914759_3 WHERE team = \"Notts County\" AND incoming_manager = \"Martin Allen\""} {"instruction":"which player had the status to the fourth round lost to tsvetana pironkova [32] Answers:","input":"CREATE TABLE table_29572583_20 (\n player VARCHAR,\n status VARCHAR\n)","response":"SELECT player FROM table_29572583_20 WHERE status = \"Fourth round lost to Tsvetana Pironkova [32]\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which player had the status to the fourth round lost to tsvetana pironkova [32] Answers: ### Input: CREATE TABLE table_29572583_20 (\n player VARCHAR,\n status VARCHAR\n) ### Response: SELECT player FROM table_29572583_20 WHERE status = \"Fourth round lost to Tsvetana Pironkova [32]\""} {"instruction":"What is the Home team of the event on Thursday, December 11 with Visitor Modo Hockey?","input":"CREATE TABLE table_name_44 (\n home VARCHAR,\n visitor VARCHAR,\n date VARCHAR\n)","response":"SELECT home FROM table_name_44 WHERE visitor = \"modo hockey\" AND date = \"thursday, december 11\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Home team of the event on Thursday, December 11 with Visitor Modo Hockey? ### Input: CREATE TABLE table_name_44 (\n home VARCHAR,\n visitor VARCHAR,\n date VARCHAR\n) ### Response: SELECT home FROM table_name_44 WHERE visitor = \"modo hockey\" AND date = \"thursday, december 11\""} {"instruction":"What is the lowest round for an overall pick of 349 with a pick number in the round over 11?","input":"CREATE TABLE table_76383 (\n \"Round\" real,\n \"Pick\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT MIN(\"Round\") FROM table_76383 WHERE \"Overall\" = '349' AND \"Pick\" > '11'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest round for an overall pick of 349 with a pick number in the round over 11? ### Input: CREATE TABLE table_76383 (\n \"Round\" real,\n \"Pick\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT MIN(\"Round\") FROM table_76383 WHERE \"Overall\" = '349' AND \"Pick\" > '11'"} {"instruction":"Which team has a qualifying 2 time under 59.612 and a best of 59.14?","input":"CREATE TABLE table_38485 (\n \"Name\" text,\n \"Team\" text,\n \"Qual 1\" text,\n \"Qual 2\" real,\n \"Best\" real\n)","response":"SELECT \"Team\" FROM table_38485 WHERE \"Qual 2\" < '59.612' AND \"Best\" = '59.14'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team has a qualifying 2 time under 59.612 and a best of 59.14? ### Input: CREATE TABLE table_38485 (\n \"Name\" text,\n \"Team\" text,\n \"Qual 1\" text,\n \"Qual 2\" real,\n \"Best\" real\n) ### Response: SELECT \"Team\" FROM table_38485 WHERE \"Qual 2\" < '59.612' AND \"Best\" = '59.14'"} {"instruction":"What is the title of the production code 1acx09?","input":"CREATE TABLE table_18734298_1 (\n title VARCHAR,\n production_code VARCHAR\n)","response":"SELECT title FROM table_18734298_1 WHERE production_code = \"1ACX09\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title of the production code 1acx09? ### Input: CREATE TABLE table_18734298_1 (\n title VARCHAR,\n production_code VARCHAR\n) ### Response: SELECT title FROM table_18734298_1 WHERE production_code = \"1ACX09\""} {"instruction":"what type of airplane is an M80","input":"CREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)","response":"SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80'","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what type of airplane is an M80 ### Input: CREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n) ### Response: SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80'"} {"instruction":"Show me a line chart to show the change of salary for those employees whose first name does not containing the letter M over the corresponding hire date.","input":"CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)","response":"SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%'","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a line chart to show the change of salary for those employees whose first name does not containing the letter M over the corresponding hire date. ### Input: CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n) ### Response: SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%'"} {"instruction":"calculate the number of patients admitted to emergency who had colostomy, not otherwise specified.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND procedures.long_title = \"Colostomy, not otherwise specified\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of patients admitted to emergency who had colostomy, not otherwise specified. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"EMERGENCY\" AND procedures.long_title = \"Colostomy, not otherwise specified\""} {"instruction":"The home team has a score of 12.9 (81) what is the score of the away team?","input":"CREATE TABLE table_56896 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team score\" FROM table_56896 WHERE \"Home team score\" = '12.9 (81)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The home team has a score of 12.9 (81) what is the score of the away team? ### Input: CREATE TABLE table_56896 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team score\" FROM table_56896 WHERE \"Home team score\" = '12.9 (81)'"} {"instruction":"What is the average number of goals conceded where more than 19 goals were scored, the team had 31 points, and more than 7 draws?","input":"CREATE TABLE table_53653 (\n \"Place (Posici\\u00f3n)\" real,\n \"Team (Equipo)\" text,\n \"Played (PJ)\" real,\n \"Won (PG)\" real,\n \"Draw (PE)\" real,\n \"Lost (PP)\" real,\n \"Goals Scored (GF)\" real,\n \"Goals Conceded (GC)\" real,\n \"+\/- (Dif.)\" real,\n \"Points (Pts.)\" real\n)","response":"SELECT AVG(\"Goals Conceded (GC)\") FROM table_53653 WHERE \"Goals Scored (GF)\" > '19' AND \"Points (Pts.)\" = '31' AND \"Draw (PE)\" > '7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of goals conceded where more than 19 goals were scored, the team had 31 points, and more than 7 draws? ### Input: CREATE TABLE table_53653 (\n \"Place (Posici\\u00f3n)\" real,\n \"Team (Equipo)\" text,\n \"Played (PJ)\" real,\n \"Won (PG)\" real,\n \"Draw (PE)\" real,\n \"Lost (PP)\" real,\n \"Goals Scored (GF)\" real,\n \"Goals Conceded (GC)\" real,\n \"+\/- (Dif.)\" real,\n \"Points (Pts.)\" real\n) ### Response: SELECT AVG(\"Goals Conceded (GC)\") FROM table_53653 WHERE \"Goals Scored (GF)\" > '19' AND \"Points (Pts.)\" = '31' AND \"Draw (PE)\" > '7'"} {"instruction":"what measurement does the contestant from sindelfingen have?","input":"CREATE TABLE table_3565 (\n \"Contestant\" text,\n \"Place\" real,\n \"Age\" real,\n \"Country\" text,\n \"Federal state\" text,\n \"City\" text,\n \"Height\" text,\n \"Measurements (in cm)\" text\n)","response":"SELECT \"Measurements (in cm)\" FROM table_3565 WHERE \"City\" = 'Sindelfingen'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what measurement does the contestant from sindelfingen have? ### Input: CREATE TABLE table_3565 (\n \"Contestant\" text,\n \"Place\" real,\n \"Age\" real,\n \"Country\" text,\n \"Federal state\" text,\n \"City\" text,\n \"Height\" text,\n \"Measurements (in cm)\" text\n) ### Response: SELECT \"Measurements (in cm)\" FROM table_3565 WHERE \"City\" = 'Sindelfingen'"} {"instruction":"has the 'arterial bp mean' level of patient 433 remained normal since 10\/23\/2105?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)","response":"SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN mean_bp_lower AND mean_bp_upper AND STRFTIME('%y-%m-%d', chartevents.charttime) >= '2105-10-23'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has the 'arterial bp mean' level of patient 433 remained normal since 10\/23\/2105? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n) ### Response: SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN mean_bp_lower AND mean_bp_upper AND STRFTIME('%y-%m-%d', chartevents.charttime) >= '2105-10-23'"} {"instruction":"provide the number of patients whose discharge location is short term hospital and admission year is before 2198","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"SHORT TERM HOSPITAL\" AND demographic.admityear < \"2198\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose discharge location is short term hospital and admission year is before 2198 ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"SHORT TERM HOSPITAL\" AND demographic.admityear < \"2198\""} {"instruction":"Find the name of the ships that have more than one captain.","input":"CREATE TABLE ship (\n name VARCHAR,\n ship_id VARCHAR\n)\n\nCREATE TABLE captain (\n ship_id VARCHAR\n)","response":"SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the name of the ships that have more than one captain. ### Input: CREATE TABLE ship (\n name VARCHAR,\n ship_id VARCHAR\n)\n\nCREATE TABLE captain (\n ship_id VARCHAR\n) ### Response: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1"} {"instruction":"Which Runner-up has a Winning score of 20 (70-69-64-65=268)?","input":"CREATE TABLE table_name_69 (\n runner_up VARCHAR,\n winning_score VARCHAR\n)","response":"SELECT runner_up FROM table_name_69 WHERE winning_score = \u221220(70 - 69 - 64 - 65 = 268)","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Runner-up has a Winning score of 20 (70-69-64-65=268)? ### Input: CREATE TABLE table_name_69 (\n runner_up VARCHAR,\n winning_score VARCHAR\n) ### Response: SELECT runner_up FROM table_name_69 WHERE winning_score = \u221220(70 - 69 - 64 - 65 = 268)"} {"instruction":"what is the game where the high points is by manu gin bili (26)?","input":"CREATE TABLE table_27715173_8 (\n game VARCHAR,\n high_points VARCHAR\n)","response":"SELECT game FROM table_27715173_8 WHERE high_points = \"Manu Gin\u00f3bili (26)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the game where the high points is by manu gin bili (26)? ### Input: CREATE TABLE table_27715173_8 (\n game VARCHAR,\n high_points VARCHAR\n) ### Response: SELECT game FROM table_27715173_8 WHERE high_points = \"Manu Gin\u00f3bili (26)\""} {"instruction":"What are the average Laps on Grid 15?","input":"CREATE TABLE table_50944 (\n \"Rider\" text,\n \"Manufacturer\" text,\n \"Laps\" real,\n \"Time\" text,\n \"Grid\" real\n)","response":"SELECT AVG(\"Laps\") FROM table_50944 WHERE \"Grid\" = '15'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the average Laps on Grid 15? ### Input: CREATE TABLE table_50944 (\n \"Rider\" text,\n \"Manufacturer\" text,\n \"Laps\" real,\n \"Time\" text,\n \"Grid\" real\n) ### Response: SELECT AVG(\"Laps\") FROM table_50944 WHERE \"Grid\" = '15'"} {"instruction":"What event was in a year later than 2007 and in the 88th position?","input":"CREATE TABLE table_66598 (\n \"Year\" real,\n \"Competition\" text,\n \"Venue\" text,\n \"Position\" text,\n \"Event\" text,\n \"Notes\" text\n)","response":"SELECT \"Event\" FROM table_66598 WHERE \"Year\" > '2007' AND \"Position\" = '88th'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What event was in a year later than 2007 and in the 88th position? ### Input: CREATE TABLE table_66598 (\n \"Year\" real,\n \"Competition\" text,\n \"Venue\" text,\n \"Position\" text,\n \"Event\" text,\n \"Notes\" text\n) ### Response: SELECT \"Event\" FROM table_66598 WHERE \"Year\" > '2007' AND \"Position\" = '88th'"} {"instruction":"Which highest 'goals against' number had wins of 19 and a 'goals for' number that was bigger than 53?","input":"CREATE TABLE table_53525 (\n \"Position\" real,\n \"Club\" text,\n \"Played\" real,\n \"Points\" text,\n \"Wins\" real,\n \"Draws\" real,\n \"Losses\" real,\n \"Goals for\" real,\n \"Goals against\" real,\n \"Goal Difference\" real\n)","response":"SELECT MAX(\"Goals against\") FROM table_53525 WHERE \"Wins\" = '19' AND \"Goals for\" > '53'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which highest 'goals against' number had wins of 19 and a 'goals for' number that was bigger than 53? ### Input: CREATE TABLE table_53525 (\n \"Position\" real,\n \"Club\" text,\n \"Played\" real,\n \"Points\" text,\n \"Wins\" real,\n \"Draws\" real,\n \"Losses\" real,\n \"Goals for\" real,\n \"Goals against\" real,\n \"Goal Difference\" real\n) ### Response: SELECT MAX(\"Goals against\") FROM table_53525 WHERE \"Wins\" = '19' AND \"Goals for\" > '53'"} {"instruction":"what is the name of the first player on this list ?","input":"CREATE TABLE table_203_871 (\n id number,\n \"#\" number,\n \"player\" text,\n \"pos\" text,\n \"pts\" number,\n \"tries\" number,\n \"conv\" number,\n \"pens\" number,\n \"drop\" number,\n \"opposition\" text,\n \"venue\" text,\n \"date\" text\n)","response":"SELECT \"player\" FROM table_203_871 WHERE id = 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the first player on this list ? ### Input: CREATE TABLE table_203_871 (\n id number,\n \"#\" number,\n \"player\" text,\n \"pos\" text,\n \"pts\" number,\n \"tries\" number,\n \"conv\" number,\n \"pens\" number,\n \"drop\" number,\n \"opposition\" text,\n \"venue\" text,\n \"date\" text\n) ### Response: SELECT \"player\" FROM table_203_871 WHERE id = 1"} {"instruction":"What inverse subjunctive has as the imperative and a subjunctive of se m chadn?","input":"CREATE TABLE table_42917 (\n \"m\\u00e5cha\" text,\n \"indicative\" text,\n \"imperative\" text,\n \"subjunctive\" text,\n \"inverse subjunctive\" text\n)","response":"SELECT \"inverse subjunctive\" FROM table_42917 WHERE \"imperative\" = '\u2014' AND \"subjunctive\" = 'se m\u00e5chadn'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What inverse subjunctive has as the imperative and a subjunctive of se m chadn? ### Input: CREATE TABLE table_42917 (\n \"m\\u00e5cha\" text,\n \"indicative\" text,\n \"imperative\" text,\n \"subjunctive\" text,\n \"inverse subjunctive\" text\n) ### Response: SELECT \"inverse subjunctive\" FROM table_42917 WHERE \"imperative\" = '\u2014' AND \"subjunctive\" = 'se m\u00e5chadn'"} {"instruction":"Which term in office has a qld state, a Party of labor, and an Electorate of fisher?","input":"CREATE TABLE table_name_76 (\n term_in_office VARCHAR,\n electorate VARCHAR,\n state VARCHAR,\n party VARCHAR\n)","response":"SELECT term_in_office FROM table_name_76 WHERE state = \"qld\" AND party = \"labor\" AND electorate = \"fisher\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which term in office has a qld state, a Party of labor, and an Electorate of fisher? ### Input: CREATE TABLE table_name_76 (\n term_in_office VARCHAR,\n electorate VARCHAR,\n state VARCHAR,\n party VARCHAR\n) ### Response: SELECT term_in_office FROM table_name_76 WHERE state = \"qld\" AND party = \"labor\" AND electorate = \"fisher\""} {"instruction":"A bar chart for what are the number of the descriptions of all the project outcomes?, and show X in desc order.","input":"CREATE TABLE Documents (\n document_id INTEGER,\n document_type_code VARCHAR(10),\n grant_id INTEGER,\n sent_date DATETIME,\n response_received_date DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Grants (\n grant_id INTEGER,\n organisation_id INTEGER,\n grant_amount DECIMAL(19,4),\n grant_start_date DATETIME,\n grant_end_date DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Staff_Roles (\n role_code VARCHAR(10),\n role_description VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n project_id INTEGER,\n organisation_id INTEGER,\n project_details VARCHAR(255)\n)\n\nCREATE TABLE Research_Outcomes (\n outcome_code VARCHAR(10),\n outcome_description VARCHAR(255)\n)\n\nCREATE TABLE Organisations (\n organisation_id INTEGER,\n organisation_type VARCHAR(10),\n organisation_details VARCHAR(255)\n)\n\nCREATE TABLE Organisation_Types (\n organisation_type VARCHAR(10),\n organisation_type_description VARCHAR(255)\n)\n\nCREATE TABLE Research_Staff (\n staff_id INTEGER,\n employer_organisation_id INTEGER,\n staff_details VARCHAR(255)\n)\n\nCREATE TABLE Project_Outcomes (\n project_id INTEGER,\n outcome_code VARCHAR(10),\n outcome_details VARCHAR(255)\n)\n\nCREATE TABLE Project_Staff (\n staff_id DOUBLE,\n project_id INTEGER,\n role_code VARCHAR(10),\n date_from DATETIME,\n date_to DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Document_Types (\n document_type_code VARCHAR(10),\n document_description VARCHAR(255)\n)\n\nCREATE TABLE Tasks (\n task_id INTEGER,\n project_id INTEGER,\n task_details VARCHAR(255),\n \"eg Agree Objectives\" VARCHAR(1)\n)","response":"SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the descriptions of all the project outcomes?, and show X in desc order. ### Input: CREATE TABLE Documents (\n document_id INTEGER,\n document_type_code VARCHAR(10),\n grant_id INTEGER,\n sent_date DATETIME,\n response_received_date DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Grants (\n grant_id INTEGER,\n organisation_id INTEGER,\n grant_amount DECIMAL(19,4),\n grant_start_date DATETIME,\n grant_end_date DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Staff_Roles (\n role_code VARCHAR(10),\n role_description VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n project_id INTEGER,\n organisation_id INTEGER,\n project_details VARCHAR(255)\n)\n\nCREATE TABLE Research_Outcomes (\n outcome_code VARCHAR(10),\n outcome_description VARCHAR(255)\n)\n\nCREATE TABLE Organisations (\n organisation_id INTEGER,\n organisation_type VARCHAR(10),\n organisation_details VARCHAR(255)\n)\n\nCREATE TABLE Organisation_Types (\n organisation_type VARCHAR(10),\n organisation_type_description VARCHAR(255)\n)\n\nCREATE TABLE Research_Staff (\n staff_id INTEGER,\n employer_organisation_id INTEGER,\n staff_details VARCHAR(255)\n)\n\nCREATE TABLE Project_Outcomes (\n project_id INTEGER,\n outcome_code VARCHAR(10),\n outcome_details VARCHAR(255)\n)\n\nCREATE TABLE Project_Staff (\n staff_id DOUBLE,\n project_id INTEGER,\n role_code VARCHAR(10),\n date_from DATETIME,\n date_to DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Document_Types (\n document_type_code VARCHAR(10),\n document_description VARCHAR(255)\n)\n\nCREATE TABLE Tasks (\n task_id INTEGER,\n project_id INTEGER,\n task_details VARCHAR(255),\n \"eg Agree Objectives\" VARCHAR(1)\n) ### Response: SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description DESC"} {"instruction":"users with my same first name who have twitter in their about me.","input":"CREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT COUNT(*) FROM Users WHERE DisplayName LIKE 'Abby %' AND WebsiteUrl LIKE '%twitter%'","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: users with my same first name who have twitter in their about me. ### Input: CREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT COUNT(*) FROM Users WHERE DisplayName LIKE 'Abby %' AND WebsiteUrl LIKE '%twitter%'"} {"instruction":"What is the score for the player who won $3,600?","input":"CREATE TABLE table_name_40 (\n score VARCHAR,\n money___$__ VARCHAR\n)","response":"SELECT score FROM table_name_40 WHERE money___$__ = \"3,600\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for the player who won $3,600? ### Input: CREATE TABLE table_name_40 (\n score VARCHAR,\n money___$__ VARCHAR\n) ### Response: SELECT score FROM table_name_40 WHERE money___$__ = \"3,600\""} {"instruction":"Name the most field goals","input":"CREATE TABLE table_72533 (\n \"Player\" text,\n \"Position\" text,\n \"Starter\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n)","response":"SELECT MAX(\"Field goals\") FROM table_72533","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most field goals ### Input: CREATE TABLE table_72533 (\n \"Player\" text,\n \"Position\" text,\n \"Starter\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n) ### Response: SELECT MAX(\"Field goals\") FROM table_72533"} {"instruction":"What year did jockey Ramon Dominguez have a distance of 1-1\/16?","input":"CREATE TABLE table_53833 (\n \"Year\" text,\n \"Winner\" text,\n \"Jockey\" text,\n \"Trainer\" text,\n \"Owner\" text,\n \"Distance\" text,\n \"Time\" text,\n \"Purse\" text\n)","response":"SELECT \"Year\" FROM table_53833 WHERE \"Distance\" = '1-1\/16' AND \"Jockey\" = 'ramon dominguez'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year did jockey Ramon Dominguez have a distance of 1-1\/16? ### Input: CREATE TABLE table_53833 (\n \"Year\" text,\n \"Winner\" text,\n \"Jockey\" text,\n \"Trainer\" text,\n \"Owner\" text,\n \"Distance\" text,\n \"Time\" text,\n \"Purse\" text\n) ### Response: SELECT \"Year\" FROM table_53833 WHERE \"Distance\" = '1-1\/16' AND \"Jockey\" = 'ramon dominguez'"} {"instruction":"What is the largest vote result if loss\/gain is -0.5%?","input":"CREATE TABLE table_73867 (\n \"Constituency\" text,\n \"Candidate\" text,\n \"Affiliation\" text,\n \"Result - votes\" real,\n \"Result - %\" text,\n \"Loss\/gain\" text\n)","response":"SELECT MAX(\"Result - votes\") FROM table_73867 WHERE \"Loss\/gain\" = '-0.5%'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest vote result if loss\/gain is -0.5%? ### Input: CREATE TABLE table_73867 (\n \"Constituency\" text,\n \"Candidate\" text,\n \"Affiliation\" text,\n \"Result - votes\" real,\n \"Result - %\" text,\n \"Loss\/gain\" text\n) ### Response: SELECT MAX(\"Result - votes\") FROM table_73867 WHERE \"Loss\/gain\" = '-0.5%'"} {"instruction":"What is the sum for December when the record was 22-12-5?","input":"CREATE TABLE table_36845 (\n \"Game\" real,\n \"December\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Record\" text\n)","response":"SELECT SUM(\"December\") FROM table_36845 WHERE \"Record\" = '22-12-5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum for December when the record was 22-12-5? ### Input: CREATE TABLE table_36845 (\n \"Game\" real,\n \"December\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Record\" text\n) ### Response: SELECT SUM(\"December\") FROM table_36845 WHERE \"Record\" = '22-12-5'"} {"instruction":"Find the number of professors in each office with a bar chart, and order y axis in descending order.","input":"CREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)","response":"SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of professors in each office with a bar chart, and order y axis in descending order. ### Input: CREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n) ### Response: SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) DESC"} {"instruction":"How many members did Africa have the year that Australia had 94615?","input":"CREATE TABLE table_22851 (\n \"Year\" real,\n \"Worldwide\" real,\n \"Africa\" real,\n \"America\" real,\n \"Asia\" real,\n \"Australia\" real,\n \"Europe\" real\n)","response":"SELECT \"Africa\" FROM table_22851 WHERE \"Australia\" = '94615'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many members did Africa have the year that Australia had 94615? ### Input: CREATE TABLE table_22851 (\n \"Year\" real,\n \"Worldwide\" real,\n \"Africa\" real,\n \"America\" real,\n \"Asia\" real,\n \"Australia\" real,\n \"Europe\" real\n) ### Response: SELECT \"Africa\" FROM table_22851 WHERE \"Australia\" = '94615'"} {"instruction":"List the total number of years that have a score of 3 6, 4 6, 2 6.","input":"CREATE TABLE table_2533 (\n \"Outcome\" text,\n \"Year\" real,\n \"Championship\" text,\n \"Surface\" text,\n \"Opponent in the final\" text,\n \"Score in the final\" text\n)","response":"SELECT COUNT(\"Year\") FROM table_2533 WHERE \"Score in the final\" = '3\u20136, 4\u20136, 2\u20136'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the total number of years that have a score of 3 6, 4 6, 2 6. ### Input: CREATE TABLE table_2533 (\n \"Outcome\" text,\n \"Year\" real,\n \"Championship\" text,\n \"Surface\" text,\n \"Opponent in the final\" text,\n \"Score in the final\" text\n) ### Response: SELECT COUNT(\"Year\") FROM table_2533 WHERE \"Score in the final\" = '3\u20136, 4\u20136, 2\u20136'"} {"instruction":"What is the result when the Indianapolis Colts are the opponents?","input":"CREATE TABLE table_55184 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Kickoff [a ]\" text,\n \"Game site\" text,\n \"Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Result\" FROM table_55184 WHERE \"Opponent\" = 'indianapolis colts'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result when the Indianapolis Colts are the opponents? ### Input: CREATE TABLE table_55184 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Kickoff [a ]\" text,\n \"Game site\" text,\n \"Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Result\" FROM table_55184 WHERE \"Opponent\" = 'indianapolis colts'"} {"instruction":"Which country does FC Atyrau represent after the 2006 season?","input":"CREATE TABLE table_name_67 (\n country VARCHAR,\n season VARCHAR,\n team VARCHAR\n)","response":"SELECT country FROM table_name_67 WHERE season > 2006 AND team = \"fc atyrau\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which country does FC Atyrau represent after the 2006 season? ### Input: CREATE TABLE table_name_67 (\n country VARCHAR,\n season VARCHAR,\n team VARCHAR\n) ### Response: SELECT country FROM table_name_67 WHERE season > 2006 AND team = \"fc atyrau\""} {"instruction":"Who played in the Toronto Raptors from 1995-96?","input":"CREATE TABLE table_15857 (\n \"Player\" text,\n \"No.\" real,\n \"Nationality\" text,\n \"Position\" text,\n \"Years in Toronto\" text,\n \"School\/Club Team\" text\n)","response":"SELECT \"Player\" FROM table_15857 WHERE \"Years in Toronto\" = '1995-96'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who played in the Toronto Raptors from 1995-96? ### Input: CREATE TABLE table_15857 (\n \"Player\" text,\n \"No.\" real,\n \"Nationality\" text,\n \"Position\" text,\n \"Years in Toronto\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT \"Player\" FROM table_15857 WHERE \"Years in Toronto\" = '1995-96'"} {"instruction":"What's the sub-parish (sokn) of Eikefjord?","input":"CREATE TABLE table_21949 (\n \"Parish (Prestegjeld)\" text,\n \"Sub-Parish (Sokn)\" text,\n \"Church Name\" text,\n \"Year Built\" text,\n \"Location of the Church\" text\n)","response":"SELECT \"Sub-Parish (Sokn)\" FROM table_21949 WHERE \"Location of the Church\" = 'Eikefjord'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the sub-parish (sokn) of Eikefjord? ### Input: CREATE TABLE table_21949 (\n \"Parish (Prestegjeld)\" text,\n \"Sub-Parish (Sokn)\" text,\n \"Church Name\" text,\n \"Year Built\" text,\n \"Location of the Church\" text\n) ### Response: SELECT \"Sub-Parish (Sokn)\" FROM table_21949 WHERE \"Location of the Church\" = 'Eikefjord'"} {"instruction":"what's the first elected with district illinois 18","input":"CREATE TABLE table_1341472_15 (\n first_elected VARCHAR,\n district VARCHAR\n)","response":"SELECT first_elected FROM table_1341472_15 WHERE district = \"Illinois 18\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the first elected with district illinois 18 ### Input: CREATE TABLE table_1341472_15 (\n first_elected VARCHAR,\n district VARCHAR\n) ### Response: SELECT first_elected FROM table_1341472_15 WHERE district = \"Illinois 18\""} {"instruction":"What is the highest production number released on 1955-04-02 with i. freleng as the director?","input":"CREATE TABLE table_79458 (\n \"Title\" text,\n \"Series\" text,\n \"Director\" text,\n \"Production Number\" real,\n \"Release date\" text\n)","response":"SELECT MAX(\"Production Number\") FROM table_79458 WHERE \"Director\" = 'i. freleng' AND \"Release date\" = '1955-04-02'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest production number released on 1955-04-02 with i. freleng as the director? ### Input: CREATE TABLE table_79458 (\n \"Title\" text,\n \"Series\" text,\n \"Director\" text,\n \"Production Number\" real,\n \"Release date\" text\n) ### Response: SELECT MAX(\"Production Number\") FROM table_79458 WHERE \"Director\" = 'i. freleng' AND \"Release date\" = '1955-04-02'"} {"instruction":"Orphan questions that were migrated from another site. Questions that were migrated and have no owner","input":"CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)","response":"SELECT p.Id AS \"post_link\", p.CreationDate AS \"date\", p.OwnerDisplayName AS \"current_user_name\", ph.Comment AS \"comment\" FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 17 AND p.PostTypeId = 1 AND p.OwnerUserId IS NULL ORDER BY p.Id DESC LIMIT 1000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Orphan questions that were migrated from another site. Questions that were migrated and have no owner ### Input: CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n) ### Response: SELECT p.Id AS \"post_link\", p.CreationDate AS \"date\", p.OwnerDisplayName AS \"current_user_name\", ph.Comment AS \"comment\" FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 17 AND p.PostTypeId = 1 AND p.OwnerUserId IS NULL ORDER BY p.Id DESC LIMIT 1000"} {"instruction":"For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to sort y-axis from low to high order.","input":"CREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)","response":"SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to sort y-axis from low to high order. ### Input: CREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)"} {"instruction":"What is the Skip when the Third was john morris?","input":"CREATE TABLE table_name_61 (\n skip VARCHAR,\n third VARCHAR\n)","response":"SELECT skip FROM table_name_61 WHERE third = \"john morris\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Skip when the Third was john morris? ### Input: CREATE TABLE table_name_61 (\n skip VARCHAR,\n third VARCHAR\n) ### Response: SELECT skip FROM table_name_61 WHERE third = \"john morris\""} {"instruction":"Show the number of documents for each location code in a bar chart.","input":"CREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)","response":"SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of documents for each location code in a bar chart. ### Input: CREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n) ### Response: SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code"} {"instruction":"What is the 3rd largest when 2nd largest in Minab?","input":"CREATE TABLE table_48113 (\n \"Province\" text,\n \"Largest city\" text,\n \"2nd Largest\" text,\n \"3rd Largest\" text,\n \"4th largest\" text\n)","response":"SELECT \"3rd Largest\" FROM table_48113 WHERE \"2nd Largest\" = 'minab'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 3rd largest when 2nd largest in Minab? ### Input: CREATE TABLE table_48113 (\n \"Province\" text,\n \"Largest city\" text,\n \"2nd Largest\" text,\n \"3rd Largest\" text,\n \"4th largest\" text\n) ### Response: SELECT \"3rd Largest\" FROM table_48113 WHERE \"2nd Largest\" = 'minab'"} {"instruction":"What type of game was held against France with the results of 3:1?","input":"CREATE TABLE table_6658 (\n \"Date\" text,\n \"City\" text,\n \"Opponent\" text,\n \"Results\\u00b9\" text,\n \"Type of game\" text\n)","response":"SELECT \"Type of game\" FROM table_6658 WHERE \"Results\\u00b9\" = '3:1' AND \"Opponent\" = 'france'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of game was held against France with the results of 3:1? ### Input: CREATE TABLE table_6658 (\n \"Date\" text,\n \"City\" text,\n \"Opponent\" text,\n \"Results\\u00b9\" text,\n \"Type of game\" text\n) ### Response: SELECT \"Type of game\" FROM table_6658 WHERE \"Results\\u00b9\" = '3:1' AND \"Opponent\" = 'france'"} {"instruction":"Give the number of patients that died with a drug named pneumococcal vac polyvalent.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = \"1\" AND prescriptions.drug = \"PNEUMOcoccal Vac Polyvalent\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give the number of patients that died with a drug named pneumococcal vac polyvalent. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = \"1\" AND prescriptions.drug = \"PNEUMOcoccal Vac Polyvalent\""} {"instruction":"Which song had Central Station as a label and whose album was Various - Wild Nights 4?","input":"CREATE TABLE table_31987 (\n \"Year\" real,\n \"Album\" text,\n \"Song\" text,\n \"Label\" text,\n \"Catalog#\" text,\n \"Format\" text,\n \"Country\" text\n)","response":"SELECT \"Song\" FROM table_31987 WHERE \"Label\" = 'central station' AND \"Album\" = 'various - wild nights 4'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which song had Central Station as a label and whose album was Various - Wild Nights 4? ### Input: CREATE TABLE table_31987 (\n \"Year\" real,\n \"Album\" text,\n \"Song\" text,\n \"Label\" text,\n \"Catalog#\" text,\n \"Format\" text,\n \"Country\" text\n) ### Response: SELECT \"Song\" FROM table_31987 WHERE \"Label\" = 'central station' AND \"Album\" = 'various - wild nights 4'"} {"instruction":"Who had more than 3 wins?","input":"CREATE TABLE table_10510 (\n \"Season\" text,\n \"Winner\" text,\n \"Team\" text,\n \"Position\" text,\n \"Win #\" real\n)","response":"SELECT \"Winner\" FROM table_10510 WHERE \"Win #\" > '3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had more than 3 wins? ### Input: CREATE TABLE table_10510 (\n \"Season\" text,\n \"Winner\" text,\n \"Team\" text,\n \"Position\" text,\n \"Win #\" real\n) ### Response: SELECT \"Winner\" FROM table_10510 WHERE \"Win #\" > '3'"} {"instruction":"how many times was the televote\/sms 2.39% and the place more than 9?","input":"CREATE TABLE table_66500 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Televote\/SMS\" text,\n \"Place\" real\n)","response":"SELECT COUNT(\"Draw\") FROM table_66500 WHERE \"Televote\/SMS\" = '2.39%' AND \"Place\" > '9'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times was the televote\/sms 2.39% and the place more than 9? ### Input: CREATE TABLE table_66500 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Televote\/SMS\" text,\n \"Place\" real\n) ### Response: SELECT COUNT(\"Draw\") FROM table_66500 WHERE \"Televote\/SMS\" = '2.39%' AND \"Place\" > '9'"} {"instruction":"from WASHINGTON to ATLANTA","input":"CREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: from WASHINGTON to ATLANTA ### Input: CREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"plasma creatinine > 2 mg \/ dl.","input":"CREATE TABLE table_train_119 (\n \"id\" int,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"diastolic_blood_pressure_dbp\" int,\n \"hypotension\" bool,\n \"allergy_to_milk\" bool,\n \"allergy_to_soy\" bool,\n \"body_mass_index_bmi\" float,\n \"plasma_creatinine\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_119 WHERE plasma_creatinine > 2","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: plasma creatinine > 2 mg \/ dl. ### Input: CREATE TABLE table_train_119 (\n \"id\" int,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"diastolic_blood_pressure_dbp\" int,\n \"hypotension\" bool,\n \"allergy_to_milk\" bool,\n \"allergy_to_soy\" bool,\n \"body_mass_index_bmi\" float,\n \"plasma_creatinine\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_119 WHERE plasma_creatinine > 2"} {"instruction":"how many years did an jae sung play ?","input":"CREATE TABLE table_204_177 (\n id number,\n \"player\" text,\n \"years played\" text,\n \"total w-l\" text,\n \"singles w-l\" text,\n \"doubles w-l\" text\n)","response":"SELECT \"years played\" FROM table_204_177 WHERE \"player\" = 'an jae-sung'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many years did an jae sung play ? ### Input: CREATE TABLE table_204_177 (\n id number,\n \"player\" text,\n \"years played\" text,\n \"total w-l\" text,\n \"singles w-l\" text,\n \"doubles w-l\" text\n) ### Response: SELECT \"years played\" FROM table_204_177 WHERE \"player\" = 'an jae-sung'"} {"instruction":"Name the week for date of bye","input":"CREATE TABLE table_39203 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Record\" text\n)","response":"SELECT \"Week\" FROM table_39203 WHERE \"Date\" = 'bye'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the week for date of bye ### Input: CREATE TABLE table_39203 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Record\" text\n) ### Response: SELECT \"Week\" FROM table_39203 WHERE \"Date\" = 'bye'"} {"instruction":"A bar chart for what are the number of the names of the workshop groups that have bookings with status code 'stop'?, I want to list by the Y in asc.","input":"CREATE TABLE Clients (\n Client_ID INTEGER,\n Address_ID INTEGER,\n Customer_Email_Address VARCHAR(255),\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Addresses (\n Address_ID VARCHAR(100),\n Line_1 VARCHAR(255),\n Line_2 VARCHAR(255),\n City_Town VARCHAR(255),\n State_County VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n Customer_ID VARCHAR(100),\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Payment_Methods (\n payment_method_code CHAR(10),\n payment_method_description VARCHAR(80)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15),\n Workshop_Group_ID INTEGER,\n Product_Description VARCHAR(255),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoices (\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n payment_method_code CHAR(15),\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255),\n Order_Item_ID INTEGER\n)\n\nCREATE TABLE Marketing_Regions (\n Marketing_Region_Code CHAR(15),\n Marketing_Region_Name VARCHAR(255),\n Marketing_Region_Descriptrion VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n Order_Item_ID INTEGER,\n Order_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers (\n Performer_ID INTEGER,\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Drama_Workshop_Groups (\n Workshop_Group_ID INTEGER,\n Address_ID INTEGER,\n Currency_Code CHAR(15),\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Items (\n Invoice_Item_ID INTEGER,\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n Order_Item_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity INTEGER,\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Service_Types (\n Service_Type_Code CHAR(15),\n Parent_Service_Type_Code CHAR(15),\n Service_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Stores (\n Store_ID VARCHAR(100),\n Address_ID INTEGER,\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customer_Orders (\n Order_ID INTEGER,\n Customer_ID INTEGER,\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers_in_Bookings (\n Order_ID INTEGER,\n Performer_ID INTEGER\n)\n\nCREATE TABLE Bookings (\n Booking_ID INTEGER,\n Customer_ID INTEGER,\n Workshop_Group_ID VARCHAR(100),\n Status_Code CHAR(15),\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n Product_ID VARCHAR(100),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Product_Description VARCHAR(255),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings_Services (\n Order_ID INTEGER,\n Product_ID INTEGER\n)","response":"SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = \"stop\" GROUP BY Store_Name ORDER BY COUNT(Store_Name)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the names of the workshop groups that have bookings with status code 'stop'?, I want to list by the Y in asc. ### Input: CREATE TABLE Clients (\n Client_ID INTEGER,\n Address_ID INTEGER,\n Customer_Email_Address VARCHAR(255),\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Addresses (\n Address_ID VARCHAR(100),\n Line_1 VARCHAR(255),\n Line_2 VARCHAR(255),\n City_Town VARCHAR(255),\n State_County VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n Customer_ID VARCHAR(100),\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Payment_Methods (\n payment_method_code CHAR(10),\n payment_method_description VARCHAR(80)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15),\n Workshop_Group_ID INTEGER,\n Product_Description VARCHAR(255),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoices (\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n payment_method_code CHAR(15),\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255),\n Order_Item_ID INTEGER\n)\n\nCREATE TABLE Marketing_Regions (\n Marketing_Region_Code CHAR(15),\n Marketing_Region_Name VARCHAR(255),\n Marketing_Region_Descriptrion VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n Order_Item_ID INTEGER,\n Order_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers (\n Performer_ID INTEGER,\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Drama_Workshop_Groups (\n Workshop_Group_ID INTEGER,\n Address_ID INTEGER,\n Currency_Code CHAR(15),\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Items (\n Invoice_Item_ID INTEGER,\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n Order_Item_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity INTEGER,\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Service_Types (\n Service_Type_Code CHAR(15),\n Parent_Service_Type_Code CHAR(15),\n Service_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Stores (\n Store_ID VARCHAR(100),\n Address_ID INTEGER,\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customer_Orders (\n Order_ID INTEGER,\n Customer_ID INTEGER,\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers_in_Bookings (\n Order_ID INTEGER,\n Performer_ID INTEGER\n)\n\nCREATE TABLE Bookings (\n Booking_ID INTEGER,\n Customer_ID INTEGER,\n Workshop_Group_ID VARCHAR(100),\n Status_Code CHAR(15),\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n Product_ID VARCHAR(100),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Product_Description VARCHAR(255),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings_Services (\n Order_ID INTEGER,\n Product_ID INTEGER\n) ### Response: SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = \"stop\" GROUP BY Store_Name ORDER BY COUNT(Store_Name)"} {"instruction":"What is the sum of the drawn values for teams with 2 losses?","input":"CREATE TABLE table_name_45 (\n drawn INTEGER,\n lost VARCHAR\n)","response":"SELECT SUM(drawn) FROM table_name_45 WHERE lost = 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of the drawn values for teams with 2 losses? ### Input: CREATE TABLE table_name_45 (\n drawn INTEGER,\n lost VARCHAR\n) ### Response: SELECT SUM(drawn) FROM table_name_45 WHERE lost = 2"} {"instruction":"What is the average rating of songs for each language. Plot them as pie chart.","input":"CREATE TABLE genre (\n g_name varchar2(20),\n rating varchar2(10),\n most_popular_in varchar2(50)\n)\n\nCREATE TABLE artist (\n artist_name varchar2(50),\n country varchar2(20),\n gender varchar2(20),\n preferred_genre varchar2(50)\n)\n\nCREATE TABLE files (\n f_id number(10),\n artist_name varchar2(50),\n file_size varchar2(20),\n duration varchar2(20),\n formats varchar2(20)\n)\n\nCREATE TABLE song (\n song_name varchar2(50),\n artist_name varchar2(50),\n country varchar2(20),\n f_id number(10),\n genre_is varchar2(20),\n rating number(10),\n languages varchar2(20),\n releasedate Date,\n resolution number(10)\n)","response":"SELECT languages, AVG(rating) FROM song GROUP BY languages","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average rating of songs for each language. Plot them as pie chart. ### Input: CREATE TABLE genre (\n g_name varchar2(20),\n rating varchar2(10),\n most_popular_in varchar2(50)\n)\n\nCREATE TABLE artist (\n artist_name varchar2(50),\n country varchar2(20),\n gender varchar2(20),\n preferred_genre varchar2(50)\n)\n\nCREATE TABLE files (\n f_id number(10),\n artist_name varchar2(50),\n file_size varchar2(20),\n duration varchar2(20),\n formats varchar2(20)\n)\n\nCREATE TABLE song (\n song_name varchar2(50),\n artist_name varchar2(50),\n country varchar2(20),\n f_id number(10),\n genre_is varchar2(20),\n rating number(10),\n languages varchar2(20),\n releasedate Date,\n resolution number(10)\n) ### Response: SELECT languages, AVG(rating) FROM song GROUP BY languages"} {"instruction":"What is the total number of Wins, when Top-25 is less than 4, and when Top-10 is less than 1?","input":"CREATE TABLE table_name_81 (\n wins VARCHAR,\n top_25 VARCHAR,\n top_10 VARCHAR\n)","response":"SELECT COUNT(wins) FROM table_name_81 WHERE top_25 < 4 AND top_10 < 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Wins, when Top-25 is less than 4, and when Top-10 is less than 1? ### Input: CREATE TABLE table_name_81 (\n wins VARCHAR,\n top_25 VARCHAR,\n top_10 VARCHAR\n) ### Response: SELECT COUNT(wins) FROM table_name_81 WHERE top_25 < 4 AND top_10 < 1"} {"instruction":"How many patients of black\/cape verdean ethnicity were primarily diagnosed with the disease colangitis","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"BLACK\/CAPE VERDEAN\" AND demographic.diagnosis = \"COLANGITIS\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients of black\/cape verdean ethnicity were primarily diagnosed with the disease colangitis ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"BLACK\/CAPE VERDEAN\" AND demographic.diagnosis = \"COLANGITIS\""} {"instruction":"What is the proportion of each customer's move in date? Show me the bar chart.","input":"CREATE TABLE Timed_Status_of_Things (\n thing_id INTEGER,\n Date_and_Date DATETIME,\n Status_of_Thing_Code CHAR(15)\n)\n\nCREATE TABLE Services (\n service_id INTEGER,\n organization_id INTEGER,\n service_type_code CHAR(15),\n service_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_details VARCHAR(255)\n)\n\nCREATE TABLE Properties (\n property_id INTEGER,\n property_type_code CHAR(15),\n property_address VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Residents (\n resident_id INTEGER,\n property_id INTEGER,\n date_moved_in DATETIME,\n date_moved_out DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Customer_Events (\n Customer_Event_ID INTEGER,\n customer_id INTEGER,\n date_moved_in DATETIME,\n property_id INTEGER,\n resident_id INTEGER,\n thing_id INTEGER\n)\n\nCREATE TABLE Customer_Event_Notes (\n Customer_Event_Note_ID INTEGER,\n Customer_Event_ID INTEGER,\n service_type_code CHAR(15),\n resident_id INTEGER,\n property_id INTEGER,\n date_moved_in DATETIME\n)\n\nCREATE TABLE Timed_Locations_of_Things (\n thing_id INTEGER,\n Date_and_Time DATETIME,\n Location_Code CHAR(15)\n)\n\nCREATE TABLE Residents_Services (\n resident_id INTEGER,\n service_id INTEGER,\n date_moved_in DATETIME,\n property_id INTEGER,\n date_requested DATETIME,\n date_provided DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Things (\n thing_id INTEGER,\n organization_id INTEGER,\n Type_of_Thing_Code CHAR(15),\n service_type_code CHAR(10),\n service_details VARCHAR(255)\n)\n\nCREATE TABLE Organizations (\n organization_id INTEGER,\n parent_organization_id INTEGER,\n organization_details VARCHAR(255)\n)","response":"SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the proportion of each customer's move in date? Show me the bar chart. ### Input: CREATE TABLE Timed_Status_of_Things (\n thing_id INTEGER,\n Date_and_Date DATETIME,\n Status_of_Thing_Code CHAR(15)\n)\n\nCREATE TABLE Services (\n service_id INTEGER,\n organization_id INTEGER,\n service_type_code CHAR(15),\n service_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_details VARCHAR(255)\n)\n\nCREATE TABLE Properties (\n property_id INTEGER,\n property_type_code CHAR(15),\n property_address VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Residents (\n resident_id INTEGER,\n property_id INTEGER,\n date_moved_in DATETIME,\n date_moved_out DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Customer_Events (\n Customer_Event_ID INTEGER,\n customer_id INTEGER,\n date_moved_in DATETIME,\n property_id INTEGER,\n resident_id INTEGER,\n thing_id INTEGER\n)\n\nCREATE TABLE Customer_Event_Notes (\n Customer_Event_Note_ID INTEGER,\n Customer_Event_ID INTEGER,\n service_type_code CHAR(15),\n resident_id INTEGER,\n property_id INTEGER,\n date_moved_in DATETIME\n)\n\nCREATE TABLE Timed_Locations_of_Things (\n thing_id INTEGER,\n Date_and_Time DATETIME,\n Location_Code CHAR(15)\n)\n\nCREATE TABLE Residents_Services (\n resident_id INTEGER,\n service_id INTEGER,\n date_moved_in DATETIME,\n property_id INTEGER,\n date_requested DATETIME,\n date_provided DATETIME,\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Things (\n thing_id INTEGER,\n organization_id INTEGER,\n Type_of_Thing_Code CHAR(15),\n service_type_code CHAR(10),\n service_details VARCHAR(255)\n)\n\nCREATE TABLE Organizations (\n organization_id INTEGER,\n parent_organization_id INTEGER,\n organization_details VARCHAR(255)\n) ### Response: SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in"} {"instruction":"Can you draw the trend of sum attendance over the binning year?, show by the X-axis in descending.","input":"CREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT\n)\n\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT\n)\n\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER\n)\n\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER\n)\n\nCREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC\n)\n\nCREATE TABLE player_college (\n player_id TEXT,\n college_id TEXT,\n year INTEGER\n)\n\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC\n)\n\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC\n)\n\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC\n)\n\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT\n)\n\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER\n)\n\nCREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC\n)\n\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER\n)\n\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC\n)\n\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT\n)\n\nCREATE TABLE batting (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE player_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes TEXT\n)\n\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT\n)\n\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC\n)\n\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER\n)\n\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER\n)\n\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)","response":"SELECT year, SUM(attendance) FROM home_game ORDER BY year DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you draw the trend of sum attendance over the binning year?, show by the X-axis in descending. ### Input: CREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT\n)\n\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT\n)\n\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER\n)\n\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER\n)\n\nCREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC\n)\n\nCREATE TABLE player_college (\n player_id TEXT,\n college_id TEXT,\n year INTEGER\n)\n\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC\n)\n\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC\n)\n\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC\n)\n\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT\n)\n\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER\n)\n\nCREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC\n)\n\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER\n)\n\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC\n)\n\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT\n)\n\nCREATE TABLE batting (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE player_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes TEXT\n)\n\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT\n)\n\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC\n)\n\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER\n)\n\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER\n)\n\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n) ### Response: SELECT year, SUM(attendance) FROM home_game ORDER BY year DESC"} {"instruction":"What are the vocal types used in song 'Le Pop'?","input":"CREATE TABLE instruments (\n songid number,\n bandmateid number,\n instrument text\n)\n\nCREATE TABLE tracklists (\n albumid number,\n position number,\n songid number\n)\n\nCREATE TABLE band (\n id number,\n firstname text,\n lastname text\n)\n\nCREATE TABLE albums (\n aid number,\n title text,\n year number,\n label text,\n type text\n)\n\nCREATE TABLE performance (\n songid number,\n bandmate number,\n stageposition text\n)\n\nCREATE TABLE vocals (\n songid number,\n bandmate number,\n type text\n)\n\nCREATE TABLE songs (\n songid number,\n title text\n)","response":"SELECT type FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the vocal types used in song 'Le Pop'? ### Input: CREATE TABLE instruments (\n songid number,\n bandmateid number,\n instrument text\n)\n\nCREATE TABLE tracklists (\n albumid number,\n position number,\n songid number\n)\n\nCREATE TABLE band (\n id number,\n firstname text,\n lastname text\n)\n\nCREATE TABLE albums (\n aid number,\n title text,\n year number,\n label text,\n type text\n)\n\nCREATE TABLE performance (\n songid number,\n bandmate number,\n stageposition text\n)\n\nCREATE TABLE vocals (\n songid number,\n bandmate number,\n type text\n)\n\nCREATE TABLE songs (\n songid number,\n title text\n) ### Response: SELECT type FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\""} {"instruction":"what is the most weeks on chart when the peak position is less than 5 and from Sweden?","input":"CREATE TABLE table_79845 (\n \"Title\" text,\n \"Album\" text,\n \"Country\" text,\n \"Peak position\" real,\n \"Weeks on chart\" real\n)","response":"SELECT MAX(\"Weeks on chart\") FROM table_79845 WHERE \"Peak position\" < '5' AND \"Country\" = 'sweden'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the most weeks on chart when the peak position is less than 5 and from Sweden? ### Input: CREATE TABLE table_79845 (\n \"Title\" text,\n \"Album\" text,\n \"Country\" text,\n \"Peak position\" real,\n \"Weeks on chart\" real\n) ### Response: SELECT MAX(\"Weeks on chart\") FROM table_79845 WHERE \"Peak position\" < '5' AND \"Country\" = 'sweden'"} {"instruction":"Count the number of patients died in or before year 2111 whose lab test fluid is ascites.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= \"2111.0\" AND lab.fluid = \"Ascites\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of patients died in or before year 2111 whose lab test fluid is ascites. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= \"2111.0\" AND lab.fluid = \"Ascites\""} {"instruction":"What was the series in season 2009?","input":"CREATE TABLE table_name_61 (\n series VARCHAR,\n season VARCHAR\n)","response":"SELECT series FROM table_name_61 WHERE season = 2009","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the series in season 2009? ### Input: CREATE TABLE table_name_61 (\n series VARCHAR,\n season VARCHAR\n) ### Response: SELECT series FROM table_name_61 WHERE season = 2009"} {"instruction":"What is the maximum pesticide concentration ever found in a commodity?","input":"CREATE TABLE sampledata15 (\n sample_pk number,\n state text,\n year text,\n month text,\n day text,\n site text,\n commod text,\n source_id text,\n variety text,\n origin text,\n country text,\n disttype text,\n commtype text,\n claim text,\n quantity number,\n growst text,\n packst text,\n distst text\n)\n\nCREATE TABLE resultsdata15 (\n sample_pk number,\n commod text,\n commtype text,\n lab text,\n pestcode text,\n testclass text,\n concen number,\n lod number,\n conunit text,\n confmethod text,\n confmethod2 text,\n annotate text,\n quantitate text,\n mean text,\n extract text,\n determin text\n)","response":"SELECT MAX(concen) FROM resultsdata15","source":"pesticide","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the maximum pesticide concentration ever found in a commodity? ### Input: CREATE TABLE sampledata15 (\n sample_pk number,\n state text,\n year text,\n month text,\n day text,\n site text,\n commod text,\n source_id text,\n variety text,\n origin text,\n country text,\n disttype text,\n commtype text,\n claim text,\n quantity number,\n growst text,\n packst text,\n distst text\n)\n\nCREATE TABLE resultsdata15 (\n sample_pk number,\n commod text,\n commtype text,\n lab text,\n pestcode text,\n testclass text,\n concen number,\n lod number,\n conunit text,\n confmethod text,\n confmethod2 text,\n annotate text,\n quantitate text,\n mean text,\n extract text,\n determin text\n) ### Response: SELECT MAX(concen) FROM resultsdata15"} {"instruction":"What is the international mail with the highest number that has a change of +0,2% and less than 0 domestic mail?","input":"CREATE TABLE table_45338 (\n \"Year\" real,\n \"Domestic freight\" real,\n \"Domestic mail\" real,\n \"International freight\" real,\n \"International mail\" real,\n \"Total freight and mail\" real,\n \"Change\" text\n)","response":"SELECT MAX(\"International mail\") FROM table_45338 WHERE \"Change\" = '+0,2%' AND \"Domestic mail\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the international mail with the highest number that has a change of +0,2% and less than 0 domestic mail? ### Input: CREATE TABLE table_45338 (\n \"Year\" real,\n \"Domestic freight\" real,\n \"Domestic mail\" real,\n \"International freight\" real,\n \"International mail\" real,\n \"Total freight and mail\" real,\n \"Change\" text\n) ### Response: SELECT MAX(\"International mail\") FROM table_45338 WHERE \"Change\" = '+0,2%' AND \"Domestic mail\" < '0'"} {"instruction":"What is the park & ride lot for the Temple Square station?","input":"CREATE TABLE table_name_97 (\n park_and_ride_lot VARCHAR,\n station_name VARCHAR\n)","response":"SELECT park_and_ride_lot FROM table_name_97 WHERE station_name = \"temple square\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the park & ride lot for the Temple Square station? ### Input: CREATE TABLE table_name_97 (\n park_and_ride_lot VARCHAR,\n station_name VARCHAR\n) ### Response: SELECT park_and_ride_lot FROM table_name_97 WHERE station_name = \"temple square\""} {"instruction":"Name the total number of player for 51 points","input":"CREATE TABLE table_22824319_3 (\n player VARCHAR,\n points VARCHAR\n)","response":"SELECT COUNT(player) FROM table_22824319_3 WHERE points = 51","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of player for 51 points ### Input: CREATE TABLE table_22824319_3 (\n player VARCHAR,\n points VARCHAR\n) ### Response: SELECT COUNT(player) FROM table_22824319_3 WHERE points = 51"} {"instruction":"Name of David Kimball, and an Overall smaller than 229 is what highest round?","input":"CREATE TABLE table_name_51 (\n round INTEGER,\n name VARCHAR,\n overall VARCHAR\n)","response":"SELECT MAX(round) FROM table_name_51 WHERE name = \"david kimball\" AND overall < 229","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name of David Kimball, and an Overall smaller than 229 is what highest round? ### Input: CREATE TABLE table_name_51 (\n round INTEGER,\n name VARCHAR,\n overall VARCHAR\n) ### Response: SELECT MAX(round) FROM table_name_51 WHERE name = \"david kimball\" AND overall < 229"} {"instruction":"How is the crowd of the team Geelong?","input":"CREATE TABLE table_53964 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT AVG(\"Crowd\") FROM table_53964 WHERE \"Away team\" = 'geelong'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How is the crowd of the team Geelong? ### Input: CREATE TABLE table_53964 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT AVG(\"Crowd\") FROM table_53964 WHERE \"Away team\" = 'geelong'"} {"instruction":"flights from MILWAUKEE to PHOENIX on saturday or sunday AA","input":"CREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, flight WHERE (((flight.airline_code = 'AA') AND ((flight.flight_days = DAYS_0.days_code AND DAYS_0.day_name = DATE_DAY_0.day_name AND DATE_DAY_0.year = 1991 AND DATE_DAY_0.month_number = 7 AND DATE_DAY_0.day_number = 26) OR (flight.flight_days = DAYS_1.days_code AND DAYS_1.day_name = DATE_DAY_1.day_name AND DATE_DAY_1.year = 1991 AND DATE_DAY_1.month_number = 7 AND DATE_DAY_1.day_number = 26))) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from MILWAUKEE to PHOENIX on saturday or sunday AA ### Input: CREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, flight WHERE (((flight.airline_code = 'AA') AND ((flight.flight_days = DAYS_0.days_code AND DAYS_0.day_name = DATE_DAY_0.day_name AND DATE_DAY_0.year = 1991 AND DATE_DAY_0.month_number = 7 AND DATE_DAY_0.day_number = 26) OR (flight.flight_days = DAYS_1.days_code AND DAYS_1.day_name = DATE_DAY_1.day_name AND DATE_DAY_1.year = 1991 AND DATE_DAY_1.month_number = 7 AND DATE_DAY_1.day_number = 26))) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"provide the number of patients whose discharge location is snf and days of hospital stay is greater than 13?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"SNF\" AND demographic.days_stay > \"13\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose discharge location is snf and days of hospital stay is greater than 13? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"SNF\" AND demographic.days_stay > \"13\""} {"instruction":"For each team, how many technicians are there, and sort from high to low by the y axis.","input":"CREATE TABLE repair (\n repair_ID int,\n name text,\n Launch_Date text,\n Notes text\n)\n\nCREATE TABLE machine (\n Machine_ID int,\n Making_Year int,\n Class text,\n Team text,\n Machine_series text,\n value_points real,\n quality_rank int\n)\n\nCREATE TABLE repair_assignment (\n technician_id int,\n repair_ID int,\n Machine_ID int\n)\n\nCREATE TABLE technician (\n technician_id real,\n Name text,\n Team text,\n Starting_Year real,\n Age int\n)","response":"SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each team, how many technicians are there, and sort from high to low by the y axis. ### Input: CREATE TABLE repair (\n repair_ID int,\n name text,\n Launch_Date text,\n Notes text\n)\n\nCREATE TABLE machine (\n Machine_ID int,\n Making_Year int,\n Class text,\n Team text,\n Machine_series text,\n value_points real,\n quality_rank int\n)\n\nCREATE TABLE repair_assignment (\n technician_id int,\n repair_ID int,\n Machine_ID int\n)\n\nCREATE TABLE technician (\n technician_id real,\n Name text,\n Team text,\n Starting_Year real,\n Age int\n) ### Response: SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC"} {"instruction":"what is average age of patients whose marital status is married and discharge location is home health care?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = \"MARRIED\" AND demographic.discharge_location = \"HOME HEALTH CARE\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is average age of patients whose marital status is married and discharge location is home health care? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = \"MARRIED\" AND demographic.discharge_location = \"HOME HEALTH CARE\""} {"instruction":"September 23, 1973 landed on which week of the season?","input":"CREATE TABLE table_70568 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n)","response":"SELECT \"Week\" FROM table_70568 WHERE \"Date\" = 'september 23, 1973'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: September 23, 1973 landed on which week of the season? ### Input: CREATE TABLE table_70568 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n) ### Response: SELECT \"Week\" FROM table_70568 WHERE \"Date\" = 'september 23, 1973'"} {"instruction":"Where was the method of tko?","input":"CREATE TABLE table_name_34 (\n location VARCHAR,\n method VARCHAR\n)","response":"SELECT location FROM table_name_34 WHERE method = \"tko\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the method of tko? ### Input: CREATE TABLE table_name_34 (\n location VARCHAR,\n method VARCHAR\n) ### Response: SELECT location FROM table_name_34 WHERE method = \"tko\""} {"instruction":"What Partner has a Construction Start of 2008 january?","input":"CREATE TABLE table_name_2 (\n partner VARCHAR,\n construction_start VARCHAR\n)","response":"SELECT partner FROM table_name_2 WHERE construction_start = \"2008 january\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Partner has a Construction Start of 2008 january? ### Input: CREATE TABLE table_name_2 (\n partner VARCHAR,\n construction_start VARCHAR\n) ### Response: SELECT partner FROM table_name_2 WHERE construction_start = \"2008 january\""} {"instruction":"calculate the number of medications that patient 52898 has been prescribed in 2105.","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND STRFTIME('%y', prescriptions.startdate) = '2105'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of medications that patient 52898 has been prescribed in 2105. ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND STRFTIME('%y', prescriptions.startdate) = '2105'"} {"instruction":"what are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnosed with poison-medicinal agt nos?","input":"CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poison-medicinal agt nos')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 3","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnosed with poison-medicinal agt nos? ### Input: CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poison-medicinal agt nos')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 3"} {"instruction":"what are the five most frequently prescribed drugs since 5 years ago for patients prescribed with atropine 0.1 mg\/ml inj syringe at the same time?","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)","response":"SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atropine 0.1 mg\/ml inj syringe' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequently prescribed drugs since 5 years ago for patients prescribed with atropine 0.1 mg\/ml inj syringe at the same time? ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n) ### Response: SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atropine 0.1 mg\/ml inj syringe' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5"} {"instruction":"When was the date of death for the person married to Charles II?","input":"CREATE TABLE table_name_86 (\n death VARCHAR,\n spouse VARCHAR\n)","response":"SELECT death FROM table_name_86 WHERE spouse = \"charles ii\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the date of death for the person married to Charles II? ### Input: CREATE TABLE table_name_86 (\n death VARCHAR,\n spouse VARCHAR\n) ### Response: SELECT death FROM table_name_86 WHERE spouse = \"charles ii\""} {"instruction":"count the number of patients whose gender is f and procedure icd9 code is 4610?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = \"F\" AND procedures.icd9_code = \"4610\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose gender is f and procedure icd9 code is 4610? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = \"F\" AND procedures.icd9_code = \"4610\""} {"instruction":"How many points did Carlin have when they had 3 wins?","input":"CREATE TABLE table_name_90 (\n points VARCHAR,\n wins VARCHAR,\n team VARCHAR\n)","response":"SELECT points FROM table_name_90 WHERE wins = \"3\" AND team = \"carlin\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many points did Carlin have when they had 3 wins? ### Input: CREATE TABLE table_name_90 (\n points VARCHAR,\n wins VARCHAR,\n team VARCHAR\n) ### Response: SELECT points FROM table_name_90 WHERE wins = \"3\" AND team = \"carlin\""} {"instruction":"In the final, who are the opponents of partner Simon Aspelin?","input":"CREATE TABLE table_35942 (\n \"Outcome\" text,\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Partner\" text,\n \"Opponents in the final\" text,\n \"Score in the final\" text\n)","response":"SELECT \"Opponents in the final\" FROM table_35942 WHERE \"Partner\" = 'simon aspelin'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the final, who are the opponents of partner Simon Aspelin? ### Input: CREATE TABLE table_35942 (\n \"Outcome\" text,\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Partner\" text,\n \"Opponents in the final\" text,\n \"Score in the final\" text\n) ### Response: SELECT \"Opponents in the final\" FROM table_35942 WHERE \"Partner\" = 'simon aspelin'"} {"instruction":"how much does the arterial bp [systolic] of patient 8116 vary second measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?","input":"CREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1 OFFSET 1) - (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much does the arterial bp [systolic] of patient 8116 vary second measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit? ### Input: CREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1 OFFSET 1) - (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1)"} {"instruction":"Name the representative for party of whig","input":"CREATE TABLE table_69618 (\n \"Representative\" text,\n \"Years\" text,\n \"State\" text,\n \"Party\" text,\n \"Lifespan\" text\n)","response":"SELECT \"Representative\" FROM table_69618 WHERE \"Party\" = 'whig'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the representative for party of whig ### Input: CREATE TABLE table_69618 (\n \"Representative\" text,\n \"Years\" text,\n \"State\" text,\n \"Party\" text,\n \"Lifespan\" text\n) ### Response: SELECT \"Representative\" FROM table_69618 WHERE \"Party\" = 'whig'"} {"instruction":"What is the status of the district where the result is 63% 37%?","input":"CREATE TABLE table_16185956_1 (\n status VARCHAR,\n results VARCHAR\n)","response":"SELECT status FROM table_16185956_1 WHERE results = \"63% 37%\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the status of the district where the result is 63% 37%? ### Input: CREATE TABLE table_16185956_1 (\n status VARCHAR,\n results VARCHAR\n) ### Response: SELECT status FROM table_16185956_1 WHERE results = \"63% 37%\""} {"instruction":"What is the Kashmiri word for the Indonesian word senin?","input":"CREATE TABLE table_name_90 (\n kashmiri VARCHAR,\n indonesian VARCHAR\n)","response":"SELECT kashmiri FROM table_name_90 WHERE indonesian = \"senin\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Kashmiri word for the Indonesian word senin? ### Input: CREATE TABLE table_name_90 (\n kashmiri VARCHAR,\n indonesian VARCHAR\n) ### Response: SELECT kashmiri FROM table_name_90 WHERE indonesian = \"senin\""} {"instruction":"how many female patients followed the procedure ven cath renal dialysis?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = \"F\" AND procedures.short_title = \"Ven cath renal dialysis\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many female patients followed the procedure ven cath renal dialysis? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = \"F\" AND procedures.short_title = \"Ven cath renal dialysis\""} {"instruction":"Which City of license has a Call sign of k241an?","input":"CREATE TABLE table_name_68 (\n city_of_license VARCHAR,\n call_sign VARCHAR\n)","response":"SELECT city_of_license FROM table_name_68 WHERE call_sign = \"k241an\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which City of license has a Call sign of k241an? ### Input: CREATE TABLE table_name_68 (\n city_of_license VARCHAR,\n call_sign VARCHAR\n) ### Response: SELECT city_of_license FROM table_name_68 WHERE call_sign = \"k241an\""} {"instruction":"Where is the orchestra when the year of recording is 1934?","input":"CREATE TABLE table_73366 (\n \"Piano\" text,\n \"Conductor\" text,\n \"Orchestra\" text,\n \"Record Company\" text,\n \"Year of Recording\" real,\n \"Format\" text\n)","response":"SELECT \"Orchestra\" FROM table_73366 WHERE \"Year of Recording\" = '1934'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is the orchestra when the year of recording is 1934? ### Input: CREATE TABLE table_73366 (\n \"Piano\" text,\n \"Conductor\" text,\n \"Orchestra\" text,\n \"Record Company\" text,\n \"Year of Recording\" real,\n \"Format\" text\n) ### Response: SELECT \"Orchestra\" FROM table_73366 WHERE \"Year of Recording\" = '1934'"} {"instruction":"How many number of site have May 1, 2004 as the date?","input":"CREATE TABLE table_22098274_1 (\n site VARCHAR,\n date VARCHAR\n)","response":"SELECT COUNT(site) FROM table_22098274_1 WHERE date = \"May 1, 2004\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many number of site have May 1, 2004 as the date? ### Input: CREATE TABLE table_22098274_1 (\n site VARCHAR,\n date VARCHAR\n) ### Response: SELECT COUNT(site) FROM table_22098274_1 WHERE date = \"May 1, 2004\""} {"instruction":"how many times has patient 015-56390 recieved a enteral tube intake: nasoduodenal nostril, r 10f intake in 12\/last year?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56390')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'enteral tube intake: nasoduodenal nostril, r 10f' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', intakeoutput.intakeoutputtime) = '12'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times has patient 015-56390 recieved a enteral tube intake: nasoduodenal nostril, r 10f intake in 12\/last year? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56390')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'enteral tube intake: nasoduodenal nostril, r 10f' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', intakeoutput.intakeoutputtime) = '12'"} {"instruction":"What is Current Rank, when Ring Name is Kimurayama Mamoru?","input":"CREATE TABLE table_40076 (\n \"Ring name\" text,\n \"Current rank\" text,\n \"Debut\" text,\n \"Stable\" text,\n \"Birthplace\" text\n)","response":"SELECT \"Current rank\" FROM table_40076 WHERE \"Ring name\" = 'kimurayama mamoru'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Current Rank, when Ring Name is Kimurayama Mamoru? ### Input: CREATE TABLE table_40076 (\n \"Ring name\" text,\n \"Current rank\" text,\n \"Debut\" text,\n \"Stable\" text,\n \"Birthplace\" text\n) ### Response: SELECT \"Current rank\" FROM table_40076 WHERE \"Ring name\" = 'kimurayama mamoru'"} {"instruction":"What was the nationality of the skater with 108.8 points?","input":"CREATE TABLE table_name_52 (\n nation VARCHAR,\n points VARCHAR\n)","response":"SELECT nation FROM table_name_52 WHERE points = 108.8","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the nationality of the skater with 108.8 points? ### Input: CREATE TABLE table_name_52 (\n nation VARCHAR,\n points VARCHAR\n) ### Response: SELECT nation FROM table_name_52 WHERE points = 108.8"} {"instruction":"what are the top four most frequently diagnosed diagnoses among the patients in the 20s since 1 year ago?","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)","response":"SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top four most frequently diagnosed diagnoses among the patients in the 20s since 1 year ago? ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n) ### Response: SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4"} {"instruction":"What is the total number of To Par, when Score is '70-75-76=221'?","input":"CREATE TABLE table_45574 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real\n)","response":"SELECT COUNT(\"To par\") FROM table_45574 WHERE \"Score\" = '70-75-76=221'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of To Par, when Score is '70-75-76=221'? ### Input: CREATE TABLE table_45574 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real\n) ### Response: SELECT COUNT(\"To par\") FROM table_45574 WHERE \"Score\" = '70-75-76=221'"} {"instruction":"For CS , are there any upper elective courses offered ?","input":"CREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For CS , are there any upper elective courses offered ? ### Input: CREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id"} {"instruction":"Number of unanswered question (zero answers) per month.","input":"CREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)","response":"SELECT LAST_DATE_OF_MONTH(q.CreationDate), COUNT(q.Id) AS Count FROM Posts AS q WHERE (q.PostTypeId = 1) AND (q.AnswerCount = 0) GROUP BY LAST_DATE_OF_MONTH(q.CreationDate) ORDER BY LAST_DATE_OF_MONTH(q.CreationDate)","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of unanswered question (zero answers) per month. ### Input: CREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n) ### Response: SELECT LAST_DATE_OF_MONTH(q.CreationDate), COUNT(q.Id) AS Count FROM Posts AS q WHERE (q.PostTypeId = 1) AND (q.AnswerCount = 0) GROUP BY LAST_DATE_OF_MONTH(q.CreationDate) ORDER BY LAST_DATE_OF_MONTH(q.CreationDate)"} {"instruction":"flights from KANSAS CITY to CLEVELAND on wednesday before 1700","input":"CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time < 1700 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'KANSAS CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from KANSAS CITY to CLEVELAND on wednesday before 1700 ### Input: CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time < 1700 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'KANSAS CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"What is the total number of 2012 Employees (Total) when 2007 Employees (Total) is 8,985, and rank (2010) is smaller than 9?","input":"CREATE TABLE table_63078 (\n \"Rank (2012)\" real,\n \"Rank (2010)\" real,\n \"Employer\" text,\n \"Industry\" text,\n \"2012 Employees (Total)\" real,\n \"2010 Employees (Total)\" real,\n \"2007 Employees (Total)\" text,\n \"Head office\" text\n)","response":"SELECT COUNT(\"2012 Employees (Total)\") FROM table_63078 WHERE \"2007 Employees (Total)\" = '8,985' AND \"Rank (2010)\" < '9'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of 2012 Employees (Total) when 2007 Employees (Total) is 8,985, and rank (2010) is smaller than 9? ### Input: CREATE TABLE table_63078 (\n \"Rank (2012)\" real,\n \"Rank (2010)\" real,\n \"Employer\" text,\n \"Industry\" text,\n \"2012 Employees (Total)\" real,\n \"2010 Employees (Total)\" real,\n \"2007 Employees (Total)\" text,\n \"Head office\" text\n) ### Response: SELECT COUNT(\"2012 Employees (Total)\") FROM table_63078 WHERE \"2007 Employees (Total)\" = '8,985' AND \"Rank (2010)\" < '9'"} {"instruction":"With a rank of 2 what is the second quarter?","input":"CREATE TABLE table_36998 (\n \"Rank\" real,\n \"First quarter\" text,\n \"Second quarter\" text,\n \"Third quarter\" text,\n \"Fourth quarter\" text\n)","response":"SELECT \"Second quarter\" FROM table_36998 WHERE \"Rank\" = '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With a rank of 2 what is the second quarter? ### Input: CREATE TABLE table_36998 (\n \"Rank\" real,\n \"First quarter\" text,\n \"Second quarter\" text,\n \"Third quarter\" text,\n \"Fourth quarter\" text\n) ### Response: SELECT \"Second quarter\" FROM table_36998 WHERE \"Rank\" = '2'"} {"instruction":"What party did hilda solis represent?","input":"CREATE TABLE table_22126 (\n \"District\" text,\n \"Incumbent\" text,\n \"Party\" text,\n \"First elected\" real,\n \"Results\" text,\n \"Candidates\" text\n)","response":"SELECT \"Party\" FROM table_22126 WHERE \"Incumbent\" = 'Hilda Solis'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What party did hilda solis represent? ### Input: CREATE TABLE table_22126 (\n \"District\" text,\n \"Incumbent\" text,\n \"Party\" text,\n \"First elected\" real,\n \"Results\" text,\n \"Candidates\" text\n) ### Response: SELECT \"Party\" FROM table_22126 WHERE \"Incumbent\" = 'Hilda Solis'"} {"instruction":"what was the last height of patient 005-73237 in the last month.","input":"CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)","response":"SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY patient.unitadmittime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last height of patient 005-73237 in the last month. ### Input: CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n) ### Response: SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY patient.unitadmittime DESC LIMIT 1"} {"instruction":"how old was patient 035-18528's age during the first hospital visit?","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT patient.age FROM patient WHERE patient.uniquepid = '035-18528' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how old was patient 035-18528's age during the first hospital visit? ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT patient.age FROM patient WHERE patient.uniquepid = '035-18528' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1"} {"instruction":"What is the score for Greg Norman","input":"CREATE TABLE table_12721 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n)","response":"SELECT \"Score\" FROM table_12721 WHERE \"Player\" = 'greg norman'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for Greg Norman ### Input: CREATE TABLE table_12721 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n) ### Response: SELECT \"Score\" FROM table_12721 WHERE \"Player\" = 'greg norman'"} {"instruction":"What is the Artist with a Date that is june 1979?","input":"CREATE TABLE table_40579 (\n \"Spoofed Title\" text,\n \"Actual Title\" text,\n \"Writer\" text,\n \"Artist\" text,\n \"Issue\" real,\n \"Date\" text\n)","response":"SELECT \"Artist\" FROM table_40579 WHERE \"Date\" = 'june 1979'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Artist with a Date that is june 1979? ### Input: CREATE TABLE table_40579 (\n \"Spoofed Title\" text,\n \"Actual Title\" text,\n \"Writer\" text,\n \"Artist\" text,\n \"Issue\" real,\n \"Date\" text\n) ### Response: SELECT \"Artist\" FROM table_40579 WHERE \"Date\" = 'june 1979'"} {"instruction":"how many married patients have lab test item id 51214?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = \"MARRIED\" AND lab.itemid = \"51214\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many married patients have lab test item id 51214? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = \"MARRIED\" AND lab.itemid = \"51214\""} {"instruction":"Name the total number of series for march 19, 2000","input":"CREATE TABLE table_22590 (\n \"No. in series\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text\n)","response":"SELECT COUNT(\"No. in series\") FROM table_22590 WHERE \"Original air date\" = 'March 19, 2000'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of series for march 19, 2000 ### Input: CREATE TABLE table_22590 (\n \"No. in series\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text\n) ### Response: SELECT COUNT(\"No. in series\") FROM table_22590 WHERE \"Original air date\" = 'March 19, 2000'"} {"instruction":"What is the line of the station in Toolamba that is currently demolished and closed in the late 1970s?","input":"CREATE TABLE table_14710 (\n \"Name\" text,\n \"Line\" text,\n \"Location\" text,\n \"Closed\" text,\n \"Current Status\" text\n)","response":"SELECT \"Line\" FROM table_14710 WHERE \"Current Status\" = 'demolished' AND \"Closed\" = 'late 1970s' AND \"Location\" = 'toolamba'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the line of the station in Toolamba that is currently demolished and closed in the late 1970s? ### Input: CREATE TABLE table_14710 (\n \"Name\" text,\n \"Line\" text,\n \"Location\" text,\n \"Closed\" text,\n \"Current Status\" text\n) ### Response: SELECT \"Line\" FROM table_14710 WHERE \"Current Status\" = 'demolished' AND \"Closed\" = 'late 1970s' AND \"Location\" = 'toolamba'"} {"instruction":"What is every value on Thursday August 25 for rank 3?","input":"CREATE TABLE table_30058355_3 (\n thurs_25_aug VARCHAR,\n rank VARCHAR\n)","response":"SELECT thurs_25_aug FROM table_30058355_3 WHERE rank = 3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every value on Thursday August 25 for rank 3? ### Input: CREATE TABLE table_30058355_3 (\n thurs_25_aug VARCHAR,\n rank VARCHAR\n) ### Response: SELECT thurs_25_aug FROM table_30058355_3 WHERE rank = 3"} {"instruction":"what diagnosis did patient 025-53910 receive last?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53910')) ORDER BY diagnosis.diagnosistime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what diagnosis did patient 025-53910 receive last? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53910')) ORDER BY diagnosis.diagnosistime DESC LIMIT 1"} {"instruction":"What is the location for the club trophy?","input":"CREATE TABLE table_name_69 (\n location VARCHAR,\n type VARCHAR\n)","response":"SELECT location FROM table_name_69 WHERE type = \"club trophy\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the location for the club trophy? ### Input: CREATE TABLE table_name_69 (\n location VARCHAR,\n type VARCHAR\n) ### Response: SELECT location FROM table_name_69 WHERE type = \"club trophy\""} {"instruction":"How many values of total top 3 placements does Taiwan have?","input":"CREATE TABLE table_2876467_3 (\n total_top_3_placements VARCHAR,\n region_represented VARCHAR\n)","response":"SELECT COUNT(total_top_3_placements) FROM table_2876467_3 WHERE region_represented = \"Taiwan\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many values of total top 3 placements does Taiwan have? ### Input: CREATE TABLE table_2876467_3 (\n total_top_3_placements VARCHAR,\n region_represented VARCHAR\n) ### Response: SELECT COUNT(total_top_3_placements) FROM table_2876467_3 WHERE region_represented = \"Taiwan\""} {"instruction":"What are the names of the airports in the city of Goroka?","input":"CREATE TABLE airlines (\n alid number,\n name text,\n iata text,\n icao text,\n callsign text,\n country text,\n active text\n)\n\nCREATE TABLE airports (\n apid number,\n name text,\n city text,\n country text,\n x number,\n y number,\n elevation number,\n iata text,\n icao text\n)\n\nCREATE TABLE routes (\n rid number,\n dst_apid number,\n dst_ap text,\n src_apid number,\n src_ap text,\n alid number,\n airline text,\n codeshare text\n)","response":"SELECT name FROM airports WHERE city = 'Goroka'","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of the airports in the city of Goroka? ### Input: CREATE TABLE airlines (\n alid number,\n name text,\n iata text,\n icao text,\n callsign text,\n country text,\n active text\n)\n\nCREATE TABLE airports (\n apid number,\n name text,\n city text,\n country text,\n x number,\n y number,\n elevation number,\n iata text,\n icao text\n)\n\nCREATE TABLE routes (\n rid number,\n dst_apid number,\n dst_ap text,\n src_apid number,\n src_ap text,\n alid number,\n airline text,\n codeshare text\n) ### Response: SELECT name FROM airports WHERE city = 'Goroka'"} {"instruction":"Questions by date - backwards.","input":"CREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)","response":"SELECT Id, Score, ViewCount, Title, Tags, LastActivityDate, CreationDate FROM Posts WHERE PostTypeId = 1 ORDER BY CreationDate LIMIT 50","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions by date - backwards. ### Input: CREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n) ### Response: SELECT Id, Score, ViewCount, Title, Tags, LastActivityDate, CreationDate FROM Posts WHERE PostTypeId = 1 ORDER BY CreationDate LIMIT 50"} {"instruction":"What is the Date for the game at michie stadium west point, ny?","input":"CREATE TABLE table_name_80 (\n date VARCHAR,\n location VARCHAR\n)","response":"SELECT date FROM table_name_80 WHERE location = \"michie stadium \u2022 west point, ny\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date for the game at michie stadium west point, ny? ### Input: CREATE TABLE table_name_80 (\n date VARCHAR,\n location VARCHAR\n) ### Response: SELECT date FROM table_name_80 WHERE location = \"michie stadium \u2022 west point, ny\""} {"instruction":"Can you tell me the highest Against that has the Losses larger than 9, and the Byes of 2, and the Draws larger than 0?","input":"CREATE TABLE table_name_56 (\n against INTEGER,\n draws VARCHAR,\n losses VARCHAR,\n byes VARCHAR\n)","response":"SELECT MAX(against) FROM table_name_56 WHERE losses > 9 AND byes = 2 AND draws > 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the highest Against that has the Losses larger than 9, and the Byes of 2, and the Draws larger than 0? ### Input: CREATE TABLE table_name_56 (\n against INTEGER,\n draws VARCHAR,\n losses VARCHAR,\n byes VARCHAR\n) ### Response: SELECT MAX(against) FROM table_name_56 WHERE losses > 9 AND byes = 2 AND draws > 0"} {"instruction":"When is a Type of tko, and an Opponent of jesse brinkley","input":"CREATE TABLE table_name_53 (\n date VARCHAR,\n type VARCHAR,\n opponent VARCHAR\n)","response":"SELECT date FROM table_name_53 WHERE type = \"tko\" AND opponent = \"jesse brinkley\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When is a Type of tko, and an Opponent of jesse brinkley ### Input: CREATE TABLE table_name_53 (\n date VARCHAR,\n type VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT date FROM table_name_53 WHERE type = \"tko\" AND opponent = \"jesse brinkley\""} {"instruction":"What was Shaun Murphy's outcome in the Premier League Snooker championship held before 2010?","input":"CREATE TABLE table_name_1 (\n outcome VARCHAR,\n championship VARCHAR,\n year VARCHAR\n)","response":"SELECT outcome FROM table_name_1 WHERE championship = \"premier league snooker\" AND year < 2010","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Shaun Murphy's outcome in the Premier League Snooker championship held before 2010? ### Input: CREATE TABLE table_name_1 (\n outcome VARCHAR,\n championship VARCHAR,\n year VARCHAR\n) ### Response: SELECT outcome FROM table_name_1 WHERE championship = \"premier league snooker\" AND year < 2010"} {"instruction":"Which commission was launched 28 june 1934, and has a Pennant number of h.78?","input":"CREATE TABLE table_name_40 (\n commissioned VARCHAR,\n launched VARCHAR,\n pennant_number VARCHAR\n)","response":"SELECT commissioned FROM table_name_40 WHERE launched = \"28 june 1934\" AND pennant_number = \"h.78\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which commission was launched 28 june 1934, and has a Pennant number of h.78? ### Input: CREATE TABLE table_name_40 (\n commissioned VARCHAR,\n launched VARCHAR,\n pennant_number VARCHAR\n) ### Response: SELECT commissioned FROM table_name_40 WHERE launched = \"28 june 1934\" AND pennant_number = \"h.78\""} {"instruction":"Which Total Pts have a 2001 02 Pts smaller than 38?","input":"CREATE TABLE table_78639 (\n \"Team\" text,\n \"2003\\u201304 Pts\" text,\n \"2004\\u201305 Pts\" text,\n \"2001\\u201302 Pts\" real,\n \"Total Pts\" real,\n \"Total Pld\" real\n)","response":"SELECT MIN(\"Total Pts\") FROM table_78639 WHERE \"2001\\u201302 Pts\" < '38'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Total Pts have a 2001 02 Pts smaller than 38? ### Input: CREATE TABLE table_78639 (\n \"Team\" text,\n \"2003\\u201304 Pts\" text,\n \"2004\\u201305 Pts\" text,\n \"2001\\u201302 Pts\" real,\n \"Total Pts\" real,\n \"Total Pld\" real\n) ### Response: SELECT MIN(\"Total Pts\") FROM table_78639 WHERE \"2001\\u201302 Pts\" < '38'"} {"instruction":"give me the difference between the total of the input and the output of patient 26057 on 12\/27\/this year.","input":"CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)","response":"SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '12-27') - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', outputevents.charttime) = '12-27')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the difference between the total of the input and the output of patient 26057 on 12\/27\/this year. ### Input: CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n) ### Response: SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '12-27') - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', outputevents.charttime) = '12-27')"} {"instruction":"Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a line chart.","input":"CREATE TABLE Catalog_Structure (\n catalog_level_number INTEGER,\n catalog_id INTEGER,\n catalog_level_name VARCHAR(50)\n)\n\nCREATE TABLE Catalogs (\n catalog_id INTEGER,\n catalog_name VARCHAR(50),\n catalog_publisher VARCHAR(80),\n date_of_publication DATETIME,\n date_of_latest_revision DATETIME\n)\n\nCREATE TABLE Catalog_Contents_Additional_Attributes (\n catalog_entry_id INTEGER,\n catalog_level_number INTEGER,\n attribute_id INTEGER,\n attribute_value VARCHAR(255)\n)\n\nCREATE TABLE Catalog_Contents (\n catalog_entry_id INTEGER,\n catalog_level_number INTEGER,\n parent_entry_id INTEGER,\n previous_entry_id INTEGER,\n next_entry_id INTEGER,\n catalog_entry_name VARCHAR(80),\n product_stock_number VARCHAR(50),\n price_in_dollars DOUBLE,\n price_in_euros DOUBLE,\n price_in_pounds DOUBLE,\n capacity VARCHAR(20),\n length VARCHAR(20),\n height VARCHAR(20),\n width VARCHAR(20)\n)\n\nCREATE TABLE Attribute_Definitions (\n attribute_id INTEGER,\n attribute_name VARCHAR(30),\n attribute_data_type VARCHAR(10)\n)","response":"SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a line chart. ### Input: CREATE TABLE Catalog_Structure (\n catalog_level_number INTEGER,\n catalog_id INTEGER,\n catalog_level_name VARCHAR(50)\n)\n\nCREATE TABLE Catalogs (\n catalog_id INTEGER,\n catalog_name VARCHAR(50),\n catalog_publisher VARCHAR(80),\n date_of_publication DATETIME,\n date_of_latest_revision DATETIME\n)\n\nCREATE TABLE Catalog_Contents_Additional_Attributes (\n catalog_entry_id INTEGER,\n catalog_level_number INTEGER,\n attribute_id INTEGER,\n attribute_value VARCHAR(255)\n)\n\nCREATE TABLE Catalog_Contents (\n catalog_entry_id INTEGER,\n catalog_level_number INTEGER,\n parent_entry_id INTEGER,\n previous_entry_id INTEGER,\n next_entry_id INTEGER,\n catalog_entry_name VARCHAR(80),\n product_stock_number VARCHAR(50),\n price_in_dollars DOUBLE,\n price_in_euros DOUBLE,\n price_in_pounds DOUBLE,\n capacity VARCHAR(20),\n length VARCHAR(20),\n height VARCHAR(20),\n width VARCHAR(20)\n)\n\nCREATE TABLE Attribute_Definitions (\n attribute_id INTEGER,\n attribute_name VARCHAR(30),\n attribute_data_type VARCHAR(10)\n) ### Response: SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs"} {"instruction":"What is the acronym for the name Malay of Kolej Komuniti Sungai Petani?","input":"CREATE TABLE table_61910 (\n \"Name in English\" text,\n \"Name in Malay\" text,\n \"Acronym\" text,\n \"Foundation\" text,\n \"Location\" text\n)","response":"SELECT \"Acronym\" FROM table_61910 WHERE \"Name in Malay\" = 'kolej komuniti sungai petani'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the acronym for the name Malay of Kolej Komuniti Sungai Petani? ### Input: CREATE TABLE table_61910 (\n \"Name in English\" text,\n \"Name in Malay\" text,\n \"Acronym\" text,\n \"Foundation\" text,\n \"Location\" text\n) ### Response: SELECT \"Acronym\" FROM table_61910 WHERE \"Name in Malay\" = 'kolej komuniti sungai petani'"} {"instruction":"What year has earnings of $557,158?","input":"CREATE TABLE table_35365 (\n \"Year\" real,\n \"Wins\" real,\n \"Earnings ($)\" text,\n \"Rank\" real,\n \"Scoring average\" real\n)","response":"SELECT MAX(\"Year\") FROM table_35365 WHERE \"Earnings ($)\" = '557,158'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year has earnings of $557,158? ### Input: CREATE TABLE table_35365 (\n \"Year\" real,\n \"Wins\" real,\n \"Earnings ($)\" text,\n \"Rank\" real,\n \"Scoring average\" real\n) ### Response: SELECT MAX(\"Year\") FROM table_35365 WHERE \"Earnings ($)\" = '557,158'"} {"instruction":"what's the points against with won being 11","input":"CREATE TABLE table_14058433_4 (\n points_against VARCHAR,\n won VARCHAR\n)","response":"SELECT points_against FROM table_14058433_4 WHERE won = \"11\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the points against with won being 11 ### Input: CREATE TABLE table_14058433_4 (\n points_against VARCHAR,\n won VARCHAR\n) ### Response: SELECT points_against FROM table_14058433_4 WHERE won = \"11\""} {"instruction":"What was the team score when Tim Duncan (12) got the high rebounds?","input":"CREATE TABLE table_29788 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Score\" FROM table_29788 WHERE \"High rebounds\" = 'Tim Duncan (12)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the team score when Tim Duncan (12) got the high rebounds? ### Input: CREATE TABLE table_29788 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Score\" FROM table_29788 WHERE \"High rebounds\" = 'Tim Duncan (12)'"} {"instruction":"what was the name of the drug that patient 433 had been prescribed two or more times?","input":"CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)","response":"SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the drug that patient 433 had been prescribed two or more times? ### Input: CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n) ### Response: SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2"} {"instruction":"did patient 027-151154 receive angiogram - with coiling at other hospitals?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'angiogram - with coiling'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 027-151154 receive angiogram - with coiling at other hospitals? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'angiogram - with coiling'"} {"instruction":"Which Constellation has an Apparent magnitude larger that 7.7, and an NGC number of 7777","input":"CREATE TABLE table_name_60 (\n constellation VARCHAR,\n apparent_magnitude VARCHAR,\n ngc_number VARCHAR\n)","response":"SELECT constellation FROM table_name_60 WHERE apparent_magnitude > 7.7 AND ngc_number = 7777","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Constellation has an Apparent magnitude larger that 7.7, and an NGC number of 7777 ### Input: CREATE TABLE table_name_60 (\n constellation VARCHAR,\n apparent_magnitude VARCHAR,\n ngc_number VARCHAR\n) ### Response: SELECT constellation FROM table_name_60 WHERE apparent_magnitude > 7.7 AND ngc_number = 7777"} {"instruction":"until 95 months ago, had entacapone ever been prescribed to patient 7241?","input":"CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)","response":"SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241) AND prescriptions.drug = 'entacapone' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-95 month')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 95 months ago, had entacapone ever been prescribed to patient 7241? ### Input: CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241) AND prescriptions.drug = 'entacapone' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-95 month')"} {"instruction":"what was last value of heart rate of patient 14467 today?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') ORDER BY chartevents.charttime DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was last value of heart rate of patient 14467 today? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') ORDER BY chartevents.charttime DESC LIMIT 1"} {"instruction":"What is the place of the Pinyin transcription Xi Wangri?","input":"CREATE TABLE table_1805919_1 (\n standard_order INTEGER,\n transcription__based_on_pinyin_ VARCHAR\n)","response":"SELECT MAX(standard_order) FROM table_1805919_1 WHERE transcription__based_on_pinyin_ = \"Xi Wangri\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the place of the Pinyin transcription Xi Wangri? ### Input: CREATE TABLE table_1805919_1 (\n standard_order INTEGER,\n transcription__based_on_pinyin_ VARCHAR\n) ### Response: SELECT MAX(standard_order) FROM table_1805919_1 WHERE transcription__based_on_pinyin_ = \"Xi Wangri\""} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by weekday.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)","response":"SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by weekday. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n) ### Response: SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)"} {"instruction":"Count the number of patients on a main drug type prescription with diagnoses icd9 code 41512.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = \"41512\" AND prescriptions.drug_type = \"MAIN\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of patients on a main drug type prescription with diagnoses icd9 code 41512. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = \"41512\" AND prescriptions.drug_type = \"MAIN\""} {"instruction":"Name the least game for score of l 93 109 (ot)","input":"CREATE TABLE table_23186738_9 (\n game INTEGER,\n score VARCHAR\n)","response":"SELECT MIN(game) FROM table_23186738_9 WHERE score = \"L 93\u2013109 (OT)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least game for score of l 93 109 (ot) ### Input: CREATE TABLE table_23186738_9 (\n game INTEGER,\n score VARCHAR\n) ### Response: SELECT MIN(game) FROM table_23186738_9 WHERE score = \"L 93\u2013109 (OT)\""} {"instruction":"Top 10 Users from India by Reputation.","input":"CREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)","response":"SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS \"#\", Id AS \"user_link\", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 100","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 10 Users from India by Reputation. ### Input: CREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS \"#\", Id AS \"user_link\", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 100"} {"instruction":"Show me about the distribution of meter_300 and meter_100 in a bar chart, and I want to show Y from low to high order.","input":"CREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)","response":"SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of meter_300 and meter_100 in a bar chart, and I want to show Y from low to high order. ### Input: CREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n) ### Response: SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100"} {"instruction":"How many completion students in each day? Return a bar chart binning date of completion by weekday, and I want to sort y-axis in asc order.","input":"CREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)","response":"SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many completion students in each day? Return a bar chart binning date of completion by weekday, and I want to sort y-axis in asc order. ### Input: CREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n) ### Response: SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion)"} {"instruction":"had patient 016-9636 excreted output amt-chest tube a in 12\/this year?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output amt-chest tube a' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', intakeoutput.intakeoutputtime) = '12'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 016-9636 excreted output amt-chest tube a in 12\/this year? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output amt-chest tube a' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', intakeoutput.intakeoutputtime) = '12'"} {"instruction":"Count the names of all the products in the store and return me a bar chart, could you order Name in asc order?","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the names of all the products in the store and return me a bar chart, could you order Name in asc order? ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name"} {"instruction":"who was the pitcher in seasons 1982, 1984, 1985, 1987, 1988, 1989","input":"CREATE TABLE table_19864214_3 (\n pitcher VARCHAR,\n seasons VARCHAR\n)","response":"SELECT pitcher FROM table_19864214_3 WHERE seasons = \"1982, 1984, 1985, 1987, 1988, 1989\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the pitcher in seasons 1982, 1984, 1985, 1987, 1988, 1989 ### Input: CREATE TABLE table_19864214_3 (\n pitcher VARCHAR,\n seasons VARCHAR\n) ### Response: SELECT pitcher FROM table_19864214_3 WHERE seasons = \"1982, 1984, 1985, 1987, 1988, 1989\""} {"instruction":"List first name and last name of customers that have more than 2 payments.","input":"CREATE TABLE Customers (\n first_name VARCHAR,\n last_name VARCHAR,\n customer_id VARCHAR\n)\n\nCREATE TABLE Customer_Payments (\n customer_id VARCHAR\n)","response":"SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List first name and last name of customers that have more than 2 payments. ### Input: CREATE TABLE Customers (\n first_name VARCHAR,\n last_name VARCHAR,\n customer_id VARCHAR\n)\n\nCREATE TABLE Customer_Payments (\n customer_id VARCHAR\n) ### Response: SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2"} {"instruction":"what was the number of patients that were tested since 5 years ago for sputum, tracheal specimen microbiology?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)","response":"SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, tracheal specimen' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-5 year'))","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the number of patients that were tested since 5 years ago for sputum, tracheal specimen microbiology? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n) ### Response: SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, tracheal specimen' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-5 year'))"} {"instruction":"What is the player listed when the score is 68-70-68-69=275","input":"CREATE TABLE table_28498999_5 (\n player VARCHAR,\n score VARCHAR\n)","response":"SELECT player FROM table_28498999_5 WHERE score = 68 - 70 - 68 - 69 = 275","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the player listed when the score is 68-70-68-69=275 ### Input: CREATE TABLE table_28498999_5 (\n player VARCHAR,\n score VARCHAR\n) ### Response: SELECT player FROM table_28498999_5 WHERE score = 68 - 70 - 68 - 69 = 275"} {"instruction":"what's the name of the specimen test that was first given to patient 40967 during the last hospital encounter?","input":"CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40967 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the name of the specimen test that was first given to patient 40967 during the last hospital encounter? ### Input: CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40967 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime LIMIT 1"} {"instruction":"What is the Loan Club from Eng that ended on 22 February?","input":"CREATE TABLE table_name_57 (\n loan_club VARCHAR,\n country VARCHAR,\n ended VARCHAR\n)","response":"SELECT loan_club FROM table_name_57 WHERE country = \"eng\" AND ended = \"22 february\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Loan Club from Eng that ended on 22 February? ### Input: CREATE TABLE table_name_57 (\n loan_club VARCHAR,\n country VARCHAR,\n ended VARCHAR\n) ### Response: SELECT loan_club FROM table_name_57 WHERE country = \"eng\" AND ended = \"22 february\""} {"instruction":"What is the maximum renewable energy (gw h) for the state of Delaware?","input":"CREATE TABLE table_25244412_1 (\n renewable_electricity__gw INTEGER,\n state VARCHAR\n)","response":"SELECT MAX(renewable_electricity__gw) AS \u2022h_ FROM table_25244412_1 WHERE state = \"Delaware\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the maximum renewable energy (gw h) for the state of Delaware? ### Input: CREATE TABLE table_25244412_1 (\n renewable_electricity__gw INTEGER,\n state VARCHAR\n) ### Response: SELECT MAX(renewable_electricity__gw) AS \u2022h_ FROM table_25244412_1 WHERE state = \"Delaware\""} {"instruction":"How many competitions in each competition type? And split them by country, show in desc by the x-axis.","input":"CREATE TABLE club (\n Club_ID int,\n name text,\n Region text,\n Start_year text\n)\n\nCREATE TABLE competition_result (\n Competition_ID int,\n Club_ID_1 int,\n Club_ID_2 int,\n Score text\n)\n\nCREATE TABLE club_rank (\n Rank real,\n Club_ID int,\n Gold real,\n Silver real,\n Bronze real,\n Total real\n)\n\nCREATE TABLE competition (\n Competition_ID int,\n Year real,\n Competition_type text,\n Country text\n)\n\nCREATE TABLE player (\n Player_ID int,\n name text,\n Position text,\n Club_ID int,\n Apps real,\n Tries real,\n Goals text,\n Points real\n)","response":"SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many competitions in each competition type? And split them by country, show in desc by the x-axis. ### Input: CREATE TABLE club (\n Club_ID int,\n name text,\n Region text,\n Start_year text\n)\n\nCREATE TABLE competition_result (\n Competition_ID int,\n Club_ID_1 int,\n Club_ID_2 int,\n Score text\n)\n\nCREATE TABLE club_rank (\n Rank real,\n Club_ID int,\n Gold real,\n Silver real,\n Bronze real,\n Total real\n)\n\nCREATE TABLE competition (\n Competition_ID int,\n Year real,\n Competition_type text,\n Country text\n)\n\nCREATE TABLE player (\n Player_ID int,\n name text,\n Position text,\n Club_ID int,\n Apps real,\n Tries real,\n Goals text,\n Points real\n) ### Response: SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country DESC"} {"instruction":"Which game had a result of 126-95?","input":"CREATE TABLE table_75338 (\n \"Game\" text,\n \"Date\" text,\n \"Home Team\" text,\n \"Result\" text,\n \"Road Team\" text\n)","response":"SELECT \"Game\" FROM table_75338 WHERE \"Result\" = '126-95'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which game had a result of 126-95? ### Input: CREATE TABLE table_75338 (\n \"Game\" text,\n \"Date\" text,\n \"Home Team\" text,\n \"Result\" text,\n \"Road Team\" text\n) ### Response: SELECT \"Game\" FROM table_75338 WHERE \"Result\" = '126-95'"} {"instruction":"All posts of a user.","input":"CREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)","response":"SELECT OwnerUserId AS \"user_link\", u.DisplayName, p.Id AS \"post_link\", ParentId AS \"post_link\", Title FROM Posts AS p LEFT OUTER JOIN Users AS u ON u.Id = OwnerUserId WHERE OwnerUserId = 65889","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: All posts of a user. ### Input: CREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n) ### Response: SELECT OwnerUserId AS \"user_link\", u.DisplayName, p.Id AS \"post_link\", ParentId AS \"post_link\", Title FROM Posts AS p LEFT OUTER JOIN Users AS u ON u.Id = OwnerUserId WHERE OwnerUserId = 65889"} {"instruction":"In which club is Ledley King a captain?","input":"CREATE TABLE table_name_3 (\n club VARCHAR,\n captain VARCHAR\n)","response":"SELECT club FROM table_name_3 WHERE captain = \"ledley king\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In which club is Ledley King a captain? ### Input: CREATE TABLE table_name_3 (\n club VARCHAR,\n captain VARCHAR\n) ### Response: SELECT club FROM table_name_3 WHERE captain = \"ledley king\""} {"instruction":"Which team had 21 points?","input":"CREATE TABLE table_20007 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Won\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"For\" real,\n \"Against\" real,\n \"Difference\" text\n)","response":"SELECT \"Team\" FROM table_20007 WHERE \"Points\" = '21'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team had 21 points? ### Input: CREATE TABLE table_20007 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Won\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"For\" real,\n \"Against\" real,\n \"Difference\" text\n) ### Response: SELECT \"Team\" FROM table_20007 WHERE \"Points\" = '21'"} {"instruction":"With Round 3 and Pick # over 10, what is the higher Overall number?","input":"CREATE TABLE table_name_38 (\n overall INTEGER,\n round VARCHAR,\n pick__number VARCHAR\n)","response":"SELECT MAX(overall) FROM table_name_38 WHERE round = 3 AND pick__number > 10","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With Round 3 and Pick # over 10, what is the higher Overall number? ### Input: CREATE TABLE table_name_38 (\n overall INTEGER,\n round VARCHAR,\n pick__number VARCHAR\n) ### Response: SELECT MAX(overall) FROM table_name_38 WHERE round = 3 AND pick__number > 10"} {"instruction":"Who is the tournament winner in the Atlantic Coast Conference?","input":"CREATE TABLE table_22779004_1 (\n tournament_winner VARCHAR,\n conference VARCHAR\n)","response":"SELECT tournament_winner FROM table_22779004_1 WHERE conference = \"Atlantic Coast conference\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the tournament winner in the Atlantic Coast Conference? ### Input: CREATE TABLE table_22779004_1 (\n tournament_winner VARCHAR,\n conference VARCHAR\n) ### Response: SELECT tournament_winner FROM table_22779004_1 WHERE conference = \"Atlantic Coast conference\""} {"instruction":"what is the latest FIRST class flight of the day leaving DALLAS for SAN FRANCISCO","input":"CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time = (SELECT MAX(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, fare_basis AS FARE_BASISalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE (CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'SAN FRANCISCO' AND FARE_BASISalias1.class_type = 'FIRST' AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code)","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the latest FIRST class flight of the day leaving DALLAS for SAN FRANCISCO ### Input: CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time = (SELECT MAX(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, fare_basis AS FARE_BASISalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE (CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'SAN FRANCISCO' AND FARE_BASISalias1.class_type = 'FIRST' AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code)"} {"instruction":"has patient 030-8973 had any enteral osmolte 1.5 intake since 66 months ago.","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'enteral osmolte 1.5' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-66 month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 030-8973 had any enteral osmolte 1.5 intake since 66 months ago. ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'enteral osmolte 1.5' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-66 month')"} {"instruction":"which district has the greatest total number of electorates ?","input":"CREATE TABLE table_204_255 (\n id number,\n \"constituency number\" number,\n \"name\" text,\n \"reserved for (sc\/st\/none)\" text,\n \"district\" text,\n \"number of electorates (2009)\" number\n)","response":"SELECT \"district\" FROM table_204_255 GROUP BY \"district\" ORDER BY SUM(\"number of electorates (2009)\") DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which district has the greatest total number of electorates ? ### Input: CREATE TABLE table_204_255 (\n id number,\n \"constituency number\" number,\n \"name\" text,\n \"reserved for (sc\/st\/none)\" text,\n \"district\" text,\n \"number of electorates (2009)\" number\n) ### Response: SELECT \"district\" FROM table_204_255 GROUP BY \"district\" ORDER BY SUM(\"number of electorates (2009)\") DESC LIMIT 1"} {"instruction":"What is the title and source for the game developed by Hydravision Entertainment?","input":"CREATE TABLE table_3580 (\n \"Title and source\" text,\n \"Developer\" text,\n \"Publisher\" text,\n \"First released\" text,\n \"Japan\" text,\n \"Europe\" text,\n \"North America\" text,\n \"Exclusive\" text,\n \"Move-only\" text\n)","response":"SELECT \"Title and source\" FROM table_3580 WHERE \"Developer\" = 'Hydravision Entertainment'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title and source for the game developed by Hydravision Entertainment? ### Input: CREATE TABLE table_3580 (\n \"Title and source\" text,\n \"Developer\" text,\n \"Publisher\" text,\n \"First released\" text,\n \"Japan\" text,\n \"Europe\" text,\n \"North America\" text,\n \"Exclusive\" text,\n \"Move-only\" text\n) ### Response: SELECT \"Title and source\" FROM table_3580 WHERE \"Developer\" = 'Hydravision Entertainment'"} {"instruction":"give me the number of patients whose year of death is less than or equal to 2158 and procedure icd9 code is 3615?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= \"2158.0\" AND procedures.icd9_code = \"3615\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose year of death is less than or equal to 2158 and procedure icd9 code is 3615? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= \"2158.0\" AND procedures.icd9_code = \"3615\""} {"instruction":"Which college has fewer than 2 rounds?","input":"CREATE TABLE table_35540 (\n \"Round\" real,\n \"Pick #\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT \"College\" FROM table_35540 WHERE \"Round\" < '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which college has fewer than 2 rounds? ### Input: CREATE TABLE table_35540 (\n \"Round\" real,\n \"Pick #\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT \"College\" FROM table_35540 WHERE \"Round\" < '2'"} {"instruction":"What was the score for a game with the odds of p + 2 after 1847?","input":"CREATE TABLE table_name_36 (\n score VARCHAR,\n odds VARCHAR,\n date VARCHAR\n)","response":"SELECT score FROM table_name_36 WHERE odds = \"p + 2\" AND date > 1847","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score for a game with the odds of p + 2 after 1847? ### Input: CREATE TABLE table_name_36 (\n score VARCHAR,\n odds VARCHAR,\n date VARCHAR\n) ### Response: SELECT score FROM table_name_36 WHERE odds = \"p + 2\" AND date > 1847"} {"instruction":"What is the district with the result mac collins (r) unopposed?","input":"CREATE TABLE table_27021001_1 (\n district VARCHAR,\n result VARCHAR\n)","response":"SELECT district FROM table_27021001_1 WHERE result = \"Mac Collins (R) unopposed\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the district with the result mac collins (r) unopposed? ### Input: CREATE TABLE table_27021001_1 (\n district VARCHAR,\n result VARCHAR\n) ### Response: SELECT district FROM table_27021001_1 WHERE result = \"Mac Collins (R) unopposed\""} {"instruction":"what are the four most commonly prescribed drugs for patients who are prescribed cefepime at the same time?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)","response":"SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'cefepime') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most commonly prescribed drugs for patients who are prescribed cefepime at the same time? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'cefepime') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4"} {"instruction":"Name the least world rank for south american rank 3","input":"CREATE TABLE table_2249087_1 (\n world_rank INTEGER,\n south_american_rank VARCHAR\n)","response":"SELECT MIN(world_rank) FROM table_2249087_1 WHERE south_american_rank = 3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least world rank for south american rank 3 ### Input: CREATE TABLE table_2249087_1 (\n world_rank INTEGER,\n south_american_rank VARCHAR\n) ### Response: SELECT MIN(world_rank) FROM table_2249087_1 WHERE south_american_rank = 3"} {"instruction":"what is the color quality when the proxy is x, the encryption is x, the webclient is x and authentication is ?","input":"CREATE TABLE table_65068 (\n \"Project\" text,\n \"License\" text,\n \"Date\" text,\n \"Protocol\" text,\n \"Technology\" text,\n \"Server\" text,\n \"Client\" text,\n \"Web Client\" text,\n \"Multiple Sessions\" text,\n \"Encryption\" text,\n \"Authentication\" text,\n \"Data Compression\" text,\n \"Image Quality\" text,\n \"Color Quality\" text,\n \"File Transfer\" text,\n \"Clipboard Transfer\" text,\n \"Chat\" text,\n \"Relay\" text,\n \"HTTP Tunnel\" text,\n \"Proxy\" text\n)","response":"SELECT \"Color Quality\" FROM table_65068 WHERE \"Proxy\" = 'x' AND \"Encryption\" = 'x' AND \"Web Client\" = 'x' AND \"Authentication\" = '\u2713'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the color quality when the proxy is x, the encryption is x, the webclient is x and authentication is ? ### Input: CREATE TABLE table_65068 (\n \"Project\" text,\n \"License\" text,\n \"Date\" text,\n \"Protocol\" text,\n \"Technology\" text,\n \"Server\" text,\n \"Client\" text,\n \"Web Client\" text,\n \"Multiple Sessions\" text,\n \"Encryption\" text,\n \"Authentication\" text,\n \"Data Compression\" text,\n \"Image Quality\" text,\n \"Color Quality\" text,\n \"File Transfer\" text,\n \"Clipboard Transfer\" text,\n \"Chat\" text,\n \"Relay\" text,\n \"HTTP Tunnel\" text,\n \"Proxy\" text\n) ### Response: SELECT \"Color Quality\" FROM table_65068 WHERE \"Proxy\" = 'x' AND \"Encryption\" = 'x' AND \"Web Client\" = 'x' AND \"Authentication\" = '\u2713'"} {"instruction":"Which Advanced Portuguese courses have 8 credits , can you show me ?","input":"CREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)","response":"SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Portuguese%' OR name LIKE '%Advanced Portuguese%') AND credits = 8","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Advanced Portuguese courses have 8 credits , can you show me ? ### Input: CREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n) ### Response: SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Portuguese%' OR name LIKE '%Advanced Portuguese%') AND credits = 8"} {"instruction":"select Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId from Posts inner join PostLinks O.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)","response":"SELECT Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId FROM Posts INNER JOIN PostLinks ON PostLinks.LinkTypeId = 3 AND (Posts.Id = PostLinks.PostId OR Posts.Id = PostLinks.RelatedPostId)","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: select Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId from Posts inner join PostLinks O. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n) ### Response: SELECT Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId FROM Posts INNER JOIN PostLinks ON PostLinks.LinkTypeId = 3 AND (Posts.Id = PostLinks.PostId OR Posts.Id = PostLinks.RelatedPostId)"} {"instruction":"How many faculty members did the university that conferred the most degrees in 2002 have?","input":"CREATE TABLE discipline_enrollments (\n campus number,\n discipline number,\n year number,\n undergraduate number,\n graduate number\n)\n\nCREATE TABLE csu_fees (\n campus number,\n year number,\n campusfee number\n)\n\nCREATE TABLE enrollments (\n campus number,\n year number,\n totalenrollment_ay number,\n fte_ay number\n)\n\nCREATE TABLE degrees (\n year number,\n campus number,\n degrees number\n)\n\nCREATE TABLE faculty (\n campus number,\n year number,\n faculty number\n)\n\nCREATE TABLE campuses (\n id number,\n campus text,\n location text,\n county text,\n year number\n)","response":"SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members did the university that conferred the most degrees in 2002 have? ### Input: CREATE TABLE discipline_enrollments (\n campus number,\n discipline number,\n year number,\n undergraduate number,\n graduate number\n)\n\nCREATE TABLE csu_fees (\n campus number,\n year number,\n campusfee number\n)\n\nCREATE TABLE enrollments (\n campus number,\n year number,\n totalenrollment_ay number,\n fte_ay number\n)\n\nCREATE TABLE degrees (\n year number,\n campus number,\n degrees number\n)\n\nCREATE TABLE faculty (\n campus number,\n year number,\n faculty number\n)\n\nCREATE TABLE campuses (\n id number,\n campus text,\n location text,\n county text,\n year number\n) ### Response: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1"} {"instruction":"which was the first state to be formed ?","input":"CREATE TABLE table_203_190 (\n id number,\n \"name\" text,\n \"type\" text,\n \"circle\" text,\n \"bench\" text,\n \"formed\" number,\n \"notes\" text\n)","response":"SELECT \"name\" FROM table_203_190 ORDER BY \"formed\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which was the first state to be formed ? ### Input: CREATE TABLE table_203_190 (\n id number,\n \"name\" text,\n \"type\" text,\n \"circle\" text,\n \"bench\" text,\n \"formed\" number,\n \"notes\" text\n) ### Response: SELECT \"name\" FROM table_203_190 ORDER BY \"formed\" LIMIT 1"} {"instruction":"what was the number of winners from spain ?","input":"CREATE TABLE table_203_600 (\n id number,\n \"rank\" text,\n \"country\" text,\n \"winners\" number,\n \"runners-up\" number,\n \"finals total\" number\n)","response":"SELECT \"winners\" FROM table_203_600 WHERE \"country\" = 'spain'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the number of winners from spain ? ### Input: CREATE TABLE table_203_600 (\n id number,\n \"rank\" text,\n \"country\" text,\n \"winners\" number,\n \"runners-up\" number,\n \"finals total\" number\n) ### Response: SELECT \"winners\" FROM table_203_600 WHERE \"country\" = 'spain'"} {"instruction":"how many patients were diagnosed as having transaminase elevation within 2 months after being diagnosed with hypoglycemia?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)","response":"SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'transaminase elevation') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoglycemia') AS t2 WHERE t1.diagnosistime < t2.diagnosistime AND DATETIME(t2.diagnosistime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients were diagnosed as having transaminase elevation within 2 months after being diagnosed with hypoglycemia? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n) ### Response: SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'transaminase elevation') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoglycemia') AS t2 WHERE t1.diagnosistime < t2.diagnosistime AND DATETIME(t2.diagnosistime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')"} {"instruction":"Calculate the total number of patients admitted before the year 2174","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < \"2174\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Calculate the total number of patients admitted before the year 2174 ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < \"2174\""} {"instruction":"What is the for the f136fb engine?","input":"CREATE TABLE table_14101 (\n \"Engine\" text,\n \"Displacement\" text,\n \"Years\" text,\n \"Usage\" text,\n \"Power\" text\n)","response":"SELECT \"Usage\" FROM table_14101 WHERE \"Engine\" = 'f136fb'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the for the f136fb engine? ### Input: CREATE TABLE table_14101 (\n \"Engine\" text,\n \"Displacement\" text,\n \"Years\" text,\n \"Usage\" text,\n \"Power\" text\n) ### Response: SELECT \"Usage\" FROM table_14101 WHERE \"Engine\" = 'f136fb'"} {"instruction":"When middle assyrian empire is the ubaid period in mesopotamia what is the copper age?","input":"CREATE TABLE table_23537091_1 (\n copper_age VARCHAR,\n ubaid_period_in_mesopotamia VARCHAR\n)","response":"SELECT copper_age FROM table_23537091_1 WHERE ubaid_period_in_mesopotamia = \"Middle Assyrian Empire\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When middle assyrian empire is the ubaid period in mesopotamia what is the copper age? ### Input: CREATE TABLE table_23537091_1 (\n copper_age VARCHAR,\n ubaid_period_in_mesopotamia VARCHAR\n) ### Response: SELECT copper_age FROM table_23537091_1 WHERE ubaid_period_in_mesopotamia = \"Middle Assyrian Empire\""} {"instruction":"Top 100K users by hit rate (accepted answer percentage rate). 100 users having the highest accepted answer percentage rate (among users with >100 answers)","input":"CREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)","response":"SELECT u.Id AS \"user_link\", COUNT(a.Id), (CAST(SUM(CASE WHEN a.Id = q.AcceptedAnswerId THEN 1 ELSE 0 END) AS FLOAT) \/ COUNT(a.Id)) * 100 AS HitRate FROM Users AS u JOIN Posts AS a ON a.OwnerUserId = u.Id AND a.PostTypeId = 2 JOIN Posts AS q ON a.ParentId = q.Id GROUP BY u.Id HAVING COUNT(a.Id) > 25 ORDER BY HitRate DESC LIMIT 100000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 100K users by hit rate (accepted answer percentage rate). 100 users having the highest accepted answer percentage rate (among users with >100 answers) ### Input: CREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n) ### Response: SELECT u.Id AS \"user_link\", COUNT(a.Id), (CAST(SUM(CASE WHEN a.Id = q.AcceptedAnswerId THEN 1 ELSE 0 END) AS FLOAT) \/ COUNT(a.Id)) * 100 AS HitRate FROM Users AS u JOIN Posts AS a ON a.OwnerUserId = u.Id AND a.PostTypeId = 2 JOIN Posts AS q ON a.ParentId = q.Id GROUP BY u.Id HAVING COUNT(a.Id) > 25 ORDER BY HitRate DESC LIMIT 100000"} {"instruction":"How many Against have a Team of hespanha, and Points smaller than 30?","input":"CREATE TABLE table_40250 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Against\" real,\n \"Difference\" text\n)","response":"SELECT COUNT(\"Against\") FROM table_40250 WHERE \"Team\" = 'hespanha' AND \"Points\" < '30'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Against have a Team of hespanha, and Points smaller than 30? ### Input: CREATE TABLE table_40250 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Against\" real,\n \"Difference\" text\n) ### Response: SELECT COUNT(\"Against\") FROM table_40250 WHERE \"Team\" = 'hespanha' AND \"Points\" < '30'"} {"instruction":"Name the market value for rhb capital","input":"CREATE TABLE table_73087 (\n \"World Rank\" real,\n \"Company\" text,\n \"Industry\" text,\n \"Revenue (billion $)\" text,\n \"Profits (billion $)\" text,\n \"Assets (billion $)\" text,\n \"Market Value (billion $)\" text\n)","response":"SELECT \"Market Value (billion $)\" FROM table_73087 WHERE \"Company\" = 'RHB Capital'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the market value for rhb capital ### Input: CREATE TABLE table_73087 (\n \"World Rank\" real,\n \"Company\" text,\n \"Industry\" text,\n \"Revenue (billion $)\" text,\n \"Profits (billion $)\" text,\n \"Assets (billion $)\" text,\n \"Market Value (billion $)\" text\n) ### Response: SELECT \"Market Value (billion $)\" FROM table_73087 WHERE \"Company\" = 'RHB Capital'"} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time, could you list total number of employee id in ascending order?","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time, could you list total number of employee id in ascending order? ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID)"} {"instruction":"who is the replacement when the team is milton keynes dons?","input":"CREATE TABLE table_name_10 (\n replaced_by VARCHAR,\n team VARCHAR\n)","response":"SELECT replaced_by FROM table_name_10 WHERE team = \"milton keynes dons\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the replacement when the team is milton keynes dons? ### Input: CREATE TABLE table_name_10 (\n replaced_by VARCHAR,\n team VARCHAR\n) ### Response: SELECT replaced_by FROM table_name_10 WHERE team = \"milton keynes dons\""} {"instruction":"What is Name, when Authors are Kammerer & Sidor?","input":"CREATE TABLE table_name_51 (\n name VARCHAR,\n authors VARCHAR\n)","response":"SELECT name FROM table_name_51 WHERE authors = \"kammerer & sidor\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Name, when Authors are Kammerer & Sidor? ### Input: CREATE TABLE table_name_51 (\n name VARCHAR,\n authors VARCHAR\n) ### Response: SELECT name FROM table_name_51 WHERE authors = \"kammerer & sidor\""} {"instruction":"What is every value for Under-17 if Under-15 is Maria Elena Ubina?","input":"CREATE TABLE table_26368963_2 (\n under_17 VARCHAR,\n under_15 VARCHAR\n)","response":"SELECT under_17 FROM table_26368963_2 WHERE under_15 = \"Maria Elena Ubina\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every value for Under-17 if Under-15 is Maria Elena Ubina? ### Input: CREATE TABLE table_26368963_2 (\n under_17 VARCHAR,\n under_15 VARCHAR\n) ### Response: SELECT under_17 FROM table_26368963_2 WHERE under_15 = \"Maria Elena Ubina\""} {"instruction":"What league has a value of 0 29 (152) for Europe?","input":"CREATE TABLE table_15444 (\n \"Name\" text,\n \"Years\" text,\n \"League\" text,\n \"FA Cup\" text,\n \"League Cup\" text,\n \"Europe\" text,\n \"Other [C ]\" text,\n \"Total\" text\n)","response":"SELECT \"League\" FROM table_15444 WHERE \"Europe\" = '0 29 (152)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What league has a value of 0 29 (152) for Europe? ### Input: CREATE TABLE table_15444 (\n \"Name\" text,\n \"Years\" text,\n \"League\" text,\n \"FA Cup\" text,\n \"League Cup\" text,\n \"Europe\" text,\n \"Other [C ]\" text,\n \"Total\" text\n) ### Response: SELECT \"League\" FROM table_15444 WHERE \"Europe\" = '0 29 (152)'"} {"instruction":"Which Tally has a County of limerick, and a Rank larger than 1?","input":"CREATE TABLE table_13261 (\n \"Rank\" real,\n \"Player\" text,\n \"County\" text,\n \"Tally\" text,\n \"Total\" real,\n \"Opposition\" text\n)","response":"SELECT \"Tally\" FROM table_13261 WHERE \"County\" = 'limerick' AND \"Rank\" > '1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Tally has a County of limerick, and a Rank larger than 1? ### Input: CREATE TABLE table_13261 (\n \"Rank\" real,\n \"Player\" text,\n \"County\" text,\n \"Tally\" text,\n \"Total\" real,\n \"Opposition\" text\n) ### Response: SELECT \"Tally\" FROM table_13261 WHERE \"County\" = 'limerick' AND \"Rank\" > '1'"} {"instruction":"count the number of patients who have received a coronar arteriogr-2 cath procedure in the same hospital visit after having received a partial ostectomy nec.","input":"CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)","response":"SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'partial ostectomy nec')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-2 cath')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have received a coronar arteriogr-2 cath procedure in the same hospital visit after having received a partial ostectomy nec. ### Input: CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'partial ostectomy nec')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-2 cath')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id"} {"instruction":"papers written by authors Richard Ladner and Linda Shapiro","input":"CREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)","response":"SELECT DISTINCT WRITES_0.paperid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Richard Ladner' AND AUTHOR_1.authorname = 'Linda Shapiro' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: papers written by authors Richard Ladner and Linda Shapiro ### Input: CREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n) ### Response: SELECT DISTINCT WRITES_0.paperid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Richard Ladner' AND AUTHOR_1.authorname = 'Linda Shapiro' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid"} {"instruction":"Name the highest Comp which has a Yds\/game larger than 0, bostick, and a Rating smaller than 91.77?","input":"CREATE TABLE table_name_19 (\n comp INTEGER,\n rating VARCHAR,\n yds_game VARCHAR,\n name VARCHAR\n)","response":"SELECT MAX(comp) FROM table_name_19 WHERE yds_game > 0 AND name = \"bostick\" AND rating < 91.77","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the highest Comp which has a Yds\/game larger than 0, bostick, and a Rating smaller than 91.77? ### Input: CREATE TABLE table_name_19 (\n comp INTEGER,\n rating VARCHAR,\n yds_game VARCHAR,\n name VARCHAR\n) ### Response: SELECT MAX(comp) FROM table_name_19 WHERE yds_game > 0 AND name = \"bostick\" AND rating < 91.77"} {"instruction":"What is year Built of the Moulin de Momalle Mill?","input":"CREATE TABLE table_79591 (\n \"Location\" text,\n \"Name of mill\" text,\n \"Type\" text,\n \"Built\" real,\n \"Notes\" text\n)","response":"SELECT MAX(\"Built\") FROM table_79591 WHERE \"Name of mill\" = 'moulin de momalle'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is year Built of the Moulin de Momalle Mill? ### Input: CREATE TABLE table_79591 (\n \"Location\" text,\n \"Name of mill\" text,\n \"Type\" text,\n \"Built\" real,\n \"Notes\" text\n) ### Response: SELECT MAX(\"Built\") FROM table_79591 WHERE \"Name of mill\" = 'moulin de momalle'"} {"instruction":"If Thursday 3 June is 20' 27.93 110.615mph, what are the names of the riders?","input":"CREATE TABLE table_25220821_3 (\n rider VARCHAR,\n thurs_3_june VARCHAR\n)","response":"SELECT rider FROM table_25220821_3 WHERE thurs_3_june = \"20' 27.93 110.615mph\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If Thursday 3 June is 20' 27.93 110.615mph, what are the names of the riders? ### Input: CREATE TABLE table_25220821_3 (\n rider VARCHAR,\n thurs_3_june VARCHAR\n) ### Response: SELECT rider FROM table_25220821_3 WHERE thurs_3_june = \"20' 27.93 110.615mph\""} {"instruction":"What is the total subframe count with Bits of 18 22?","input":"CREATE TABLE table_name_48 (\n subframe__number INTEGER,\n bits VARCHAR\n)","response":"SELECT SUM(subframe__number) FROM table_name_48 WHERE bits = \"18\u201322\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total subframe count with Bits of 18 22? ### Input: CREATE TABLE table_name_48 (\n subframe__number INTEGER,\n bits VARCHAR\n) ### Response: SELECT SUM(subframe__number) FROM table_name_48 WHERE bits = \"18\u201322\""} {"instruction":"What is the total capacity of venues that opened in 1999?","input":"CREATE TABLE table_name_15 (\n capacity VARCHAR,\n opened VARCHAR\n)","response":"SELECT COUNT(capacity) FROM table_name_15 WHERE opened = \"1999\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total capacity of venues that opened in 1999? ### Input: CREATE TABLE table_name_15 (\n capacity VARCHAR,\n opened VARCHAR\n) ### Response: SELECT COUNT(capacity) FROM table_name_15 WHERE opened = \"1999\""} {"instruction":"What date is week 3?","input":"CREATE TABLE table_name_77 (\n date VARCHAR,\n week VARCHAR\n)","response":"SELECT date FROM table_name_77 WHERE week = 3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date is week 3? ### Input: CREATE TABLE table_name_77 (\n date VARCHAR,\n week VARCHAR\n) ### Response: SELECT date FROM table_name_77 WHERE week = 3"} {"instruction":"Name the most middle schools for 2005-2006","input":"CREATE TABLE table_2367847_2 (\n middle_schools INTEGER,\n year VARCHAR\n)","response":"SELECT MAX(middle_schools) FROM table_2367847_2 WHERE year = \"2005-2006\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most middle schools for 2005-2006 ### Input: CREATE TABLE table_2367847_2 (\n middle_schools INTEGER,\n year VARCHAR\n) ### Response: SELECT MAX(middle_schools) FROM table_2367847_2 WHERE year = \"2005-2006\""} {"instruction":"What was the record set during the game played at Hubert H. Humphrey Metrodome?","input":"CREATE TABLE table_13258851_2 (\n record VARCHAR,\n game_site VARCHAR\n)","response":"SELECT record FROM table_13258851_2 WHERE game_site = \"Hubert H. Humphrey Metrodome\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record set during the game played at Hubert H. Humphrey Metrodome? ### Input: CREATE TABLE table_13258851_2 (\n record VARCHAR,\n game_site VARCHAR\n) ### Response: SELECT record FROM table_13258851_2 WHERE game_site = \"Hubert H. Humphrey Metrodome\""} {"instruction":"does air florida have more or less than four aircrafts scheduled ?","input":"CREATE TABLE table_204_215 (\n id number,\n \"airline\" text,\n \"destination(s)\" text,\n \"aircraft scheduled\" text,\n \"service date(s)\" text,\n \"comments\" text\n)","response":"SELECT (SELECT \"aircraft scheduled\" FROM table_204_215 WHERE \"airline\" = 'air florida') > 4","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does air florida have more or less than four aircrafts scheduled ? ### Input: CREATE TABLE table_204_215 (\n id number,\n \"airline\" text,\n \"destination(s)\" text,\n \"aircraft scheduled\" text,\n \"service date(s)\" text,\n \"comments\" text\n) ### Response: SELECT (SELECT \"aircraft scheduled\" FROM table_204_215 WHERE \"airline\" = 'air florida') > 4"} {"instruction":"What year did Culver leave?","input":"CREATE TABLE table_name_71 (\n year_left INTEGER,\n location VARCHAR\n)","response":"SELECT SUM(year_left) FROM table_name_71 WHERE location = \"culver\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year did Culver leave? ### Input: CREATE TABLE table_name_71 (\n year_left INTEGER,\n location VARCHAR\n) ### Response: SELECT SUM(year_left) FROM table_name_71 WHERE location = \"culver\""} {"instruction":"My undeleted closed ID questions.","input":"CREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT * FROM Votes AS v WHERE v.UserId = 52","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: My undeleted closed ID questions. ### Input: CREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT * FROM Votes AS v WHERE v.UserId = 52"} {"instruction":"how much does it cost for dexamethasone 4 mg po tabs?","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dexamethasone 4 mg po tabs')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much does it cost for dexamethasone 4 mg po tabs? ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dexamethasone 4 mg po tabs')"} {"instruction":"What is the highest year named for the name Tie Fluctus?","input":"CREATE TABLE table_21081 (\n \"Name\" text,\n \"Latitude\" text,\n \"Longitude\" text,\n \"Diameter (km)\" text,\n \"Year named\" real,\n \"Name origin\" text\n)","response":"SELECT MAX(\"Year named\") FROM table_21081 WHERE \"Name\" = 'Tie Fluctus'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest year named for the name Tie Fluctus? ### Input: CREATE TABLE table_21081 (\n \"Name\" text,\n \"Latitude\" text,\n \"Longitude\" text,\n \"Diameter (km)\" text,\n \"Year named\" real,\n \"Name origin\" text\n) ### Response: SELECT MAX(\"Year named\") FROM table_21081 WHERE \"Name\" = 'Tie Fluctus'"} {"instruction":"What is Country, when Score is '69-69=138', and when Player is 'Ian Poulter'?","input":"CREATE TABLE table_name_20 (\n country VARCHAR,\n player VARCHAR,\n score VARCHAR\n)","response":"SELECT country FROM table_name_20 WHERE score = 69 - 69 = 138 AND player = \"ian poulter\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Country, when Score is '69-69=138', and when Player is 'Ian Poulter'? ### Input: CREATE TABLE table_name_20 (\n country VARCHAR,\n player VARCHAR,\n score VARCHAR\n) ### Response: SELECT country FROM table_name_20 WHERE score = 69 - 69 = 138 AND player = \"ian poulter\""} {"instruction":"Which rider was on the 600cc Yamaha team?","input":"CREATE TABLE table_name_44 (\n rider VARCHAR,\n team VARCHAR\n)","response":"SELECT rider FROM table_name_44 WHERE team = \"600cc yamaha\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which rider was on the 600cc Yamaha team? ### Input: CREATE TABLE table_name_44 (\n rider VARCHAR,\n team VARCHAR\n) ### Response: SELECT rider FROM table_name_44 WHERE team = \"600cc yamaha\""} {"instruction":"was the value of calculated total co2 of patient 14671 second measured on the current hospital visit less than its value first measured on the current hospital visit?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)","response":"SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') ORDER BY labevents.charttime LIMIT 1 OFFSET 1) < (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') ORDER BY labevents.charttime LIMIT 1)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the value of calculated total co2 of patient 14671 second measured on the current hospital visit less than its value first measured on the current hospital visit? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n) ### Response: SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') ORDER BY labevents.charttime LIMIT 1 OFFSET 1) < (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') ORDER BY labevents.charttime LIMIT 1)"} {"instruction":"Name the tournament for march 25, 2012","input":"CREATE TABLE table_name_24 (\n tournament VARCHAR,\n date VARCHAR\n)","response":"SELECT tournament FROM table_name_24 WHERE date = \"march 25, 2012\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the tournament for march 25, 2012 ### Input: CREATE TABLE table_name_24 (\n tournament VARCHAR,\n date VARCHAR\n) ### Response: SELECT tournament FROM table_name_24 WHERE date = \"march 25, 2012\""} {"instruction":"Will Prof. David Moon teach 597 next semester ?","input":"CREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)","response":"SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 597 AND instructor.name LIKE '%David Moon%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Will Prof. David Moon teach 597 next semester ? ### Input: CREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n) ### Response: SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 597 AND instructor.name LIKE '%David Moon%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016"} {"instruction":"what were the number of innings albert clapp had ?","input":"CREATE TABLE table_204_154 (\n id number,\n \"player\" text,\n \"matches\" number,\n \"innings\" number,\n \"runs\" number,\n \"average\" number,\n \"100s\" number,\n \"50s\" number\n)","response":"SELECT \"innings\" FROM table_204_154 WHERE \"player\" = 'albert clapp'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the number of innings albert clapp had ? ### Input: CREATE TABLE table_204_154 (\n id number,\n \"player\" text,\n \"matches\" number,\n \"innings\" number,\n \"runs\" number,\n \"average\" number,\n \"100s\" number,\n \"50s\" number\n) ### Response: SELECT \"innings\" FROM table_204_154 WHERE \"player\" = 'albert clapp'"} {"instruction":"Show aircraft names and number of flights for each aircraft.","input":"CREATE TABLE flight (\n flno number(4,0),\n origin varchar2(20),\n destination varchar2(20),\n distance number(6,0),\n departure_date date,\n arrival_date date,\n price number(7,2),\n aid number(9,0)\n)\n\nCREATE TABLE aircraft (\n aid number(9,0),\n name varchar2(30),\n distance number(6,0)\n)\n\nCREATE TABLE certificate (\n eid number(9,0),\n aid number(9,0)\n)\n\nCREATE TABLE employee (\n eid number(9,0),\n name varchar2(30),\n salary number(10,2)\n)","response":"SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show aircraft names and number of flights for each aircraft. ### Input: CREATE TABLE flight (\n flno number(4,0),\n origin varchar2(20),\n destination varchar2(20),\n distance number(6,0),\n departure_date date,\n arrival_date date,\n price number(7,2),\n aid number(9,0)\n)\n\nCREATE TABLE aircraft (\n aid number(9,0),\n name varchar2(30),\n distance number(6,0)\n)\n\nCREATE TABLE certificate (\n eid number(9,0),\n aid number(9,0)\n)\n\nCREATE TABLE employee (\n eid number(9,0),\n name varchar2(30),\n salary number(10,2)\n) ### Response: SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid"} {"instruction":"what is the overall number of times when the calendar showed october 6","input":"CREATE TABLE table_27733909_1 (\n record VARCHAR,\n date VARCHAR\n)","response":"SELECT COUNT(record) FROM table_27733909_1 WHERE date = \"October 6\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the overall number of times when the calendar showed october 6 ### Input: CREATE TABLE table_27733909_1 (\n record VARCHAR,\n date VARCHAR\n) ### Response: SELECT COUNT(record) FROM table_27733909_1 WHERE date = \"October 6\""} {"instruction":"Name the tries against when tries for is 30","input":"CREATE TABLE table_22025 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Tries against\" text,\n \"Try bonus\" text,\n \"Losing bonus\" text,\n \"Points\" text\n)","response":"SELECT \"Tries against\" FROM table_22025 WHERE \"Tries for\" = '30'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the tries against when tries for is 30 ### Input: CREATE TABLE table_22025 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Tries against\" text,\n \"Try bonus\" text,\n \"Losing bonus\" text,\n \"Points\" text\n) ### Response: SELECT \"Tries against\" FROM table_22025 WHERE \"Tries for\" = '30'"} {"instruction":"WHAT IS THE ROUND FOR ZACH BOYCHUK?","input":"CREATE TABLE table_49926 (\n \"Round\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"College\/Junior\/Club Team (League)\" text\n)","response":"SELECT COUNT(\"Round\") FROM table_49926 WHERE \"Player\" = 'zach boychuk'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHAT IS THE ROUND FOR ZACH BOYCHUK? ### Input: CREATE TABLE table_49926 (\n \"Round\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"College\/Junior\/Club Team (League)\" text\n) ### Response: SELECT COUNT(\"Round\") FROM table_49926 WHERE \"Player\" = 'zach boychuk'"} {"instruction":"what is maximum age of patients whose gender is m and discharge location is short term hospital?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = \"M\" AND demographic.discharge_location = \"SHORT TERM HOSPITAL\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose gender is m and discharge location is short term hospital? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = \"M\" AND demographic.discharge_location = \"SHORT TERM HOSPITAL\""} {"instruction":"How many people attended the game on week 3?","input":"CREATE TABLE table_name_26 (\n attendance INTEGER,\n week VARCHAR\n)","response":"SELECT AVG(attendance) FROM table_name_26 WHERE week = 3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the game on week 3? ### Input: CREATE TABLE table_name_26 (\n attendance INTEGER,\n week VARCHAR\n) ### Response: SELECT AVG(attendance) FROM table_name_26 WHERE week = 3"} {"instruction":"Please show different types of artworks with the corresponding number of artworks of each type.","input":"CREATE TABLE festival_detail (\n festival_id number,\n festival_name text,\n chair_name text,\n location text,\n year number,\n num_of_audience number\n)\n\nCREATE TABLE nomination (\n artwork_id number,\n festival_id number,\n result text\n)\n\nCREATE TABLE artwork (\n artwork_id number,\n type text,\n name text\n)","response":"SELECT type, COUNT(*) FROM artwork GROUP BY type","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please show different types of artworks with the corresponding number of artworks of each type. ### Input: CREATE TABLE festival_detail (\n festival_id number,\n festival_name text,\n chair_name text,\n location text,\n year number,\n num_of_audience number\n)\n\nCREATE TABLE nomination (\n artwork_id number,\n festival_id number,\n result text\n)\n\nCREATE TABLE artwork (\n artwork_id number,\n type text,\n name text\n) ### Response: SELECT type, COUNT(*) FROM artwork GROUP BY type"} {"instruction":"what is the total number of priests that have held the job in resita ?","input":"CREATE TABLE table_204_734 (\n id number,\n \"first name\" text,\n \"surname\" text,\n \"death year\" number,\n \"beginning of\\nservice\" text,\n \"end of\\nservice\" text,\n \"notes\" text\n)","response":"SELECT COUNT(\"first name\") FROM table_204_734","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of priests that have held the job in resita ? ### Input: CREATE TABLE table_204_734 (\n id number,\n \"first name\" text,\n \"surname\" text,\n \"death year\" number,\n \"beginning of\\nservice\" text,\n \"end of\\nservice\" text,\n \"notes\" text\n) ### Response: SELECT COUNT(\"first name\") FROM table_204_734"} {"instruction":"Which school was Lawrence Roberts from ?","input":"CREATE TABLE table_46045 (\n \"Player\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Years for Grizzlies\" text,\n \"School\/Club Team\" text\n)","response":"SELECT \"School\/Club Team\" FROM table_46045 WHERE \"Player\" = 'lawrence roberts'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which school was Lawrence Roberts from ? ### Input: CREATE TABLE table_46045 (\n \"Player\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Years for Grizzlies\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT \"School\/Club Team\" FROM table_46045 WHERE \"Player\" = 'lawrence roberts'"} {"instruction":"What is the total number of Silver, when Gold is '1', and when Bronze is less than 0?","input":"CREATE TABLE table_name_35 (\n silver VARCHAR,\n gold VARCHAR,\n bronze VARCHAR\n)","response":"SELECT COUNT(silver) FROM table_name_35 WHERE gold = 1 AND bronze < 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Silver, when Gold is '1', and when Bronze is less than 0? ### Input: CREATE TABLE table_name_35 (\n silver VARCHAR,\n gold VARCHAR,\n bronze VARCHAR\n) ### Response: SELECT COUNT(silver) FROM table_name_35 WHERE gold = 1 AND bronze < 0"} {"instruction":"What is the col location with a col height (m) of 1107?","input":"CREATE TABLE table_2731431_1 (\n col_location VARCHAR,\n col_height__m_ VARCHAR\n)","response":"SELECT col_location FROM table_2731431_1 WHERE col_height__m_ = 1107","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the col location with a col height (m) of 1107? ### Input: CREATE TABLE table_2731431_1 (\n col_location VARCHAR,\n col_height__m_ VARCHAR\n) ### Response: SELECT col_location FROM table_2731431_1 WHERE col_height__m_ = 1107"} {"instruction":"What is Venue, when Status is '2007 Rugby World Cup', when Against is less than 22, and when Date is '08\/09\/2007'?","input":"CREATE TABLE table_name_22 (\n venue VARCHAR,\n date VARCHAR,\n status VARCHAR,\n against VARCHAR\n)","response":"SELECT venue FROM table_name_22 WHERE status = \"2007 rugby world cup\" AND against < 22 AND date = \"08\/09\/2007\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Venue, when Status is '2007 Rugby World Cup', when Against is less than 22, and when Date is '08\/09\/2007'? ### Input: CREATE TABLE table_name_22 (\n venue VARCHAR,\n date VARCHAR,\n status VARCHAR,\n against VARCHAR\n) ### Response: SELECT venue FROM table_name_22 WHERE status = \"2007 rugby world cup\" AND against < 22 AND date = \"08\/09\/2007\""} {"instruction":"What was the result of the match in Penrith that featured a score of 48-12?","input":"CREATE TABLE table_4661 (\n \"Date\" text,\n \"Result\" text,\n \"Score\" text,\n \"Stadium\" text,\n \"City\" text,\n \"Crowd\" real\n)","response":"SELECT \"Result\" FROM table_4661 WHERE \"Score\" = '48-12' AND \"City\" = 'penrith'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the match in Penrith that featured a score of 48-12? ### Input: CREATE TABLE table_4661 (\n \"Date\" text,\n \"Result\" text,\n \"Score\" text,\n \"Stadium\" text,\n \"City\" text,\n \"Crowd\" real\n) ### Response: SELECT \"Result\" FROM table_4661 WHERE \"Score\" = '48-12' AND \"City\" = 'penrith'"} {"instruction":"Show the number of the countries that have managers of age above 50 or below 46.","input":"CREATE TABLE train (\n Train_ID int,\n Train_Num text,\n Name text,\n From text,\n Arrival text,\n Railway_ID int\n)\n\nCREATE TABLE railway (\n Railway_ID int,\n Railway text,\n Builder text,\n Built text,\n Wheels text,\n Location text,\n ObjectNumber text\n)\n\nCREATE TABLE railway_manage (\n Railway_ID int,\n Manager_ID int,\n From_Year text\n)\n\nCREATE TABLE manager (\n Manager_ID int,\n Name text,\n Country text,\n Working_year_starts text,\n Age int,\n Level int\n)","response":"SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of the countries that have managers of age above 50 or below 46. ### Input: CREATE TABLE train (\n Train_ID int,\n Train_Num text,\n Name text,\n From text,\n Arrival text,\n Railway_ID int\n)\n\nCREATE TABLE railway (\n Railway_ID int,\n Railway text,\n Builder text,\n Built text,\n Wheels text,\n Location text,\n ObjectNumber text\n)\n\nCREATE TABLE railway_manage (\n Railway_ID int,\n Manager_ID int,\n From_Year text\n)\n\nCREATE TABLE manager (\n Manager_ID int,\n Name text,\n Country text,\n Working_year_starts text,\n Age int,\n Level int\n) ### Response: SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country"} {"instruction":"what is the number of patients whose marital status is widowed and procedure icd9 code is 4105?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"WIDOWED\" AND procedures.icd9_code = \"4105\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose marital status is widowed and procedure icd9 code is 4105? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"WIDOWED\" AND procedures.icd9_code = \"4105\""} {"instruction":"What was the date of the game that had a goal of 3?","input":"CREATE TABLE table_71388 (\n \"Goal\" real,\n \"Date\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n)","response":"SELECT \"Date\" FROM table_71388 WHERE \"Goal\" = '3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the game that had a goal of 3? ### Input: CREATE TABLE table_71388 (\n \"Goal\" real,\n \"Date\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n) ### Response: SELECT \"Date\" FROM table_71388 WHERE \"Goal\" = '3'"} {"instruction":"DALLAS to SAN FRANCISCO leaving after 1600 in the afternoon please","input":"CREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: DALLAS to SAN FRANCISCO leaving after 1600 in the afternoon please ### Input: CREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"what is date of birth and diagnoses short title of subject id 66411?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT demographic.dob, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = \"66411\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is date of birth and diagnoses short title of subject id 66411? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT demographic.dob, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = \"66411\""} {"instruction":"What's the abbreviation for libya?","input":"CREATE TABLE table_name_88 (\n abbreviation VARCHAR,\n country VARCHAR\n)","response":"SELECT abbreviation FROM table_name_88 WHERE country = \"libya\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the abbreviation for libya? ### Input: CREATE TABLE table_name_88 (\n abbreviation VARCHAR,\n country VARCHAR\n) ### Response: SELECT abbreviation FROM table_name_88 WHERE country = \"libya\""} {"instruction":"What is the total number of games for the opponent in Washington?","input":"CREATE TABLE table_name_89 (\n game VARCHAR,\n opponent VARCHAR\n)","response":"SELECT COUNT(game) FROM table_name_89 WHERE opponent = \"washington\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of games for the opponent in Washington? ### Input: CREATE TABLE table_name_89 (\n game VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT COUNT(game) FROM table_name_89 WHERE opponent = \"washington\""} {"instruction":"Which opponent's game was less than 76 when the march was 10?","input":"CREATE TABLE table_name_45 (\n opponent VARCHAR,\n game VARCHAR,\n march VARCHAR\n)","response":"SELECT opponent FROM table_name_45 WHERE game < 76 AND march = 10","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which opponent's game was less than 76 when the march was 10? ### Input: CREATE TABLE table_name_45 (\n opponent VARCHAR,\n game VARCHAR,\n march VARCHAR\n) ### Response: SELECT opponent FROM table_name_45 WHERE game < 76 AND march = 10"} {"instruction":"what is minimum age of patients whose gender is f and age is greater than or equal to 30?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = \"F\" AND demographic.age >= \"30\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose gender is f and age is greater than or equal to 30? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = \"F\" AND demographic.age >= \"30\""} {"instruction":"What finish time started at 32?","input":"CREATE TABLE table_58371 (\n \"Year\" text,\n \"Start\" text,\n \"Qual\" text,\n \"Rank\" text,\n \"Finish\" text,\n \"Laps\" real\n)","response":"SELECT \"Finish\" FROM table_58371 WHERE \"Start\" = '32'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What finish time started at 32? ### Input: CREATE TABLE table_58371 (\n \"Year\" text,\n \"Start\" text,\n \"Qual\" text,\n \"Rank\" text,\n \"Finish\" text,\n \"Laps\" real\n) ### Response: SELECT \"Finish\" FROM table_58371 WHERE \"Start\" = '32'"} {"instruction":"For those employees who did not have any job in the past, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart.","input":"CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart. ### Input: CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)"} {"instruction":"What player that has a Position of df, and Loaned to is Stoke City?","input":"CREATE TABLE table_name_89 (\n player VARCHAR,\n position VARCHAR,\n loaned_to VARCHAR\n)","response":"SELECT player FROM table_name_89 WHERE position = \"df\" AND loaned_to = \"stoke city\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player that has a Position of df, and Loaned to is Stoke City? ### Input: CREATE TABLE table_name_89 (\n player VARCHAR,\n position VARCHAR,\n loaned_to VARCHAR\n) ### Response: SELECT player FROM table_name_89 WHERE position = \"df\" AND loaned_to = \"stoke city\""} {"instruction":"get me the number of patients suffering from celo-vessicle fistula primary disease.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"CELO-VESSICLE FISTULA\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the number of patients suffering from celo-vessicle fistula primary disease. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"CELO-VESSICLE FISTULA\""} {"instruction":"What is the highest number of dave viewers of an episode with 119000 dave ja vu viewers?","input":"CREATE TABLE table_28053 (\n \"Episode no.\" real,\n \"Airdate\" text,\n \"Dave Viewers\" real,\n \"Dave Rank\" real,\n \"Rank (cable)\" real,\n \"Dave ja vu Viewers\" real,\n \"Total viewers\" real\n)","response":"SELECT MAX(\"Dave Viewers\") FROM table_28053 WHERE \"Dave ja vu Viewers\" = '119000'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest number of dave viewers of an episode with 119000 dave ja vu viewers? ### Input: CREATE TABLE table_28053 (\n \"Episode no.\" real,\n \"Airdate\" text,\n \"Dave Viewers\" real,\n \"Dave Rank\" real,\n \"Rank (cable)\" real,\n \"Dave ja vu Viewers\" real,\n \"Total viewers\" real\n) ### Response: SELECT MAX(\"Dave Viewers\") FROM table_28053 WHERE \"Dave ja vu Viewers\" = '119000'"} {"instruction":"Bar chart of mean salary from each dept name, and rank by the X-axis in desc.","input":"CREATE TABLE student (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n tot_cred numeric(3,0)\n)\n\nCREATE TABLE teaches (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0)\n)\n\nCREATE TABLE course (\n course_id varchar(8),\n title varchar(50),\n dept_name varchar(20),\n credits numeric(2,0)\n)\n\nCREATE TABLE instructor (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n salary numeric(8,2)\n)\n\nCREATE TABLE takes (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n grade varchar(2)\n)\n\nCREATE TABLE classroom (\n building varchar(15),\n room_number varchar(7),\n capacity numeric(4,0)\n)\n\nCREATE TABLE section (\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n building varchar(15),\n room_number varchar(7),\n time_slot_id varchar(4)\n)\n\nCREATE TABLE time_slot (\n time_slot_id varchar(4),\n day varchar(1),\n start_hr numeric(2),\n start_min numeric(2),\n end_hr numeric(2),\n end_min numeric(2)\n)\n\nCREATE TABLE prereq (\n course_id varchar(8),\n prereq_id varchar(8)\n)\n\nCREATE TABLE department (\n dept_name varchar(20),\n building varchar(15),\n budget numeric(12,2)\n)\n\nCREATE TABLE advisor (\n s_ID varchar(5),\n i_ID varchar(5)\n)","response":"SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart of mean salary from each dept name, and rank by the X-axis in desc. ### Input: CREATE TABLE student (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n tot_cred numeric(3,0)\n)\n\nCREATE TABLE teaches (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0)\n)\n\nCREATE TABLE course (\n course_id varchar(8),\n title varchar(50),\n dept_name varchar(20),\n credits numeric(2,0)\n)\n\nCREATE TABLE instructor (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n salary numeric(8,2)\n)\n\nCREATE TABLE takes (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n grade varchar(2)\n)\n\nCREATE TABLE classroom (\n building varchar(15),\n room_number varchar(7),\n capacity numeric(4,0)\n)\n\nCREATE TABLE section (\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n building varchar(15),\n room_number varchar(7),\n time_slot_id varchar(4)\n)\n\nCREATE TABLE time_slot (\n time_slot_id varchar(4),\n day varchar(1),\n start_hr numeric(2),\n start_min numeric(2),\n end_hr numeric(2),\n end_min numeric(2)\n)\n\nCREATE TABLE prereq (\n course_id varchar(8),\n prereq_id varchar(8)\n)\n\nCREATE TABLE department (\n dept_name varchar(20),\n building varchar(15),\n budget numeric(12,2)\n)\n\nCREATE TABLE advisor (\n s_ID varchar(5),\n i_ID varchar(5)\n) ### Response: SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name DESC"} {"instruction":"has patient 015-59552 had any milrinone intake since 06\/10\/2105.","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'milrinone' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2105-06-10'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 015-59552 had any milrinone intake since 06\/10\/2105. ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'milrinone' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2105-06-10'"} {"instruction":"who is the champion where semi-finalist #2 is na and location is morrisville, nc","input":"CREATE TABLE table_16524 (\n \"Year\" text,\n \"Champion\" text,\n \"Score\" text,\n \"Runner-Up\" text,\n \"Location\" text,\n \"Semi-Finalist #1\" text,\n \"Semi-Finalist #2\" text\n)","response":"SELECT \"Champion\" FROM table_16524 WHERE \"Semi-Finalist #2\" = 'NA' AND \"Location\" = 'Morrisville, NC'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the champion where semi-finalist #2 is na and location is morrisville, nc ### Input: CREATE TABLE table_16524 (\n \"Year\" text,\n \"Champion\" text,\n \"Score\" text,\n \"Runner-Up\" text,\n \"Location\" text,\n \"Semi-Finalist #1\" text,\n \"Semi-Finalist #2\" text\n) ### Response: SELECT \"Champion\" FROM table_16524 WHERE \"Semi-Finalist #2\" = 'NA' AND \"Location\" = 'Morrisville, NC'"} {"instruction":"mark skaife was the winnter of atcc round 1 , but what was the name of his team ?","input":"CREATE TABLE table_203_271 (\n id number,\n \"date\" text,\n \"series\" text,\n \"circuit\" text,\n \"city \/ state\" text,\n \"winner\" text,\n \"team\" text,\n \"car\" text,\n \"report\" text\n)","response":"SELECT \"team\" FROM table_203_271 WHERE \"series\" = 'atcc round 1' AND \"winner\" = 'mark skaife'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mark skaife was the winnter of atcc round 1 , but what was the name of his team ? ### Input: CREATE TABLE table_203_271 (\n id number,\n \"date\" text,\n \"series\" text,\n \"circuit\" text,\n \"city \/ state\" text,\n \"winner\" text,\n \"team\" text,\n \"car\" text,\n \"report\" text\n) ### Response: SELECT \"team\" FROM table_203_271 WHERE \"series\" = 'atcc round 1' AND \"winner\" = 'mark skaife'"} {"instruction":"Who is the player in guard position from Stephen F. Austin in a round less than 8?","input":"CREATE TABLE table_45213 (\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"School\/Club Team\" text\n)","response":"SELECT \"Player\" FROM table_45213 WHERE \"Round\" < '8' AND \"Position\" = 'guard' AND \"School\/Club Team\" = 'stephen f. austin'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the player in guard position from Stephen F. Austin in a round less than 8? ### Input: CREATE TABLE table_45213 (\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT \"Player\" FROM table_45213 WHERE \"Round\" < '8' AND \"Position\" = 'guard' AND \"School\/Club Team\" = 'stephen f. austin'"} {"instruction":"What stadium was the game held in when the final score was 17-31?","input":"CREATE TABLE table_name_88 (\n stadium VARCHAR,\n final_score VARCHAR\n)","response":"SELECT stadium FROM table_name_88 WHERE final_score = \"17-31\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What stadium was the game held in when the final score was 17-31? ### Input: CREATE TABLE table_name_88 (\n stadium VARCHAR,\n final_score VARCHAR\n) ### Response: SELECT stadium FROM table_name_88 WHERE final_score = \"17-31\""} {"instruction":"What is the average Acquired when the Number shows as 7?","input":"CREATE TABLE table_name_73 (\n acquired INTEGER,\n number VARCHAR\n)","response":"SELECT AVG(acquired) FROM table_name_73 WHERE number = 7","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Acquired when the Number shows as 7? ### Input: CREATE TABLE table_name_73 (\n acquired INTEGER,\n number VARCHAR\n) ### Response: SELECT AVG(acquired) FROM table_name_73 WHERE number = 7"} {"instruction":"How many viewers tuned in for season 2?","input":"CREATE TABLE table_22347090_4 (\n us_viewers__million_ VARCHAR,\n no_in_season VARCHAR\n)","response":"SELECT us_viewers__million_ FROM table_22347090_4 WHERE no_in_season = 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many viewers tuned in for season 2? ### Input: CREATE TABLE table_22347090_4 (\n us_viewers__million_ VARCHAR,\n no_in_season VARCHAR\n) ### Response: SELECT us_viewers__million_ FROM table_22347090_4 WHERE no_in_season = 2"} {"instruction":"When was the Masters Tournament?","input":"CREATE TABLE table_55448 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"To par\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n)","response":"SELECT \"Date\" FROM table_55448 WHERE \"Tournament\" = 'masters tournament'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the Masters Tournament? ### Input: CREATE TABLE table_55448 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"To par\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n) ### Response: SELECT \"Date\" FROM table_55448 WHERE \"Tournament\" = 'masters tournament'"} {"instruction":"Show the residences that have both a player of gender 'M' and a player of gender 'F'.","input":"CREATE TABLE player (\n Residence VARCHAR,\n gender VARCHAR\n)","response":"SELECT Residence FROM player WHERE gender = \"M\" INTERSECT SELECT Residence FROM player WHERE gender = \"F\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the residences that have both a player of gender 'M' and a player of gender 'F'. ### Input: CREATE TABLE player (\n Residence VARCHAR,\n gender VARCHAR\n) ### Response: SELECT Residence FROM player WHERE gender = \"M\" INTERSECT SELECT Residence FROM player WHERE gender = \"F\""} {"instruction":"How many Attendances on may 24?","input":"CREATE TABLE table_36390 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Decision\" text,\n \"Attendance\" real,\n \"Series\" text\n)","response":"SELECT MIN(\"Attendance\") FROM table_36390 WHERE \"Date\" = 'may 24'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Attendances on may 24? ### Input: CREATE TABLE table_36390 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Decision\" text,\n \"Attendance\" real,\n \"Series\" text\n) ### Response: SELECT MIN(\"Attendance\") FROM table_36390 WHERE \"Date\" = 'may 24'"} {"instruction":"Are there sections of BIOMEDE 430 between the hours of 8:00 and 1:00 ?","input":"CREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)","response":"SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '8:00' AND course.course_id = course_offering.course_id AND course.department = 'BIOMEDE' AND course.number = 430 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there sections of BIOMEDE 430 between the hours of 8:00 and 1:00 ? ### Input: CREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n) ### Response: SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '8:00' AND course.course_id = course_offering.course_id AND course.department = 'BIOMEDE' AND course.number = 430 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016"} {"instruction":"In what episode was segment D ned Can Corn?","input":"CREATE TABLE table_19894 (\n \"Series Ep.\" text,\n \"Episode\" real,\n \"Netflix\" text,\n \"Segment A\" text,\n \"Segment B\" text,\n \"Segment C\" text,\n \"Segment D\" text\n)","response":"SELECT MAX(\"Episode\") FROM table_19894 WHERE \"Segment D\" = 'ned Can Corn'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what episode was segment D ned Can Corn? ### Input: CREATE TABLE table_19894 (\n \"Series Ep.\" text,\n \"Episode\" real,\n \"Netflix\" text,\n \"Segment A\" text,\n \"Segment B\" text,\n \"Segment C\" text,\n \"Segment D\" text\n) ### Response: SELECT MAX(\"Episode\") FROM table_19894 WHERE \"Segment D\" = 'ned Can Corn'"} {"instruction":"Who directed 'running the gauntlet'?","input":"CREATE TABLE table_3916 (\n \"Episode #\" real,\n \"Series #\" real,\n \"Title\" text,\n \"Director\" text,\n \"Writer\" text,\n \"Original airdate\" text,\n \"Viewers (millions)\" text\n)","response":"SELECT \"Director\" FROM table_3916 WHERE \"Title\" = 'Running the Gauntlet'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed 'running the gauntlet'? ### Input: CREATE TABLE table_3916 (\n \"Episode #\" real,\n \"Series #\" real,\n \"Title\" text,\n \"Director\" text,\n \"Writer\" text,\n \"Original airdate\" text,\n \"Viewers (millions)\" text\n) ### Response: SELECT \"Director\" FROM table_3916 WHERE \"Title\" = 'Running the Gauntlet'"} {"instruction":"What is the class of the team that has a behind of +44.780?","input":"CREATE TABLE table_name_18 (\n class VARCHAR,\n behind VARCHAR\n)","response":"SELECT class FROM table_name_18 WHERE behind = \"+44.780\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the class of the team that has a behind of +44.780? ### Input: CREATE TABLE table_name_18 (\n class VARCHAR,\n behind VARCHAR\n) ### Response: SELECT class FROM table_name_18 WHERE behind = \"+44.780\""} {"instruction":"Would you mind informing me what all of the ULCS classes are ?","input":"CREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Would you mind informing me what all of the ULCS classes are ? ### Input: CREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id"} {"instruction":"display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a T .","input":"CREATE TABLE employees (\n employee_id VARCHAR,\n first_name VARCHAR,\n last_name VARCHAR,\n department_id VARCHAR\n)","response":"SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a T . ### Input: CREATE TABLE employees (\n employee_id VARCHAR,\n first_name VARCHAR,\n last_name VARCHAR,\n department_id VARCHAR\n) ### Response: SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')"} {"instruction":"What Round against Aleksander Emelianenko had a time of 5:00?","input":"CREATE TABLE table_40258 (\n \"Res.\" text,\n \"Record\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Event\" text,\n \"Round\" real,\n \"Time\" text,\n \"Location\" text\n)","response":"SELECT \"Round\" FROM table_40258 WHERE \"Time\" = '5:00' AND \"Opponent\" = 'aleksander emelianenko'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Round against Aleksander Emelianenko had a time of 5:00? ### Input: CREATE TABLE table_40258 (\n \"Res.\" text,\n \"Record\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Event\" text,\n \"Round\" real,\n \"Time\" text,\n \"Location\" text\n) ### Response: SELECT \"Round\" FROM table_40258 WHERE \"Time\" = '5:00' AND \"Opponent\" = 'aleksander emelianenko'"} {"instruction":"which company has a person that can wear clothing in 33-23-36","input":"CREATE TABLE table_27515452_3 (\n agency VARCHAR,\n sizes VARCHAR\n)","response":"SELECT agency FROM table_27515452_3 WHERE sizes = \"33-23-36\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which company has a person that can wear clothing in 33-23-36 ### Input: CREATE TABLE table_27515452_3 (\n agency VARCHAR,\n sizes VARCHAR\n) ### Response: SELECT agency FROM table_27515452_3 WHERE sizes = \"33-23-36\""} {"instruction":"Which Nation has a Gold larger than 0, and a Total larger than 4, and a Rank of 6?","input":"CREATE TABLE table_48308 (\n \"Rank\" text,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT \"Nation\" FROM table_48308 WHERE \"Gold\" > '0' AND \"Total\" > '4' AND \"Rank\" = '6'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Nation has a Gold larger than 0, and a Total larger than 4, and a Rank of 6? ### Input: CREATE TABLE table_48308 (\n \"Rank\" text,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT \"Nation\" FROM table_48308 WHERE \"Gold\" > '0' AND \"Total\" > '4' AND \"Rank\" = '6'"} {"instruction":"For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the amount of hire_date bin hire_date by weekday in a bar chart, and rank from high to low by the Y please.","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)","response":"SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the amount of hire_date bin hire_date by weekday in a bar chart, and rank from high to low by the Y please. ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n) ### Response: SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC"} {"instruction":"If the record is 5-8, what is the team name?","input":"CREATE TABLE table_73512 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Team\" FROM table_73512 WHERE \"Record\" = '5-8'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the record is 5-8, what is the team name? ### Input: CREATE TABLE table_73512 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Team\" FROM table_73512 WHERE \"Record\" = '5-8'"} {"instruction":"How many courses for each subject? Plot a bar chart, could you display bar in ascending order?","input":"CREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)","response":"SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many courses for each subject? Plot a bar chart, could you display bar in ascending order? ### Input: CREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n) ### Response: SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name"} {"instruction":"Are there any Teams after 1997?","input":"CREATE TABLE table_69280 (\n \"Year\" real,\n \"Class\" text,\n \"Tyres\" text,\n \"Team\" text,\n \"Co-Drivers\" text,\n \"Laps\" real,\n \"Pos.\" text\n)","response":"SELECT \"Team\" FROM table_69280 WHERE \"Year\" > '1997'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any Teams after 1997? ### Input: CREATE TABLE table_69280 (\n \"Year\" real,\n \"Class\" text,\n \"Tyres\" text,\n \"Team\" text,\n \"Co-Drivers\" text,\n \"Laps\" real,\n \"Pos.\" text\n) ### Response: SELECT \"Team\" FROM table_69280 WHERE \"Year\" > '1997'"} {"instruction":"What skip has angela tuvaeva as the lead?","input":"CREATE TABLE table_75427 (\n \"Country\" text,\n \"Skip\" text,\n \"Third\" text,\n \"Second\" text,\n \"Lead\" text\n)","response":"SELECT \"Skip\" FROM table_75427 WHERE \"Lead\" = 'angela tuvaeva'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What skip has angela tuvaeva as the lead? ### Input: CREATE TABLE table_75427 (\n \"Country\" text,\n \"Skip\" text,\n \"Third\" text,\n \"Second\" text,\n \"Lead\" text\n) ### Response: SELECT \"Skip\" FROM table_75427 WHERE \"Lead\" = 'angela tuvaeva'"} {"instruction":"Create a pie chart showing the total number across outcome code.","input":"CREATE TABLE Mailshot_Customers (\n mailshot_id INTEGER,\n customer_id INTEGER,\n outcome_code VARCHAR(15),\n mailshot_customer_date DATETIME\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n product_category VARCHAR(15),\n product_name VARCHAR(80)\n)\n\nCREATE TABLE Mailshot_Campaigns (\n mailshot_id INTEGER,\n product_category VARCHAR(15),\n mailshot_name VARCHAR(80),\n mailshot_start_date DATETIME,\n mailshot_end_date DATETIME\n)\n\nCREATE TABLE Premises (\n premise_id INTEGER,\n premises_type VARCHAR(15),\n premise_details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n item_id INTEGER,\n order_item_status_code VARCHAR(15),\n order_id INTEGER,\n product_id INTEGER,\n item_status_code VARCHAR(15),\n item_delivered_datetime DATETIME,\n item_order_quantity VARCHAR(80)\n)\n\nCREATE TABLE Customer_Addresses (\n customer_id INTEGER,\n premise_id INTEGER,\n date_address_from DATETIME,\n address_type_code VARCHAR(15),\n date_address_to DATETIME\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n payment_method VARCHAR(15),\n customer_name VARCHAR(80),\n customer_phone VARCHAR(80),\n customer_email VARCHAR(80),\n customer_address VARCHAR(255),\n customer_login VARCHAR(80),\n customer_password VARCHAR(10)\n)\n\nCREATE TABLE Customer_Orders (\n order_id INTEGER,\n customer_id INTEGER,\n order_status_code VARCHAR(15),\n shipping_method_code VARCHAR(15),\n order_placed_datetime DATETIME,\n order_delivered_datetime DATETIME,\n order_shipping_charges VARCHAR(255)\n)","response":"SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a pie chart showing the total number across outcome code. ### Input: CREATE TABLE Mailshot_Customers (\n mailshot_id INTEGER,\n customer_id INTEGER,\n outcome_code VARCHAR(15),\n mailshot_customer_date DATETIME\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n product_category VARCHAR(15),\n product_name VARCHAR(80)\n)\n\nCREATE TABLE Mailshot_Campaigns (\n mailshot_id INTEGER,\n product_category VARCHAR(15),\n mailshot_name VARCHAR(80),\n mailshot_start_date DATETIME,\n mailshot_end_date DATETIME\n)\n\nCREATE TABLE Premises (\n premise_id INTEGER,\n premises_type VARCHAR(15),\n premise_details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n item_id INTEGER,\n order_item_status_code VARCHAR(15),\n order_id INTEGER,\n product_id INTEGER,\n item_status_code VARCHAR(15),\n item_delivered_datetime DATETIME,\n item_order_quantity VARCHAR(80)\n)\n\nCREATE TABLE Customer_Addresses (\n customer_id INTEGER,\n premise_id INTEGER,\n date_address_from DATETIME,\n address_type_code VARCHAR(15),\n date_address_to DATETIME\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n payment_method VARCHAR(15),\n customer_name VARCHAR(80),\n customer_phone VARCHAR(80),\n customer_email VARCHAR(80),\n customer_address VARCHAR(255),\n customer_login VARCHAR(80),\n customer_password VARCHAR(10)\n)\n\nCREATE TABLE Customer_Orders (\n order_id INTEGER,\n customer_id INTEGER,\n order_status_code VARCHAR(15),\n shipping_method_code VARCHAR(15),\n order_placed_datetime DATETIME,\n order_delivered_datetime DATETIME,\n order_shipping_charges VARCHAR(255)\n) ### Response: SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code"} {"instruction":"What is Home, when Score is 103-93?","input":"CREATE TABLE table_name_95 (\n home VARCHAR,\n score VARCHAR\n)","response":"SELECT home FROM table_name_95 WHERE score = \"103-93\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Home, when Score is 103-93? ### Input: CREATE TABLE table_name_95 (\n home VARCHAR,\n score VARCHAR\n) ### Response: SELECT home FROM table_name_95 WHERE score = \"103-93\""} {"instruction":"What is Television Service, when HDTV is No, and when Language is Italian?","input":"CREATE TABLE table_name_11 (\n television_service VARCHAR,\n hdtv VARCHAR,\n language VARCHAR\n)","response":"SELECT television_service FROM table_name_11 WHERE hdtv = \"no\" AND language = \"italian\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Television Service, when HDTV is No, and when Language is Italian? ### Input: CREATE TABLE table_name_11 (\n television_service VARCHAR,\n hdtv VARCHAR,\n language VARCHAR\n) ### Response: SELECT television_service FROM table_name_11 WHERE hdtv = \"no\" AND language = \"italian\""} {"instruction":"Bin all date of transactions into the YEAR interval, and give the average of the share count for each bin. What is the trend?","input":"CREATE TABLE Transactions (\n transaction_id INTEGER,\n investor_id INTEGER,\n transaction_type_code VARCHAR(10),\n date_of_transaction DATETIME,\n amount_of_transaction DECIMAL(19,4),\n share_count VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Transactions_Lots (\n transaction_id INTEGER,\n lot_id INTEGER\n)\n\nCREATE TABLE Lots (\n lot_id INTEGER,\n investor_id INTEGER,\n lot_details VARCHAR(255)\n)\n\nCREATE TABLE Sales (\n sales_transaction_id INTEGER,\n sales_details VARCHAR(255)\n)\n\nCREATE TABLE Purchases (\n purchase_transaction_id INTEGER,\n purchase_details VARCHAR(255)\n)\n\nCREATE TABLE Investors (\n investor_id INTEGER,\n Investor_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Transaction_Types (\n transaction_type_code VARCHAR(10),\n transaction_type_description VARCHAR(80)\n)","response":"SELECT date_of_transaction, AVG(share_count) FROM Transactions","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bin all date of transactions into the YEAR interval, and give the average of the share count for each bin. What is the trend? ### Input: CREATE TABLE Transactions (\n transaction_id INTEGER,\n investor_id INTEGER,\n transaction_type_code VARCHAR(10),\n date_of_transaction DATETIME,\n amount_of_transaction DECIMAL(19,4),\n share_count VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Transactions_Lots (\n transaction_id INTEGER,\n lot_id INTEGER\n)\n\nCREATE TABLE Lots (\n lot_id INTEGER,\n investor_id INTEGER,\n lot_details VARCHAR(255)\n)\n\nCREATE TABLE Sales (\n sales_transaction_id INTEGER,\n sales_details VARCHAR(255)\n)\n\nCREATE TABLE Purchases (\n purchase_transaction_id INTEGER,\n purchase_details VARCHAR(255)\n)\n\nCREATE TABLE Investors (\n investor_id INTEGER,\n Investor_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Transaction_Types (\n transaction_type_code VARCHAR(10),\n transaction_type_description VARCHAR(80)\n) ### Response: SELECT date_of_transaction, AVG(share_count) FROM Transactions"} {"instruction":"Highest voted answers that have no competition.","input":"CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)","response":"SELECT Id AS \"post_link\", Score FROM Posts WHERE PostTypeId = 2 AND ParentId IN (SELECT Id FROM Posts WHERE AnswerCount = 1) ORDER BY Score DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Highest voted answers that have no competition. ### Input: CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n) ### Response: SELECT Id AS \"post_link\", Score FROM Posts WHERE PostTypeId = 2 AND ParentId IN (SELECT Id FROM Posts WHERE AnswerCount = 1) ORDER BY Score DESC"} {"instruction":"What is the maximum number of starts?","input":"CREATE TABLE table_3005915_3 (\n starts INTEGER\n)","response":"SELECT MAX(starts) FROM table_3005915_3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the maximum number of starts? ### Input: CREATE TABLE table_3005915_3 (\n starts INTEGER\n) ### Response: SELECT MAX(starts) FROM table_3005915_3"} {"instruction":"Margin of victory on no. 4 was?","input":"CREATE TABLE table_24524 (\n \"No.\" real,\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"To par\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n)","response":"SELECT \"Margin of victory\" FROM table_24524 WHERE \"No.\" = '4'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Margin of victory on no. 4 was? ### Input: CREATE TABLE table_24524 (\n \"No.\" real,\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"To par\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n) ### Response: SELECT \"Margin of victory\" FROM table_24524 WHERE \"No.\" = '4'"} {"instruction":"What is the name of the person who was in the Original Broadway Cast that was Original West End Cast of sheila hancock?","input":"CREATE TABLE table_name_56 (\n original_broadway_cast VARCHAR,\n original_west_end_cast VARCHAR\n)","response":"SELECT original_broadway_cast FROM table_name_56 WHERE original_west_end_cast = \"sheila hancock\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the person who was in the Original Broadway Cast that was Original West End Cast of sheila hancock? ### Input: CREATE TABLE table_name_56 (\n original_broadway_cast VARCHAR,\n original_west_end_cast VARCHAR\n) ### Response: SELECT original_broadway_cast FROM table_name_56 WHERE original_west_end_cast = \"sheila hancock\""} {"instruction":"did they place better in 1987\/88 or 1993\/94 ?","input":"CREATE TABLE table_204_35 (\n id number,\n \"season\" text,\n \"tier\" number,\n \"division\" text,\n \"place\" text\n)","response":"SELECT \"season\" FROM table_204_35 WHERE \"season\" IN ('1987\/88', '1993\/94') ORDER BY \"place\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did they place better in 1987\/88 or 1993\/94 ? ### Input: CREATE TABLE table_204_35 (\n id number,\n \"season\" text,\n \"tier\" number,\n \"division\" text,\n \"place\" text\n) ### Response: SELECT \"season\" FROM table_204_35 WHERE \"season\" IN ('1987\/88', '1993\/94') ORDER BY \"place\" LIMIT 1"} {"instruction":"Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' Visualize by bar chart, list from high to low by the Y.","input":"CREATE TABLE department (\n Department_ID int,\n Name text,\n Creation text,\n Ranking int,\n Budget_in_Billions real,\n Num_Employees real\n)\n\nCREATE TABLE head (\n head_ID int,\n name text,\n born_state text,\n age real\n)\n\nCREATE TABLE management (\n department_ID int,\n head_ID int,\n temporary_acting text\n)","response":"SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' Visualize by bar chart, list from high to low by the Y. ### Input: CREATE TABLE department (\n Department_ID int,\n Name text,\n Creation text,\n Ranking int,\n Budget_in_Billions real,\n Num_Employees real\n)\n\nCREATE TABLE head (\n head_ID int,\n name text,\n born_state text,\n age real\n)\n\nCREATE TABLE management (\n department_ID int,\n head_ID int,\n temporary_acting text\n) ### Response: SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees) DESC"} {"instruction":"Tell me the class with rank of 89th","input":"CREATE TABLE table_name_12 (\n class VARCHAR,\n rank VARCHAR\n)","response":"SELECT class FROM table_name_12 WHERE rank = \"89th\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the class with rank of 89th ### Input: CREATE TABLE table_name_12 (\n class VARCHAR,\n rank VARCHAR\n) ### Response: SELECT class FROM table_name_12 WHERE rank = \"89th\""} {"instruction":"What is the first year for Popgun?","input":"CREATE TABLE table_55144 (\n \"Title\" text,\n \"Publisher\" text,\n \"First Year\" text,\n \"Last Year\" text,\n \"Genre\" text\n)","response":"SELECT \"First Year\" FROM table_55144 WHERE \"Title\" = 'popgun'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the first year for Popgun? ### Input: CREATE TABLE table_55144 (\n \"Title\" text,\n \"Publisher\" text,\n \"First Year\" text,\n \"Last Year\" text,\n \"Genre\" text\n) ### Response: SELECT \"First Year\" FROM table_55144 WHERE \"Title\" = 'popgun'"} {"instruction":"what character did Masaharu satou play","input":"CREATE TABLE table_38210 (\n \"Character Name\" text,\n \"Voice Actor (Japanese)\" text,\n \"Voice Actor (English 1997 \/ Saban)\" text,\n \"Voice Actor (English 1998 \/ Pioneer)\" text,\n \"Voice Actor (English 2006 \/ FUNimation)\" text\n)","response":"SELECT \"Character Name\" FROM table_38210 WHERE \"Voice Actor (Japanese)\" = 'masaharu satou'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what character did Masaharu satou play ### Input: CREATE TABLE table_38210 (\n \"Character Name\" text,\n \"Voice Actor (Japanese)\" text,\n \"Voice Actor (English 1997 \/ Saban)\" text,\n \"Voice Actor (English 1998 \/ Pioneer)\" text,\n \"Voice Actor (English 2006 \/ FUNimation)\" text\n) ### Response: SELECT \"Character Name\" FROM table_38210 WHERE \"Voice Actor (Japanese)\" = 'masaharu satou'"} {"instruction":"What years did number 54 play for the jazz","input":"CREATE TABLE table_16858 (\n \"Player\" text,\n \"No.\" real,\n \"Nationality\" text,\n \"Position\" text,\n \"Years for Jazz\" text,\n \"School\/Club Team\" text\n)","response":"SELECT \"Years for Jazz\" FROM table_16858 WHERE \"No.\" = '54'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years did number 54 play for the jazz ### Input: CREATE TABLE table_16858 (\n \"Player\" text,\n \"No.\" real,\n \"Nationality\" text,\n \"Position\" text,\n \"Years for Jazz\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT \"Years for Jazz\" FROM table_16858 WHERE \"No.\" = '54'"} {"instruction":"For each director, how many reviews have they received Visualize by bar chart, and could you rank from high to low by the Y-axis?","input":"CREATE TABLE Rating (\n rID int,\n mID int,\n stars int,\n ratingDate date\n)\n\nCREATE TABLE Reviewer (\n rID int,\n name text\n)\n\nCREATE TABLE Movie (\n mID int,\n title text,\n year int,\n director text\n)","response":"SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each director, how many reviews have they received Visualize by bar chart, and could you rank from high to low by the Y-axis? ### Input: CREATE TABLE Rating (\n rID int,\n mID int,\n stars int,\n ratingDate date\n)\n\nCREATE TABLE Reviewer (\n rID int,\n name text\n)\n\nCREATE TABLE Movie (\n mID int,\n title text,\n year int,\n director text\n) ### Response: SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY COUNT(*) DESC"} {"instruction":"Which lowest played has a Position of 2, and Goals against larger than 53?","input":"CREATE TABLE table_name_6 (\n played INTEGER,\n position VARCHAR,\n goals_against VARCHAR\n)","response":"SELECT MIN(played) FROM table_name_6 WHERE position = 2 AND goals_against > 53","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which lowest played has a Position of 2, and Goals against larger than 53? ### Input: CREATE TABLE table_name_6 (\n played INTEGER,\n position VARCHAR,\n goals_against VARCHAR\n) ### Response: SELECT MIN(played) FROM table_name_6 WHERE position = 2 AND goals_against > 53"} {"instruction":"What is the English title of the film directed by Fernando Meirelles?","input":"CREATE TABLE table_name_53 (\n english_title VARCHAR,\n director_s_ VARCHAR\n)","response":"SELECT english_title FROM table_name_53 WHERE director_s_ = \"fernando meirelles\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the English title of the film directed by Fernando Meirelles? ### Input: CREATE TABLE table_name_53 (\n english_title VARCHAR,\n director_s_ VARCHAR\n) ### Response: SELECT english_title FROM table_name_53 WHERE director_s_ = \"fernando meirelles\""} {"instruction":"Name the college\/junior club team for pick number 63","input":"CREATE TABLE table_19548 (\n \"Pick #\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"NHL team\" text,\n \"College\/junior\/club team\" text\n)","response":"SELECT \"College\/junior\/club team\" FROM table_19548 WHERE \"Pick #\" = '63'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the college\/junior club team for pick number 63 ### Input: CREATE TABLE table_19548 (\n \"Pick #\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"NHL team\" text,\n \"College\/junior\/club team\" text\n) ### Response: SELECT \"College\/junior\/club team\" FROM table_19548 WHERE \"Pick #\" = '63'"} {"instruction":"what is the total number of silver medals won by russia , norway , and sweden combined ?","input":"CREATE TABLE table_204_761 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT SUM(\"silver\") FROM table_204_761 WHERE \"nation\" IN ('russia', 'norway', 'sweden')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of silver medals won by russia , norway , and sweden combined ? ### Input: CREATE TABLE table_204_761 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT SUM(\"silver\") FROM table_204_761 WHERE \"nation\" IN ('russia', 'norway', 'sweden')"} {"instruction":"Find the number of members living in each address.","input":"CREATE TABLE shop (\n shop_id number,\n address text,\n num_of_staff text,\n score number,\n open_year text\n)\n\nCREATE TABLE happy_hour (\n hh_id number,\n shop_id number,\n month text,\n num_of_shaff_in_charge number\n)\n\nCREATE TABLE member (\n member_id number,\n name text,\n membership_card text,\n age number,\n time_of_purchase number,\n level_of_membership number,\n address text\n)\n\nCREATE TABLE happy_hour_member (\n hh_id number,\n member_id number,\n total_amount number\n)","response":"SELECT COUNT(*), address FROM member GROUP BY address","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of members living in each address. ### Input: CREATE TABLE shop (\n shop_id number,\n address text,\n num_of_staff text,\n score number,\n open_year text\n)\n\nCREATE TABLE happy_hour (\n hh_id number,\n shop_id number,\n month text,\n num_of_shaff_in_charge number\n)\n\nCREATE TABLE member (\n member_id number,\n name text,\n membership_card text,\n age number,\n time_of_purchase number,\n level_of_membership number,\n address text\n)\n\nCREATE TABLE happy_hour_member (\n hh_id number,\n member_id number,\n total_amount number\n) ### Response: SELECT COUNT(*), address FROM member GROUP BY address"} {"instruction":"what is the variation of patient 006-181433's weight second measured on the current hospital visit compared to the first value measured on the current hospital visit?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1)","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the variation of patient 006-181433's weight second measured on the current hospital visit compared to the first value measured on the current hospital visit? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1)"} {"instruction":"how many patients with death status 0 had procedure icd9 code as 5011?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = \"0\" AND procedures.icd9_code = \"5011\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients with death status 0 had procedure icd9 code as 5011? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = \"0\" AND procedures.icd9_code = \"5011\""} {"instruction":"For those records from the products and each product's manufacturer, find headquarter and the amount of headquarter , and group by attribute headquarter, and visualize them by a bar chart, and I want to display x axis in descending order please.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, find headquarter and the amount of headquarter , and group by attribute headquarter, and visualize them by a bar chart, and I want to display x axis in descending order please. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC"} {"instruction":"What is To Par, when Place is 3?","input":"CREATE TABLE table_name_43 (\n to_par VARCHAR,\n place VARCHAR\n)","response":"SELECT to_par FROM table_name_43 WHERE place = \"3\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is To Par, when Place is 3? ### Input: CREATE TABLE table_name_43 (\n to_par VARCHAR,\n place VARCHAR\n) ### Response: SELECT to_par FROM table_name_43 WHERE place = \"3\""} {"instruction":"what age does patient 71192 have on the last hospital encounter?","input":"CREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT admissions.age FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what age does patient 71192 have on the last hospital encounter? ### Input: CREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT admissions.age FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1"} {"instruction":"On what date was god & guns released?","input":"CREATE TABLE table_name_15 (\n date_of_release VARCHAR,\n title VARCHAR\n)","response":"SELECT date_of_release FROM table_name_15 WHERE title = \"god & guns\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date was god & guns released? ### Input: CREATE TABLE table_name_15 (\n date_of_release VARCHAR,\n title VARCHAR\n) ### Response: SELECT date_of_release FROM table_name_15 WHERE title = \"god & guns\""} {"instruction":"From 11:00 to 4:00 , are there ECON 442 sections ?","input":"CREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)","response":"SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '4:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'ECON' AND course.number = 442 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: From 11:00 to 4:00 , are there ECON 442 sections ? ### Input: CREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n) ### Response: SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '4:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'ECON' AND course.number = 442 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016"} {"instruction":"What's the 2nd leg result in the round where team #1 is Iraklis?","input":"CREATE TABLE table_19130829_4 (\n team__number1 VARCHAR\n)","response":"SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number1 = \"Iraklis\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the 2nd leg result in the round where team #1 is Iraklis? ### Input: CREATE TABLE table_19130829_4 (\n team__number1 VARCHAR\n) ### Response: SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number1 = \"Iraklis\""} {"instruction":"what number of publications are indicated as being in print ?","input":"CREATE TABLE table_204_692 (\n id number,\n \"publication\" text,\n \"score\" text,\n \"review\" text\n)","response":"SELECT COUNT(\"publication\") FROM table_204_692 WHERE \"review\" = 'print'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of publications are indicated as being in print ? ### Input: CREATE TABLE table_204_692 (\n id number,\n \"publication\" text,\n \"score\" text,\n \"review\" text\n) ### Response: SELECT COUNT(\"publication\") FROM table_204_692 WHERE \"review\" = 'print'"} {"instruction":"had patient 005-80291 been prescribed 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg\/5ml po susp, potassium chloride 2 meq\/ml iv soln or ondansetron hcl 4 mg\/2ml ij soln since 2105?","input":"CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-80291')) AND medication.drugname IN ('30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg\/5ml po susp', 'potassium chloride 2 meq\/ml iv soln', 'ondansetron hcl 4 mg\/2ml ij soln') AND STRFTIME('%y', medication.drugstarttime) >= '2105'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 005-80291 been prescribed 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg\/5ml po susp, potassium chloride 2 meq\/ml iv soln or ondansetron hcl 4 mg\/2ml ij soln since 2105? ### Input: CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-80291')) AND medication.drugname IN ('30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg\/5ml po susp', 'potassium chloride 2 meq\/ml iv soln', 'ondansetron hcl 4 mg\/2ml ij soln') AND STRFTIME('%y', medication.drugstarttime) >= '2105'"} {"instruction":"Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home, and sort from low to high by the y axis.","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home, and sort from low to high by the y axis. ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID"} {"instruction":"When 228 is the lap and chip ganassi racing is the team what is the race time?","input":"CREATE TABLE table_21885 (\n \"Season\" text,\n \"Date\" text,\n \"Driver\" text,\n \"Team\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Laps\" text,\n \"Miles (km)\" text,\n \"Race Time\" text,\n \"Average Speed (mph)\" text,\n \"Report\" text\n)","response":"SELECT \"Race Time\" FROM table_21885 WHERE \"Team\" = 'Chip Ganassi Racing' AND \"Laps\" = '228'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When 228 is the lap and chip ganassi racing is the team what is the race time? ### Input: CREATE TABLE table_21885 (\n \"Season\" text,\n \"Date\" text,\n \"Driver\" text,\n \"Team\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Laps\" text,\n \"Miles (km)\" text,\n \"Race Time\" text,\n \"Average Speed (mph)\" text,\n \"Report\" text\n) ### Response: SELECT \"Race Time\" FROM table_21885 WHERE \"Team\" = 'Chip Ganassi Racing' AND \"Laps\" = '228'"} {"instruction":"Which song was picked that was originally performed by Marisa Monte?","input":"CREATE TABLE table_29668 (\n \"Week #\" text,\n \"Theme\" text,\n \"Song Choice\" text,\n \"Original Artist\" text,\n \"Order #\" text,\n \"Result\" text\n)","response":"SELECT \"Song Choice\" FROM table_29668 WHERE \"Original Artist\" = 'Marisa Monte'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which song was picked that was originally performed by Marisa Monte? ### Input: CREATE TABLE table_29668 (\n \"Week #\" text,\n \"Theme\" text,\n \"Song Choice\" text,\n \"Original Artist\" text,\n \"Order #\" text,\n \"Result\" text\n) ### Response: SELECT \"Song Choice\" FROM table_29668 WHERE \"Original Artist\" = 'Marisa Monte'"} {"instruction":"Scores of users in specific tag.","input":"CREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)","response":"WITH scorestags_cte AS (SELECT pt.TagId AS TagId, p.OwnerUserId AS uid, p.OwnerDisplayName AS udn, SUM(p.Score) AS sco, COUNT(p.Id) AS num FROM Posts AS p INNER JOIN Posts AS q ON q.Id = p.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId WHERE (p.CommunityOwnedDate IS NULL) GROUP BY pt.TagId, p.OwnerUserId, p.OwnerDisplayName) SELECT CAST('##MinScore##' AS INT), t.TagName, s.uid AS \"user_link\", s.udn, s.sco AS \"score\", s.num AS \"count\" FROM scorestags_cte AS s INNER JOIN Tags AS t ON s.TagId = t.Id WHERE t.TagName = '##TagName##' AND s.sco >= CAST('##MinScore##' AS INT) ORDER BY s.sco DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Scores of users in specific tag. ### Input: CREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n) ### Response: WITH scorestags_cte AS (SELECT pt.TagId AS TagId, p.OwnerUserId AS uid, p.OwnerDisplayName AS udn, SUM(p.Score) AS sco, COUNT(p.Id) AS num FROM Posts AS p INNER JOIN Posts AS q ON q.Id = p.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId WHERE (p.CommunityOwnedDate IS NULL) GROUP BY pt.TagId, p.OwnerUserId, p.OwnerDisplayName) SELECT CAST('##MinScore##' AS INT), t.TagName, s.uid AS \"user_link\", s.udn, s.sco AS \"score\", s.num AS \"count\" FROM scorestags_cte AS s INNER JOIN Tags AS t ON s.TagId = t.Id WHERE t.TagName = '##TagName##' AND s.sco >= CAST('##MinScore##' AS INT) ORDER BY s.sco DESC"} {"instruction":"What is the population where the median household income is $87,832 and there are fewer than 64,886 households?","input":"CREATE TABLE table_name_83 (\n population INTEGER,\n median_household_income VARCHAR,\n number_of_households VARCHAR\n)","response":"SELECT AVG(population) FROM table_name_83 WHERE median_household_income = \"$87,832\" AND number_of_households < 64 OFFSET 886","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the population where the median household income is $87,832 and there are fewer than 64,886 households? ### Input: CREATE TABLE table_name_83 (\n population INTEGER,\n median_household_income VARCHAR,\n number_of_households VARCHAR\n) ### Response: SELECT AVG(population) FROM table_name_83 WHERE median_household_income = \"$87,832\" AND number_of_households < 64 OFFSET 886"} {"instruction":"provide the number of patients whose procedure icd9 code is 5771 and drug type is main?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = \"5771\" AND prescriptions.drug_type = \"MAIN\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose procedure icd9 code is 5771 and drug type is main? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = \"5771\" AND prescriptions.drug_type = \"MAIN\""} {"instruction":"What is the rank of the player who got 58179 in yardage?","input":"CREATE TABLE table_18686317_1 (\n rank VARCHAR,\n yardage VARCHAR\n)","response":"SELECT rank FROM table_18686317_1 WHERE yardage = 58179","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank of the player who got 58179 in yardage? ### Input: CREATE TABLE table_18686317_1 (\n rank VARCHAR,\n yardage VARCHAR\n) ### Response: SELECT rank FROM table_18686317_1 WHERE yardage = 58179"} {"instruction":"What is the name of the course that has the most student enrollment?","input":"CREATE TABLE Courses (\n course_name VARCHAR,\n course_id VARCHAR\n)\n\nCREATE TABLE Student_Course_Enrolment (\n course_id VARCHAR\n)","response":"SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the course that has the most student enrollment? ### Input: CREATE TABLE Courses (\n course_name VARCHAR,\n course_id VARCHAR\n)\n\nCREATE TABLE Student_Course_Enrolment (\n course_id VARCHAR\n) ### Response: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1"} {"instruction":"What is the largest amount of wins that was before the 2007 season, as well as the Team being silverstone motorsport academy?","input":"CREATE TABLE table_39196 (\n \"Season\" real,\n \"Series\" text,\n \"Team\" text,\n \"Races\" real,\n \"Wins\" real,\n \"Poles\" real,\n \"Podiums\" real\n)","response":"SELECT MAX(\"Wins\") FROM table_39196 WHERE \"Season\" < '2007' AND \"Team\" = 'silverstone motorsport academy'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest amount of wins that was before the 2007 season, as well as the Team being silverstone motorsport academy? ### Input: CREATE TABLE table_39196 (\n \"Season\" real,\n \"Series\" text,\n \"Team\" text,\n \"Races\" real,\n \"Wins\" real,\n \"Poles\" real,\n \"Podiums\" real\n) ### Response: SELECT MAX(\"Wins\") FROM table_39196 WHERE \"Season\" < '2007' AND \"Team\" = 'silverstone motorsport academy'"} {"instruction":"What away team has 7 as the tie no.?","input":"CREATE TABLE table_name_38 (\n away_team VARCHAR,\n tie_no VARCHAR\n)","response":"SELECT away_team FROM table_name_38 WHERE tie_no = \"7\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What away team has 7 as the tie no.? ### Input: CREATE TABLE table_name_38 (\n away_team VARCHAR,\n tie_no VARCHAR\n) ### Response: SELECT away_team FROM table_name_38 WHERE tie_no = \"7\""} {"instruction":"male or female ages >= 3.5 years and <= 18 years on day of sepsis recognition","input":"CREATE TABLE table_train_71 (\n \"id\" int,\n \"gender\" string,\n \"language\" string,\n \"intention_to_arterial_catheter\" bool,\n \"renal_disease\" bool,\n \"sepsis\" bool,\n \"allergy_to_hydroxyethyl_starch\" bool,\n \"age\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_71 WHERE (gender = 'male' OR gender = 'female') AND (age >= 3.5 AND age <= 18) AND sepsis = 1","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: male or female ages >= 3.5 years and <= 18 years on day of sepsis recognition ### Input: CREATE TABLE table_train_71 (\n \"id\" int,\n \"gender\" string,\n \"language\" string,\n \"intention_to_arterial_catheter\" bool,\n \"renal_disease\" bool,\n \"sepsis\" bool,\n \"allergy_to_hydroxyethyl_starch\" bool,\n \"age\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_71 WHERE (gender = 'male' OR gender = 'female') AND (age >= 3.5 AND age <= 18) AND sepsis = 1"} {"instruction":"Which year has a Round of 17?","input":"CREATE TABLE table_67049 (\n \"Quarter\" text,\n \"Score\" text,\n \"Club\" text,\n \"Opponent\" text,\n \"Year\" text,\n \"Round\" text,\n \"Venue\" text\n)","response":"SELECT \"Year\" FROM table_67049 WHERE \"Round\" = '17'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which year has a Round of 17? ### Input: CREATE TABLE table_67049 (\n \"Quarter\" text,\n \"Score\" text,\n \"Club\" text,\n \"Opponent\" text,\n \"Year\" text,\n \"Round\" text,\n \"Venue\" text\n) ### Response: SELECT \"Year\" FROM table_67049 WHERE \"Round\" = '17'"} {"instruction":"how many license plates were issued before 1960 ?","input":"CREATE TABLE table_203_379 (\n id number,\n \"first issued\" text,\n \"design\" text,\n \"slogan\" text,\n \"serial format\" text,\n \"serials issued\" text,\n \"notes\" text\n)","response":"SELECT COUNT(*) FROM table_203_379 WHERE \"first issued\" < 1960","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many license plates were issued before 1960 ? ### Input: CREATE TABLE table_203_379 (\n id number,\n \"first issued\" text,\n \"design\" text,\n \"slogan\" text,\n \"serial format\" text,\n \"serials issued\" text,\n \"notes\" text\n) ### Response: SELECT COUNT(*) FROM table_203_379 WHERE \"first issued\" < 1960"} {"instruction":"when was patient 035-24054's ventric #1 output for the last time on the current intensive care unit visit?","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'ventric #1' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 035-24054's ventric #1 output for the last time on the current intensive care unit visit? ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'ventric #1' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1"} {"instruction":"Which runner-up placed in a year prior to 2006 and whose Champion was Elon?","input":"CREATE TABLE table_name_66 (\n runner_up VARCHAR,\n year VARCHAR,\n champion VARCHAR\n)","response":"SELECT runner_up FROM table_name_66 WHERE year < 2006 AND champion = \"elon\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which runner-up placed in a year prior to 2006 and whose Champion was Elon? ### Input: CREATE TABLE table_name_66 (\n runner_up VARCHAR,\n year VARCHAR,\n champion VARCHAR\n) ### Response: SELECT runner_up FROM table_name_66 WHERE year < 2006 AND champion = \"elon\""} {"instruction":"Which Touchdowns is the lowest one that has Points of 5, and a Field goals larger than 0?","input":"CREATE TABLE table_name_81 (\n touchdowns INTEGER,\n points VARCHAR,\n field_goals VARCHAR\n)","response":"SELECT MIN(touchdowns) FROM table_name_81 WHERE points = 5 AND field_goals > 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Touchdowns is the lowest one that has Points of 5, and a Field goals larger than 0? ### Input: CREATE TABLE table_name_81 (\n touchdowns INTEGER,\n points VARCHAR,\n field_goals VARCHAR\n) ### Response: SELECT MIN(touchdowns) FROM table_name_81 WHERE points = 5 AND field_goals > 0"} {"instruction":"give me the number of patients whose admission location is transfer from hosp\/extram and procedure icd9 code is 5781?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = \"TRANSFER FROM HOSP\/EXTRAM\" AND procedures.icd9_code = \"5781\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission location is transfer from hosp\/extram and procedure icd9 code is 5781? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = \"TRANSFER FROM HOSP\/EXTRAM\" AND procedures.icd9_code = \"5781\""} {"instruction":"i'm interested in a flight from DALLAS to WASHINGTON and i'm also interested in going to BALTIMORE","input":"CREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'BALTIMORE')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i'm interested in a flight from DALLAS to WASHINGTON and i'm also interested in going to BALTIMORE ### Input: CREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'BALTIMORE')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"what is religion of subject id 26746?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.religion FROM demographic WHERE demographic.subject_id = \"26746\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is religion of subject id 26746? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.religion FROM demographic WHERE demographic.subject_id = \"26746\""} {"instruction":"who is the constructor when the laps is more than 72 and the driver is eddie irvine?","input":"CREATE TABLE table_name_33 (\n constructor VARCHAR,\n laps VARCHAR,\n driver VARCHAR\n)","response":"SELECT constructor FROM table_name_33 WHERE laps > 72 AND driver = \"eddie irvine\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the constructor when the laps is more than 72 and the driver is eddie irvine? ### Input: CREATE TABLE table_name_33 (\n constructor VARCHAR,\n laps VARCHAR,\n driver VARCHAR\n) ### Response: SELECT constructor FROM table_name_33 WHERE laps > 72 AND driver = \"eddie irvine\""} {"instruction":"What is the average total for teams with under 34 bronzes, 0 silver, and under 14 gold?","input":"CREATE TABLE table_name_88 (\n total INTEGER,\n silver VARCHAR,\n bronze VARCHAR,\n gold VARCHAR\n)","response":"SELECT AVG(total) FROM table_name_88 WHERE bronze < 34 AND gold < 14 AND silver < 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average total for teams with under 34 bronzes, 0 silver, and under 14 gold? ### Input: CREATE TABLE table_name_88 (\n total INTEGER,\n silver VARCHAR,\n bronze VARCHAR,\n gold VARCHAR\n) ### Response: SELECT AVG(total) FROM table_name_88 WHERE bronze < 34 AND gold < 14 AND silver < 0"} {"instruction":"What are the highest points with a Chassis of gordini t16, and a Year smaller than 1954?","input":"CREATE TABLE table_15405 (\n \"Year\" real,\n \"Team\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n)","response":"SELECT MAX(\"Points\") FROM table_15405 WHERE \"Chassis\" = 'gordini t16' AND \"Year\" < '1954'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the highest points with a Chassis of gordini t16, and a Year smaller than 1954? ### Input: CREATE TABLE table_15405 (\n \"Year\" real,\n \"Team\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n) ### Response: SELECT MAX(\"Points\") FROM table_15405 WHERE \"Chassis\" = 'gordini t16' AND \"Year\" < '1954'"} {"instruction":"Who wrote the episodes with 7.70 u.s. viewers (million) ?","input":"CREATE TABLE table_29318 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text,\n \"U.S. viewers (million)\" text\n)","response":"SELECT \"Written by\" FROM table_29318 WHERE \"U.S. viewers (million)\" = '7.70'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who wrote the episodes with 7.70 u.s. viewers (million) ? ### Input: CREATE TABLE table_29318 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text,\n \"U.S. viewers (million)\" text\n) ### Response: SELECT \"Written by\" FROM table_29318 WHERE \"U.S. viewers (million)\" = '7.70'"} {"instruction":"calculate the total number of patients diagnosed with other b-complex deficiencies","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = \"Other B-complex deficiencies\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the total number of patients diagnosed with other b-complex deficiencies ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = \"Other B-complex deficiencies\""} {"instruction":"What super g was before 1998, had 2 giant slaloms and 24 downhills?","input":"CREATE TABLE table_68185 (\n \"Season\" real,\n \"Overall\" text,\n \"Slalom\" text,\n \"Giant Slalom\" text,\n \"Super G\" text,\n \"Downhill\" text,\n \"Combined\" text\n)","response":"SELECT \"Super G\" FROM table_68185 WHERE \"Season\" < '1998' AND \"Giant Slalom\" = '2' AND \"Downhill\" = '24'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What super g was before 1998, had 2 giant slaloms and 24 downhills? ### Input: CREATE TABLE table_68185 (\n \"Season\" real,\n \"Overall\" text,\n \"Slalom\" text,\n \"Giant Slalom\" text,\n \"Super G\" text,\n \"Downhill\" text,\n \"Combined\" text\n) ### Response: SELECT \"Super G\" FROM table_68185 WHERE \"Season\" < '1998' AND \"Giant Slalom\" = '2' AND \"Downhill\" = '24'"} {"instruction":"Which pick's round was 5 when Kellen Davis was a player?","input":"CREATE TABLE table_name_40 (\n pick VARCHAR,\n round VARCHAR,\n player VARCHAR\n)","response":"SELECT pick FROM table_name_40 WHERE round = \"5\" AND player = \"kellen davis\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which pick's round was 5 when Kellen Davis was a player? ### Input: CREATE TABLE table_name_40 (\n pick VARCHAR,\n round VARCHAR,\n player VARCHAR\n) ### Response: SELECT pick FROM table_name_40 WHERE round = \"5\" AND player = \"kellen davis\""} {"instruction":"What is the name of the episode that was written by Michael Rauch?","input":"CREATE TABLE table_23117208_5 (\n title VARCHAR,\n written_by VARCHAR\n)","response":"SELECT title FROM table_23117208_5 WHERE written_by = \"Michael Rauch\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the episode that was written by Michael Rauch? ### Input: CREATE TABLE table_23117208_5 (\n title VARCHAR,\n written_by VARCHAR\n) ### Response: SELECT title FROM table_23117208_5 WHERE written_by = \"Michael Rauch\""} {"instruction":"What was the away team score when the home team was Carlton?","input":"CREATE TABLE table_32413 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team score\" FROM table_32413 WHERE \"Home team\" = 'carlton'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away team score when the home team was Carlton? ### Input: CREATE TABLE table_32413 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team score\" FROM table_32413 WHERE \"Home team\" = 'carlton'"} {"instruction":"What is every 5-year peak when Emanuel Lasker, 2847 is the 10-year peak?","input":"CREATE TABLE table_21323 (\n \"Rank\" real,\n \"1-year peak\" text,\n \"5-year peak\" text,\n \"10-year peak\" text,\n \"15-year peak\" text,\n \"20-year peak\" text\n)","response":"SELECT \"5-year peak\" FROM table_21323 WHERE \"10-year peak\" = 'Emanuel Lasker, 2847'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every 5-year peak when Emanuel Lasker, 2847 is the 10-year peak? ### Input: CREATE TABLE table_21323 (\n \"Rank\" real,\n \"1-year peak\" text,\n \"5-year peak\" text,\n \"10-year peak\" text,\n \"15-year peak\" text,\n \"20-year peak\" text\n) ### Response: SELECT \"5-year peak\" FROM table_21323 WHERE \"10-year peak\" = 'Emanuel Lasker, 2847'"} {"instruction":"List people who signed up during private beta.","input":"CREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)","response":"SELECT u.Id AS \"user_link\", u.Id, u.CreationDate FROM Users AS u WHERE u.CreationDate < '2011-08-30 00:00:00.00'","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List people who signed up during private beta. ### Input: CREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n) ### Response: SELECT u.Id AS \"user_link\", u.Id, u.CreationDate FROM Users AS u WHERE u.CreationDate < '2011-08-30 00:00:00.00'"} {"instruction":"how old is each student and how many students are each age?","input":"CREATE TABLE Has_Allergy (\n StuID INTEGER,\n Allergy VARCHAR(20)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Allergy_Type (\n Allergy VARCHAR(20),\n AllergyType VARCHAR(20)\n)","response":"SELECT Age, COUNT(*) FROM Student GROUP BY Age","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how old is each student and how many students are each age? ### Input: CREATE TABLE Has_Allergy (\n StuID INTEGER,\n Allergy VARCHAR(20)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Allergy_Type (\n Allergy VARCHAR(20),\n AllergyType VARCHAR(20)\n) ### Response: SELECT Age, COUNT(*) FROM Student GROUP BY Age"} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me the trend about department_id over hire_date with a line chart, show by the x-axis in desc.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)","response":"SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me the trend about department_id over hire_date with a line chart, show by the x-axis in desc. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n) ### Response: SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC"} {"instruction":"What is the total number of Games, when Rank is less than 4, and when Rebounds is less than 102?","input":"CREATE TABLE table_40605 (\n \"Rank\" real,\n \"Name\" text,\n \"Team\" text,\n \"Games\" real,\n \"Rebounds\" real\n)","response":"SELECT COUNT(\"Games\") FROM table_40605 WHERE \"Rank\" < '4' AND \"Rebounds\" < '102'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Games, when Rank is less than 4, and when Rebounds is less than 102? ### Input: CREATE TABLE table_40605 (\n \"Rank\" real,\n \"Name\" text,\n \"Team\" text,\n \"Games\" real,\n \"Rebounds\" real\n) ### Response: SELECT COUNT(\"Games\") FROM table_40605 WHERE \"Rank\" < '4' AND \"Rebounds\" < '102'"} {"instruction":"Which Pictorials has a 20 Questions of eva longoria?","input":"CREATE TABLE table_39930 (\n \"Date\" text,\n \"Centerfold model\" text,\n \"Interview subject\" text,\n \"20 Questions\" text,\n \"Pictorials\" text\n)","response":"SELECT \"Pictorials\" FROM table_39930 WHERE \"20 Questions\" = 'eva longoria'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Pictorials has a 20 Questions of eva longoria? ### Input: CREATE TABLE table_39930 (\n \"Date\" text,\n \"Centerfold model\" text,\n \"Interview subject\" text,\n \"20 Questions\" text,\n \"Pictorials\" text\n) ### Response: SELECT \"Pictorials\" FROM table_39930 WHERE \"20 Questions\" = 'eva longoria'"} {"instruction":"What is the nomination title used for the original film, Monsieur Hawarden?","input":"CREATE TABLE table_name_18 (\n film_title_used_in_nomination VARCHAR,\n original_title VARCHAR\n)","response":"SELECT film_title_used_in_nomination FROM table_name_18 WHERE original_title = \"monsieur hawarden\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the nomination title used for the original film, Monsieur Hawarden? ### Input: CREATE TABLE table_name_18 (\n film_title_used_in_nomination VARCHAR,\n original_title VARCHAR\n) ### Response: SELECT film_title_used_in_nomination FROM table_name_18 WHERE original_title = \"monsieur hawarden\""} {"instruction":"What was the net capacity with a gross capacity of 1,126 mw, and a Unit of tianwan-4?","input":"CREATE TABLE table_name_74 (\n net_capacity VARCHAR,\n gross_capacity VARCHAR,\n unit VARCHAR\n)","response":"SELECT net_capacity FROM table_name_74 WHERE gross_capacity = \"1,126 mw\" AND unit = \"tianwan-4\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the net capacity with a gross capacity of 1,126 mw, and a Unit of tianwan-4? ### Input: CREATE TABLE table_name_74 (\n net_capacity VARCHAR,\n gross_capacity VARCHAR,\n unit VARCHAR\n) ### Response: SELECT net_capacity FROM table_name_74 WHERE gross_capacity = \"1,126 mw\" AND unit = \"tianwan-4\""} {"instruction":"Name the 10:30 for 8:00 of charmed","input":"CREATE TABLE table_5084 (\n \"7:00\" text,\n \"7:30\" text,\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"10:00\" text,\n \"10:30\" text\n)","response":"SELECT \"10:30\" FROM table_5084 WHERE \"8:00\" = 'charmed'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the 10:30 for 8:00 of charmed ### Input: CREATE TABLE table_5084 (\n \"7:00\" text,\n \"7:30\" text,\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"10:00\" text,\n \"10:30\" text\n) ### Response: SELECT \"10:30\" FROM table_5084 WHERE \"8:00\" = 'charmed'"} {"instruction":"what was the last winner 's album name ?","input":"CREATE TABLE table_204_655 (\n id number,\n \"year\" number,\n \"winner\" text,\n \"album\" text,\n \"other finalists\" text\n)","response":"SELECT \"album\" FROM table_204_655 ORDER BY \"year\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last winner 's album name ? ### Input: CREATE TABLE table_204_655 (\n id number,\n \"year\" number,\n \"winner\" text,\n \"album\" text,\n \"other finalists\" text\n) ### Response: SELECT \"album\" FROM table_204_655 ORDER BY \"year\" DESC LIMIT 1"} {"instruction":"How many Silver medals were won in total by all those with more than 3 bronze and exactly 16 gold?","input":"CREATE TABLE table_80452 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT SUM(\"Silver\") FROM table_80452 WHERE \"Bronze\" > '3' AND \"Gold\" = '16'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Silver medals were won in total by all those with more than 3 bronze and exactly 16 gold? ### Input: CREATE TABLE table_80452 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT SUM(\"Silver\") FROM table_80452 WHERE \"Bronze\" > '3' AND \"Gold\" = '16'"} {"instruction":"Name the memory for frequency of 1.6 ghz","input":"CREATE TABLE table_21021 (\n \"Model number\" text,\n \"sSpec number\" text,\n \"Frequency\" text,\n \"GPU frequency\" text,\n \"L2 cache\" text,\n \"I\/O bus\" text,\n \"Memory\" text,\n \"Voltage\" text,\n \"TDP\" text,\n \"Socket\" text,\n \"Release date\" text,\n \"Part number(s)\" text,\n \"Release price ( USD )\" text\n)","response":"SELECT \"Memory\" FROM table_21021 WHERE \"Frequency\" = '1.6 GHz'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the memory for frequency of 1.6 ghz ### Input: CREATE TABLE table_21021 (\n \"Model number\" text,\n \"sSpec number\" text,\n \"Frequency\" text,\n \"GPU frequency\" text,\n \"L2 cache\" text,\n \"I\/O bus\" text,\n \"Memory\" text,\n \"Voltage\" text,\n \"TDP\" text,\n \"Socket\" text,\n \"Release date\" text,\n \"Part number(s)\" text,\n \"Release price ( USD )\" text\n) ### Response: SELECT \"Memory\" FROM table_21021 WHERE \"Frequency\" = '1.6 GHz'"} {"instruction":"what is the name of procedure patient 51200 has been given two times last month?","input":"CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)","response":"SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51200) AND DATETIME(procedures_icd.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of procedure patient 51200 has been given two times last month? ### Input: CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n) ### Response: SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51200) AND DATETIME(procedures_icd.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2)"} {"instruction":"What is the Competition for Season 2002 03, and the Opponent was zenit st. petersburg?","input":"CREATE TABLE table_name_86 (\n competition VARCHAR,\n season VARCHAR,\n opponent VARCHAR\n)","response":"SELECT competition FROM table_name_86 WHERE season = \"2002\u201303\" AND opponent = \"zenit st. petersburg\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Competition for Season 2002 03, and the Opponent was zenit st. petersburg? ### Input: CREATE TABLE table_name_86 (\n competition VARCHAR,\n season VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT competition FROM table_name_86 WHERE season = \"2002\u201303\" AND opponent = \"zenit st. petersburg\""} {"instruction":"Which Name has Apparent Magnitude smaller than 11.4, and R.A. (J2000) of 04h17m35.8s?","input":"CREATE TABLE table_name_75 (\n name VARCHAR,\n apparent_magnitude VARCHAR,\n ra___j2000__ VARCHAR\n)","response":"SELECT name FROM table_name_75 WHERE apparent_magnitude < 11.4 AND ra___j2000__ = \"04h17m35.8s\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Name has Apparent Magnitude smaller than 11.4, and R.A. (J2000) of 04h17m35.8s? ### Input: CREATE TABLE table_name_75 (\n name VARCHAR,\n apparent_magnitude VARCHAR,\n ra___j2000__ VARCHAR\n) ### Response: SELECT name FROM table_name_75 WHERE apparent_magnitude < 11.4 AND ra___j2000__ = \"04h17m35.8s\""} {"instruction":"What is the sum of the area values for districts having density over 462 and websites of http:\/\/krishna.nic.in\/?","input":"CREATE TABLE table_name_19 (\n area__km\u00b2_ INTEGER,\n density___km\u00b2_ VARCHAR,\n official_website VARCHAR\n)","response":"SELECT SUM(area__km\u00b2_) FROM table_name_19 WHERE density___km\u00b2_ > 462 AND official_website = \"http:\/\/krishna.nic.in\/\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of the area values for districts having density over 462 and websites of http:\/\/krishna.nic.in\/? ### Input: CREATE TABLE table_name_19 (\n area__km\u00b2_ INTEGER,\n density___km\u00b2_ VARCHAR,\n official_website VARCHAR\n) ### Response: SELECT SUM(area__km\u00b2_) FROM table_name_19 WHERE density___km\u00b2_ > 462 AND official_website = \"http:\/\/krishna.nic.in\/\""} {"instruction":"Which Wins have a Win % smaller than 0.8270000000000001, and a Name of rick mirer, and Ties smaller than 1?","input":"CREATE TABLE table_name_17 (\n wins INTEGER,\n ties VARCHAR,\n win__percentage VARCHAR,\n name VARCHAR\n)","response":"SELECT SUM(wins) FROM table_name_17 WHERE win__percentage < 0.8270000000000001 AND name = \"rick mirer\" AND ties < 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Wins have a Win % smaller than 0.8270000000000001, and a Name of rick mirer, and Ties smaller than 1? ### Input: CREATE TABLE table_name_17 (\n wins INTEGER,\n ties VARCHAR,\n win__percentage VARCHAR,\n name VARCHAR\n) ### Response: SELECT SUM(wins) FROM table_name_17 WHERE win__percentage < 0.8270000000000001 AND name = \"rick mirer\" AND ties < 1"} {"instruction":"What is the long-term capital gain rate when the long-term gain on commercial buildings is 25% and long term gain on collectibles is 28% while short-term capital gain rate is 33%?","input":"CREATE TABLE table_55784 (\n \"Ordinary income rate\" text,\n \"Long-term capital gain rate\" text,\n \"Short-term capital gain rate\" text,\n \"Long-term gain on commercial buildings*\" text,\n \"Long-term gain on collectibles\" text\n)","response":"SELECT \"Long-term capital gain rate\" FROM table_55784 WHERE \"Long-term gain on commercial buildings*\" = '25%' AND \"Long-term gain on collectibles\" = '28%' AND \"Short-term capital gain rate\" = '33%'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the long-term capital gain rate when the long-term gain on commercial buildings is 25% and long term gain on collectibles is 28% while short-term capital gain rate is 33%? ### Input: CREATE TABLE table_55784 (\n \"Ordinary income rate\" text,\n \"Long-term capital gain rate\" text,\n \"Short-term capital gain rate\" text,\n \"Long-term gain on commercial buildings*\" text,\n \"Long-term gain on collectibles\" text\n) ### Response: SELECT \"Long-term capital gain rate\" FROM table_55784 WHERE \"Long-term gain on commercial buildings*\" = '25%' AND \"Long-term gain on collectibles\" = '28%' AND \"Short-term capital gain rate\" = '33%'"} {"instruction":"What is the number of the player who attended Delta State?","input":"CREATE TABLE table_20200 (\n \"Player\" text,\n \"No.\" real,\n \"Nationality\" text,\n \"Position\" text,\n \"Years in Orlando\" text,\n \"School\/Club Team\" text\n)","response":"SELECT MAX(\"No.\") FROM table_20200 WHERE \"School\/Club Team\" = 'Delta State'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of the player who attended Delta State? ### Input: CREATE TABLE table_20200 (\n \"Player\" text,\n \"No.\" real,\n \"Nationality\" text,\n \"Position\" text,\n \"Years in Orlando\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT MAX(\"No.\") FROM table_20200 WHERE \"School\/Club Team\" = 'Delta State'"} {"instruction":"What is the to par of the player with more than $4,100 and a score of 69-67-72-70=278?","input":"CREATE TABLE table_48568 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" real\n)","response":"SELECT \"To par\" FROM table_48568 WHERE \"Money ( $ )\" > '4,100' AND \"Score\" = '69-67-72-70=278'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the to par of the player with more than $4,100 and a score of 69-67-72-70=278? ### Input: CREATE TABLE table_48568 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" real\n) ### Response: SELECT \"To par\" FROM table_48568 WHERE \"Money ( $ )\" > '4,100' AND \"Score\" = '69-67-72-70=278'"} {"instruction":"Show name and distance for all aircrafts by a bar chart, list by the y axis in ascending please.","input":"CREATE TABLE employee (\n eid number(9,0),\n name varchar2(30),\n salary number(10,2)\n)\n\nCREATE TABLE aircraft (\n aid number(9,0),\n name varchar2(30),\n distance number(6,0)\n)\n\nCREATE TABLE certificate (\n eid number(9,0),\n aid number(9,0)\n)\n\nCREATE TABLE flight (\n flno number(4,0),\n origin varchar2(20),\n destination varchar2(20),\n distance number(6,0),\n departure_date date,\n arrival_date date,\n price number(7,2),\n aid number(9,0)\n)","response":"SELECT name, distance FROM aircraft ORDER BY distance","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show name and distance for all aircrafts by a bar chart, list by the y axis in ascending please. ### Input: CREATE TABLE employee (\n eid number(9,0),\n name varchar2(30),\n salary number(10,2)\n)\n\nCREATE TABLE aircraft (\n aid number(9,0),\n name varchar2(30),\n distance number(6,0)\n)\n\nCREATE TABLE certificate (\n eid number(9,0),\n aid number(9,0)\n)\n\nCREATE TABLE flight (\n flno number(4,0),\n origin varchar2(20),\n destination varchar2(20),\n distance number(6,0),\n departure_date date,\n arrival_date date,\n price number(7,2),\n aid number(9,0)\n) ### Response: SELECT name, distance FROM aircraft ORDER BY distance"} {"instruction":"Name the regions for usf45","input":"CREATE TABLE table_21530474_1 (\n region_s_ VARCHAR,\n chassis_code VARCHAR\n)","response":"SELECT region_s_ FROM table_21530474_1 WHERE chassis_code = \"USF45\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the regions for usf45 ### Input: CREATE TABLE table_21530474_1 (\n region_s_ VARCHAR,\n chassis_code VARCHAR\n) ### Response: SELECT region_s_ FROM table_21530474_1 WHERE chassis_code = \"USF45\""} {"instruction":"How many laps for robin montgomerie-charrington, and a Grid smaller than 15?","input":"CREATE TABLE table_name_18 (\n laps VARCHAR,\n driver VARCHAR,\n grid VARCHAR\n)","response":"SELECT COUNT(laps) FROM table_name_18 WHERE driver = \"robin montgomerie-charrington\" AND grid < 15","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many laps for robin montgomerie-charrington, and a Grid smaller than 15? ### Input: CREATE TABLE table_name_18 (\n laps VARCHAR,\n driver VARCHAR,\n grid VARCHAR\n) ### Response: SELECT COUNT(laps) FROM table_name_18 WHERE driver = \"robin montgomerie-charrington\" AND grid < 15"} {"instruction":"show me all flights on WN from SAN DIEGO to SAN FRANCISCO","input":"CREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'WN'","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all flights on WN from SAN DIEGO to SAN FRANCISCO ### Input: CREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'WN'"} {"instruction":"who is the driver with the engine era 1.5 l6 s and the chassis is era b?","input":"CREATE TABLE table_name_17 (\n driver VARCHAR,\n engine VARCHAR,\n chassis VARCHAR\n)","response":"SELECT driver FROM table_name_17 WHERE engine = \"era 1.5 l6 s\" AND chassis = \"era b\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the driver with the engine era 1.5 l6 s and the chassis is era b? ### Input: CREATE TABLE table_name_17 (\n driver VARCHAR,\n engine VARCHAR,\n chassis VARCHAR\n) ### Response: SELECT driver FROM table_name_17 WHERE engine = \"era 1.5 l6 s\" AND chassis = \"era b\""} {"instruction":"What is the average crowd size for games with hawthorn as the home side?","input":"CREATE TABLE table_name_8 (\n crowd INTEGER,\n home_team VARCHAR\n)","response":"SELECT AVG(crowd) FROM table_name_8 WHERE home_team = \"hawthorn\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average crowd size for games with hawthorn as the home side? ### Input: CREATE TABLE table_name_8 (\n crowd INTEGER,\n home_team VARCHAR\n) ### Response: SELECT AVG(crowd) FROM table_name_8 WHERE home_team = \"hawthorn\""} {"instruction":"who is the opponent when the method is tko (punches) at 4:26 of round 1?","input":"CREATE TABLE table_43573 (\n \"Result\" text,\n \"TUF Competitor\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Event\" text,\n \"Date\" text\n)","response":"SELECT \"Opponent\" FROM table_43573 WHERE \"Method\" = 'tko (punches) at 4:26 of round 1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the opponent when the method is tko (punches) at 4:26 of round 1? ### Input: CREATE TABLE table_43573 (\n \"Result\" text,\n \"TUF Competitor\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Event\" text,\n \"Date\" text\n) ### Response: SELECT \"Opponent\" FROM table_43573 WHERE \"Method\" = 'tko (punches) at 4:26 of round 1'"} {"instruction":"What's the sum of draw for artist hari mata hari with less than 70 points?","input":"CREATE TABLE table_11271 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Points\" real,\n \"Place\" real\n)","response":"SELECT SUM(\"Draw\") FROM table_11271 WHERE \"Artist\" = 'hari mata hari' AND \"Points\" < '70'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the sum of draw for artist hari mata hari with less than 70 points? ### Input: CREATE TABLE table_11271 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Points\" real,\n \"Place\" real\n) ### Response: SELECT SUM(\"Draw\") FROM table_11271 WHERE \"Artist\" = 'hari mata hari' AND \"Points\" < '70'"} {"instruction":"A bar chart about the name and age for all male people who don't have a wedding, could you display by the x axis in ascending?","input":"CREATE TABLE church (\n Church_ID int,\n Name text,\n Organized_by text,\n Open_Date int,\n Continuation_of text\n)\n\nCREATE TABLE wedding (\n Church_ID int,\n Male_ID int,\n Female_ID int,\n Year int\n)\n\nCREATE TABLE people (\n People_ID int,\n Name text,\n Country text,\n Is_Male text,\n Age int\n)","response":"SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about the name and age for all male people who don't have a wedding, could you display by the x axis in ascending? ### Input: CREATE TABLE church (\n Church_ID int,\n Name text,\n Organized_by text,\n Open_Date int,\n Continuation_of text\n)\n\nCREATE TABLE wedding (\n Church_ID int,\n Male_ID int,\n Female_ID int,\n Year int\n)\n\nCREATE TABLE people (\n People_ID int,\n Name text,\n Country text,\n Is_Male text,\n Age int\n) ### Response: SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Name"} {"instruction":"What number pick was the player for the Oakland Athletics who plays the 1B position?","input":"CREATE TABLE table_15226 (\n \"Pick\" real,\n \"Player\" text,\n \"Team\" text,\n \"Position\" text,\n \"School\" text\n)","response":"SELECT \"Pick\" FROM table_15226 WHERE \"Position\" = '1b' AND \"Team\" = 'oakland athletics'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What number pick was the player for the Oakland Athletics who plays the 1B position? ### Input: CREATE TABLE table_15226 (\n \"Pick\" real,\n \"Player\" text,\n \"Team\" text,\n \"Position\" text,\n \"School\" text\n) ### Response: SELECT \"Pick\" FROM table_15226 WHERE \"Position\" = '1b' AND \"Team\" = 'oakland athletics'"} {"instruction":"ground transportation in WESTCHESTER COUNTY","input":"CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)","response":"SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WESTCHESTER COUNTY' AND ground_service.city_code = city.city_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: ground transportation in WESTCHESTER COUNTY ### Input: CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n) ### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WESTCHESTER COUNTY' AND ground_service.city_code = city.city_code"} {"instruction":"What was the high amount of assists before game 60?","input":"CREATE TABLE table_50265 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"High assists\" FROM table_50265 WHERE \"Game\" < '60'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the high amount of assists before game 60? ### Input: CREATE TABLE table_50265 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"High assists\" FROM table_50265 WHERE \"Game\" < '60'"} {"instruction":"What stamp design has a denomination of $1.18?","input":"CREATE TABLE table_58443 (\n \"Date of Issue\" text,\n \"Denomination\" text,\n \"Design\" text,\n \"Paper Type\" text,\n \"First Day Cover Cancellation\" text\n)","response":"SELECT \"Design\" FROM table_58443 WHERE \"Denomination\" = '$1.18'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What stamp design has a denomination of $1.18? ### Input: CREATE TABLE table_58443 (\n \"Date of Issue\" text,\n \"Denomination\" text,\n \"Design\" text,\n \"Paper Type\" text,\n \"First Day Cover Cancellation\" text\n) ### Response: SELECT \"Design\" FROM table_58443 WHERE \"Denomination\" = '$1.18'"} {"instruction":"What are the nationalities and ages of journalists?","input":"CREATE TABLE journalist (\n journalist_id number,\n name text,\n nationality text,\n age text,\n years_working number\n)\n\nCREATE TABLE event (\n event_id number,\n date text,\n venue text,\n name text,\n event_attendance number\n)\n\nCREATE TABLE news_report (\n journalist_id number,\n event_id number,\n work_type text\n)","response":"SELECT nationality, age FROM journalist","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the nationalities and ages of journalists? ### Input: CREATE TABLE journalist (\n journalist_id number,\n name text,\n nationality text,\n age text,\n years_working number\n)\n\nCREATE TABLE event (\n event_id number,\n date text,\n venue text,\n name text,\n event_attendance number\n)\n\nCREATE TABLE news_report (\n journalist_id number,\n event_id number,\n work_type text\n) ### Response: SELECT nationality, age FROM journalist"} {"instruction":"Where did Jack Badcock play?","input":"CREATE TABLE table_34003 (\n \"Rank\" text,\n \"Runs\" text,\n \"Player\" text,\n \"Opponent\" text,\n \"Venue\" text,\n \"Season\" text\n)","response":"SELECT \"Venue\" FROM table_34003 WHERE \"Player\" = 'jack badcock'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did Jack Badcock play? ### Input: CREATE TABLE table_34003 (\n \"Rank\" text,\n \"Runs\" text,\n \"Player\" text,\n \"Opponent\" text,\n \"Venue\" text,\n \"Season\" text\n) ### Response: SELECT \"Venue\" FROM table_34003 WHERE \"Player\" = 'jack badcock'"} {"instruction":"what is the player who's college is listed as direct to nba, school is st. vincent st. mary high school and the year is 2001-2002?","input":"CREATE TABLE table_17100 (\n \"Year\" text,\n \"Player\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text,\n \"NBA Draft\" text\n)","response":"SELECT \"Player\" FROM table_17100 WHERE \"College\" = 'Direct to NBA' AND \"School\" = 'St. Vincent \u2013 St. Mary High School' AND \"Year\" = '2001-2002'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the player who's college is listed as direct to nba, school is st. vincent st. mary high school and the year is 2001-2002? ### Input: CREATE TABLE table_17100 (\n \"Year\" text,\n \"Player\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text,\n \"NBA Draft\" text\n) ### Response: SELECT \"Player\" FROM table_17100 WHERE \"College\" = 'Direct to NBA' AND \"School\" = 'St. Vincent \u2013 St. Mary High School' AND \"Year\" = '2001-2002'"} {"instruction":"What was the highest amount of laps when the class was v8 and the entrant was diet-coke racing?","input":"CREATE TABLE table_name_13 (\n laps INTEGER,\n class VARCHAR,\n entrant VARCHAR\n)","response":"SELECT MAX(laps) FROM table_name_13 WHERE class = \"v8\" AND entrant = \"diet-coke racing\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest amount of laps when the class was v8 and the entrant was diet-coke racing? ### Input: CREATE TABLE table_name_13 (\n laps INTEGER,\n class VARCHAR,\n entrant VARCHAR\n) ### Response: SELECT MAX(laps) FROM table_name_13 WHERE class = \"v8\" AND entrant = \"diet-coke racing\""} {"instruction":"What is the oder part number for the model with 10x mult. 1?","input":"CREATE TABLE table_27277284_28 (\n order_part_number VARCHAR,\n mult_1 VARCHAR\n)","response":"SELECT order_part_number FROM table_27277284_28 WHERE mult_1 = \"10x\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the oder part number for the model with 10x mult. 1? ### Input: CREATE TABLE table_27277284_28 (\n order_part_number VARCHAR,\n mult_1 VARCHAR\n) ### Response: SELECT order_part_number FROM table_27277284_28 WHERE mult_1 = \"10x\""} {"instruction":"What is the score of the home team that played at brunswick street oval with a crowd larger than 12,000?","input":"CREATE TABLE table_57262 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team score\" FROM table_57262 WHERE \"Crowd\" > '12,000' AND \"Venue\" = 'brunswick street oval'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of the home team that played at brunswick street oval with a crowd larger than 12,000? ### Input: CREATE TABLE table_57262 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team score\" FROM table_57262 WHERE \"Crowd\" > '12,000' AND \"Venue\" = 'brunswick street oval'"} {"instruction":"What is the location for the software of BIND and an IPv6 address of 2001:503:c27::2:30?","input":"CREATE TABLE table_46736 (\n \"Letter\" text,\n \"IPv6 address\" text,\n \"AS-number\" text,\n \"Operator\" text,\n \"Location #sites (global\/local)\" text,\n \"Software\" text\n)","response":"SELECT \"Location #sites (global\/local)\" FROM table_46736 WHERE \"Software\" = 'bind' AND \"IPv6 address\" = '2001:503:c27::2:30'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the location for the software of BIND and an IPv6 address of 2001:503:c27::2:30? ### Input: CREATE TABLE table_46736 (\n \"Letter\" text,\n \"IPv6 address\" text,\n \"AS-number\" text,\n \"Operator\" text,\n \"Location #sites (global\/local)\" text,\n \"Software\" text\n) ### Response: SELECT \"Location #sites (global\/local)\" FROM table_46736 WHERE \"Software\" = 'bind' AND \"IPv6 address\" = '2001:503:c27::2:30'"} {"instruction":"How many grids have a Time\/Retired of gearbox, and Laps smaller than 3?","input":"CREATE TABLE table_name_98 (\n grid VARCHAR,\n time_retired VARCHAR,\n laps VARCHAR\n)","response":"SELECT COUNT(grid) FROM table_name_98 WHERE time_retired = \"gearbox\" AND laps < 3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many grids have a Time\/Retired of gearbox, and Laps smaller than 3? ### Input: CREATE TABLE table_name_98 (\n grid VARCHAR,\n time_retired VARCHAR,\n laps VARCHAR\n) ### Response: SELECT COUNT(grid) FROM table_name_98 WHERE time_retired = \"gearbox\" AND laps < 3"} {"instruction":"What is Joe Jonas' result at the Kids' Choice Awards Mexico?","input":"CREATE TABLE table_15555 (\n \"Year\" real,\n \"Award\" text,\n \"Category\" text,\n \"Recipient(s)\" text,\n \"Result\" text\n)","response":"SELECT \"Result\" FROM table_15555 WHERE \"Recipient(s)\" = 'joe jonas' AND \"Award\" = 'kids'' choice awards mexico'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Joe Jonas' result at the Kids' Choice Awards Mexico? ### Input: CREATE TABLE table_15555 (\n \"Year\" real,\n \"Award\" text,\n \"Category\" text,\n \"Recipient(s)\" text,\n \"Result\" text\n) ### Response: SELECT \"Result\" FROM table_15555 WHERE \"Recipient(s)\" = 'joe jonas' AND \"Award\" = 'kids'' choice awards mexico'"} {"instruction":"What is the date for the episode performed by Sue Manchester?","input":"CREATE TABLE table_191105_4 (\n first_aired VARCHAR,\n performed_by VARCHAR\n)","response":"SELECT first_aired FROM table_191105_4 WHERE performed_by = \"Sue Manchester\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date for the episode performed by Sue Manchester? ### Input: CREATE TABLE table_191105_4 (\n first_aired VARCHAR,\n performed_by VARCHAR\n) ### Response: SELECT first_aired FROM table_191105_4 WHERE performed_by = \"Sue Manchester\""} {"instruction":"What is the evening gown score of the contestant from the District of Columbia with preliminaries smaller than 8.647?","input":"CREATE TABLE table_11829 (\n \"State\" text,\n \"Preliminaries\" real,\n \"Interview\" real,\n \"Swimsuit\" real,\n \"Evening Gown\" real,\n \"Average\" real\n)","response":"SELECT COUNT(\"Evening Gown\") FROM table_11829 WHERE \"Preliminaries\" < '8.647' AND \"State\" = 'district of columbia'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the evening gown score of the contestant from the District of Columbia with preliminaries smaller than 8.647? ### Input: CREATE TABLE table_11829 (\n \"State\" text,\n \"Preliminaries\" real,\n \"Interview\" real,\n \"Swimsuit\" real,\n \"Evening Gown\" real,\n \"Average\" real\n) ### Response: SELECT COUNT(\"Evening Gown\") FROM table_11829 WHERE \"Preliminaries\" < '8.647' AND \"State\" = 'district of columbia'"} {"instruction":"List the location and number of fans in attendance for game 7\/","input":"CREATE TABLE table_25367 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT COUNT(\"Location Attendance\") FROM table_25367 WHERE \"Game\" = '7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the location and number of fans in attendance for game 7\/ ### Input: CREATE TABLE table_25367 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT COUNT(\"Location Attendance\") FROM table_25367 WHERE \"Game\" = '7'"} {"instruction":"what's the name of the procedure that patient 25814 was given two times since 154 months ago?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)","response":"SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-154 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the name of the procedure that patient 25814 was given two times since 154 months ago? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n) ### Response: SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-154 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2)"} {"instruction":"Show the most common nationality for journalists.","input":"CREATE TABLE journalist (\n Nationality VARCHAR\n)","response":"SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the most common nationality for journalists. ### Input: CREATE TABLE journalist (\n Nationality VARCHAR\n) ### Response: SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1"} {"instruction":"What Country scored 72-65-73=210?","input":"CREATE TABLE table_8815 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n)","response":"SELECT \"Country\" FROM table_8815 WHERE \"Score\" = '72-65-73=210'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Country scored 72-65-73=210? ### Input: CREATE TABLE table_8815 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n) ### Response: SELECT \"Country\" FROM table_8815 WHERE \"Score\" = '72-65-73=210'"} {"instruction":"What was the Result of the game after Week 9 with an Attendance of 69,714?","input":"CREATE TABLE table_48615 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" text\n)","response":"SELECT \"Result\" FROM table_48615 WHERE \"Week\" > '9' AND \"Attendance\" = '69,714'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Result of the game after Week 9 with an Attendance of 69,714? ### Input: CREATE TABLE table_48615 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Result\" FROM table_48615 WHERE \"Week\" > '9' AND \"Attendance\" = '69,714'"} {"instruction":"What was the genre of Queen (an artist from the United Kingdom)?","input":"CREATE TABLE table_15675 (\n \"Artist\" text,\n \"Country of origin\" text,\n \"Period active\" text,\n \"Release-year of first charted record\" real,\n \"Genre\" text,\n \"Claimed sales\" text\n)","response":"SELECT \"Genre\" FROM table_15675 WHERE \"Country of origin\" = 'united kingdom' AND \"Artist\" = 'queen'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the genre of Queen (an artist from the United Kingdom)? ### Input: CREATE TABLE table_15675 (\n \"Artist\" text,\n \"Country of origin\" text,\n \"Period active\" text,\n \"Release-year of first charted record\" real,\n \"Genre\" text,\n \"Claimed sales\" text\n) ### Response: SELECT \"Genre\" FROM table_15675 WHERE \"Country of origin\" = 'united kingdom' AND \"Artist\" = 'queen'"} {"instruction":"previous to the tippeligaen , what was the league called ?","input":"CREATE TABLE table_203_683 (\n id number,\n \"season\" text,\n \"league\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"winning manager\" text\n)","response":"SELECT \"league\" FROM table_203_683 WHERE \"season\" < (SELECT \"season\" FROM table_203_683 WHERE \"league\" = 'tippeligaen') ORDER BY \"season\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: previous to the tippeligaen , what was the league called ? ### Input: CREATE TABLE table_203_683 (\n id number,\n \"season\" text,\n \"league\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"winning manager\" text\n) ### Response: SELECT \"league\" FROM table_203_683 WHERE \"season\" < (SELECT \"season\" FROM table_203_683 WHERE \"league\" = 'tippeligaen') ORDER BY \"season\" DESC LIMIT 1"} {"instruction":"What was the attendance during the week 1 match?","input":"CREATE TABLE table_32927 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n)","response":"SELECT \"Attendance\" FROM table_32927 WHERE \"Week\" = '1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the attendance during the week 1 match? ### Input: CREATE TABLE table_32927 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n) ### Response: SELECT \"Attendance\" FROM table_32927 WHERE \"Week\" = '1'"} {"instruction":"what is the name of drug that patient 63676 was prescribed for within 2 days after having been diagnosed with gstr\/ddnts nos w hmrhg in 03\/2105?","input":"CREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)","response":"SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 63676 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gstr\/ddnts nos w hmrhg') AND STRFTIME('%y-%m', diagnoses_icd.charttime) = '2105-03') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 63676 AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-03') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of drug that patient 63676 was prescribed for within 2 days after having been diagnosed with gstr\/ddnts nos w hmrhg in 03\/2105? ### Input: CREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n) ### Response: SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 63676 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gstr\/ddnts nos w hmrhg') AND STRFTIME('%y-%m', diagnoses_icd.charttime) = '2105-03') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 63676 AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-03') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')"} {"instruction":"A bar chart shows the distribution of personal_name and gender_mf .","input":"CREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)","response":"SELECT personal_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of personal_name and gender_mf . ### Input: CREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)\n\nCREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n) ### Response: SELECT personal_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name"} {"instruction":"What was the highest number of wins for any team?","input":"CREATE TABLE table_18018214_3 (\n wins INTEGER\n)","response":"SELECT MAX(wins) FROM table_18018214_3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest number of wins for any team? ### Input: CREATE TABLE table_18018214_3 (\n wins INTEGER\n) ### Response: SELECT MAX(wins) FROM table_18018214_3"} {"instruction":"Distribution of Flagged Posts by Time (Hours) to close.","input":"CREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)","response":"SELECT diff1 AS hoursToClose, COUNT(*) FROM (SELECT CAST((JULIANDAY(ClosedDate) - JULIANDAY(d.CreationDate)) * 24.0 AS INT) AS \"diff1\", TIME_TO_STR(d.CreationDate, '%y-%m') AS \"date1\", TIME_TO_STR(d.ClosedDate, '%y-%m') AS \"date2\", (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId WHERE (d.PostTypeId = 1 OR d.PostTypeId = 2) AND ph.PostHistoryTypeId = 10) AS t1 GROUP BY diff1 ORDER BY diff1","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Distribution of Flagged Posts by Time (Hours) to close. ### Input: CREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n) ### Response: SELECT diff1 AS hoursToClose, COUNT(*) FROM (SELECT CAST((JULIANDAY(ClosedDate) - JULIANDAY(d.CreationDate)) * 24.0 AS INT) AS \"diff1\", TIME_TO_STR(d.CreationDate, '%y-%m') AS \"date1\", TIME_TO_STR(d.ClosedDate, '%y-%m') AS \"date2\", (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId WHERE (d.PostTypeId = 1 OR d.PostTypeId = 2) AND ph.PostHistoryTypeId = 10) AS t1 GROUP BY diff1 ORDER BY diff1"} {"instruction":"count the number of patients whose marital status is single and lab test name is hyaline casts?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = \"SINGLE\" AND lab.label = \"Hyaline Casts\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose marital status is single and lab test name is hyaline casts? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = \"SINGLE\" AND lab.label = \"Hyaline Casts\""} {"instruction":"What is the largest numbered?","input":"CREATE TABLE table_14723382_1 (\n division INTEGER\n)","response":"SELECT MAX(division) FROM table_14723382_1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest numbered? ### Input: CREATE TABLE table_14723382_1 (\n division INTEGER\n) ### Response: SELECT MAX(division) FROM table_14723382_1"} {"instruction":"How many Laps were there in 2010?","input":"CREATE TABLE table_name_46 (\n laps INTEGER,\n year VARCHAR\n)","response":"SELECT SUM(laps) FROM table_name_46 WHERE year = 2010","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Laps were there in 2010? ### Input: CREATE TABLE table_name_46 (\n laps INTEGER,\n year VARCHAR\n) ### Response: SELECT SUM(laps) FROM table_name_46 WHERE year = 2010"} {"instruction":"Who was the husband date that was married in 1858?","input":"CREATE TABLE table_name_54 (\n husband_dates VARCHAR,\n date_married VARCHAR\n)","response":"SELECT husband_dates FROM table_name_54 WHERE date_married = \"1858\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the husband date that was married in 1858? ### Input: CREATE TABLE table_name_54 (\n husband_dates VARCHAR,\n date_married VARCHAR\n) ### Response: SELECT husband_dates FROM table_name_54 WHERE date_married = \"1858\""} {"instruction":"Which FA Cup Goals have League Cup Apps larger than 0, and a Name of trevor cherry?","input":"CREATE TABLE table_65892 (\n \"Name\" text,\n \"Position\" text,\n \"League Apps\" text,\n \"League Goals\" real,\n \"FA Cup Apps\" text,\n \"FA Cup Goals\" real,\n \"League Cup Apps\" real,\n \"League Cup Goals\" real,\n \"Total Apps\" text,\n \"Total Goals\" real\n)","response":"SELECT MAX(\"FA Cup Goals\") FROM table_65892 WHERE \"League Cup Apps\" > '0' AND \"Name\" = 'trevor cherry'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which FA Cup Goals have League Cup Apps larger than 0, and a Name of trevor cherry? ### Input: CREATE TABLE table_65892 (\n \"Name\" text,\n \"Position\" text,\n \"League Apps\" text,\n \"League Goals\" real,\n \"FA Cup Apps\" text,\n \"FA Cup Goals\" real,\n \"League Cup Apps\" real,\n \"League Cup Goals\" real,\n \"Total Apps\" text,\n \"Total Goals\" real\n) ### Response: SELECT MAX(\"FA Cup Goals\") FROM table_65892 WHERE \"League Cup Apps\" > '0' AND \"Name\" = 'trevor cherry'"} {"instruction":"Get Posts and Upvotes for Last X days. This query takes in a given integer X and returns all posts from the last X days as well as the votes on each of those posts.","input":"CREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)","response":"SELECT COUNT(DISTINCT Posts.Id) FROM Posts WHERE Posts.CreationDate >= CURRENT_TIMESTAMP() - @numDays","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Get Posts and Upvotes for Last X days. This query takes in a given integer X and returns all posts from the last X days as well as the votes on each of those posts. ### Input: CREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n) ### Response: SELECT COUNT(DISTINCT Posts.Id) FROM Posts WHERE Posts.CreationDate >= CURRENT_TIMESTAMP() - @numDays"} {"instruction":"What is the class of team liqui moly equipe, which has less than 71 laps?","input":"CREATE TABLE table_48102 (\n \"Class\" text,\n \"Team\" text,\n \"Driver\" text,\n \"Chassis \\u2013 Engine\" text,\n \"Laps\" real\n)","response":"SELECT \"Class\" FROM table_48102 WHERE \"Laps\" < '71' AND \"Team\" = 'liqui moly equipe'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the class of team liqui moly equipe, which has less than 71 laps? ### Input: CREATE TABLE table_48102 (\n \"Class\" text,\n \"Team\" text,\n \"Driver\" text,\n \"Chassis \\u2013 Engine\" text,\n \"Laps\" real\n) ### Response: SELECT \"Class\" FROM table_48102 WHERE \"Laps\" < '71' AND \"Team\" = 'liqui moly equipe'"} {"instruction":"If the playoff berth is 17, what is the AFC championship number?","input":"CREATE TABLE table_23060 (\n \"Team\" text,\n \"Division Titles\" real,\n \"Playoff Berths\" real,\n \"AFL Titles\" real,\n \"AFC Championships\" real,\n \"Super Bowl Championships\" real\n)","response":"SELECT \"AFC Championships\" FROM table_23060 WHERE \"Playoff Berths\" = '17'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the playoff berth is 17, what is the AFC championship number? ### Input: CREATE TABLE table_23060 (\n \"Team\" text,\n \"Division Titles\" real,\n \"Playoff Berths\" real,\n \"AFL Titles\" real,\n \"AFC Championships\" real,\n \"Super Bowl Championships\" real\n) ### Response: SELECT \"AFC Championships\" FROM table_23060 WHERE \"Playoff Berths\" = '17'"} {"instruction":"What was the range of finishing position for 15 awarded platinum points?","input":"CREATE TABLE table_11254821_2 (\n finishing_position VARCHAR,\n points_awarded__platinum_ VARCHAR\n)","response":"SELECT finishing_position FROM table_11254821_2 WHERE points_awarded__platinum_ = 15","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the range of finishing position for 15 awarded platinum points? ### Input: CREATE TABLE table_11254821_2 (\n finishing_position VARCHAR,\n points_awarded__platinum_ VARCHAR\n) ### Response: SELECT finishing_position FROM table_11254821_2 WHERE points_awarded__platinum_ = 15"} {"instruction":"What is the attendance number for December 2, 1979?","input":"CREATE TABLE table_70615 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n)","response":"SELECT SUM(\"Attendance\") FROM table_70615 WHERE \"Date\" = 'december 2, 1979'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the attendance number for December 2, 1979? ### Input: CREATE TABLE table_70615 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n) ### Response: SELECT SUM(\"Attendance\") FROM table_70615 WHERE \"Date\" = 'december 2, 1979'"} {"instruction":"How many seconds is a shuttle run that give 2 points?","input":"CREATE TABLE table_name_54 (\n shuttle_run__sec_ VARCHAR,\n points VARCHAR\n)","response":"SELECT shuttle_run__sec_ FROM table_name_54 WHERE points = 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many seconds is a shuttle run that give 2 points? ### Input: CREATE TABLE table_name_54 (\n shuttle_run__sec_ VARCHAR,\n points VARCHAR\n) ### Response: SELECT shuttle_run__sec_ FROM table_name_54 WHERE points = 2"} {"instruction":"Questions Using Popular Tags In January 2019. Questions Using Popular Tags In January 2019\nTags with rate of use over 4 times on this site.","input":"CREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT Id AS \"post_link\", Id, CreationDate, AnswerCount, CommentCount, rate.TagId FROM Posts, PostTags, (SELECT COUNT(PostId) AS Rate, TagId FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2019-03-01' AND Posts.CreationDate > '2019-01-01' GROUP BY TagId, TagName HAVING COUNT(PostId) > 4) AS rate WHERE rate.TagId = PostTags.TagId AND Posts.Id = PostId AND CreationDate > '2019-01-01' AND CreationDate < '2019-01-03' AND DeletionDate IS NULL AND AnswerCount > 0 AND CommentCount > 0","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions Using Popular Tags In January 2019. Questions Using Popular Tags In January 2019\nTags with rate of use over 4 times on this site. ### Input: CREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT Id AS \"post_link\", Id, CreationDate, AnswerCount, CommentCount, rate.TagId FROM Posts, PostTags, (SELECT COUNT(PostId) AS Rate, TagId FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2019-03-01' AND Posts.CreationDate > '2019-01-01' GROUP BY TagId, TagName HAVING COUNT(PostId) > 4) AS rate WHERE rate.TagId = PostTags.TagId AND Posts.Id = PostId AND CreationDate > '2019-01-01' AND CreationDate < '2019-01-03' AND DeletionDate IS NULL AND AnswerCount > 0 AND CommentCount > 0"} {"instruction":"In what place is the player with a score of 72-66-75=213?","input":"CREATE TABLE table_name_13 (\n place VARCHAR,\n score VARCHAR\n)","response":"SELECT place FROM table_name_13 WHERE score = 72 - 66 - 75 = 213","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what place is the player with a score of 72-66-75=213? ### Input: CREATE TABLE table_name_13 (\n place VARCHAR,\n score VARCHAR\n) ### Response: SELECT place FROM table_name_13 WHERE score = 72 - 66 - 75 = 213"} {"instruction":"What is the location attendance of the game with a 27-22 record?","input":"CREATE TABLE table_38827 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Location Attendance\" FROM table_38827 WHERE \"Record\" = '27-22'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the location attendance of the game with a 27-22 record? ### Input: CREATE TABLE table_38827 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Location Attendance\" FROM table_38827 WHERE \"Record\" = '27-22'"} {"instruction":"how many patients are admitted under urgency and followed the procedure colonoscopy?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"URGENT\" AND procedures.short_title = \"Colonoscopy\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are admitted under urgency and followed the procedure colonoscopy? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"URGENT\" AND procedures.short_title = \"Colonoscopy\""} {"instruction":"What is the amount of assists for richmond kickers and points larger than 24","input":"CREATE TABLE table_name_32 (\n assists INTEGER,\n club VARCHAR,\n points VARCHAR\n)","response":"SELECT SUM(assists) FROM table_name_32 WHERE club = \"richmond kickers\" AND points > 24","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the amount of assists for richmond kickers and points larger than 24 ### Input: CREATE TABLE table_name_32 (\n assists INTEGER,\n club VARCHAR,\n points VARCHAR\n) ### Response: SELECT SUM(assists) FROM table_name_32 WHERE club = \"richmond kickers\" AND points > 24"} {"instruction":"what was the four most often given procedures for patients 40s?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the four most often given procedures for patients 40s? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4"} {"instruction":"Who was the Republican when the green was Harold Burbank?","input":"CREATE TABLE table_name_27 (\n republican VARCHAR,\n green VARCHAR\n)","response":"SELECT republican FROM table_name_27 WHERE green = \"harold burbank\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the Republican when the green was Harold Burbank? ### Input: CREATE TABLE table_name_27 (\n republican VARCHAR,\n green VARCHAR\n) ### Response: SELECT republican FROM table_name_27 WHERE green = \"harold burbank\""} {"instruction":"How big (in km2) is Persarmenia?","input":"CREATE TABLE table_26375 (\n \"Province (ashkharh)\" text,\n \"Armenian name\" text,\n \"Area (km\\u00b2)\" real,\n \"Number of cantons (gavars)\" real,\n \"Center\" text\n)","response":"SELECT \"Area (km\\u00b2)\" FROM table_26375 WHERE \"Province (ashkharh)\" = 'Persarmenia'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How big (in km2) is Persarmenia? ### Input: CREATE TABLE table_26375 (\n \"Province (ashkharh)\" text,\n \"Armenian name\" text,\n \"Area (km\\u00b2)\" real,\n \"Number of cantons (gavars)\" real,\n \"Center\" text\n) ### Response: SELECT \"Area (km\\u00b2)\" FROM table_26375 WHERE \"Province (ashkharh)\" = 'Persarmenia'"} {"instruction":"What is the score March 27?","input":"CREATE TABLE table_name_55 (\n score VARCHAR,\n date VARCHAR\n)","response":"SELECT score FROM table_name_55 WHERE date = \"march 27\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score March 27? ### Input: CREATE TABLE table_name_55 (\n score VARCHAR,\n date VARCHAR\n) ### Response: SELECT score FROM table_name_55 WHERE date = \"march 27\""} {"instruction":"Top 10 Meta users from Nigeria.","input":"CREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)","response":"SELECT * FROM Users WHERE Location LIKE '%Nigeria' ORDER BY Reputation DESC LIMIT 10","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 10 Meta users from Nigeria. ### Input: CREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n) ### Response: SELECT * FROM Users WHERE Location LIKE '%Nigeria' ORDER BY Reputation DESC LIMIT 10"} {"instruction":"How many pints does the Cambrian Welfare RFC have?","input":"CREATE TABLE table_name_50 (\n points_for VARCHAR,\n club VARCHAR\n)","response":"SELECT points_for FROM table_name_50 WHERE club = \"cambrian welfare rfc\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many pints does the Cambrian Welfare RFC have? ### Input: CREATE TABLE table_name_50 (\n points_for VARCHAR,\n club VARCHAR\n) ### Response: SELECT points_for FROM table_name_50 WHERE club = \"cambrian welfare rfc\""} {"instruction":"What kind of Sanskrit has a Kannada of uttara ?","input":"CREATE TABLE table_35105 (\n \"Sanskrit \\u0938\\u0902\\u0938\\u094d\\u0915\\u0943\\u0924\\u092e\\u094d\" text,\n \"Tamil \\u0ba4\\u0bae\\u0bbf\\u0bb4\\u0bcd\" text,\n \"Telugu \\u0c24\\u0c46\\u0c32\\u0c41\\u0c17\\u0c41\" text,\n \"Kannada \\u0c95\\u0ca8\\u0ccd\\u0ca8\\u0ca1\" text,\n \"Malayalam \\u0d2e\\u0d32\\u0d2f\\u0d3e\\u0d33\\u0d02\" text,\n \"Mongolian\" text\n)","response":"SELECT \"Sanskrit \\u0938\\u0902\\u0938\\u094d\\u0915\\u0943\\u0924\\u092e\\u094d\" FROM table_35105 WHERE \"Kannada \\u0c95\\u0ca8\\u0ccd\\u0ca8\\u0ca1\" = 'uttara \u0c89\u0ca4\u0ccd\u0ca4\u0cb0\u0cbe'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What kind of Sanskrit has a Kannada of uttara ? ### Input: CREATE TABLE table_35105 (\n \"Sanskrit \\u0938\\u0902\\u0938\\u094d\\u0915\\u0943\\u0924\\u092e\\u094d\" text,\n \"Tamil \\u0ba4\\u0bae\\u0bbf\\u0bb4\\u0bcd\" text,\n \"Telugu \\u0c24\\u0c46\\u0c32\\u0c41\\u0c17\\u0c41\" text,\n \"Kannada \\u0c95\\u0ca8\\u0ccd\\u0ca8\\u0ca1\" text,\n \"Malayalam \\u0d2e\\u0d32\\u0d2f\\u0d3e\\u0d33\\u0d02\" text,\n \"Mongolian\" text\n) ### Response: SELECT \"Sanskrit \\u0938\\u0902\\u0938\\u094d\\u0915\\u0943\\u0924\\u092e\\u094d\" FROM table_35105 WHERE \"Kannada \\u0c95\\u0ca8\\u0ccd\\u0ca8\\u0ca1\" = 'uttara \u0c89\u0ca4\u0ccd\u0ca4\u0cb0\u0cbe'"} {"instruction":"How is the marriage of who became queen on 30 October 1816 husband's accession?","input":"CREATE TABLE table_6115 (\n \"Name\" text,\n \"Birth\" text,\n \"Marriage\" text,\n \"Became Queen\" text,\n \"Ceased to be Queen\" text,\n \"Death\" text,\n \"Spouse\" text\n)","response":"SELECT \"Marriage\" FROM table_6115 WHERE \"Became Queen\" = '30 october 1816 husband''s accession'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How is the marriage of who became queen on 30 October 1816 husband's accession? ### Input: CREATE TABLE table_6115 (\n \"Name\" text,\n \"Birth\" text,\n \"Marriage\" text,\n \"Became Queen\" text,\n \"Ceased to be Queen\" text,\n \"Death\" text,\n \"Spouse\" text\n) ### Response: SELECT \"Marriage\" FROM table_6115 WHERE \"Became Queen\" = '30 october 1816 husband''s accession'"} {"instruction":"How many customers live in Prague city?","input":"CREATE TABLE media_types (\n id number,\n name text\n)\n\nCREATE TABLE employees (\n id number,\n last_name text,\n first_name text,\n title text,\n reports_to number,\n birth_date time,\n hire_date time,\n address text,\n city text,\n state text,\n country text,\n postal_code text,\n phone text,\n fax text,\n email text\n)\n\nCREATE TABLE invoices (\n id number,\n customer_id number,\n invoice_date time,\n billing_address text,\n billing_city text,\n billing_state text,\n billing_country text,\n billing_postal_code text,\n total number\n)\n\nCREATE TABLE genres (\n id number,\n name text\n)\n\nCREATE TABLE invoice_lines (\n id number,\n invoice_id number,\n track_id number,\n unit_price number,\n quantity number\n)\n\nCREATE TABLE artists (\n id number,\n name text\n)\n\nCREATE TABLE sqlite_sequence (\n name text,\n seq text\n)\n\nCREATE TABLE tracks (\n id number,\n name text,\n album_id number,\n media_type_id number,\n genre_id number,\n composer text,\n milliseconds number,\n bytes number,\n unit_price number\n)\n\nCREATE TABLE customers (\n id number,\n first_name text,\n last_name text,\n company text,\n address text,\n city text,\n state text,\n country text,\n postal_code text,\n phone text,\n fax text,\n email text,\n support_rep_id number\n)\n\nCREATE TABLE playlist_tracks (\n playlist_id number,\n track_id number\n)\n\nCREATE TABLE playlists (\n id number,\n name text\n)\n\nCREATE TABLE albums (\n id number,\n title text,\n artist_id number\n)","response":"SELECT COUNT(*) FROM customers WHERE city = \"Prague\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many customers live in Prague city? ### Input: CREATE TABLE media_types (\n id number,\n name text\n)\n\nCREATE TABLE employees (\n id number,\n last_name text,\n first_name text,\n title text,\n reports_to number,\n birth_date time,\n hire_date time,\n address text,\n city text,\n state text,\n country text,\n postal_code text,\n phone text,\n fax text,\n email text\n)\n\nCREATE TABLE invoices (\n id number,\n customer_id number,\n invoice_date time,\n billing_address text,\n billing_city text,\n billing_state text,\n billing_country text,\n billing_postal_code text,\n total number\n)\n\nCREATE TABLE genres (\n id number,\n name text\n)\n\nCREATE TABLE invoice_lines (\n id number,\n invoice_id number,\n track_id number,\n unit_price number,\n quantity number\n)\n\nCREATE TABLE artists (\n id number,\n name text\n)\n\nCREATE TABLE sqlite_sequence (\n name text,\n seq text\n)\n\nCREATE TABLE tracks (\n id number,\n name text,\n album_id number,\n media_type_id number,\n genre_id number,\n composer text,\n milliseconds number,\n bytes number,\n unit_price number\n)\n\nCREATE TABLE customers (\n id number,\n first_name text,\n last_name text,\n company text,\n address text,\n city text,\n state text,\n country text,\n postal_code text,\n phone text,\n fax text,\n email text,\n support_rep_id number\n)\n\nCREATE TABLE playlist_tracks (\n playlist_id number,\n track_id number\n)\n\nCREATE TABLE playlists (\n id number,\n name text\n)\n\nCREATE TABLE albums (\n id number,\n title text,\n artist_id number\n) ### Response: SELECT COUNT(*) FROM customers WHERE city = \"Prague\""} {"instruction":"What was the rating\/share for 18-49 for the episode that had 5.90 million viewers?","input":"CREATE TABLE table_23730973_5 (\n rating VARCHAR,\n viewers__millions_ VARCHAR\n)","response":"SELECT rating \/ SHARE(18 - 49) FROM table_23730973_5 WHERE viewers__millions_ = \"5.90\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the rating\/share for 18-49 for the episode that had 5.90 million viewers? ### Input: CREATE TABLE table_23730973_5 (\n rating VARCHAR,\n viewers__millions_ VARCHAR\n) ### Response: SELECT rating \/ SHARE(18 - 49) FROM table_23730973_5 WHERE viewers__millions_ = \"5.90\""} {"instruction":"Return a bar chart on what are the different ship flags, and how many ships have each?, list by the Y-axis in descending.","input":"CREATE TABLE captain (\n Captain_ID int,\n Name text,\n Ship_ID int,\n age text,\n Class text,\n Rank text\n)\n\nCREATE TABLE Ship (\n Ship_ID int,\n Name text,\n Type text,\n Built_Year real,\n Class text,\n Flag text\n)","response":"SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on what are the different ship flags, and how many ships have each?, list by the Y-axis in descending. ### Input: CREATE TABLE captain (\n Captain_ID int,\n Name text,\n Ship_ID int,\n age text,\n Class text,\n Rank text\n)\n\nCREATE TABLE Ship (\n Ship_ID int,\n Name text,\n Type text,\n Built_Year real,\n Class text,\n Flag text\n) ### Response: SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY COUNT(*) DESC"} {"instruction":"provide the admission time and marital status of subject id 6983.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.marital_status, demographic.admittime FROM demographic WHERE demographic.subject_id = \"6983\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the admission time and marital status of subject id 6983. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.marital_status, demographic.admittime FROM demographic WHERE demographic.subject_id = \"6983\""} {"instruction":"Which format has january 21, 2002 as the date?","input":"CREATE TABLE table_44036 (\n \"Region\" text,\n \"Date\" text,\n \"Label\" text,\n \"Format\" text,\n \"Catalog\" text\n)","response":"SELECT \"Format\" FROM table_44036 WHERE \"Date\" = 'january 21, 2002'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which format has january 21, 2002 as the date? ### Input: CREATE TABLE table_44036 (\n \"Region\" text,\n \"Date\" text,\n \"Label\" text,\n \"Format\" text,\n \"Catalog\" text\n) ### Response: SELECT \"Format\" FROM table_44036 WHERE \"Date\" = 'january 21, 2002'"} {"instruction":"What is the link of rnaz that predicts an alignment of input?","input":"CREATE TABLE table_34127 (\n \"Name\" text,\n \"Number of sequences Number of sequences: .\" text,\n \"Alignment Alignment: predicts an alignment , .\" text,\n \"Structure Structure: predicts structure , .\" text,\n \"Link\" text\n)","response":"SELECT \"Link\" FROM table_34127 WHERE \"Alignment Alignment: predicts an alignment , .\" = 'input' AND \"Name\" = 'rnaz'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the link of rnaz that predicts an alignment of input? ### Input: CREATE TABLE table_34127 (\n \"Name\" text,\n \"Number of sequences Number of sequences: .\" text,\n \"Alignment Alignment: predicts an alignment , .\" text,\n \"Structure Structure: predicts structure , .\" text,\n \"Link\" text\n) ### Response: SELECT \"Link\" FROM table_34127 WHERE \"Alignment Alignment: predicts an alignment , .\" = 'input' AND \"Name\" = 'rnaz'"} {"instruction":"What kind of Week 4 has a Week 9 of all housemates?","input":"CREATE TABLE table_59962 (\n \"Week 1\" text,\n \"Week 2\" text,\n \"Week 3\" text,\n \"Week 4\" text,\n \"Week 5\" text,\n \"Week 6\" text,\n \"Week 7\" text,\n \"Week 8\" text,\n \"Week 9\" text,\n \"Week 10 FINAL\" text\n)","response":"SELECT \"Week 4\" FROM table_59962 WHERE \"Week 9\" = 'all housemates'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What kind of Week 4 has a Week 9 of all housemates? ### Input: CREATE TABLE table_59962 (\n \"Week 1\" text,\n \"Week 2\" text,\n \"Week 3\" text,\n \"Week 4\" text,\n \"Week 5\" text,\n \"Week 6\" text,\n \"Week 7\" text,\n \"Week 8\" text,\n \"Week 9\" text,\n \"Week 10 FINAL\" text\n) ### Response: SELECT \"Week 4\" FROM table_59962 WHERE \"Week 9\" = 'all housemates'"} {"instruction":"What was the transfer fee for the player moving in the winter window and ending in a year after 2010?","input":"CREATE TABLE table_7726 (\n \"Nat.\" text,\n \"Name\" text,\n \"Moving from\" text,\n \"Type\" text,\n \"Transfer window\" text,\n \"Ends\" real,\n \"Transfer fee\" text\n)","response":"SELECT \"Transfer fee\" FROM table_7726 WHERE \"Ends\" > '2010' AND \"Transfer window\" = 'winter'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the transfer fee for the player moving in the winter window and ending in a year after 2010? ### Input: CREATE TABLE table_7726 (\n \"Nat.\" text,\n \"Name\" text,\n \"Moving from\" text,\n \"Type\" text,\n \"Transfer window\" text,\n \"Ends\" real,\n \"Transfer fee\" text\n) ### Response: SELECT \"Transfer fee\" FROM table_7726 WHERE \"Ends\" > '2010' AND \"Transfer window\" = 'winter'"} {"instruction":"Role of narrator, and a Radio Station\/Production Company of bbc audiobooks, and a Release\/Air Date of 13 november 2008 is what sum of the year?","input":"CREATE TABLE table_67776 (\n \"Year\" real,\n \"Role\" text,\n \"Author\" text,\n \"Radio Station\/Production Company\" text,\n \"Release\/Air Date\" text\n)","response":"SELECT SUM(\"Year\") FROM table_67776 WHERE \"Role\" = 'narrator' AND \"Radio Station\/Production Company\" = 'bbc audiobooks' AND \"Release\/Air Date\" = '13 november 2008'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Role of narrator, and a Radio Station\/Production Company of bbc audiobooks, and a Release\/Air Date of 13 november 2008 is what sum of the year? ### Input: CREATE TABLE table_67776 (\n \"Year\" real,\n \"Role\" text,\n \"Author\" text,\n \"Radio Station\/Production Company\" text,\n \"Release\/Air Date\" text\n) ### Response: SELECT SUM(\"Year\") FROM table_67776 WHERE \"Role\" = 'narrator' AND \"Radio Station\/Production Company\" = 'bbc audiobooks' AND \"Release\/Air Date\" = '13 november 2008'"} {"instruction":"Show team id vs acc_percent as scatter plot use a different color for each All_Games","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show team id vs acc_percent as scatter plot use a different color for each All_Games ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games"} {"instruction":"what is the number of delegates younger than 20 ?","input":"CREATE TABLE table_204_20 (\n id number,\n \"represent\" text,\n \"contestant\" text,\n \"age\" number,\n \"height\" text,\n \"hometown\" text\n)","response":"SELECT COUNT(\"contestant\") FROM table_204_20 WHERE \"age\" < 20","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of delegates younger than 20 ? ### Input: CREATE TABLE table_204_20 (\n id number,\n \"represent\" text,\n \"contestant\" text,\n \"age\" number,\n \"height\" text,\n \"hometown\" text\n) ### Response: SELECT COUNT(\"contestant\") FROM table_204_20 WHERE \"age\" < 20"} {"instruction":"Which Team has a Qualification of entry to the 2004 chinese super league, and a 2002 Position smaller than 6, and a 2003 Position smaller than 9, and a Total Position larger than 3.5?","input":"CREATE TABLE table_65384 (\n \"Team\" text,\n \"2002 Position\" real,\n \"2003 Position\" real,\n \"Total Position\" real,\n \"Qualification\" text\n)","response":"SELECT \"Team\" FROM table_65384 WHERE \"Qualification\" = 'entry to the 2004 chinese super league' AND \"2002 Position\" < '6' AND \"2003 Position\" < '9' AND \"Total Position\" > '3.5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Team has a Qualification of entry to the 2004 chinese super league, and a 2002 Position smaller than 6, and a 2003 Position smaller than 9, and a Total Position larger than 3.5? ### Input: CREATE TABLE table_65384 (\n \"Team\" text,\n \"2002 Position\" real,\n \"2003 Position\" real,\n \"Total Position\" real,\n \"Qualification\" text\n) ### Response: SELECT \"Team\" FROM table_65384 WHERE \"Qualification\" = 'entry to the 2004 chinese super league' AND \"2002 Position\" < '6' AND \"2003 Position\" < '9' AND \"Total Position\" > '3.5'"} {"instruction":"current plasma creatinine >= 0.5 mg \/ dl","input":"CREATE TABLE table_train_111 (\n \"id\" int,\n \"mini_mental_state_examination_mmse\" int,\n \"liver_disease\" bool,\n \"geriatric_depression_scale_gds\" int,\n \"rosen_modified_hachinski_ischemic_score\" int,\n \"plasma_creatinine\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_111 WHERE plasma_creatinine >= 0.5","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: current plasma creatinine >= 0.5 mg \/ dl ### Input: CREATE TABLE table_train_111 (\n \"id\" int,\n \"mini_mental_state_examination_mmse\" int,\n \"liver_disease\" bool,\n \"geriatric_depression_scale_gds\" int,\n \"rosen_modified_hachinski_ischemic_score\" int,\n \"plasma_creatinine\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_111 WHERE plasma_creatinine >= 0.5"} {"instruction":"count the number of patients whose diagnoses short title is acute uri nos and lab test fluid is ascites?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = \"Acute uri NOS\" AND lab.fluid = \"Ascites\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses short title is acute uri nos and lab test fluid is ascites? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = \"Acute uri NOS\" AND lab.fluid = \"Ascites\""} {"instruction":"Which Winner has a Runner-up of larne, and a Season of 2003 04?","input":"CREATE TABLE table_name_13 (\n winner VARCHAR,\n runner_up VARCHAR,\n season VARCHAR\n)","response":"SELECT winner FROM table_name_13 WHERE runner_up = \"larne\" AND season = \"2003\u201304\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Winner has a Runner-up of larne, and a Season of 2003 04? ### Input: CREATE TABLE table_name_13 (\n winner VARCHAR,\n runner_up VARCHAR,\n season VARCHAR\n) ### Response: SELECT winner FROM table_name_13 WHERE runner_up = \"larne\" AND season = \"2003\u201304\""} {"instruction":"What year was USF founded?","input":"CREATE TABLE table_262 (\n \"University Name\" text,\n \"Acronym\" text,\n \"Date founded\" real,\n \"Website\" text,\n \"Official registration notes\" text\n)","response":"SELECT \"Date founded\" FROM table_262 WHERE \"Acronym\" = 'USF'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was USF founded? ### Input: CREATE TABLE table_262 (\n \"University Name\" text,\n \"Acronym\" text,\n \"Date founded\" real,\n \"Website\" text,\n \"Official registration notes\" text\n) ### Response: SELECT \"Date founded\" FROM table_262 WHERE \"Acronym\" = 'USF'"} {"instruction":"which country\/countries has the same number of total metals as thailand ?","input":"CREATE TABLE table_204_183 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT \"nation\" FROM table_204_183 WHERE \"nation\" <> 'thailand' AND \"total\" = (SELECT \"total\" FROM table_204_183 WHERE \"nation\" = 'thailand')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which country\/countries has the same number of total metals as thailand ? ### Input: CREATE TABLE table_204_183 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT \"nation\" FROM table_204_183 WHERE \"nation\" <> 'thailand' AND \"total\" = (SELECT \"total\" FROM table_204_183 WHERE \"nation\" = 'thailand')"} {"instruction":"Visualize a scatter chart about the correlation between Credits and DNO .","input":"CREATE TABLE Minor_in (\n StuID INTEGER,\n DNO INTEGER\n)\n\nCREATE TABLE Enrolled_in (\n StuID INTEGER,\n CID VARCHAR(7),\n Grade VARCHAR(2)\n)\n\nCREATE TABLE Course (\n CID VARCHAR(7),\n CName VARCHAR(40),\n Credits INTEGER,\n Instructor INTEGER,\n Days VARCHAR(5),\n Hours VARCHAR(11),\n DNO INTEGER\n)\n\nCREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Member_of (\n FacID INTEGER,\n DNO INTEGER,\n Appt_Type VARCHAR(15)\n)\n\nCREATE TABLE Department (\n DNO INTEGER,\n Division VARCHAR(2),\n DName VARCHAR(25),\n Room VARCHAR(5),\n Building VARCHAR(13),\n DPhone INTEGER\n)\n\nCREATE TABLE Gradeconversion (\n lettergrade VARCHAR(2),\n gradepoint FLOAT\n)","response":"SELECT Credits, DNO FROM Course ORDER BY Credits","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a scatter chart about the correlation between Credits and DNO . ### Input: CREATE TABLE Minor_in (\n StuID INTEGER,\n DNO INTEGER\n)\n\nCREATE TABLE Enrolled_in (\n StuID INTEGER,\n CID VARCHAR(7),\n Grade VARCHAR(2)\n)\n\nCREATE TABLE Course (\n CID VARCHAR(7),\n CName VARCHAR(40),\n Credits INTEGER,\n Instructor INTEGER,\n Days VARCHAR(5),\n Hours VARCHAR(11),\n DNO INTEGER\n)\n\nCREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Member_of (\n FacID INTEGER,\n DNO INTEGER,\n Appt_Type VARCHAR(15)\n)\n\nCREATE TABLE Department (\n DNO INTEGER,\n Division VARCHAR(2),\n DName VARCHAR(25),\n Room VARCHAR(5),\n Building VARCHAR(13),\n DPhone INTEGER\n)\n\nCREATE TABLE Gradeconversion (\n lettergrade VARCHAR(2),\n gradepoint FLOAT\n) ### Response: SELECT Credits, DNO FROM Course ORDER BY Credits"} {"instruction":"During the week does 588 usually have 2 or 3 lectures ?","input":"CREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)","response":"SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 588 AND semester.semester_id = course_offering.semester ORDER BY semester.semester_id DESC LIMIT 10","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: During the week does 588 usually have 2 or 3 lectures ? ### Input: CREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n) ### Response: SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 588 AND semester.semester_id = course_offering.semester ORDER BY semester.semester_id DESC LIMIT 10"} {"instruction":"Top 1000 reputation whores in C++ tag.","input":"CREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)","response":"SELECT Users.Id AS Id, Users.DisplayName AS \"user_link\", SUM(Answers.Score) * 10 AS Reputation FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER JOIN PostTags ON PostTags.PostId = Answers.ParentId INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Answers.PostTypeId = 2 AND (LOWER(Users.Location) LIKE '%spain%' OR LOWER(Users.Location) LIKE '%espa a%') AND NOT Answers.OwnerUserId IS NULL AND Tags.TagName = 'c++' AND (Questions.ClosedDate != '' OR Questions.Score < 0) GROUP BY Users.Id, Users.DisplayName ORDER BY Reputation DESC LIMIT 1000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 1000 reputation whores in C++ tag. ### Input: CREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n) ### Response: SELECT Users.Id AS Id, Users.DisplayName AS \"user_link\", SUM(Answers.Score) * 10 AS Reputation FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER JOIN PostTags ON PostTags.PostId = Answers.ParentId INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Answers.PostTypeId = 2 AND (LOWER(Users.Location) LIKE '%spain%' OR LOWER(Users.Location) LIKE '%espa a%') AND NOT Answers.OwnerUserId IS NULL AND Tags.TagName = 'c++' AND (Questions.ClosedDate != '' OR Questions.Score < 0) GROUP BY Users.Id, Users.DisplayName ORDER BY Reputation DESC LIMIT 1000"} {"instruction":"what was the name of the mission previous to cosmos 300 ?","input":"CREATE TABLE table_204_633 (\n id number,\n \"launch date\" text,\n \"operator\" text,\n \"name\" text,\n \"sample origin\" text,\n \"samples returned\" text,\n \"recovery date\" text,\n \"mission result\" text\n)","response":"SELECT \"name\" FROM table_204_633 WHERE id = (SELECT id FROM table_204_633 WHERE \"name\" = 'cosmos 300') - 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the mission previous to cosmos 300 ? ### Input: CREATE TABLE table_204_633 (\n id number,\n \"launch date\" text,\n \"operator\" text,\n \"name\" text,\n \"sample origin\" text,\n \"samples returned\" text,\n \"recovery date\" text,\n \"mission result\" text\n) ### Response: SELECT \"name\" FROM table_204_633 WHERE id = (SELECT id FROM table_204_633 WHERE \"name\" = 'cosmos 300') - 1"} {"instruction":"How many grids had a Time\/Retired of +4 laps?","input":"CREATE TABLE table_43494 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT COUNT(\"Grid\") FROM table_43494 WHERE \"Time\/Retired\" = '+4 laps'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many grids had a Time\/Retired of +4 laps? ### Input: CREATE TABLE table_43494 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT COUNT(\"Grid\") FROM table_43494 WHERE \"Time\/Retired\" = '+4 laps'"} {"instruction":"how many featured guests are there in total ?","input":"CREATE TABLE table_204_184 (\n id number,\n \"#\" number,\n \"title\" text,\n \"producer(s)\" text,\n \"featured guest(s)\" text,\n \"length\" text\n)","response":"SELECT COUNT(\"featured guest(s)\") FROM table_204_184","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many featured guests are there in total ? ### Input: CREATE TABLE table_204_184 (\n id number,\n \"#\" number,\n \"title\" text,\n \"producer(s)\" text,\n \"featured guest(s)\" text,\n \"length\" text\n) ### Response: SELECT COUNT(\"featured guest(s)\") FROM table_204_184"} {"instruction":"In what place did the golfer representing Zimbabwe finish?","input":"CREATE TABLE table_name_60 (\n place VARCHAR,\n country VARCHAR\n)","response":"SELECT place FROM table_name_60 WHERE country = \"zimbabwe\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what place did the golfer representing Zimbabwe finish? ### Input: CREATE TABLE table_name_60 (\n place VARCHAR,\n country VARCHAR\n) ### Response: SELECT place FROM table_name_60 WHERE country = \"zimbabwe\""} {"instruction":"How many total songs has the order #1","input":"CREATE TABLE table_21501518_1 (\n song_choice VARCHAR,\n order__number VARCHAR\n)","response":"SELECT COUNT(song_choice) FROM table_21501518_1 WHERE order__number = \"1\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many total songs has the order #1 ### Input: CREATE TABLE table_21501518_1 (\n song_choice VARCHAR,\n order__number VARCHAR\n) ### Response: SELECT COUNT(song_choice) FROM table_21501518_1 WHERE order__number = \"1\""} {"instruction":"In what season was the overall record 29-7?","input":"CREATE TABLE table_19441 (\n \"Season\" text,\n \"Coach\" text,\n \"Overall\" text,\n \"Conference\" text,\n \"Standing\" text,\n \"Postseason\" text\n)","response":"SELECT \"Season\" FROM table_19441 WHERE \"Overall\" = '29-7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what season was the overall record 29-7? ### Input: CREATE TABLE table_19441 (\n \"Season\" text,\n \"Coach\" text,\n \"Overall\" text,\n \"Conference\" text,\n \"Standing\" text,\n \"Postseason\" text\n) ### Response: SELECT \"Season\" FROM table_19441 WHERE \"Overall\" = '29-7'"} {"instruction":"What is the English title for Ansikte Mot Ansikte?","input":"CREATE TABLE table_68616 (\n \"Year\" text,\n \"English title\" text,\n \"Original title\" text,\n \"Country\" text,\n \"Director\" text\n)","response":"SELECT \"English title\" FROM table_68616 WHERE \"Original title\" = 'ansikte mot ansikte'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the English title for Ansikte Mot Ansikte? ### Input: CREATE TABLE table_68616 (\n \"Year\" text,\n \"English title\" text,\n \"Original title\" text,\n \"Country\" text,\n \"Director\" text\n) ### Response: SELECT \"English title\" FROM table_68616 WHERE \"Original title\" = 'ansikte mot ansikte'"} {"instruction":"Which gc37-01 v10 engine has the fewest points?","input":"CREATE TABLE table_15328 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyres\" text,\n \"Points\" real\n)","response":"SELECT MIN(\"Points\") FROM table_15328 WHERE \"Engine\" = 'gc37-01 v10'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which gc37-01 v10 engine has the fewest points? ### Input: CREATE TABLE table_15328 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyres\" text,\n \"Points\" real\n) ### Response: SELECT MIN(\"Points\") FROM table_15328 WHERE \"Engine\" = 'gc37-01 v10'"} {"instruction":"how many patients whose admission location is phys referral\/normal deli and discharge location is home?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = \"PHYS REFERRAL\/NORMAL DELI\" AND demographic.discharge_location = \"HOME\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission location is phys referral\/normal deli and discharge location is home? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = \"PHYS REFERRAL\/NORMAL DELI\" AND demographic.discharge_location = \"HOME\""} {"instruction":"How many players played each position Plot them as bar chart, and rank in asc by the y-axis.","input":"CREATE TABLE team (\n Team_id int,\n Name text\n)\n\nCREATE TABLE player (\n Player_ID int,\n Player text,\n Years_Played text,\n Total_WL text,\n Singles_WL text,\n Doubles_WL text,\n Team int\n)\n\nCREATE TABLE match_season (\n Season real,\n Player text,\n Position text,\n Country int,\n Team int,\n Draft_Pick_Number int,\n Draft_Class text,\n College text\n)\n\nCREATE TABLE country (\n Country_id int,\n Country_name text,\n Capital text,\n Official_native_language text\n)","response":"SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many players played each position Plot them as bar chart, and rank in asc by the y-axis. ### Input: CREATE TABLE team (\n Team_id int,\n Name text\n)\n\nCREATE TABLE player (\n Player_ID int,\n Player text,\n Years_Played text,\n Total_WL text,\n Singles_WL text,\n Doubles_WL text,\n Team int\n)\n\nCREATE TABLE match_season (\n Season real,\n Player text,\n Position text,\n Country int,\n Team int,\n Draft_Pick_Number int,\n Draft_Class text,\n College text\n)\n\nCREATE TABLE country (\n Country_id int,\n Country_name text,\n Capital text,\n Official_native_language text\n) ### Response: SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*)"} {"instruction":"Which venue has 16 against?","input":"CREATE TABLE table_name_5 (\n venue VARCHAR,\n against VARCHAR\n)","response":"SELECT venue FROM table_name_5 WHERE against = 16","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue has 16 against? ### Input: CREATE TABLE table_name_5 (\n venue VARCHAR,\n against VARCHAR\n) ### Response: SELECT venue FROM table_name_5 WHERE against = 16"} {"instruction":"What is the pick # when the new jersey devils is the nhl team?","input":"CREATE TABLE table_30854 (\n \"Pick #\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"NHL team\" text,\n \"College\/junior\/club team\" text\n)","response":"SELECT \"Pick #\" FROM table_30854 WHERE \"NHL team\" = 'New Jersey Devils'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the pick # when the new jersey devils is the nhl team? ### Input: CREATE TABLE table_30854 (\n \"Pick #\" real,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"NHL team\" text,\n \"College\/junior\/club team\" text\n) ### Response: SELECT \"Pick #\" FROM table_30854 WHERE \"NHL team\" = 'New Jersey Devils'"} {"instruction":"what is the mchc difference\/difference of patient 032-17571 second measured on the last hospital visit compared to the first value measured on the last hospital visit?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1 OFFSET 1) - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1)","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the mchc difference\/difference of patient 032-17571 second measured on the last hospital visit compared to the first value measured on the last hospital visit? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1 OFFSET 1) - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1)"} {"instruction":"provide the number of patients whose diagnoses long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use and drug type is main?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = \"Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use\" AND prescriptions.drug_type = \"MAIN\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose diagnoses long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use and drug type is main? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = \"Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use\" AND prescriptions.drug_type = \"MAIN\""} {"instruction":"What is Score, when Attendance is 2,444?","input":"CREATE TABLE table_name_33 (\n score VARCHAR,\n attendance VARCHAR\n)","response":"SELECT score FROM table_name_33 WHERE attendance = \"2,444\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Score, when Attendance is 2,444? ### Input: CREATE TABLE table_name_33 (\n score VARCHAR,\n attendance VARCHAR\n) ### Response: SELECT score FROM table_name_33 WHERE attendance = \"2,444\""} {"instruction":"Between which years were there 241 fokker 70 model cabins built?","input":"CREATE TABLE table_name_43 (\n period VARCHAR,\n built VARCHAR,\n model VARCHAR\n)","response":"SELECT period FROM table_name_43 WHERE built < 241 AND model = \"fokker 70\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Between which years were there 241 fokker 70 model cabins built? ### Input: CREATE TABLE table_name_43 (\n period VARCHAR,\n built VARCHAR,\n model VARCHAR\n) ### Response: SELECT period FROM table_name_43 WHERE built < 241 AND model = \"fokker 70\""} {"instruction":"Name the republican steve sauerberg for august 12, 2008","input":"CREATE TABLE table_21037 (\n \"Poll Source\" text,\n \"Dates administered\" text,\n \"Democrat: Dick Durbin\" text,\n \"Republican: Steve Sauerberg\" text,\n \"Lead Margin\" real\n)","response":"SELECT \"Republican: Steve Sauerberg\" FROM table_21037 WHERE \"Dates administered\" = 'August 12, 2008'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the republican steve sauerberg for august 12, 2008 ### Input: CREATE TABLE table_21037 (\n \"Poll Source\" text,\n \"Dates administered\" text,\n \"Democrat: Dick Durbin\" text,\n \"Republican: Steve Sauerberg\" text,\n \"Lead Margin\" real\n) ### Response: SELECT \"Republican: Steve Sauerberg\" FROM table_21037 WHERE \"Dates administered\" = 'August 12, 2008'"} {"instruction":"how long did bernard pilon serve in the canadian army ?","input":"CREATE TABLE table_204_608 (\n id number,\n \"name\" text,\n \"elected party\" text,\n \"constituency\" text,\n \"elected date\" text,\n \"military service\" text\n)","response":"SELECT \"military service\" - \"military service\" FROM table_204_608 WHERE \"name\" = 'bernard pilon'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how long did bernard pilon serve in the canadian army ? ### Input: CREATE TABLE table_204_608 (\n id number,\n \"name\" text,\n \"elected party\" text,\n \"constituency\" text,\n \"elected date\" text,\n \"military service\" text\n) ### Response: SELECT \"military service\" - \"military service\" FROM table_204_608 WHERE \"name\" = 'bernard pilon'"} {"instruction":"What is the Money of the T4 Place Player with a Score of 71-66-74-67=278?","input":"CREATE TABLE table_name_64 (\n money___ INTEGER,\n place VARCHAR,\n score VARCHAR\n)","response":"SELECT AVG(money___) AS $__ FROM table_name_64 WHERE place = \"t4\" AND score = 71 - 66 - 74 - 67 = 278","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Money of the T4 Place Player with a Score of 71-66-74-67=278? ### Input: CREATE TABLE table_name_64 (\n money___ INTEGER,\n place VARCHAR,\n score VARCHAR\n) ### Response: SELECT AVG(money___) AS $__ FROM table_name_64 WHERE place = \"t4\" AND score = 71 - 66 - 74 - 67 = 278"} {"instruction":"How many female patients have a prescription for aspirin ec?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = \"F\" AND prescriptions.drug = \"Aspirin EC\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many female patients have a prescription for aspirin ec? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = \"F\" AND prescriptions.drug = \"Aspirin EC\""} {"instruction":"what is the number of hours elapsed since the last time patient 033-22108 had a d5w intake on the current intensive care unit visit?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'd5w' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of hours elapsed since the last time patient 033-22108 had a d5w intake on the current intensive care unit visit? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'd5w' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1"} {"instruction":"What was the date of the game when Atlanta was the home team?","input":"CREATE TABLE table_51441 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Decision\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT \"Date\" FROM table_51441 WHERE \"Home\" = 'atlanta'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the game when Atlanta was the home team? ### Input: CREATE TABLE table_51441 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Decision\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT \"Date\" FROM table_51441 WHERE \"Home\" = 'atlanta'"} {"instruction":"Who is the Trainer with the Year of 2013?","input":"CREATE TABLE table_name_33 (\n trainer VARCHAR,\n year VARCHAR\n)","response":"SELECT trainer FROM table_name_33 WHERE year = \"2013\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the Trainer with the Year of 2013? ### Input: CREATE TABLE table_name_33 (\n trainer VARCHAR,\n year VARCHAR\n) ### Response: SELECT trainer FROM table_name_33 WHERE year = \"2013\""} {"instruction":"what is the dose of sodium bicarbonate that is first prescribed to patient 10811 since 05\/2103?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)","response":"SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811) AND prescriptions.drug = 'sodium bicarbonate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-05' ORDER BY prescriptions.startdate LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the dose of sodium bicarbonate that is first prescribed to patient 10811 since 05\/2103? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n) ### Response: SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811) AND prescriptions.drug = 'sodium bicarbonate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-05' ORDER BY prescriptions.startdate LIMIT 1"} {"instruction":"In what Round was Pick 138?","input":"CREATE TABLE table_39413 (\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Nationality\" text,\n \"College\" text\n)","response":"SELECT SUM(\"Round\") FROM table_39413 WHERE \"Pick\" = '138'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what Round was Pick 138? ### Input: CREATE TABLE table_39413 (\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Nationality\" text,\n \"College\" text\n) ### Response: SELECT SUM(\"Round\") FROM table_39413 WHERE \"Pick\" = '138'"} {"instruction":"What years did the player with a t71 finish win?","input":"CREATE TABLE table_60790 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n)","response":"SELECT \"Year(s) won\" FROM table_60790 WHERE \"Finish\" = 't71'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years did the player with a t71 finish win? ### Input: CREATE TABLE table_60790 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n) ### Response: SELECT \"Year(s) won\" FROM table_60790 WHERE \"Finish\" = 't71'"} {"instruction":"What is the defective year for the regular year of 29 days and month sequence of 2?","input":"CREATE TABLE table_30897 (\n \"Month Sequence\" real,\n \"Numbered Month\" text,\n \"Month Name\" text,\n \"Regular Year\" text,\n \"Defective Year\" real,\n \"Excessive Year\" real\n)","response":"SELECT MAX(\"Defective Year\") FROM table_30897 WHERE \"Regular Year\" = '29 days' AND \"Month Sequence\" = '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the defective year for the regular year of 29 days and month sequence of 2? ### Input: CREATE TABLE table_30897 (\n \"Month Sequence\" real,\n \"Numbered Month\" text,\n \"Month Name\" text,\n \"Regular Year\" text,\n \"Defective Year\" real,\n \"Excessive Year\" real\n) ### Response: SELECT MAX(\"Defective Year\") FROM table_30897 WHERE \"Regular Year\" = '29 days' AND \"Month Sequence\" = '2'"} {"instruction":"What is the name of the technician whose team is not 'NYY', and count them by a bar chart","input":"CREATE TABLE repair (\n repair_ID int,\n name text,\n Launch_Date text,\n Notes text\n)\n\nCREATE TABLE machine (\n Machine_ID int,\n Making_Year int,\n Class text,\n Team text,\n Machine_series text,\n value_points real,\n quality_rank int\n)\n\nCREATE TABLE technician (\n technician_id real,\n Name text,\n Team text,\n Starting_Year real,\n Age int\n)\n\nCREATE TABLE repair_assignment (\n technician_id int,\n repair_ID int,\n Machine_ID int\n)","response":"SELECT Name, COUNT(Name) FROM technician WHERE Team <> \"NYY\" GROUP BY Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the technician whose team is not 'NYY', and count them by a bar chart ### Input: CREATE TABLE repair (\n repair_ID int,\n name text,\n Launch_Date text,\n Notes text\n)\n\nCREATE TABLE machine (\n Machine_ID int,\n Making_Year int,\n Class text,\n Team text,\n Machine_series text,\n value_points real,\n quality_rank int\n)\n\nCREATE TABLE technician (\n technician_id real,\n Name text,\n Team text,\n Starting_Year real,\n Age int\n)\n\nCREATE TABLE repair_assignment (\n technician_id int,\n repair_ID int,\n Machine_ID int\n) ### Response: SELECT Name, COUNT(Name) FROM technician WHERE Team <> \"NYY\" GROUP BY Name"} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart, and sort in desc by the y-axis.","input":"CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart, and sort in desc by the y-axis. ### Input: CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC"} {"instruction":"Who was the finalist when the MVP was Romain Sato?","input":"CREATE TABLE table_2095 (\n \"Season\" text,\n \"Final Venue\" text,\n \"Champion\" text,\n \"Result\" text,\n \"Finalist\" text,\n \"MVP\" text\n)","response":"SELECT \"Finalist\" FROM table_2095 WHERE \"MVP\" = 'Romain Sato'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the finalist when the MVP was Romain Sato? ### Input: CREATE TABLE table_2095 (\n \"Season\" text,\n \"Final Venue\" text,\n \"Champion\" text,\n \"Result\" text,\n \"Finalist\" text,\n \"MVP\" text\n) ### Response: SELECT \"Finalist\" FROM table_2095 WHERE \"MVP\" = 'Romain Sato'"} {"instruction":"Which clubs have one or more members whose advisor is '1121'?","input":"CREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n)\n\nCREATE TABLE member_of_club (\n stuid number,\n clubid number,\n position text\n)\n\nCREATE TABLE club (\n clubid number,\n clubname text,\n clubdesc text,\n clublocation text\n)","response":"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which clubs have one or more members whose advisor is '1121'? ### Input: CREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n)\n\nCREATE TABLE member_of_club (\n stuid number,\n clubid number,\n position text\n)\n\nCREATE TABLE club (\n clubid number,\n clubname text,\n clubdesc text,\n clublocation text\n) ### Response: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121"} {"instruction":"what is the drug that patient 19352 was prescribed for within 2 days after the diagnosis of hx traumatic fracture until 22 months ago?","input":"CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)","response":"SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx traumatic fracture') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the drug that patient 19352 was prescribed for within 2 days after the diagnosis of hx traumatic fracture until 22 months ago? ### Input: CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n) ### Response: SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx traumatic fracture') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')"} {"instruction":"Visualize the general trend of sum share count over the date of transaction, sort in descending by the X-axis.","input":"CREATE TABLE Investors (\n investor_id INTEGER,\n Investor_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Transaction_Types (\n transaction_type_code VARCHAR(10),\n transaction_type_description VARCHAR(80)\n)\n\nCREATE TABLE Sales (\n sales_transaction_id INTEGER,\n sales_details VARCHAR(255)\n)\n\nCREATE TABLE Transactions_Lots (\n transaction_id INTEGER,\n lot_id INTEGER\n)\n\nCREATE TABLE Lots (\n lot_id INTEGER,\n investor_id INTEGER,\n lot_details VARCHAR(255)\n)\n\nCREATE TABLE Transactions (\n transaction_id INTEGER,\n investor_id INTEGER,\n transaction_type_code VARCHAR(10),\n date_of_transaction DATETIME,\n amount_of_transaction DECIMAL(19,4),\n share_count VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Purchases (\n purchase_transaction_id INTEGER,\n purchase_details VARCHAR(255)\n)","response":"SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the general trend of sum share count over the date of transaction, sort in descending by the X-axis. ### Input: CREATE TABLE Investors (\n investor_id INTEGER,\n Investor_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Transaction_Types (\n transaction_type_code VARCHAR(10),\n transaction_type_description VARCHAR(80)\n)\n\nCREATE TABLE Sales (\n sales_transaction_id INTEGER,\n sales_details VARCHAR(255)\n)\n\nCREATE TABLE Transactions_Lots (\n transaction_id INTEGER,\n lot_id INTEGER\n)\n\nCREATE TABLE Lots (\n lot_id INTEGER,\n investor_id INTEGER,\n lot_details VARCHAR(255)\n)\n\nCREATE TABLE Transactions (\n transaction_id INTEGER,\n investor_id INTEGER,\n transaction_type_code VARCHAR(10),\n date_of_transaction DATETIME,\n amount_of_transaction DECIMAL(19,4),\n share_count VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Purchases (\n purchase_transaction_id INTEGER,\n purchase_details VARCHAR(255)\n) ### Response: SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC"} {"instruction":"What is the Late Middle English equivalent of the Anglian g, g?","input":"CREATE TABLE table_28177800_5 (\n late_middle_english VARCHAR,\n late_old_english__anglian_ VARCHAR\n)","response":"SELECT late_middle_english FROM table_28177800_5 WHERE late_old_english__anglian_ = \"\u00e6g, \u01e3g\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Late Middle English equivalent of the Anglian g, g? ### Input: CREATE TABLE table_28177800_5 (\n late_middle_english VARCHAR,\n late_old_english__anglian_ VARCHAR\n) ### Response: SELECT late_middle_english FROM table_28177800_5 WHERE late_old_english__anglian_ = \"\u00e6g, \u01e3g\""} {"instruction":"What was the episode number for 'Going Bodmin'?","input":"CREATE TABLE table_24058 (\n \"Episode No.\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Viewers (millions)\" text,\n \"Original airdate\" text\n)","response":"SELECT MAX(\"Episode No.\") FROM table_24058 WHERE \"Title\" = 'Going Bodmin'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the episode number for 'Going Bodmin'? ### Input: CREATE TABLE table_24058 (\n \"Episode No.\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Viewers (millions)\" text,\n \"Original airdate\" text\n) ### Response: SELECT MAX(\"Episode No.\") FROM table_24058 WHERE \"Title\" = 'Going Bodmin'"} {"instruction":"How many touchdowns were scored by William Cole?","input":"CREATE TABLE table_39585 (\n \"Player\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n)","response":"SELECT \"Touchdowns\" FROM table_39585 WHERE \"Player\" = 'william cole'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many touchdowns were scored by William Cole? ### Input: CREATE TABLE table_39585 (\n \"Player\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n) ### Response: SELECT \"Touchdowns\" FROM table_39585 WHERE \"Player\" = 'william cole'"} {"instruction":"Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and sort in descending by the bars.","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and sort in descending by the bars. ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC"} {"instruction":"What rounds did RML Racing Silverline and James Nash compete?","input":"CREATE TABLE table_65927 (\n \"Team\" text,\n \"Car Spec.\" text,\n \"Drivers\" text,\n \"Class\" text,\n \"Rounds\" text\n)","response":"SELECT \"Rounds\" FROM table_65927 WHERE \"Team\" = 'rml racing silverline' AND \"Drivers\" = 'james nash'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What rounds did RML Racing Silverline and James Nash compete? ### Input: CREATE TABLE table_65927 (\n \"Team\" text,\n \"Car Spec.\" text,\n \"Drivers\" text,\n \"Class\" text,\n \"Rounds\" text\n) ### Response: SELECT \"Rounds\" FROM table_65927 WHERE \"Team\" = 'rml racing silverline' AND \"Drivers\" = 'james nash'"} {"instruction":"Name the score for pacers visitor on 14 april 2008","input":"CREATE TABLE table_11226 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT \"Score\" FROM table_11226 WHERE \"Visitor\" = 'pacers' AND \"Date\" = '14 april 2008'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the score for pacers visitor on 14 april 2008 ### Input: CREATE TABLE table_11226 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT \"Score\" FROM table_11226 WHERE \"Visitor\" = 'pacers' AND \"Date\" = '14 april 2008'"} {"instruction":"Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, display X-axis in asc order.","input":"CREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)","response":"SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = \"ACCT-211\" ORDER BY EMP_DOB","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, display X-axis in asc order. ### Input: CREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n) ### Response: SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = \"ACCT-211\" ORDER BY EMP_DOB"} {"instruction":"Which City has a Result of w, and a Competition of international friendly (unofficial match), and a Score of 1-0?","input":"CREATE TABLE table_37478 (\n \"Date\" text,\n \"City\" text,\n \"Result\" text,\n \"Score\" text,\n \"Competition\" text\n)","response":"SELECT \"City\" FROM table_37478 WHERE \"Result\" = 'w' AND \"Competition\" = 'international friendly (unofficial match)' AND \"Score\" = '1-0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which City has a Result of w, and a Competition of international friendly (unofficial match), and a Score of 1-0? ### Input: CREATE TABLE table_37478 (\n \"Date\" text,\n \"City\" text,\n \"Result\" text,\n \"Score\" text,\n \"Competition\" text\n) ### Response: SELECT \"City\" FROM table_37478 WHERE \"Result\" = 'w' AND \"Competition\" = 'international friendly (unofficial match)' AND \"Score\" = '1-0'"} {"instruction":"What is the 1995 value with of the 1993 ATP Masters Series?","input":"CREATE TABLE table_34222 (\n \"Tournament\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text,\n \"1997\" text,\n \"1998\" text,\n \"Career SR\" text,\n \"Career Win-Loss\" text\n)","response":"SELECT \"1995\" FROM table_34222 WHERE \"1993\" = 'atp masters series'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 1995 value with of the 1993 ATP Masters Series? ### Input: CREATE TABLE table_34222 (\n \"Tournament\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text,\n \"1997\" text,\n \"1998\" text,\n \"Career SR\" text,\n \"Career Win-Loss\" text\n) ### Response: SELECT \"1995\" FROM table_34222 WHERE \"1993\" = 'atp masters series'"} {"instruction":"What was the Pick Number when the position was wide receiver, the college was Southern Miss with an overall less than 186?","input":"CREATE TABLE table_6626 (\n \"Round\" real,\n \"Pick #\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT AVG(\"Pick #\") FROM table_6626 WHERE \"Position\" = 'wide receiver' AND \"College\" = 'southern miss' AND \"Overall\" < '186'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Pick Number when the position was wide receiver, the college was Southern Miss with an overall less than 186? ### Input: CREATE TABLE table_6626 (\n \"Round\" real,\n \"Pick #\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT AVG(\"Pick #\") FROM table_6626 WHERE \"Position\" = 'wide receiver' AND \"College\" = 'southern miss' AND \"Overall\" < '186'"} {"instruction":"When was the first beatification in Korea that was canonised before 1984?","input":"CREATE TABLE table_32112 (\n \"Name\" text,\n \"Martyred\" real,\n \"Place\" text,\n \"Beatified\" real,\n \"Canonised\" real\n)","response":"SELECT MIN(\"Beatified\") FROM table_32112 WHERE \"Place\" = 'korea' AND \"Canonised\" < '1984'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the first beatification in Korea that was canonised before 1984? ### Input: CREATE TABLE table_32112 (\n \"Name\" text,\n \"Martyred\" real,\n \"Place\" text,\n \"Beatified\" real,\n \"Canonised\" real\n) ### Response: SELECT MIN(\"Beatified\") FROM table_32112 WHERE \"Place\" = 'korea' AND \"Canonised\" < '1984'"} {"instruction":"What horse does todd pletcher ride with odds of 14.20-1?","input":"CREATE TABLE table_55341 (\n \"Finish Position\" text,\n \"Lengths Behind\" text,\n \"Post Position\" real,\n \"Horse name\" text,\n \"Trainer\" text,\n \"Jockey\" text,\n \"Owner\" text,\n \"Post Time Odds\" text\n)","response":"SELECT \"Horse name\" FROM table_55341 WHERE \"Jockey\" = 'todd pletcher' AND \"Post Time Odds\" = '14.20-1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What horse does todd pletcher ride with odds of 14.20-1? ### Input: CREATE TABLE table_55341 (\n \"Finish Position\" text,\n \"Lengths Behind\" text,\n \"Post Position\" real,\n \"Horse name\" text,\n \"Trainer\" text,\n \"Jockey\" text,\n \"Owner\" text,\n \"Post Time Odds\" text\n) ### Response: SELECT \"Horse name\" FROM table_55341 WHERE \"Jockey\" = 'todd pletcher' AND \"Post Time Odds\" = '14.20-1'"} {"instruction":"how many episodes in the serie were title 'the key","input":"CREATE TABLE table_74425 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (million)\" text\n)","response":"SELECT COUNT(\"No. in series\") FROM table_74425 WHERE \"Title\" = 'The Key'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many episodes in the serie were title 'the key ### Input: CREATE TABLE table_74425 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (million)\" text\n) ### Response: SELECT COUNT(\"No. in series\") FROM table_74425 WHERE \"Title\" = 'The Key'"} {"instruction":"get the number of patients with diagnoses icd9 code 99662 who had ascitic fluid lab test done.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = \"99662\" AND lab.fluid = \"Ascites\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get the number of patients with diagnoses icd9 code 99662 who had ascitic fluid lab test done. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = \"99662\" AND lab.fluid = \"Ascites\""} {"instruction":"What school is in Ligonier?","input":"CREATE TABLE table_name_11 (\n school VARCHAR,\n location VARCHAR\n)","response":"SELECT school FROM table_name_11 WHERE location = \"ligonier\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What school is in Ligonier? ### Input: CREATE TABLE table_name_11 (\n school VARCHAR,\n location VARCHAR\n) ### Response: SELECT school FROM table_name_11 WHERE location = \"ligonier\""} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id , and rank total number in descending order please.","input":"CREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id , and rank total number in descending order please. ### Input: CREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC"} {"instruction":"How many schools did Derrick Green attend?","input":"CREATE TABLE table_17075 (\n \"Player\" text,\n \"Position\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text\n)","response":"SELECT COUNT(\"School\") FROM table_17075 WHERE \"Player\" = 'Derrick Green'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many schools did Derrick Green attend? ### Input: CREATE TABLE table_17075 (\n \"Player\" text,\n \"Position\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text\n) ### Response: SELECT COUNT(\"School\") FROM table_17075 WHERE \"Player\" = 'Derrick Green'"} {"instruction":"what is admission type and procedure long title of subject id 2560?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"2560\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is admission type and procedure long title of subject id 2560? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"2560\""} {"instruction":"What rank is Germany?","input":"CREATE TABLE table_name_74 (\n rank VARCHAR,\n country VARCHAR\n)","response":"SELECT rank FROM table_name_74 WHERE country = \"germany\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What rank is Germany? ### Input: CREATE TABLE table_name_74 (\n rank VARCHAR,\n country VARCHAR\n) ### Response: SELECT rank FROM table_name_74 WHERE country = \"germany\""} {"instruction":"When the Away team is south melbourne, what's the Home team score?","input":"CREATE TABLE table_77872 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team score\" FROM table_77872 WHERE \"Away team\" = 'south melbourne'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Away team is south melbourne, what's the Home team score? ### Input: CREATE TABLE table_77872 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team score\" FROM table_77872 WHERE \"Away team\" = 'south melbourne'"} {"instruction":"Where did the cable-stayed Badong Bridge open in 2005?","input":"CREATE TABLE table_name_18 (\n location VARCHAR,\n name VARCHAR,\n type VARCHAR,\n opened VARCHAR\n)","response":"SELECT location FROM table_name_18 WHERE type = \"cable-stayed\" AND opened = 2005 AND name = \"badong bridge\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the cable-stayed Badong Bridge open in 2005? ### Input: CREATE TABLE table_name_18 (\n location VARCHAR,\n name VARCHAR,\n type VARCHAR,\n opened VARCHAR\n) ### Response: SELECT location FROM table_name_18 WHERE type = \"cable-stayed\" AND opened = 2005 AND name = \"badong bridge\""} {"instruction":"Draw a bar chart of dept code versus the total number, order y axis in descending order.","input":"CREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)","response":"SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of dept code versus the total number, order y axis in descending order. ### Input: CREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n) ### Response: SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC"} {"instruction":"What is the second leg for Team 1 Servette?","input":"CREATE TABLE table_60354 (\n \"Team 1\" text,\n \"Agg.\" text,\n \"Team 2\" text,\n \"1st leg\" text,\n \"2nd leg\" text\n)","response":"SELECT \"2nd leg\" FROM table_60354 WHERE \"Team 1\" = 'servette'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the second leg for Team 1 Servette? ### Input: CREATE TABLE table_60354 (\n \"Team 1\" text,\n \"Agg.\" text,\n \"Team 2\" text,\n \"1st leg\" text,\n \"2nd leg\" text\n) ### Response: SELECT \"2nd leg\" FROM table_60354 WHERE \"Team 1\" = 'servette'"} {"instruction":"how many days has passed since patient 005-4471 received his first diagnosis of post spinal surgery - cervical on their current hospital encounter?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'post spinal surgery - cervical' ORDER BY diagnosis.diagnosistime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days has passed since patient 005-4471 received his first diagnosis of post spinal surgery - cervical on their current hospital encounter? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'post spinal surgery - cervical' ORDER BY diagnosis.diagnosistime LIMIT 1"} {"instruction":"Whcih was the Class AAA in school year 2006-07?","input":"CREATE TABLE table_name_85 (\n class_aAA VARCHAR,\n school_year VARCHAR\n)","response":"SELECT class_aAA FROM table_name_85 WHERE school_year = \"2006-07\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Whcih was the Class AAA in school year 2006-07? ### Input: CREATE TABLE table_name_85 (\n class_aAA VARCHAR,\n school_year VARCHAR\n) ### Response: SELECT class_aAA FROM table_name_85 WHERE school_year = \"2006-07\""} {"instruction":"What Russian has an Avoirdupois value of 0.686 gr?","input":"CREATE TABLE table_name_16 (\n russian VARCHAR,\n avoirdupois_value VARCHAR\n)","response":"SELECT russian FROM table_name_16 WHERE avoirdupois_value = \"0.686 gr\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Russian has an Avoirdupois value of 0.686 gr? ### Input: CREATE TABLE table_name_16 (\n russian VARCHAR,\n avoirdupois_value VARCHAR\n) ### Response: SELECT russian FROM table_name_16 WHERE avoirdupois_value = \"0.686 gr\""} {"instruction":"List the positions of players whose average number of points scored by that position is larger than 20, compare the number of positions, and order total number in descending order.","input":"CREATE TABLE club (\n Club_ID int,\n name text,\n Region text,\n Start_year text\n)\n\nCREATE TABLE competition_result (\n Competition_ID int,\n Club_ID_1 int,\n Club_ID_2 int,\n Score text\n)\n\nCREATE TABLE player (\n Player_ID int,\n name text,\n Position text,\n Club_ID int,\n Apps real,\n Tries real,\n Goals text,\n Points real\n)\n\nCREATE TABLE competition (\n Competition_ID int,\n Year real,\n Competition_type text,\n Country text\n)\n\nCREATE TABLE club_rank (\n Rank real,\n Club_ID int,\n Gold real,\n Silver real,\n Bronze real,\n Total real\n)","response":"SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the positions of players whose average number of points scored by that position is larger than 20, compare the number of positions, and order total number in descending order. ### Input: CREATE TABLE club (\n Club_ID int,\n name text,\n Region text,\n Start_year text\n)\n\nCREATE TABLE competition_result (\n Competition_ID int,\n Club_ID_1 int,\n Club_ID_2 int,\n Score text\n)\n\nCREATE TABLE player (\n Player_ID int,\n name text,\n Position text,\n Club_ID int,\n Apps real,\n Tries real,\n Goals text,\n Points real\n)\n\nCREATE TABLE competition (\n Competition_ID int,\n Year real,\n Competition_type text,\n Country text\n)\n\nCREATE TABLE club_rank (\n Rank real,\n Club_ID int,\n Gold real,\n Silver real,\n Bronze real,\n Total real\n) ### Response: SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC"} {"instruction":"What player has The United States as the country, with t2 as the place?","input":"CREATE TABLE table_name_9 (\n player VARCHAR,\n country VARCHAR,\n place VARCHAR\n)","response":"SELECT player FROM table_name_9 WHERE country = \"united states\" AND place = \"t2\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player has The United States as the country, with t2 as the place? ### Input: CREATE TABLE table_name_9 (\n player VARCHAR,\n country VARCHAR,\n place VARCHAR\n) ### Response: SELECT player FROM table_name_9 WHERE country = \"united states\" AND place = \"t2\""} {"instruction":"What is Apogee, when Inclination is 65 , and when Launch Date\/Time is ( GMT ) is 15 February 1973, 01:11?","input":"CREATE TABLE table_12858 (\n \"Designation\" text,\n \"Launch date\/time ( GMT )\" text,\n \"Mass\" text,\n \"Apogee\" text,\n \"Inclination\" text\n)","response":"SELECT \"Apogee\" FROM table_12858 WHERE \"Inclination\" = '65\u00b0' AND \"Launch date\/time ( GMT )\" = '15 february 1973, 01:11'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Apogee, when Inclination is 65 , and when Launch Date\/Time is ( GMT ) is 15 February 1973, 01:11? ### Input: CREATE TABLE table_12858 (\n \"Designation\" text,\n \"Launch date\/time ( GMT )\" text,\n \"Mass\" text,\n \"Apogee\" text,\n \"Inclination\" text\n) ### Response: SELECT \"Apogee\" FROM table_12858 WHERE \"Inclination\" = '65\u00b0' AND \"Launch date\/time ( GMT )\" = '15 february 1973, 01:11'"} {"instruction":"get me the number of government health insurance patients who had closed [needle] biopsy of tongue.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Government\" AND procedures.long_title = \"Closed [needle] biopsy of tongue\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the number of government health insurance patients who had closed [needle] biopsy of tongue. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Government\" AND procedures.long_title = \"Closed [needle] biopsy of tongue\""} {"instruction":"Who is the opponent in game 5?","input":"CREATE TABLE table_20745706_1 (\n opponent VARCHAR,\n _number VARCHAR\n)","response":"SELECT opponent FROM table_20745706_1 WHERE _number = \"5\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the opponent in game 5? ### Input: CREATE TABLE table_20745706_1 (\n opponent VARCHAR,\n _number VARCHAR\n) ### Response: SELECT opponent FROM table_20745706_1 WHERE _number = \"5\""} {"instruction":"What is the round for the qualifying phase with a draw date on 16 July 2010?","input":"CREATE TABLE table_62144 (\n \"Phase\" text,\n \"Round\" text,\n \"Draw date\" text,\n \"First leg\" text,\n \"Second leg\" text\n)","response":"SELECT \"Round\" FROM table_62144 WHERE \"Phase\" = 'qualifying' AND \"Draw date\" = '16 july 2010'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the round for the qualifying phase with a draw date on 16 July 2010? ### Input: CREATE TABLE table_62144 (\n \"Phase\" text,\n \"Round\" text,\n \"Draw date\" text,\n \"First leg\" text,\n \"Second leg\" text\n) ### Response: SELECT \"Round\" FROM table_62144 WHERE \"Phase\" = 'qualifying' AND \"Draw date\" = '16 july 2010'"} {"instruction":"Show all locations and the total number of platforms for all train stations in each location in a bar chart, sort by the Location in ascending.","input":"CREATE TABLE train (\n Train_ID int,\n Name text,\n Time text,\n Service text\n)\n\nCREATE TABLE train_station (\n Train_ID int,\n Station_ID int\n)\n\nCREATE TABLE station (\n Station_ID int,\n Name text,\n Annual_entry_exit real,\n Annual_interchanges real,\n Total_Passengers real,\n Location text,\n Main_Services text,\n Number_of_Platforms int\n)","response":"SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all locations and the total number of platforms for all train stations in each location in a bar chart, sort by the Location in ascending. ### Input: CREATE TABLE train (\n Train_ID int,\n Name text,\n Time text,\n Service text\n)\n\nCREATE TABLE train_station (\n Train_ID int,\n Station_ID int\n)\n\nCREATE TABLE station (\n Station_ID int,\n Name text,\n Annual_entry_exit real,\n Annual_interchanges real,\n Total_Passengers real,\n Location text,\n Main_Services text,\n Number_of_Platforms int\n) ### Response: SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location"} {"instruction":"in this month patient 004-32341 received a magnesium test?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32341')) AND lab.labname = 'magnesium' AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in this month patient 004-32341 received a magnesium test? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32341')) AND lab.labname = 'magnesium' AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')"} {"instruction":"What is the average rank of Great Britain when their total is over 4?","input":"CREATE TABLE table_57342 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT AVG(\"Rank\") FROM table_57342 WHERE \"Total\" > '4' AND \"Nation\" = 'great britain'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average rank of Great Britain when their total is over 4? ### Input: CREATE TABLE table_57342 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT AVG(\"Rank\") FROM table_57342 WHERE \"Total\" > '4' AND \"Nation\" = 'great britain'"} {"instruction":"What are the tries against when points against 287?","input":"CREATE TABLE table_812 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Tries against\" text,\n \"Try bonus\" text,\n \"Losing bonus\" text,\n \"Points\" text\n)","response":"SELECT \"Tries against\" FROM table_812 WHERE \"Points against\" = '287'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the tries against when points against 287? ### Input: CREATE TABLE table_812 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Tries against\" text,\n \"Try bonus\" text,\n \"Losing bonus\" text,\n \"Points\" text\n) ### Response: SELECT \"Tries against\" FROM table_812 WHERE \"Points against\" = '287'"} {"instruction":"what is the lowest height (ft) for messeturm and more than 55 floors?","input":"CREATE TABLE table_54024 (\n \"Rank\" real,\n \"Name\" text,\n \"City\" text,\n \"Height (m)\" real,\n \"Height (ft)\" real,\n \"Floors\" real\n)","response":"SELECT MIN(\"Height (ft)\") FROM table_54024 WHERE \"Name\" = 'messeturm' AND \"Floors\" > '55'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the lowest height (ft) for messeturm and more than 55 floors? ### Input: CREATE TABLE table_54024 (\n \"Rank\" real,\n \"Name\" text,\n \"City\" text,\n \"Height (m)\" real,\n \"Height (ft)\" real,\n \"Floors\" real\n) ### Response: SELECT MIN(\"Height (ft)\") FROM table_54024 WHERE \"Name\" = 'messeturm' AND \"Floors\" > '55'"} {"instruction":"since 5 years ago, what are the five most frequently performed procedures for patients in the same month after receiving a vascular surgery consultation?","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)","response":"SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vascular surgery consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.treatmenttime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 5","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 5 years ago, what are the five most frequently performed procedures for patients in the same month after receiving a vascular surgery consultation? ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n) ### Response: SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vascular surgery consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.treatmenttime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 5"} {"instruction":"what is the drug route of Ascorbic acid?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = \"Ascorbic Acid\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the drug route of Ascorbic acid? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = \"Ascorbic Acid\""} {"instruction":"What was the highest points on October 12, when the attendance where is over 10,701?","input":"CREATE TABLE table_43705 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Attendance\" real,\n \"Record\" text,\n \"Points\" real\n)","response":"SELECT MAX(\"Points\") FROM table_43705 WHERE \"Date\" = 'october 12' AND \"Attendance\" > '10,701'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest points on October 12, when the attendance where is over 10,701? ### Input: CREATE TABLE table_43705 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Attendance\" real,\n \"Record\" text,\n \"Points\" real\n) ### Response: SELECT MAX(\"Points\") FROM table_43705 WHERE \"Date\" = 'october 12' AND \"Attendance\" > '10,701'"} {"instruction":"A bar chart for what are the number of the first names of all students in Smith Hall?, could you list in ascending by the total number please?","input":"CREATE TABLE Dorm (\n dormid INTEGER,\n dorm_name VARCHAR(20),\n student_capacity INTEGER,\n gender VARCHAR(1)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Lives_in (\n stuid INTEGER,\n dormid INTEGER,\n room_number INTEGER\n)\n\nCREATE TABLE Has_amenity (\n dormid INTEGER,\n amenid INTEGER\n)\n\nCREATE TABLE Dorm_amenity (\n amenid INTEGER,\n amenity_name VARCHAR(25)\n)","response":"SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the first names of all students in Smith Hall?, could you list in ascending by the total number please? ### Input: CREATE TABLE Dorm (\n dormid INTEGER,\n dorm_name VARCHAR(20),\n student_capacity INTEGER,\n gender VARCHAR(1)\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Lives_in (\n stuid INTEGER,\n dormid INTEGER,\n room_number INTEGER\n)\n\nCREATE TABLE Has_amenity (\n dormid INTEGER,\n amenid INTEGER\n)\n\nCREATE TABLE Dorm_amenity (\n amenid INTEGER,\n amenity_name VARCHAR(25)\n) ### Response: SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname)"} {"instruction":"Who was the Interview Subject on the Date when there were Pictorials of Christie Brinkley?","input":"CREATE TABLE table_40077 (\n \"Date\" text,\n \"Cover model\" text,\n \"Centerfold model\" text,\n \"Interview subject\" text,\n \"Pictorials\" text\n)","response":"SELECT \"Interview subject\" FROM table_40077 WHERE \"Pictorials\" = 'christie brinkley'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the Interview Subject on the Date when there were Pictorials of Christie Brinkley? ### Input: CREATE TABLE table_40077 (\n \"Date\" text,\n \"Cover model\" text,\n \"Centerfold model\" text,\n \"Interview subject\" text,\n \"Pictorials\" text\n) ### Response: SELECT \"Interview subject\" FROM table_40077 WHERE \"Pictorials\" = 'christie brinkley'"} {"instruction":"What is the sum of the total of the player who won in 1979?","input":"CREATE TABLE table_62505 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" real,\n \"Finish\" text\n)","response":"SELECT SUM(\"Total\") FROM table_62505 WHERE \"Year(s) won\" = '1979'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of the total of the player who won in 1979? ### Input: CREATE TABLE table_62505 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" real,\n \"Finish\" text\n) ### Response: SELECT SUM(\"Total\") FROM table_62505 WHERE \"Year(s) won\" = '1979'"} {"instruction":"What is the accreditation level for the approved (awarded 05.12.12) date?","input":"CREATE TABLE table_name_72 (\n accreditation_level VARCHAR,\n date VARCHAR\n)","response":"SELECT accreditation_level FROM table_name_72 WHERE date = \"approved (awarded 05.12.12)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the accreditation level for the approved (awarded 05.12.12) date? ### Input: CREATE TABLE table_name_72 (\n accreditation_level VARCHAR,\n date VARCHAR\n) ### Response: SELECT accreditation_level FROM table_name_72 WHERE date = \"approved (awarded 05.12.12)\""} {"instruction":"Give me a bar chart for the total number of each class, and could you sort from high to low by the y-axis please?","input":"CREATE TABLE race (\n Race_ID int,\n Name text,\n Class text,\n Date text,\n Track_ID text\n)\n\nCREATE TABLE track (\n Track_ID int,\n Name text,\n Location text,\n Seating real,\n Year_Opened real\n)","response":"SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart for the total number of each class, and could you sort from high to low by the y-axis please? ### Input: CREATE TABLE race (\n Race_ID int,\n Name text,\n Class text,\n Date text,\n Track_ID text\n)\n\nCREATE TABLE track (\n Track_ID int,\n Name text,\n Location text,\n Seating real,\n Year_Opened real\n) ### Response: SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC"} {"instruction":"Before round 7, what is the greatest Pick # for a player that plays defensive tackle?","input":"CREATE TABLE table_name_5 (\n pick__number INTEGER,\n position VARCHAR,\n round VARCHAR\n)","response":"SELECT MAX(pick__number) FROM table_name_5 WHERE position = \"defensive tackle\" AND round < 7","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Before round 7, what is the greatest Pick # for a player that plays defensive tackle? ### Input: CREATE TABLE table_name_5 (\n pick__number INTEGER,\n position VARCHAR,\n round VARCHAR\n) ### Response: SELECT MAX(pick__number) FROM table_name_5 WHERE position = \"defensive tackle\" AND round < 7"} {"instruction":"Please give me a bar chart for the total enrollment in each county, sort in asc by the total number.","input":"CREATE TABLE endowment (\n endowment_id int,\n School_id int,\n donator_name text,\n amount real\n)\n\nCREATE TABLE School (\n School_id text,\n School_name text,\n Location text,\n Mascot text,\n Enrollment int,\n IHSAA_Class text,\n IHSAA_Football_Class text,\n County text\n)\n\nCREATE TABLE budget (\n School_id int,\n Year int,\n Budgeted int,\n total_budget_percent_budgeted real,\n Invested int,\n total_budget_percent_invested real,\n Budget_invested_percent text\n)","response":"SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please give me a bar chart for the total enrollment in each county, sort in asc by the total number. ### Input: CREATE TABLE endowment (\n endowment_id int,\n School_id int,\n donator_name text,\n amount real\n)\n\nCREATE TABLE School (\n School_id text,\n School_name text,\n Location text,\n Mascot text,\n Enrollment int,\n IHSAA_Class text,\n IHSAA_Football_Class text,\n County text\n)\n\nCREATE TABLE budget (\n School_id int,\n Year int,\n Budgeted int,\n total_budget_percent_budgeted real,\n Invested int,\n total_budget_percent_invested real,\n Budget_invested_percent text\n) ### Response: SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment)"} {"instruction":"What is Record, when Game is greater than 55, and when Date is 'March 25'?","input":"CREATE TABLE table_8366 (\n \"Game\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Location\/Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Record\" FROM table_8366 WHERE \"Game\" > '55' AND \"Date\" = 'march 25'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Record, when Game is greater than 55, and when Date is 'March 25'? ### Input: CREATE TABLE table_8366 (\n \"Game\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Location\/Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Record\" FROM table_8366 WHERE \"Game\" > '55' AND \"Date\" = 'march 25'"} {"instruction":"Who is the captain of Neil Warnock's team?","input":"CREATE TABLE table_3592 (\n \"Team\" text,\n \"Manager\" text,\n \"Chairman\" text,\n \"Team captain\" text,\n \"Kit maker\" text,\n \"Sponsor\" text\n)","response":"SELECT \"Team captain\" FROM table_3592 WHERE \"Manager\" = 'Neil Warnock'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the captain of Neil Warnock's team? ### Input: CREATE TABLE table_3592 (\n \"Team\" text,\n \"Manager\" text,\n \"Chairman\" text,\n \"Team captain\" text,\n \"Kit maker\" text,\n \"Sponsor\" text\n) ### Response: SELECT \"Team captain\" FROM table_3592 WHERE \"Manager\" = 'Neil Warnock'"} {"instruction":"Users with 10 or more meta posts with score of 2 or more (Convention badge).","input":"CREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)","response":"SELECT u.Id AS \"user_link\", COUNT(*) AS NumPosts FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Score >= 2 GROUP BY u.Id HAVING COUNT(*) >= 10 ORDER BY NumPosts DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users with 10 or more meta posts with score of 2 or more (Convention badge). ### Input: CREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n) ### Response: SELECT u.Id AS \"user_link\", COUNT(*) AS NumPosts FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Score >= 2 GROUP BY u.Id HAVING COUNT(*) >= 10 ORDER BY NumPosts DESC"} {"instruction":"tell me about flights from INDIANAPOLIS to HOUSTON","input":"CREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me about flights from INDIANAPOLIS to HOUSTON ### Input: CREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"When the winners votes were 50.54% who were the members of parliment?","input":"CREATE TABLE table_18106841_1 (\n members_of_parliament VARCHAR,\n winners__percentage_votes VARCHAR\n)","response":"SELECT members_of_parliament FROM table_18106841_1 WHERE winners__percentage_votes = \"50.54%\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the winners votes were 50.54% who were the members of parliment? ### Input: CREATE TABLE table_18106841_1 (\n members_of_parliament VARCHAR,\n winners__percentage_votes VARCHAR\n) ### Response: SELECT members_of_parliament FROM table_18106841_1 WHERE winners__percentage_votes = \"50.54%\""} {"instruction":"What's the highest scoring team in the round in Ring Knutstorp in which Polestar Racing is the winning team?","input":"CREATE TABLE table_20079931_4 (\n highest_scoring_team VARCHAR,\n circuit_location VARCHAR,\n winning_team VARCHAR\n)","response":"SELECT highest_scoring_team FROM table_20079931_4 WHERE circuit_location = \"Ring Knutstorp\" AND winning_team = \"Polestar Racing\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the highest scoring team in the round in Ring Knutstorp in which Polestar Racing is the winning team? ### Input: CREATE TABLE table_20079931_4 (\n highest_scoring_team VARCHAR,\n circuit_location VARCHAR,\n winning_team VARCHAR\n) ### Response: SELECT highest_scoring_team FROM table_20079931_4 WHERE circuit_location = \"Ring Knutstorp\" AND winning_team = \"Polestar Racing\""} {"instruction":"Is it true that geoffrey e. hinton has more citations than yann lecun ?","input":"CREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)","response":"SELECT DISTINCT author.authorname, COUNT(writes.paperid) FROM author, writes WHERE author.authorname IN ('geoffrey e. hinton', 'yann lecun') AND writes.authorid = author.authorid GROUP BY author.authorname ORDER BY COUNT(writes.paperid) DESC","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Is it true that geoffrey e. hinton has more citations than yann lecun ? ### Input: CREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n) ### Response: SELECT DISTINCT author.authorname, COUNT(writes.paperid) FROM author, writes WHERE author.authorname IN ('geoffrey e. hinton', 'yann lecun') AND writes.authorid = author.authorid GROUP BY author.authorname ORDER BY COUNT(writes.paperid) DESC"} {"instruction":"Who is the mixed doubled on the tour korea super series?","input":"CREATE TABLE table_27753492_2 (\n mixed_doubles VARCHAR,\n tour VARCHAR\n)","response":"SELECT mixed_doubles FROM table_27753492_2 WHERE tour = \"Korea Super Series\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the mixed doubled on the tour korea super series? ### Input: CREATE TABLE table_27753492_2 (\n mixed_doubles VARCHAR,\n tour VARCHAR\n) ### Response: SELECT mixed_doubles FROM table_27753492_2 WHERE tour = \"Korea Super Series\""} {"instruction":"show me the three year survival rate of patients who have been prescribed tobramycin-dexamethasone ophth oint after having been diagnosed with hypertension nos?","input":"CREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 \/ COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 3 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'tobramycin-dexamethasone ophth oint') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the three year survival rate of patients who have been prescribed tobramycin-dexamethasone ophth oint after having been diagnosed with hypertension nos? ### Input: CREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 \/ COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 3 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'tobramycin-dexamethasone ophth oint') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id"} {"instruction":"calculate how many times patient 19627 received a laboratory test for potassium until 01\/2103.","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)","response":"SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19627) AND STRFTIME('%y-%m', labevents.charttime) <= '2103-01'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate how many times patient 19627 received a laboratory test for potassium until 01\/2103. ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n) ### Response: SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19627) AND STRFTIME('%y-%m', labevents.charttime) <= '2103-01'"} {"instruction":"which is longer the carolina or kentucky race ?","input":"CREATE TABLE table_204_630 (\n id number,\n \"no\" number,\n \"date\" text,\n \"race\" text,\n \"track\" text,\n \"winner\" text,\n \"reports\" text\n)","response":"SELECT \"race\" FROM table_204_630 WHERE \"race\" IN ('carolina 500', 'kentucky') ORDER BY \"no\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which is longer the carolina or kentucky race ? ### Input: CREATE TABLE table_204_630 (\n id number,\n \"no\" number,\n \"date\" text,\n \"race\" text,\n \"track\" text,\n \"winner\" text,\n \"reports\" text\n) ### Response: SELECT \"race\" FROM table_204_630 WHERE \"race\" IN ('carolina 500', 'kentucky') ORDER BY \"no\" DESC LIMIT 1"} {"instruction":"What time is CDT when PDT is 3:17 a.m.?","input":"CREATE TABLE table_name_13 (\n cdt___5_utc_ VARCHAR,\n pdt___7_utc_ VARCHAR\n)","response":"SELECT cdt___5_utc_ FROM table_name_13 WHERE pdt___7_utc_ = \"3:17 a.m.\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What time is CDT when PDT is 3:17 a.m.? ### Input: CREATE TABLE table_name_13 (\n cdt___5_utc_ VARCHAR,\n pdt___7_utc_ VARCHAR\n) ### Response: SELECT cdt___5_utc_ FROM table_name_13 WHERE pdt___7_utc_ = \"3:17 a.m.\""} {"instruction":"Who was Mountains Classification in the race with Nick Frey as Youth Classification and Tom Zirbel as Points Classification?","input":"CREATE TABLE table_25679 (\n \"Stage\" real,\n \"Winner\" text,\n \"General classification\" text,\n \"Mountains classification\" text,\n \"Points classification\" text,\n \"Youth classification\" text,\n \"Team Classification\" text\n)","response":"SELECT \"Mountains classification\" FROM table_25679 WHERE \"Youth classification\" = 'Nick Frey' AND \"Points classification\" = 'Tom Zirbel'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was Mountains Classification in the race with Nick Frey as Youth Classification and Tom Zirbel as Points Classification? ### Input: CREATE TABLE table_25679 (\n \"Stage\" real,\n \"Winner\" text,\n \"General classification\" text,\n \"Mountains classification\" text,\n \"Points classification\" text,\n \"Youth classification\" text,\n \"Team Classification\" text\n) ### Response: SELECT \"Mountains classification\" FROM table_25679 WHERE \"Youth classification\" = 'Nick Frey' AND \"Points classification\" = 'Tom Zirbel'"} {"instruction":"What Region has a Catalog of crgd 86136?","input":"CREATE TABLE table_name_47 (\n region VARCHAR,\n catalog VARCHAR\n)","response":"SELECT region FROM table_name_47 WHERE catalog = \"crgd 86136\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Region has a Catalog of crgd 86136? ### Input: CREATE TABLE table_name_47 (\n region VARCHAR,\n catalog VARCHAR\n) ### Response: SELECT region FROM table_name_47 WHERE catalog = \"crgd 86136\""} {"instruction":"What is the Pashto word for the Somali word talaado?","input":"CREATE TABLE table_name_24 (\n pashto VARCHAR,\n somali VARCHAR\n)","response":"SELECT pashto FROM table_name_24 WHERE somali = \"talaado\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Pashto word for the Somali word talaado? ### Input: CREATE TABLE table_name_24 (\n pashto VARCHAR,\n somali VARCHAR\n) ### Response: SELECT pashto FROM table_name_24 WHERE somali = \"talaado\""} {"instruction":"What years have claudia ruffo as the actor?","input":"CREATE TABLE table_65588 (\n \"Actor\" text,\n \"Character\" text,\n \"Soap Opera\" text,\n \"Years\" text,\n \"Duration\" text\n)","response":"SELECT \"Years\" FROM table_65588 WHERE \"Actor\" = 'claudia ruffo'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years have claudia ruffo as the actor? ### Input: CREATE TABLE table_65588 (\n \"Actor\" text,\n \"Character\" text,\n \"Soap Opera\" text,\n \"Years\" text,\n \"Duration\" text\n) ### Response: SELECT \"Years\" FROM table_65588 WHERE \"Actor\" = 'claudia ruffo'"} {"instruction":"what is the maximum age of patients that survived in or above the age 72?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = \"0\" AND demographic.age >= \"72\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the maximum age of patients that survived in or above the age 72? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = \"0\" AND demographic.age >= \"72\""} {"instruction":"What is Final, when Run 3 is 1:57.41?","input":"CREATE TABLE table_name_60 (\n final VARCHAR,\n run_3 VARCHAR\n)","response":"SELECT final FROM table_name_60 WHERE run_3 = \"1:57.41\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Final, when Run 3 is 1:57.41? ### Input: CREATE TABLE table_name_60 (\n final VARCHAR,\n run_3 VARCHAR\n) ### Response: SELECT final FROM table_name_60 WHERE run_3 = \"1:57.41\""} {"instruction":"Which away team has a venue of Arden Street Oval?","input":"CREATE TABLE table_name_76 (\n away_team VARCHAR,\n venue VARCHAR\n)","response":"SELECT away_team FROM table_name_76 WHERE venue = \"arden street oval\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which away team has a venue of Arden Street Oval? ### Input: CREATE TABLE table_name_76 (\n away_team VARCHAR,\n venue VARCHAR\n) ### Response: SELECT away_team FROM table_name_76 WHERE venue = \"arden street oval\""} {"instruction":"what was the first time that patient 031-24513 got a microbiology test?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) ORDER BY microlab.culturetakentime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first time that patient 031-24513 got a microbiology test? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) ORDER BY microlab.culturetakentime LIMIT 1"} {"instruction":"What is the pick number for Danny Green in a round less than 2?","input":"CREATE TABLE table_47989 (\n \"Year\" real,\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"NBA Club\" text\n)","response":"SELECT COUNT(\"Pick\") FROM table_47989 WHERE \"Player\" = 'danny green' AND \"Round\" < '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the pick number for Danny Green in a round less than 2? ### Input: CREATE TABLE table_47989 (\n \"Year\" real,\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"NBA Club\" text\n) ### Response: SELECT COUNT(\"Pick\") FROM table_47989 WHERE \"Player\" = 'danny green' AND \"Round\" < '2'"} {"instruction":"when was the last time patient 016-35266 was admitted via a hospital other hospital?","input":"CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-35266' AND patient.hospitaladmitsource = 'other hospital' ORDER BY patient.hospitaladmittime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time patient 016-35266 was admitted via a hospital other hospital? ### Input: CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-35266' AND patient.hospitaladmitsource = 'other hospital' ORDER BY patient.hospitaladmittime DESC LIMIT 1"} {"instruction":"For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday.","input":"CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)","response":"SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday. ### Input: CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n) ### Response: SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'"} {"instruction":"Give me a pie to show how many other account details from different other account details.","input":"CREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n date_account_opened DATETIME,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n product_quantity VARCHAR(50),\n other_order_item_details VARCHAR(255)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n account_id INTEGER,\n invoice_number INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DECIMAL(19,4),\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Orders (\n order_id INTEGER,\n customer_id INTEGER,\n date_order_placed DATETIME,\n order_details VARCHAR(255)\n)\n\nCREATE TABLE Product_Categories (\n production_type_code VARCHAR(15),\n product_type_description VARCHAR(80),\n vat_rating DECIMAL(19,4)\n)\n\nCREATE TABLE Invoices (\n invoice_number INTEGER,\n order_id INTEGER,\n invoice_date DATETIME\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n parent_product_id INTEGER,\n production_type_code VARCHAR(15),\n unit_price DECIMAL(19,4),\n product_name VARCHAR(80),\n product_color VARCHAR(20),\n product_size VARCHAR(20)\n)\n\nCREATE TABLE Invoice_Line_Items (\n order_item_id INTEGER,\n invoice_number INTEGER,\n product_id INTEGER,\n product_title VARCHAR(80),\n product_quantity VARCHAR(50),\n product_price DECIMAL(19,4),\n derived_product_cost DECIMAL(19,4),\n derived_vat_payable DECIMAL(19,4),\n derived_total_cost DECIMAL(19,4)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(50),\n customer_middle_initial VARCHAR(1),\n customer_last_name VARCHAR(50),\n gender VARCHAR(1),\n email_address VARCHAR(255),\n login_name VARCHAR(80),\n login_password VARCHAR(20),\n phone_number VARCHAR(255),\n town_city VARCHAR(50),\n state_county_province VARCHAR(50),\n country VARCHAR(50)\n)","response":"SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a pie to show how many other account details from different other account details. ### Input: CREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n date_account_opened DATETIME,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n product_quantity VARCHAR(50),\n other_order_item_details VARCHAR(255)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n account_id INTEGER,\n invoice_number INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DECIMAL(19,4),\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Orders (\n order_id INTEGER,\n customer_id INTEGER,\n date_order_placed DATETIME,\n order_details VARCHAR(255)\n)\n\nCREATE TABLE Product_Categories (\n production_type_code VARCHAR(15),\n product_type_description VARCHAR(80),\n vat_rating DECIMAL(19,4)\n)\n\nCREATE TABLE Invoices (\n invoice_number INTEGER,\n order_id INTEGER,\n invoice_date DATETIME\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n parent_product_id INTEGER,\n production_type_code VARCHAR(15),\n unit_price DECIMAL(19,4),\n product_name VARCHAR(80),\n product_color VARCHAR(20),\n product_size VARCHAR(20)\n)\n\nCREATE TABLE Invoice_Line_Items (\n order_item_id INTEGER,\n invoice_number INTEGER,\n product_id INTEGER,\n product_title VARCHAR(80),\n product_quantity VARCHAR(50),\n product_price DECIMAL(19,4),\n derived_product_cost DECIMAL(19,4),\n derived_vat_payable DECIMAL(19,4),\n derived_total_cost DECIMAL(19,4)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(50),\n customer_middle_initial VARCHAR(1),\n customer_last_name VARCHAR(50),\n gender VARCHAR(1),\n email_address VARCHAR(255),\n login_name VARCHAR(80),\n login_password VARCHAR(20),\n phone_number VARCHAR(255),\n town_city VARCHAR(50),\n state_county_province VARCHAR(50),\n country VARCHAR(50)\n) ### Response: SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details"} {"instruction":"What is the score from the game where Algeria is the opponent at Porto-Novo?","input":"CREATE TABLE table_name_28 (\n score VARCHAR,\n opponent VARCHAR,\n location VARCHAR\n)","response":"SELECT score FROM table_name_28 WHERE opponent = \"algeria\" AND location = \"porto-novo\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score from the game where Algeria is the opponent at Porto-Novo? ### Input: CREATE TABLE table_name_28 (\n score VARCHAR,\n opponent VARCHAR,\n location VARCHAR\n) ### Response: SELECT score FROM table_name_28 WHERE opponent = \"algeria\" AND location = \"porto-novo\""} {"instruction":"What is the Location of the Bridge Built in 1869?","input":"CREATE TABLE table_name_58 (\n location VARCHAR,\n built VARCHAR\n)","response":"SELECT location FROM table_name_58 WHERE built = \"1869\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Location of the Bridge Built in 1869? ### Input: CREATE TABLE table_name_58 (\n location VARCHAR,\n built VARCHAR\n) ### Response: SELECT location FROM table_name_58 WHERE built = \"1869\""} {"instruction":"Which series occurred in which the semi-finalist was runner-up and the 7800.00 was 6420.00?","input":"CREATE TABLE table_2544694_3 (\n indonesia_super_series_2008 VARCHAR,\n runner_up VARCHAR\n)","response":"SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE runner_up = \"Semi-Finalist\" AND 780000 = \"6420.00\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which series occurred in which the semi-finalist was runner-up and the 7800.00 was 6420.00? ### Input: CREATE TABLE table_2544694_3 (\n indonesia_super_series_2008 VARCHAR,\n runner_up VARCHAR\n) ### Response: SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE runner_up = \"Semi-Finalist\" AND 780000 = \"6420.00\""} {"instruction":"What is the status of the fleet that was commissioned on July 28, 1963?","input":"CREATE TABLE table_name_9 (\n status VARCHAR,\n commissioned VARCHAR\n)","response":"SELECT status FROM table_name_9 WHERE commissioned = \"july 28, 1963\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the status of the fleet that was commissioned on July 28, 1963? ### Input: CREATE TABLE table_name_9 (\n status VARCHAR,\n commissioned VARCHAR\n) ### Response: SELECT status FROM table_name_9 WHERE commissioned = \"july 28, 1963\""} {"instruction":"what is patient 031-22988's monthly maximum level of oxyhemoglobin?","input":"CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND lab.labname = 'oxyhemoglobin' GROUP BY STRFTIME('%y-%m', lab.labresulttime)","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is patient 031-22988's monthly maximum level of oxyhemoglobin? ### Input: CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND lab.labname = 'oxyhemoglobin' GROUP BY STRFTIME('%y-%m', lab.labresulttime)"} {"instruction":"I want the score for 23 july 1992","input":"CREATE TABLE table_name_86 (\n score VARCHAR,\n date VARCHAR\n)","response":"SELECT score FROM table_name_86 WHERE date = \"23 july 1992\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want the score for 23 july 1992 ### Input: CREATE TABLE table_name_86 (\n score VARCHAR,\n date VARCHAR\n) ### Response: SELECT score FROM table_name_86 WHERE date = \"23 july 1992\""} {"instruction":"What player's original team are the Oakland Raiders?","input":"CREATE TABLE table_80251 (\n \"Original NFL team\" text,\n \"Player\" text,\n \"Pos.\" text,\n \"College\" text,\n \"Conf.\" text\n)","response":"SELECT \"Player\" FROM table_80251 WHERE \"Original NFL team\" = 'oakland raiders'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player's original team are the Oakland Raiders? ### Input: CREATE TABLE table_80251 (\n \"Original NFL team\" text,\n \"Player\" text,\n \"Pos.\" text,\n \"College\" text,\n \"Conf.\" text\n) ### Response: SELECT \"Player\" FROM table_80251 WHERE \"Original NFL team\" = 'oakland raiders'"} {"instruction":"What is the number of patients diagnosed with rheumatic heart failure (congestive) who have a delta abnormal lab test?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = \"Rheumatic heart failure (congestive)\" AND lab.flag = \"delta\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of patients diagnosed with rheumatic heart failure (congestive) who have a delta abnormal lab test? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = \"Rheumatic heart failure (congestive)\" AND lab.flag = \"delta\""} {"instruction":"so what's the average mch value of patient 006-157753 on their current hospital encounter?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mch'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: so what's the average mch value of patient 006-157753 on their current hospital encounter? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mch'"} {"instruction":"Which Colliery has a Death toll of 7?","input":"CREATE TABLE table_name_76 (\n colliery VARCHAR,\n death_toll VARCHAR\n)","response":"SELECT colliery FROM table_name_76 WHERE death_toll = 7","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Colliery has a Death toll of 7? ### Input: CREATE TABLE table_name_76 (\n colliery VARCHAR,\n death_toll VARCHAR\n) ### Response: SELECT colliery FROM table_name_76 WHERE death_toll = 7"} {"instruction":"What is the status of vessel number K-223?","input":"CREATE TABLE table_1634376_1 (\n status VARCHAR,\n _number VARCHAR\n)","response":"SELECT status FROM table_1634376_1 WHERE _number = \"K-223\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the status of vessel number K-223? ### Input: CREATE TABLE table_1634376_1 (\n status VARCHAR,\n _number VARCHAR\n) ### Response: SELECT status FROM table_1634376_1 WHERE _number = \"K-223\""} {"instruction":"Name the post poles for 4 podiums","input":"CREATE TABLE table_29650 (\n \"Season\" real,\n \"Series\" text,\n \"Team Name\" text,\n \"Races\" real,\n \"Poles\" real,\n \"Wins\" real,\n \"Podiums\" real,\n \"F\/Laps\" real,\n \"Points\" real,\n \"Final Placing\" text\n)","response":"SELECT MAX(\"Poles\") FROM table_29650 WHERE \"Podiums\" = '4'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the post poles for 4 podiums ### Input: CREATE TABLE table_29650 (\n \"Season\" real,\n \"Series\" text,\n \"Team Name\" text,\n \"Races\" real,\n \"Poles\" real,\n \"Wins\" real,\n \"Podiums\" real,\n \"F\/Laps\" real,\n \"Points\" real,\n \"Final Placing\" text\n) ### Response: SELECT MAX(\"Poles\") FROM table_29650 WHERE \"Podiums\" = '4'"} {"instruction":"A line chart for what are the number of the distinct visit dates?","input":"CREATE TABLE Photos (\n Photo_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(255),\n Description VARCHAR(255),\n Filename VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Theme_Parks (\n Theme_Park_ID INTEGER,\n Theme_Park_Details VARCHAR(255)\n)\n\nCREATE TABLE Hotels (\n hotel_id INTEGER,\n star_rating_code CHAR(15),\n pets_allowed_yn CHAR(1),\n price_range real,\n other_hotel_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Attraction_Types (\n Attraction_Type_Code CHAR(15),\n Attraction_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Visits (\n Visit_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Tourist_ID INTEGER,\n Visit_Date DATETIME,\n Visit_Details VARCHAR(40)\n)\n\nCREATE TABLE Street_Markets (\n Market_ID INTEGER,\n Market_Details VARCHAR(255)\n)\n\nCREATE TABLE Staff (\n Staff_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(40),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Visitors (\n Tourist_ID INTEGER,\n Tourist_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attraction_Features (\n Tourist_Attraction_ID INTEGER,\n Feature_ID INTEGER\n)\n\nCREATE TABLE Features (\n Feature_ID INTEGER,\n Feature_Details VARCHAR(255)\n)\n\nCREATE TABLE Royal_Family (\n Royal_Family_ID INTEGER,\n Royal_Family_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Hotel_Star_Ratings (\n star_rating_code CHAR(15),\n star_rating_description VARCHAR(80)\n)\n\nCREATE TABLE Shops (\n Shop_ID INTEGER,\n Shop_Details VARCHAR(255)\n)\n\nCREATE TABLE Locations (\n Location_ID INTEGER,\n Location_Name VARCHAR(255),\n Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attractions (\n Tourist_Attraction_ID INTEGER,\n Attraction_Type_Code CHAR(15),\n Location_ID INTEGER,\n How_to_Get_There VARCHAR(255),\n Name VARCHAR(255),\n Description VARCHAR(255),\n Opening_Hours VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Museums (\n Museum_ID INTEGER,\n Museum_Details VARCHAR(255)\n)","response":"SELECT Visit_Date, COUNT(Visit_Date) FROM Visits","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A line chart for what are the number of the distinct visit dates? ### Input: CREATE TABLE Photos (\n Photo_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(255),\n Description VARCHAR(255),\n Filename VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Theme_Parks (\n Theme_Park_ID INTEGER,\n Theme_Park_Details VARCHAR(255)\n)\n\nCREATE TABLE Hotels (\n hotel_id INTEGER,\n star_rating_code CHAR(15),\n pets_allowed_yn CHAR(1),\n price_range real,\n other_hotel_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Attraction_Types (\n Attraction_Type_Code CHAR(15),\n Attraction_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Visits (\n Visit_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Tourist_ID INTEGER,\n Visit_Date DATETIME,\n Visit_Details VARCHAR(40)\n)\n\nCREATE TABLE Street_Markets (\n Market_ID INTEGER,\n Market_Details VARCHAR(255)\n)\n\nCREATE TABLE Staff (\n Staff_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(40),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Visitors (\n Tourist_ID INTEGER,\n Tourist_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attraction_Features (\n Tourist_Attraction_ID INTEGER,\n Feature_ID INTEGER\n)\n\nCREATE TABLE Features (\n Feature_ID INTEGER,\n Feature_Details VARCHAR(255)\n)\n\nCREATE TABLE Royal_Family (\n Royal_Family_ID INTEGER,\n Royal_Family_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Hotel_Star_Ratings (\n star_rating_code CHAR(15),\n star_rating_description VARCHAR(80)\n)\n\nCREATE TABLE Shops (\n Shop_ID INTEGER,\n Shop_Details VARCHAR(255)\n)\n\nCREATE TABLE Locations (\n Location_ID INTEGER,\n Location_Name VARCHAR(255),\n Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attractions (\n Tourist_Attraction_ID INTEGER,\n Attraction_Type_Code CHAR(15),\n Location_ID INTEGER,\n How_to_Get_There VARCHAR(255),\n Name VARCHAR(255),\n Description VARCHAR(255),\n Opening_Hours VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Museums (\n Museum_ID INTEGER,\n Museum_Details VARCHAR(255)\n) ### Response: SELECT Visit_Date, COUNT(Visit_Date) FROM Visits"} {"instruction":"How many faculty members does each building have? List the result with the name of the building with a bar chart, show from high to low by the x-axis.","input":"CREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Activity (\n actid INTEGER,\n activity_name varchar(25)\n)","response":"SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members does each building have? List the result with the name of the building with a bar chart, show from high to low by the x-axis. ### Input: CREATE TABLE Faculty (\n FacID INTEGER,\n Lname VARCHAR(15),\n Fname VARCHAR(15),\n Rank VARCHAR(15),\n Sex VARCHAR(1),\n Phone INTEGER,\n Room VARCHAR(5),\n Building VARCHAR(13)\n)\n\nCREATE TABLE Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Participates_in (\n stuid INTEGER,\n actid INTEGER\n)\n\nCREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Activity (\n actid INTEGER,\n activity_name varchar(25)\n) ### Response: SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC"} {"instruction":"What was the result of the game in Stuttgart, West Germany and a goal number of less than 9?","input":"CREATE TABLE table_name_12 (\n result VARCHAR,\n venue VARCHAR,\n goal VARCHAR\n)","response":"SELECT result FROM table_name_12 WHERE venue = \"stuttgart, west germany\" AND goal < 9","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game in Stuttgart, West Germany and a goal number of less than 9? ### Input: CREATE TABLE table_name_12 (\n result VARCHAR,\n venue VARCHAR,\n goal VARCHAR\n) ### Response: SELECT result FROM table_name_12 WHERE venue = \"stuttgart, west germany\" AND goal < 9"} {"instruction":"Who had the high rebounds in the game with a final score of w 140-108?","input":"CREATE TABLE table_1683 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"High rebounds\" FROM table_1683 WHERE \"Score\" = 'W 140-108'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the high rebounds in the game with a final score of w 140-108? ### Input: CREATE TABLE table_1683 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"High rebounds\" FROM table_1683 WHERE \"Score\" = 'W 140-108'"} {"instruction":"What is the weight of the shortest person?","input":"CREATE TABLE people (\n Weight VARCHAR,\n Height VARCHAR\n)","response":"SELECT Weight FROM people ORDER BY Height LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the weight of the shortest person? ### Input: CREATE TABLE people (\n Weight VARCHAR,\n Height VARCHAR\n) ### Response: SELECT Weight FROM people ORDER BY Height LIMIT 1"} {"instruction":"What was the 110H that the 1500m was 692 and the final was more than 7906?","input":"CREATE TABLE table_77037 (\n \"Athlete\" text,\n \"Event\" text,\n \"100 m\" real,\n \"400 m\" real,\n \"110H\" real,\n \"1500 m\" text,\n \"Final\" real\n)","response":"SELECT COUNT(\"110H\") FROM table_77037 WHERE \"1500 m\" = '692' AND \"Final\" > '7906'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the 110H that the 1500m was 692 and the final was more than 7906? ### Input: CREATE TABLE table_77037 (\n \"Athlete\" text,\n \"Event\" text,\n \"100 m\" real,\n \"400 m\" real,\n \"110H\" real,\n \"1500 m\" text,\n \"Final\" real\n) ### Response: SELECT COUNT(\"110H\") FROM table_77037 WHERE \"1500 m\" = '692' AND \"Final\" > '7906'"} {"instruction":"What is the mean pick when the play is Marc Lewis (lhp) and the round is less than 20?","input":"CREATE TABLE table_name_76 (\n pick INTEGER,\n player VARCHAR,\n round VARCHAR\n)","response":"SELECT AVG(pick) FROM table_name_76 WHERE player = \"marc lewis (lhp)\" AND round < 20","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mean pick when the play is Marc Lewis (lhp) and the round is less than 20? ### Input: CREATE TABLE table_name_76 (\n pick INTEGER,\n player VARCHAR,\n round VARCHAR\n) ### Response: SELECT AVG(pick) FROM table_name_76 WHERE player = \"marc lewis (lhp)\" AND round < 20"} {"instruction":"Which Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tournament of honolulu?","input":"CREATE TABLE table_name_51 (\n opponent VARCHAR,\n tournament VARCHAR,\n surface VARCHAR,\n outcome VARCHAR\n)","response":"SELECT opponent FROM table_name_51 WHERE surface = \"hardcourt\" AND outcome = \"runner-up\" AND tournament = \"honolulu\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tournament of honolulu? ### Input: CREATE TABLE table_name_51 (\n opponent VARCHAR,\n tournament VARCHAR,\n surface VARCHAR,\n outcome VARCHAR\n) ### Response: SELECT opponent FROM table_name_51 WHERE surface = \"hardcourt\" AND outcome = \"runner-up\" AND tournament = \"honolulu\""} {"instruction":"dysphagia nec what does it stand for?","input":"CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dysphagia nec'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: dysphagia nec what does it stand for? ### Input: CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dysphagia nec'"} {"instruction":"For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and list y axis in asc order please.","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and list y axis in asc order please. ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)"} {"instruction":"What Points for has a Try bonus of 140?","input":"CREATE TABLE table_name_26 (\n points_for VARCHAR,\n try_bonus VARCHAR\n)","response":"SELECT points_for FROM table_name_26 WHERE try_bonus = \"140\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Points for has a Try bonus of 140? ### Input: CREATE TABLE table_name_26 (\n points_for VARCHAR,\n try_bonus VARCHAR\n) ### Response: SELECT points_for FROM table_name_26 WHERE try_bonus = \"140\""} {"instruction":"Name the langauge for switzerland","input":"CREATE TABLE table_71432 (\n \"Country\" text,\n \"Film title used in nomination\" text,\n \"Language\" text,\n \"Original title\" text,\n \"Director\" text\n)","response":"SELECT \"Language\" FROM table_71432 WHERE \"Country\" = 'switzerland'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the langauge for switzerland ### Input: CREATE TABLE table_71432 (\n \"Country\" text,\n \"Film title used in nomination\" text,\n \"Language\" text,\n \"Original title\" text,\n \"Director\" text\n) ### Response: SELECT \"Language\" FROM table_71432 WHERE \"Country\" = 'switzerland'"} {"instruction":"Name the total number of bids of the sun belt conference","input":"CREATE TABLE table_10722506_6 (\n _number_of_bids VARCHAR,\n conference VARCHAR\n)","response":"SELECT COUNT(_number_of_bids) FROM table_10722506_6 WHERE conference = \"Sun Belt\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of bids of the sun belt conference ### Input: CREATE TABLE table_10722506_6 (\n _number_of_bids VARCHAR,\n conference VARCHAR\n) ### Response: SELECT COUNT(_number_of_bids) FROM table_10722506_6 WHERE conference = \"Sun Belt\""} {"instruction":"Count the number of cinemas.","input":"CREATE TABLE cinema (\n cinema_id number,\n name text,\n openning_year number,\n capacity number,\n location text\n)\n\nCREATE TABLE film (\n film_id number,\n rank_in_series number,\n number_in_season number,\n title text,\n directed_by text,\n original_air_date text,\n production_code text\n)\n\nCREATE TABLE schedule (\n cinema_id number,\n film_id number,\n date text,\n show_times_per_day number,\n price number\n)","response":"SELECT COUNT(*) FROM cinema","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of cinemas. ### Input: CREATE TABLE cinema (\n cinema_id number,\n name text,\n openning_year number,\n capacity number,\n location text\n)\n\nCREATE TABLE film (\n film_id number,\n rank_in_series number,\n number_in_season number,\n title text,\n directed_by text,\n original_air_date text,\n production_code text\n)\n\nCREATE TABLE schedule (\n cinema_id number,\n film_id number,\n date text,\n show_times_per_day number,\n price number\n) ### Response: SELECT COUNT(*) FROM cinema"} {"instruction":"What is the lowest Rank with more than 0 bronze, 8 silver, and a total of 19, with less than 9 gold?","input":"CREATE TABLE table_name_23 (\n rank INTEGER,\n gold VARCHAR,\n total VARCHAR,\n bronze VARCHAR,\n silver VARCHAR\n)","response":"SELECT MIN(rank) FROM table_name_23 WHERE bronze > 0 AND silver = 8 AND total = 19 AND gold < 9","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest Rank with more than 0 bronze, 8 silver, and a total of 19, with less than 9 gold? ### Input: CREATE TABLE table_name_23 (\n rank INTEGER,\n gold VARCHAR,\n total VARCHAR,\n bronze VARCHAR,\n silver VARCHAR\n) ### Response: SELECT MIN(rank) FROM table_name_23 WHERE bronze > 0 AND silver = 8 AND total = 19 AND gold < 9"} {"instruction":"What is the number of patients with private health insurance who had a urea nitrogen urine lab test?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = \"Private\" AND lab.label = \"Urea Nitrogen, Urine\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of patients with private health insurance who had a urea nitrogen urine lab test? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = \"Private\" AND lab.label = \"Urea Nitrogen, Urine\""} {"instruction":"Name the 2006 when the 2010 is 27","input":"CREATE TABLE table_15796 (\n \"Tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n)","response":"SELECT \"2006\" FROM table_15796 WHERE \"2010\" = '27'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the 2006 when the 2010 is 27 ### Input: CREATE TABLE table_15796 (\n \"Tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n) ### Response: SELECT \"2006\" FROM table_15796 WHERE \"2010\" = '27'"} {"instruction":"What was the score of the game when the Indians ended up with a record of 55-51?","input":"CREATE TABLE table_name_33 (\n score VARCHAR,\n record VARCHAR\n)","response":"SELECT score FROM table_name_33 WHERE record = \"55-51\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the game when the Indians ended up with a record of 55-51? ### Input: CREATE TABLE table_name_33 (\n score VARCHAR,\n record VARCHAR\n) ### Response: SELECT score FROM table_name_33 WHERE record = \"55-51\""} {"instruction":"Who won the mens singles when sayaka sato won the womens singles?","input":"CREATE TABLE table_12275551_1 (\n mens_singles VARCHAR,\n womens_singles VARCHAR\n)","response":"SELECT mens_singles FROM table_12275551_1 WHERE womens_singles = \"Sayaka Sato\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who won the mens singles when sayaka sato won the womens singles? ### Input: CREATE TABLE table_12275551_1 (\n mens_singles VARCHAR,\n womens_singles VARCHAR\n) ### Response: SELECT mens_singles FROM table_12275551_1 WHERE womens_singles = \"Sayaka Sato\""} {"instruction":"What is the name of the Original artist when the week # is top 16 (8 men)?","input":"CREATE TABLE table_name_15 (\n original_artist VARCHAR,\n week__number VARCHAR\n)","response":"SELECT original_artist FROM table_name_15 WHERE week__number = \"top 16 (8 men)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the Original artist when the week # is top 16 (8 men)? ### Input: CREATE TABLE table_name_15 (\n original_artist VARCHAR,\n week__number VARCHAR\n) ### Response: SELECT original_artist FROM table_name_15 WHERE week__number = \"top 16 (8 men)\""} {"instruction":"With an original artist names Bette Midler, what is the order number?","input":"CREATE TABLE table_21501565_1 (\n order__number VARCHAR,\n original_artist VARCHAR\n)","response":"SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = \"Bette Midler\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With an original artist names Bette Midler, what is the order number? ### Input: CREATE TABLE table_21501565_1 (\n order__number VARCHAR,\n original_artist VARCHAR\n) ### Response: SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = \"Bette Midler\""} {"instruction":"Posts that were edited by other users.","input":"CREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)","response":"SELECT Id AS \"post_link\", LastEditorUserId AS \"user_link\", LastEditDate FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != '##UserId##' ORDER BY LastEditDate DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Posts that were edited by other users. ### Input: CREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n) ### Response: SELECT Id AS \"post_link\", LastEditorUserId AS \"user_link\", LastEditDate FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != '##UserId##' ORDER BY LastEditDate DESC"} {"instruction":"How many appointment dates were recorded when J rgen Kohler was the replaced by?","input":"CREATE TABLE table_21275 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n)","response":"SELECT COUNT(\"Date of appointment\") FROM table_21275 WHERE \"Replaced by\" = 'J\u00fcrgen Kohler'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many appointment dates were recorded when J rgen Kohler was the replaced by? ### Input: CREATE TABLE table_21275 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n) ### Response: SELECT COUNT(\"Date of appointment\") FROM table_21275 WHERE \"Replaced by\" = 'J\u00fcrgen Kohler'"} {"instruction":"What is the average year with an average start smaller than 6.3 and fewer than 0 wins?","input":"CREATE TABLE table_36915 (\n \"Year\" real,\n \"Starts\" real,\n \"Wins\" real,\n \"Top 5\" real,\n \"Top 10\" real,\n \"Poles\" real,\n \"Avg. Start\" real,\n \"Avg. Finish\" real,\n \"Winnings\" text,\n \"Position\" text\n)","response":"SELECT AVG(\"Year\") FROM table_36915 WHERE \"Avg. Start\" < '6.3' AND \"Wins\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average year with an average start smaller than 6.3 and fewer than 0 wins? ### Input: CREATE TABLE table_36915 (\n \"Year\" real,\n \"Starts\" real,\n \"Wins\" real,\n \"Top 5\" real,\n \"Top 10\" real,\n \"Poles\" real,\n \"Avg. Start\" real,\n \"Avg. Finish\" real,\n \"Winnings\" text,\n \"Position\" text\n) ### Response: SELECT AVG(\"Year\") FROM table_36915 WHERE \"Avg. Start\" < '6.3' AND \"Wins\" < '0'"} {"instruction":"japan earned only 1 bronze metal in boxing during the 1960 olympics . how many other countries earned the exact same metal count as japan ?","input":"CREATE TABLE table_203_496 (\n id number,\n \"pos\" number,\n \"country\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT COUNT(\"country\") FROM table_203_496 WHERE \"country\" <> 'japan' AND \"bronze\" = 1 AND \"total\" = 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: japan earned only 1 bronze metal in boxing during the 1960 olympics . how many other countries earned the exact same metal count as japan ? ### Input: CREATE TABLE table_203_496 (\n id number,\n \"pos\" number,\n \"country\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT COUNT(\"country\") FROM table_203_496 WHERE \"country\" <> 'japan' AND \"bronze\" = 1 AND \"total\" = 1"} {"instruction":"For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to display Name in asc order.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to display Name in asc order. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name"} {"instruction":"Which Wins have Losses smaller than 6, and a Position of 4, and Played larger than 9?","input":"CREATE TABLE table_name_98 (\n wins INTEGER,\n played VARCHAR,\n losses VARCHAR,\n position VARCHAR\n)","response":"SELECT MIN(wins) FROM table_name_98 WHERE losses < 6 AND position = 4 AND played > 9","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Wins have Losses smaller than 6, and a Position of 4, and Played larger than 9? ### Input: CREATE TABLE table_name_98 (\n wins INTEGER,\n played VARCHAR,\n losses VARCHAR,\n position VARCHAR\n) ### Response: SELECT MIN(wins) FROM table_name_98 WHERE losses < 6 AND position = 4 AND played > 9"} {"instruction":"What date did the epiode that had 1.37 million as the rating originally air?","input":"CREATE TABLE table_27218002_2 (\n originalairdate VARCHAR,\n ratings VARCHAR\n)","response":"SELECT originalairdate FROM table_27218002_2 WHERE ratings = \"1.37 Million\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did the epiode that had 1.37 million as the rating originally air? ### Input: CREATE TABLE table_27218002_2 (\n originalairdate VARCHAR,\n ratings VARCHAR\n) ### Response: SELECT originalairdate FROM table_27218002_2 WHERE ratings = \"1.37 Million\""} {"instruction":"When divisional semifinals are the playoffs what is the year?","input":"CREATE TABLE table_23374 (\n \"Year\" text,\n \"Division\" text,\n \"League\" text,\n \"Regular Season\" text,\n \"Playoffs\" text,\n \"Open Cup\" text\n)","response":"SELECT \"Year\" FROM table_23374 WHERE \"Playoffs\" = 'Divisional Semifinals'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When divisional semifinals are the playoffs what is the year? ### Input: CREATE TABLE table_23374 (\n \"Year\" text,\n \"Division\" text,\n \"League\" text,\n \"Regular Season\" text,\n \"Playoffs\" text,\n \"Open Cup\" text\n) ### Response: SELECT \"Year\" FROM table_23374 WHERE \"Playoffs\" = 'Divisional Semifinals'"} {"instruction":"Which label released the catalog Magik Muzik CD 07 on 28 March 2007?","input":"CREATE TABLE table_name_86 (\n label VARCHAR,\n date VARCHAR,\n catalog VARCHAR\n)","response":"SELECT label FROM table_name_86 WHERE date = \"28 march 2007\" AND catalog = \"magik muzik cd 07\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which label released the catalog Magik Muzik CD 07 on 28 March 2007? ### Input: CREATE TABLE table_name_86 (\n label VARCHAR,\n date VARCHAR,\n catalog VARCHAR\n) ### Response: SELECT label FROM table_name_86 WHERE date = \"28 march 2007\" AND catalog = \"magik muzik cd 07\""} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart, and sort in ascending by the Y-axis.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart, and sort in ascending by the Y-axis. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)"} {"instruction":"when did patient 029-16431 come this year for the last time to the hospital?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-16431' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 029-16431 come this year for the last time to the hospital? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-16431' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1"} {"instruction":"what is the number of patients whose diagnoses long title is sinoatrial node dysfunction?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = \"Sinoatrial node dysfunction\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose diagnoses long title is sinoatrial node dysfunction? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = \"Sinoatrial node dysfunction\""} {"instruction":"Show me how many destination by destination in a histogram, display by the bars in ascending.","input":"CREATE TABLE certificate (\n eid number(9,0),\n aid number(9,0)\n)\n\nCREATE TABLE employee (\n eid number(9,0),\n name varchar2(30),\n salary number(10,2)\n)\n\nCREATE TABLE flight (\n flno number(4,0),\n origin varchar2(20),\n destination varchar2(20),\n distance number(6,0),\n departure_date date,\n arrival_date date,\n price number(7,2),\n aid number(9,0)\n)\n\nCREATE TABLE aircraft (\n aid number(9,0),\n name varchar2(30),\n distance number(6,0)\n)","response":"SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me how many destination by destination in a histogram, display by the bars in ascending. ### Input: CREATE TABLE certificate (\n eid number(9,0),\n aid number(9,0)\n)\n\nCREATE TABLE employee (\n eid number(9,0),\n name varchar2(30),\n salary number(10,2)\n)\n\nCREATE TABLE flight (\n flno number(4,0),\n origin varchar2(20),\n destination varchar2(20),\n distance number(6,0),\n departure_date date,\n arrival_date date,\n price number(7,2),\n aid number(9,0)\n)\n\nCREATE TABLE aircraft (\n aid number(9,0),\n name varchar2(30),\n distance number(6,0)\n) ### Response: SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination"} {"instruction":"Which player plays for the college of manitoba?","input":"CREATE TABLE table_52523 (\n \"Pick #\" real,\n \"CFL Team\" text,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT \"Player\" FROM table_52523 WHERE \"College\" = 'manitoba'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player plays for the college of manitoba? ### Input: CREATE TABLE table_52523 (\n \"Pick #\" real,\n \"CFL Team\" text,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT \"Player\" FROM table_52523 WHERE \"College\" = 'manitoba'"} {"instruction":"what is diagnoses short title of subject id 17519?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = \"17519\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is diagnoses short title of subject id 17519? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = \"17519\""} {"instruction":"What was the Engine, when the Chassis was Bugatti T51, and when the Entrant was a Private Entry?","input":"CREATE TABLE table_7679 (\n \"Driver\" text,\n \"Entrant\" text,\n \"Constructor\" text,\n \"Chassis\" text,\n \"Engine\" text\n)","response":"SELECT \"Engine\" FROM table_7679 WHERE \"Chassis\" = 'bugatti t51' AND \"Entrant\" = 'private entry'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Engine, when the Chassis was Bugatti T51, and when the Entrant was a Private Entry? ### Input: CREATE TABLE table_7679 (\n \"Driver\" text,\n \"Entrant\" text,\n \"Constructor\" text,\n \"Chassis\" text,\n \"Engine\" text\n) ### Response: SELECT \"Engine\" FROM table_7679 WHERE \"Chassis\" = 'bugatti t51' AND \"Entrant\" = 'private entry'"} {"instruction":"find the number of patients whose admission type is elective and lab test name is potassium, urine.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND lab.label = \"Potassium, Urine\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients whose admission type is elective and lab test name is potassium, urine. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND lab.label = \"Potassium, Urine\""} {"instruction":"Name the city for los angeles stadium","input":"CREATE TABLE table_30442 (\n \"Stadium\" text,\n \"Capacity\" real,\n \"City\" text,\n \"Country\" text,\n \"Tenant\" text,\n \"Opening\" text\n)","response":"SELECT \"City\" FROM table_30442 WHERE \"Stadium\" = 'Los Angeles Stadium'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the city for los angeles stadium ### Input: CREATE TABLE table_30442 (\n \"Stadium\" text,\n \"Capacity\" real,\n \"City\" text,\n \"Country\" text,\n \"Tenant\" text,\n \"Opening\" text\n) ### Response: SELECT \"City\" FROM table_30442 WHERE \"Stadium\" = 'Los Angeles Stadium'"} {"instruction":"What is the Film\/Show, when the Year is 2010?","input":"CREATE TABLE table_68099 (\n \"Year\" real,\n \"Group\" text,\n \"Award\" text,\n \"Film\/Show\" text,\n \"Result\" text\n)","response":"SELECT \"Film\/Show\" FROM table_68099 WHERE \"Year\" = '2010'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Film\/Show, when the Year is 2010? ### Input: CREATE TABLE table_68099 (\n \"Year\" real,\n \"Group\" text,\n \"Award\" text,\n \"Film\/Show\" text,\n \"Result\" text\n) ### Response: SELECT \"Film\/Show\" FROM table_68099 WHERE \"Year\" = '2010'"} {"instruction":"Name the score for opponents of nathan healey igor kunitsyn","input":"CREATE TABLE table_38244 (\n \"Outcome\" text,\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Partnering\" text,\n \"Opponents in the final\" text,\n \"Score\" text\n)","response":"SELECT \"Score\" FROM table_38244 WHERE \"Opponents in the final\" = 'nathan healey igor kunitsyn'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the score for opponents of nathan healey igor kunitsyn ### Input: CREATE TABLE table_38244 (\n \"Outcome\" text,\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Partnering\" text,\n \"Opponents in the final\" text,\n \"Score\" text\n) ### Response: SELECT \"Score\" FROM table_38244 WHERE \"Opponents in the final\" = 'nathan healey igor kunitsyn'"} {"instruction":"What is the average Season, when F\/Laps is 1, and when Poles is less than 0?","input":"CREATE TABLE table_42825 (\n \"Season\" real,\n \"Series\" text,\n \"Races\" real,\n \"Wins\" real,\n \"Poles\" real,\n \"F\/Laps\" real,\n \"Podiums\" real,\n \"Points\" text,\n \"Position\" text\n)","response":"SELECT AVG(\"Season\") FROM table_42825 WHERE \"F\/Laps\" = '1' AND \"Poles\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Season, when F\/Laps is 1, and when Poles is less than 0? ### Input: CREATE TABLE table_42825 (\n \"Season\" real,\n \"Series\" text,\n \"Races\" real,\n \"Wins\" real,\n \"Poles\" real,\n \"F\/Laps\" real,\n \"Podiums\" real,\n \"Points\" text,\n \"Position\" text\n) ### Response: SELECT AVG(\"Season\") FROM table_42825 WHERE \"F\/Laps\" = '1' AND \"Poles\" < '0'"} {"instruction":"let me know the birth date and death date of patient caren obrien.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = \"Caren Obrien\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: let me know the birth date and death date of patient caren obrien. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = \"Caren Obrien\""} {"instruction":"Show party names and the number of events for each party. Visualize by pie chart.","input":"CREATE TABLE party (\n Party_ID int,\n Minister text,\n Took_office text,\n Left_office text,\n Region_ID int,\n Party_name text\n)\n\nCREATE TABLE member (\n Member_ID int,\n Member_Name text,\n Party_ID text,\n In_office text\n)\n\nCREATE TABLE party_events (\n Event_ID int,\n Event_Name text,\n Party_ID int,\n Member_in_charge_ID int\n)\n\nCREATE TABLE region (\n Region_ID int,\n Region_name text,\n Date text,\n Label text,\n Format text,\n Catalogue text\n)","response":"SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show party names and the number of events for each party. Visualize by pie chart. ### Input: CREATE TABLE party (\n Party_ID int,\n Minister text,\n Took_office text,\n Left_office text,\n Region_ID int,\n Party_name text\n)\n\nCREATE TABLE member (\n Member_ID int,\n Member_Name text,\n Party_ID text,\n In_office text\n)\n\nCREATE TABLE party_events (\n Event_ID int,\n Event_Name text,\n Party_ID int,\n Member_in_charge_ID int\n)\n\nCREATE TABLE region (\n Region_ID int,\n Region_name text,\n Date text,\n Label text,\n Format text,\n Catalogue text\n) ### Response: SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID"} {"instruction":"List all results from the 3-3 scoring game.","input":"CREATE TABLE table_26930 (\n \"Game\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Wildcats points\" real,\n \"Opponents\" real,\n \"Record\" text\n)","response":"SELECT \"Result\" FROM table_26930 WHERE \"Record\" = '3-3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all results from the 3-3 scoring game. ### Input: CREATE TABLE table_26930 (\n \"Game\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Wildcats points\" real,\n \"Opponents\" real,\n \"Record\" text\n) ### Response: SELECT \"Result\" FROM table_26930 WHERE \"Record\" = '3-3'"} {"instruction":"How many laps did BRM have with a grid of 11?","input":"CREATE TABLE table_name_33 (\n laps VARCHAR,\n constructor VARCHAR,\n grid VARCHAR\n)","response":"SELECT COUNT(laps) FROM table_name_33 WHERE constructor = \"brm\" AND grid = 11","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many laps did BRM have with a grid of 11? ### Input: CREATE TABLE table_name_33 (\n laps VARCHAR,\n constructor VARCHAR,\n grid VARCHAR\n) ### Response: SELECT COUNT(laps) FROM table_name_33 WHERE constructor = \"brm\" AND grid = 11"} {"instruction":"What is the total number of draws for songs performed by Miranda with fewer than 48 points?","input":"CREATE TABLE table_name_64 (\n draw VARCHAR,\n performer VARCHAR,\n points VARCHAR\n)","response":"SELECT COUNT(draw) FROM table_name_64 WHERE performer = \"miranda\" AND points < 48","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of draws for songs performed by Miranda with fewer than 48 points? ### Input: CREATE TABLE table_name_64 (\n draw VARCHAR,\n performer VARCHAR,\n points VARCHAR\n) ### Response: SELECT COUNT(draw) FROM table_name_64 WHERE performer = \"miranda\" AND points < 48"} {"instruction":"On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70?","input":"CREATE TABLE table_name_49 (\n date VARCHAR,\n games VARCHAR,\n time VARCHAR\n)","response":"SELECT date FROM table_name_49 WHERE games = \"2002 salt lake city\" AND time = \"3:57.70\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70? ### Input: CREATE TABLE table_name_49 (\n date VARCHAR,\n games VARCHAR,\n time VARCHAR\n) ### Response: SELECT date FROM table_name_49 WHERE games = \"2002 salt lake city\" AND time = \"3:57.70\""} {"instruction":"how many countries received silver medals ?","input":"CREATE TABLE table_204_211 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT COUNT(\"nation\") FROM table_204_211 WHERE \"silver\" > 0","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many countries received silver medals ? ### Input: CREATE TABLE table_204_211 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT COUNT(\"nation\") FROM table_204_211 WHERE \"silver\" > 0"} {"instruction":"Who played against in venue a on 17 february 1900?","input":"CREATE TABLE table_name_43 (\n opponent VARCHAR,\n venue VARCHAR,\n date VARCHAR\n)","response":"SELECT opponent FROM table_name_43 WHERE venue = \"a\" AND date = \"17 february 1900\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who played against in venue a on 17 february 1900? ### Input: CREATE TABLE table_name_43 (\n opponent VARCHAR,\n venue VARCHAR,\n date VARCHAR\n) ### Response: SELECT opponent FROM table_name_43 WHERE venue = \"a\" AND date = \"17 february 1900\""} {"instruction":"does the united states have more nation of citzenship then united kingdom ?","input":"CREATE TABLE table_203_364 (\n id number,\n \"year\" number,\n \"driver\" text,\n \"nation of citizenship\" text,\n \"racing series\" text,\n \"type of vehicle\" text\n)","response":"SELECT (SELECT COUNT(*) FROM table_203_364 WHERE \"nation of citizenship\" = 'united states') > (SELECT COUNT(*) FROM table_203_364 WHERE \"nation of citizenship\" = 'united kingdom')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does the united states have more nation of citzenship then united kingdom ? ### Input: CREATE TABLE table_203_364 (\n id number,\n \"year\" number,\n \"driver\" text,\n \"nation of citizenship\" text,\n \"racing series\" text,\n \"type of vehicle\" text\n) ### Response: SELECT (SELECT COUNT(*) FROM table_203_364 WHERE \"nation of citizenship\" = 'united states') > (SELECT COUNT(*) FROM table_203_364 WHERE \"nation of citizenship\" = 'united kingdom')"} {"instruction":"which governor served for the least number of years ?","input":"CREATE TABLE table_203_89 (\n id number,\n \"#\" number,\n \"name\\n(birth-death)\" text,\n \"took office\" text,\n \"left office\" text,\n \"monarch\" text,\n \"prime minister\" text\n)","response":"SELECT \"name\\n(birth-death)\" FROM table_203_89 ORDER BY \"left office\" - \"took office\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which governor served for the least number of years ? ### Input: CREATE TABLE table_203_89 (\n id number,\n \"#\" number,\n \"name\\n(birth-death)\" text,\n \"took office\" text,\n \"left office\" text,\n \"monarch\" text,\n \"prime minister\" text\n) ### Response: SELECT \"name\\n(birth-death)\" FROM table_203_89 ORDER BY \"left office\" - \"took office\" LIMIT 1"} {"instruction":"How many documents for each document type description? Visualize by a pie chart.","input":"CREATE TABLE Statements (\n Statement_ID INTEGER,\n Statement_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents (\n Document_ID INTEGER,\n Document_Type_Code CHAR(15),\n Project_ID INTEGER,\n Document_Date DATETIME,\n Document_Name VARCHAR(255),\n Document_Description VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents_with_Expenses (\n Document_ID INTEGER,\n Budget_Type_Code CHAR(15),\n Document_Details VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n Project_ID INTEGER,\n Project_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Accounts (\n Account_ID INTEGER,\n Statement_ID INTEGER,\n Account_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Budget_Codes (\n Budget_Type_Code CHAR(15),\n Budget_Type_Description VARCHAR(255)\n)","response":"SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many documents for each document type description? Visualize by a pie chart. ### Input: CREATE TABLE Statements (\n Statement_ID INTEGER,\n Statement_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents (\n Document_ID INTEGER,\n Document_Type_Code CHAR(15),\n Project_ID INTEGER,\n Document_Date DATETIME,\n Document_Name VARCHAR(255),\n Document_Description VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents_with_Expenses (\n Document_ID INTEGER,\n Budget_Type_Code CHAR(15),\n Document_Details VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n Project_ID INTEGER,\n Project_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Accounts (\n Account_ID INTEGER,\n Statement_ID INTEGER,\n Account_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Budget_Codes (\n Budget_Type_Code CHAR(15),\n Budget_Type_Description VARCHAR(255)\n) ### Response: SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description"} {"instruction":"What was the nationality of five-eighth player Darren Lockyer?","input":"CREATE TABLE table_4886 (\n \"Year\" text,\n \"Player\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Club\" text\n)","response":"SELECT \"Nationality\" FROM table_4886 WHERE \"Player\" = 'darren lockyer' AND \"Position\" = 'five-eighth'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the nationality of five-eighth player Darren Lockyer? ### Input: CREATE TABLE table_4886 (\n \"Year\" text,\n \"Player\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Club\" text\n) ### Response: SELECT \"Nationality\" FROM table_4886 WHERE \"Player\" = 'darren lockyer' AND \"Position\" = 'five-eighth'"} {"instruction":"full PostHistory for a post.","input":"CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)","response":"SELECT ph.*, pht.Name FROM PostHistory AS ph LEFT JOIN PostHistoryTypes AS pht ON ph.PostHistoryTypeId = pht.Id WHERE PostId = '##post:int##' ORDER BY ph.Id","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: full PostHistory for a post. ### Input: CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n) ### Response: SELECT ph.*, pht.Name FROM PostHistory AS ph LEFT JOIN PostHistoryTypes AS pht ON ph.PostHistoryTypeId = pht.Id WHERE PostId = '##post:int##' ORDER BY ph.Id"} {"instruction":"Which location has a method of decision and Nikos Tsoukalas for an opponent?","input":"CREATE TABLE table_61731 (\n \"Result\" text,\n \"Record\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Location\" text\n)","response":"SELECT \"Location\" FROM table_61731 WHERE \"Method\" = 'decision' AND \"Opponent\" = 'nikos tsoukalas'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which location has a method of decision and Nikos Tsoukalas for an opponent? ### Input: CREATE TABLE table_61731 (\n \"Result\" text,\n \"Record\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Location\" text\n) ### Response: SELECT \"Location\" FROM table_61731 WHERE \"Method\" = 'decision' AND \"Opponent\" = 'nikos tsoukalas'"} {"instruction":"A bar chart about what is average age for different job title?, and rank y axis in ascending order.","input":"CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n)","response":"SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what is average age for different job title?, and rank y axis in ascending order. ### Input: CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n) ### Response: SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age)"} {"instruction":"count the number of patients whose language is engl and diagnoses long title is unspecified protein-calorie malnutrition?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = \"ENGL\" AND diagnoses.long_title = \"Unspecified protein-calorie malnutrition\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose language is engl and diagnoses long title is unspecified protein-calorie malnutrition? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = \"ENGL\" AND diagnoses.long_title = \"Unspecified protein-calorie malnutrition\""} {"instruction":"How many parties received 29.9% of the vote in Manhattan?","input":"CREATE TABLE table_1108394_47 (\n party VARCHAR,\n manhattan VARCHAR\n)","response":"SELECT COUNT(party) FROM table_1108394_47 WHERE manhattan = \"29.9_percentage\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many parties received 29.9% of the vote in Manhattan? ### Input: CREATE TABLE table_1108394_47 (\n party VARCHAR,\n manhattan VARCHAR\n) ### Response: SELECT COUNT(party) FROM table_1108394_47 WHERE manhattan = \"29.9_percentage\""} {"instruction":"Information Extraction publications","input":"CREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)","response":"SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Information Extraction' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Information Extraction publications ### Input: CREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n) ### Response: SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Information Extraction' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid"} {"instruction":"What is 1987, when 1986 is '1R'?","input":"CREATE TABLE table_43502 (\n \"Tournament\" text,\n \"1978\" text,\n \"1979\" text,\n \"1980\" text,\n \"1982\" text,\n \"1983\" text,\n \"1984\" text,\n \"1985\" text,\n \"1986\" text,\n \"1987\" text,\n \"1988\" text,\n \"1989\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"Career SR\" text\n)","response":"SELECT \"1987\" FROM table_43502 WHERE \"1986\" = '1r'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is 1987, when 1986 is '1R'? ### Input: CREATE TABLE table_43502 (\n \"Tournament\" text,\n \"1978\" text,\n \"1979\" text,\n \"1980\" text,\n \"1982\" text,\n \"1983\" text,\n \"1984\" text,\n \"1985\" text,\n \"1986\" text,\n \"1987\" text,\n \"1988\" text,\n \"1989\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"Career SR\" text\n) ### Response: SELECT \"1987\" FROM table_43502 WHERE \"1986\" = '1r'"} {"instruction":"What Event's Time is 4:01.00?","input":"CREATE TABLE table_67971 (\n \"Event\" text,\n \"Time\" text,\n \"Nationality\" text,\n \"Date\" text,\n \"Meet\" text,\n \"Location\" text\n)","response":"SELECT \"Event\" FROM table_67971 WHERE \"Time\" = '4:01.00'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Event's Time is 4:01.00? ### Input: CREATE TABLE table_67971 (\n \"Event\" text,\n \"Time\" text,\n \"Nationality\" text,\n \"Date\" text,\n \"Meet\" text,\n \"Location\" text\n) ### Response: SELECT \"Event\" FROM table_67971 WHERE \"Time\" = '4:01.00'"} {"instruction":"Which venue held a basketball team?","input":"CREATE TABLE table_name_98 (\n venue VARCHAR,\n sport VARCHAR\n)","response":"SELECT venue FROM table_name_98 WHERE sport = \"basketball\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue held a basketball team? ### Input: CREATE TABLE table_name_98 (\n venue VARCHAR,\n sport VARCHAR\n) ### Response: SELECT venue FROM table_name_98 WHERE sport = \"basketball\""} {"instruction":"Find the number of users in each role. Plot them as bar chart.","input":"CREATE TABLE Roles (\n role_code VARCHAR(15),\n role_description VARCHAR(80)\n)\n\nCREATE TABLE Document_Sections (\n section_id INTEGER,\n document_code VARCHAR(15),\n section_sequence INTEGER,\n section_code VARCHAR(20),\n section_title VARCHAR(80)\n)\n\nCREATE TABLE Document_Sections_Images (\n section_id INTEGER,\n image_id INTEGER\n)\n\nCREATE TABLE Documents (\n document_code VARCHAR(15),\n document_structure_code VARCHAR(15),\n document_type_code VARCHAR(15),\n access_count INTEGER,\n document_name VARCHAR(80)\n)\n\nCREATE TABLE Functional_Areas (\n functional_area_code VARCHAR(15),\n parent_functional_area_code VARCHAR(15),\n functional_area_description VARCHAR(80)\n)\n\nCREATE TABLE Document_Functional_Areas (\n document_code VARCHAR(15),\n functional_area_code VARCHAR(15)\n)\n\nCREATE TABLE Images (\n image_id INTEGER,\n image_alt_text VARCHAR(80),\n image_name VARCHAR(40),\n image_url VARCHAR(255)\n)\n\nCREATE TABLE Users (\n user_id INTEGER,\n role_code VARCHAR(15),\n user_name VARCHAR(40),\n user_login VARCHAR(40),\n password VARCHAR(40)\n)\n\nCREATE TABLE Document_Structures (\n document_structure_code VARCHAR(15),\n parent_document_structure_code VARCHAR(15),\n document_structure_description VARCHAR(80)\n)","response":"SELECT role_code, COUNT(*) FROM Users GROUP BY role_code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of users in each role. Plot them as bar chart. ### Input: CREATE TABLE Roles (\n role_code VARCHAR(15),\n role_description VARCHAR(80)\n)\n\nCREATE TABLE Document_Sections (\n section_id INTEGER,\n document_code VARCHAR(15),\n section_sequence INTEGER,\n section_code VARCHAR(20),\n section_title VARCHAR(80)\n)\n\nCREATE TABLE Document_Sections_Images (\n section_id INTEGER,\n image_id INTEGER\n)\n\nCREATE TABLE Documents (\n document_code VARCHAR(15),\n document_structure_code VARCHAR(15),\n document_type_code VARCHAR(15),\n access_count INTEGER,\n document_name VARCHAR(80)\n)\n\nCREATE TABLE Functional_Areas (\n functional_area_code VARCHAR(15),\n parent_functional_area_code VARCHAR(15),\n functional_area_description VARCHAR(80)\n)\n\nCREATE TABLE Document_Functional_Areas (\n document_code VARCHAR(15),\n functional_area_code VARCHAR(15)\n)\n\nCREATE TABLE Images (\n image_id INTEGER,\n image_alt_text VARCHAR(80),\n image_name VARCHAR(40),\n image_url VARCHAR(255)\n)\n\nCREATE TABLE Users (\n user_id INTEGER,\n role_code VARCHAR(15),\n user_name VARCHAR(40),\n user_login VARCHAR(40),\n password VARCHAR(40)\n)\n\nCREATE TABLE Document_Structures (\n document_structure_code VARCHAR(15),\n parent_document_structure_code VARCHAR(15),\n document_structure_description VARCHAR(80)\n) ### Response: SELECT role_code, COUNT(*) FROM Users GROUP BY role_code"} {"instruction":"What country is the Jiufotang Formation located in?","input":"CREATE TABLE table_name_59 (\n location VARCHAR,\n unit VARCHAR\n)","response":"SELECT location FROM table_name_59 WHERE unit = \"jiufotang formation\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What country is the Jiufotang Formation located in? ### Input: CREATE TABLE table_name_59 (\n location VARCHAR,\n unit VARCHAR\n) ### Response: SELECT location FROM table_name_59 WHERE unit = \"jiufotang formation\""} {"instruction":"id-requests to be deleted (q.score<4 and not a single answer scored >=3).","input":"CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)","response":"SELECT CONCAT('http:\/\/anime.stackexchange.com\/questions\/', p.Id) FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND t.TagName = 'identification-request' AND p.DeletionDate IS NULL AND p.Score < 4 AND NOT EXISTS(SELECT 1 FROM Posts AS a WHERE a.ParentId = p.Id AND a.DeletionDate IS NULL AND a.Score >= 3)","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: id-requests to be deleted (q.score<4 and not a single answer scored >=3). ### Input: CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n) ### Response: SELECT CONCAT('http:\/\/anime.stackexchange.com\/questions\/', p.Id) FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND t.TagName = 'identification-request' AND p.DeletionDate IS NULL AND p.Score < 4 AND NOT EXISTS(SELECT 1 FROM Posts AS a WHERE a.ParentId = p.Id AND a.DeletionDate IS NULL AND a.Score >= 3)"} {"instruction":"What is the sum of Grid, when Time is '+16.687'?","input":"CREATE TABLE table_59553 (\n \"Rider\" text,\n \"Bike\" text,\n \"Laps\" real,\n \"Time\" text,\n \"Grid\" real\n)","response":"SELECT SUM(\"Grid\") FROM table_59553 WHERE \"Time\" = '+16.687'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Grid, when Time is '+16.687'? ### Input: CREATE TABLE table_59553 (\n \"Rider\" text,\n \"Bike\" text,\n \"Laps\" real,\n \"Time\" text,\n \"Grid\" real\n) ### Response: SELECT SUM(\"Grid\") FROM table_59553 WHERE \"Time\" = '+16.687'"} {"instruction":"What is the highest number of bronze medals of west germany, which has more than 0 golds?","input":"CREATE TABLE table_66006 (\n \"Rank\" text,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT MAX(\"Bronze\") FROM table_66006 WHERE \"Nation\" = 'west germany' AND \"Gold\" > '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest number of bronze medals of west germany, which has more than 0 golds? ### Input: CREATE TABLE table_66006 (\n \"Rank\" text,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT MAX(\"Bronze\") FROM table_66006 WHERE \"Nation\" = 'west germany' AND \"Gold\" > '0'"} {"instruction":"why years have no liberal councillors serving ?","input":"CREATE TABLE table_204_349 (\n id number,\n \"year\" number,\n \"conservative\\ncouncillors\" number,\n \"labour\\ncouncillors\" number,\n \"independent\\ncouncillors\" number,\n \"liberal\\ncouncillors\" number\n)","response":"SELECT \"year\" FROM table_204_349 WHERE \"liberal\\ncouncillors\" = 0","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: why years have no liberal councillors serving ? ### Input: CREATE TABLE table_204_349 (\n id number,\n \"year\" number,\n \"conservative\\ncouncillors\" number,\n \"labour\\ncouncillors\" number,\n \"independent\\ncouncillors\" number,\n \"liberal\\ncouncillors\" number\n) ### Response: SELECT \"year\" FROM table_204_349 WHERE \"liberal\\ncouncillors\" = 0"} {"instruction":"Which club has a League of american basketball association, and a Venue of tba?","input":"CREATE TABLE table_67629 (\n \"Club\" text,\n \"Sport\" text,\n \"League\" text,\n \"Venue\" text,\n \"Championships (Years)\" text\n)","response":"SELECT \"Club\" FROM table_67629 WHERE \"League\" = 'american basketball association' AND \"Venue\" = 'tba'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which club has a League of american basketball association, and a Venue of tba? ### Input: CREATE TABLE table_67629 (\n \"Club\" text,\n \"Sport\" text,\n \"League\" text,\n \"Venue\" text,\n \"Championships (Years)\" text\n) ### Response: SELECT \"Club\" FROM table_67629 WHERE \"League\" = 'american basketball association' AND \"Venue\" = 'tba'"} {"instruction":"What year was incumbent jim mcdermott first elected?","input":"CREATE TABLE table_72369 (\n \"District\" text,\n \"Incumbent\" text,\n \"Party\" text,\n \"First elected\" real,\n \"Status\" text,\n \"Opponent\" text\n)","response":"SELECT MIN(\"First elected\") FROM table_72369 WHERE \"Incumbent\" = 'Jim McDermott'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was incumbent jim mcdermott first elected? ### Input: CREATE TABLE table_72369 (\n \"District\" text,\n \"Incumbent\" text,\n \"Party\" text,\n \"First elected\" real,\n \"Status\" text,\n \"Opponent\" text\n) ### Response: SELECT MIN(\"First elected\") FROM table_72369 WHERE \"Incumbent\" = 'Jim McDermott'"} {"instruction":"in the ft pct .667 what is the number of gp-gs","input":"CREATE TABLE table_23817012_6 (\n gp_gs VARCHAR,\n ft_pct VARCHAR\n)","response":"SELECT COUNT(gp_gs) FROM table_23817012_6 WHERE ft_pct = \".667\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in the ft pct .667 what is the number of gp-gs ### Input: CREATE TABLE table_23817012_6 (\n gp_gs VARCHAR,\n ft_pct VARCHAR\n) ### Response: SELECT COUNT(gp_gs) FROM table_23817012_6 WHERE ft_pct = \".667\""} {"instruction":"In what Weeks is the game against the Tampa Bay Buccaneers with less than 44,506 in Attendance?","input":"CREATE TABLE table_47699 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n)","response":"SELECT SUM(\"Week\") FROM table_47699 WHERE \"Opponent\" = 'tampa bay buccaneers' AND \"Attendance\" < '44,506'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what Weeks is the game against the Tampa Bay Buccaneers with less than 44,506 in Attendance? ### Input: CREATE TABLE table_47699 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n) ### Response: SELECT SUM(\"Week\") FROM table_47699 WHERE \"Opponent\" = 'tampa bay buccaneers' AND \"Attendance\" < '44,506'"} {"instruction":"Show each gender code and the corresponding count of guests sorted by the count in descending order by a pie chart.","input":"CREATE TABLE Apartments (\n apt_id INTEGER,\n building_id INTEGER,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5)\n)\n\nCREATE TABLE Guests (\n guest_id INTEGER,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME\n)\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER,\n facility_code CHAR(15)\n)\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER,\n apt_id INTEGER,\n guest_id INTEGER,\n booking_status_code CHAR(15),\n booking_start_date DATETIME,\n booking_end_date DATETIME\n)\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME,\n available_yn BIT\n)\n\nCREATE TABLE Apartment_Buildings (\n building_id INTEGER,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80)\n)","response":"SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show each gender code and the corresponding count of guests sorted by the count in descending order by a pie chart. ### Input: CREATE TABLE Apartments (\n apt_id INTEGER,\n building_id INTEGER,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5)\n)\n\nCREATE TABLE Guests (\n guest_id INTEGER,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME\n)\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER,\n facility_code CHAR(15)\n)\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER,\n apt_id INTEGER,\n guest_id INTEGER,\n booking_status_code CHAR(15),\n booking_start_date DATETIME,\n booking_end_date DATETIME\n)\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME,\n available_yn BIT\n)\n\nCREATE TABLE Apartment_Buildings (\n building_id INTEGER,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80)\n) ### Response: SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC"} {"instruction":"How many laps did Ricardo Zonta drive with a grid less than 14?","input":"CREATE TABLE table_name_15 (\n laps INTEGER,\n grid VARCHAR,\n driver VARCHAR\n)","response":"SELECT SUM(laps) FROM table_name_15 WHERE grid < 14 AND driver = \"ricardo zonta\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many laps did Ricardo Zonta drive with a grid less than 14? ### Input: CREATE TABLE table_name_15 (\n laps INTEGER,\n grid VARCHAR,\n driver VARCHAR\n) ### Response: SELECT SUM(laps) FROM table_name_15 WHERE grid < 14 AND driver = \"ricardo zonta\""} {"instruction":"What's the average L\/km combines when the L\/100km Urban is 13.9, the mpg-UK combined is more than 28.5 and the mpg-UK extra urban is less than 38.7?","input":"CREATE TABLE table_66547 (\n \"Manufacturer\" text,\n \"Transmission\" text,\n \"Engine Capacity\" real,\n \"Fuel Type\" text,\n \"L\/100km Urban (Cold)\" real,\n \"L\/100km Extra-Urban\" real,\n \"L\/100km Combined\" real,\n \"mpg-UK Urban (Cold)\" real,\n \"mpg-UK Extra-Urban\" real,\n \"mpg-UK Combined\" real,\n \"mpg-US Urban\" real,\n \"mpg-US Extra-Urban\" real,\n \"mpg-US Combined\" real,\n \"CO 2 g\/km\" real,\n \"Green Rating\" text\n)","response":"SELECT AVG(\"L\/100km Combined\") FROM table_66547 WHERE \"L\/100km Urban (Cold)\" = '13.9' AND \"mpg-UK Combined\" > '28.5' AND \"mpg-UK Extra-Urban\" < '38.7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the average L\/km combines when the L\/100km Urban is 13.9, the mpg-UK combined is more than 28.5 and the mpg-UK extra urban is less than 38.7? ### Input: CREATE TABLE table_66547 (\n \"Manufacturer\" text,\n \"Transmission\" text,\n \"Engine Capacity\" real,\n \"Fuel Type\" text,\n \"L\/100km Urban (Cold)\" real,\n \"L\/100km Extra-Urban\" real,\n \"L\/100km Combined\" real,\n \"mpg-UK Urban (Cold)\" real,\n \"mpg-UK Extra-Urban\" real,\n \"mpg-UK Combined\" real,\n \"mpg-US Urban\" real,\n \"mpg-US Extra-Urban\" real,\n \"mpg-US Combined\" real,\n \"CO 2 g\/km\" real,\n \"Green Rating\" text\n) ### Response: SELECT AVG(\"L\/100km Combined\") FROM table_66547 WHERE \"L\/100km Urban (Cold)\" = '13.9' AND \"mpg-UK Combined\" > '28.5' AND \"mpg-UK Extra-Urban\" < '38.7'"} {"instruction":"provide the number of patients whose marital status is widowed and procedure long title is percutaneous (endoscopic) jejunostomy [pej]?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"WIDOWED\" AND procedures.long_title = \"Percutaneous (endoscopic) jejunostomy [PEJ]\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose marital status is widowed and procedure long title is percutaneous (endoscopic) jejunostomy [pej]? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"WIDOWED\" AND procedures.long_title = \"Percutaneous (endoscopic) jejunostomy [PEJ]\""} {"instruction":"How tall is Maksim Botin?","input":"CREATE TABLE table_14038363_1 (\n height VARCHAR,\n player VARCHAR\n)","response":"SELECT height FROM table_14038363_1 WHERE player = \"Maksim Botin\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How tall is Maksim Botin? ### Input: CREATE TABLE table_14038363_1 (\n height VARCHAR,\n player VARCHAR\n) ### Response: SELECT height FROM table_14038363_1 WHERE player = \"Maksim Botin\""} {"instruction":"how many patients are diagnosed with polyneuropathy in diabetes and treated with base drug?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = \"Polyneuropathy in diabetes\" AND prescriptions.drug_type = \"BASE\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are diagnosed with polyneuropathy in diabetes and treated with base drug? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = \"Polyneuropathy in diabetes\" AND prescriptions.drug_type = \"BASE\""} {"instruction":"What shows for shoots for craig peacock a?","input":"CREATE TABLE table_name_62 (\n shoots VARCHAR,\n player VARCHAR\n)","response":"SELECT shoots FROM table_name_62 WHERE player = \"craig peacock a\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shows for shoots for craig peacock a? ### Input: CREATE TABLE table_name_62 (\n shoots VARCHAR,\n player VARCHAR\n) ### Response: SELECT shoots FROM table_name_62 WHERE player = \"craig peacock a\""} {"instruction":"What was the date of game with a score of 42-6?","input":"CREATE TABLE table_32178 (\n \"Date\" text,\n \"Result\" text,\n \"Score\" text,\n \"Stadium\" text,\n \"City\" text,\n \"Crowd\" real\n)","response":"SELECT \"Date\" FROM table_32178 WHERE \"Score\" = '42-6'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of game with a score of 42-6? ### Input: CREATE TABLE table_32178 (\n \"Date\" text,\n \"Result\" text,\n \"Score\" text,\n \"Stadium\" text,\n \"City\" text,\n \"Crowd\" real\n) ### Response: SELECT \"Date\" FROM table_32178 WHERE \"Score\" = '42-6'"} {"instruction":"What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson?","input":"CREATE TABLE table_name_62 (\n social_sec_leeds VARCHAR,\n media_officer VARCHAR,\n treasurer VARCHAR\n)","response":"SELECT social_sec_leeds FROM table_name_62 WHERE media_officer = \"jason james\" AND treasurer = \"james davidson\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson? ### Input: CREATE TABLE table_name_62 (\n social_sec_leeds VARCHAR,\n media_officer VARCHAR,\n treasurer VARCHAR\n) ### Response: SELECT social_sec_leeds FROM table_name_62 WHERE media_officer = \"jason james\" AND treasurer = \"james davidson\""} {"instruction":"What are the dates that Falling Angel aired?","input":"CREATE TABLE table_28803803_1 (\n date VARCHAR,\n name VARCHAR\n)","response":"SELECT date FROM table_28803803_1 WHERE name = \"Falling Angel\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the dates that Falling Angel aired? ### Input: CREATE TABLE table_28803803_1 (\n date VARCHAR,\n name VARCHAR\n) ### Response: SELECT date FROM table_28803803_1 WHERE name = \"Falling Angel\""} {"instruction":"give me the number of patients whose year of birth is less than 2182 and procedure short title is coronar arteriogr-1 cath?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < \"2182\" AND procedures.short_title = \"Coronar arteriogr-1 cath\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose year of birth is less than 2182 and procedure short title is coronar arteriogr-1 cath? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < \"2182\" AND procedures.short_title = \"Coronar arteriogr-1 cath\""} {"instruction":"How many completion students in each day? Return a line chart grouping by date of completion, and order by the X-axis in descending please.","input":"CREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)","response":"SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many completion students in each day? Return a line chart grouping by date of completion, and order by the X-axis in descending please. ### Input: CREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n) ### Response: SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion DESC"} {"instruction":"What is the effective date of the claim that has the largest amount of total settlement?","input":"CREATE TABLE claims (\n Effective_Date VARCHAR,\n claim_id VARCHAR\n)\n\nCREATE TABLE settlements (\n claim_id VARCHAR,\n settlement_amount INTEGER\n)","response":"SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the effective date of the claim that has the largest amount of total settlement? ### Input: CREATE TABLE claims (\n Effective_Date VARCHAR,\n claim_id VARCHAR\n)\n\nCREATE TABLE settlements (\n claim_id VARCHAR,\n settlement_amount INTEGER\n) ### Response: SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1"} {"instruction":"retrieve the patient ids who are diagnosed with nonrupt cerebral aneurym since 2105.","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)","response":"SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nonrupt cerebral aneurym') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: retrieve the patient ids who are diagnosed with nonrupt cerebral aneurym since 2105. ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n) ### Response: SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nonrupt cerebral aneurym') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105')"} {"instruction":"Which inhabitants have 2009 as the election, with cremona as the municipality?","input":"CREATE TABLE table_13089 (\n \"Municipality\" text,\n \"Inhabitants\" real,\n \"Mayor\" text,\n \"Party\" text,\n \"Election\" real\n)","response":"SELECT \"Inhabitants\" FROM table_13089 WHERE \"Election\" = '2009' AND \"Municipality\" = 'cremona'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which inhabitants have 2009 as the election, with cremona as the municipality? ### Input: CREATE TABLE table_13089 (\n \"Municipality\" text,\n \"Inhabitants\" real,\n \"Mayor\" text,\n \"Party\" text,\n \"Election\" real\n) ### Response: SELECT \"Inhabitants\" FROM table_13089 WHERE \"Election\" = '2009' AND \"Municipality\" = 'cremona'"} {"instruction":"Can you identify the GSIs from last semester for DENTED 605 ?","input":"CREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)","response":"SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'DENTED' AND course.number = 605 AND semester.semester = 'FA' AND semester.year = 2015","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you identify the GSIs from last semester for DENTED 605 ? ### Input: CREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n) ### Response: SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'DENTED' AND course.number = 605 AND semester.semester = 'FA' AND semester.year = 2015"} {"instruction":"What round did Matt Clark play?","input":"CREATE TABLE table_name_94 (\n round VARCHAR,\n player VARCHAR\n)","response":"SELECT round FROM table_name_94 WHERE player = \"matt clark\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What round did Matt Clark play? ### Input: CREATE TABLE table_name_94 (\n round VARCHAR,\n player VARCHAR\n) ### Response: SELECT round FROM table_name_94 WHERE player = \"matt clark\""} {"instruction":"Is MATH 185 available as a Summer class in 2004 ?","input":"CREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)","response":"SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MATH' AND course.number = 185 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2004","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Is MATH 185 available as a Summer class in 2004 ? ### Input: CREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n) ### Response: SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MATH' AND course.number = 185 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2004"} {"instruction":"Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart, display by the Y-axis from high to low.","input":"CREATE TABLE Apartment_Facilities (\n apt_id INTEGER,\n facility_code CHAR(15)\n)\n\nCREATE TABLE Apartments (\n apt_id INTEGER,\n building_id INTEGER,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5)\n)\n\nCREATE TABLE Guests (\n guest_id INTEGER,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME\n)\n\nCREATE TABLE Apartment_Buildings (\n building_id INTEGER,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80)\n)\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER,\n apt_id INTEGER,\n guest_id INTEGER,\n booking_status_code CHAR(15),\n booking_start_date DATETIME,\n booking_end_date DATETIME\n)\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME,\n available_yn BIT\n)","response":"SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart, display by the Y-axis from high to low. ### Input: CREATE TABLE Apartment_Facilities (\n apt_id INTEGER,\n facility_code CHAR(15)\n)\n\nCREATE TABLE Apartments (\n apt_id INTEGER,\n building_id INTEGER,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5)\n)\n\nCREATE TABLE Guests (\n guest_id INTEGER,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME\n)\n\nCREATE TABLE Apartment_Buildings (\n building_id INTEGER,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80)\n)\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER,\n apt_id INTEGER,\n guest_id INTEGER,\n booking_status_code CHAR(15),\n booking_start_date DATETIME,\n booking_end_date DATETIME\n)\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME,\n available_yn BIT\n) ### Response: SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC"} {"instruction":"Which numerical entry corresponds to 'Episode 9'?","input":"CREATE TABLE table_19808 (\n \"#\" real,\n \"Episode\" text,\n \"Writer\" text,\n \"Director\" text,\n \"Original air date\" text,\n \"Viewing figure\" text\n)","response":"SELECT COUNT(\"#\") FROM table_19808 WHERE \"Episode\" = 'Episode 9'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which numerical entry corresponds to 'Episode 9'? ### Input: CREATE TABLE table_19808 (\n \"#\" real,\n \"Episode\" text,\n \"Writer\" text,\n \"Director\" text,\n \"Original air date\" text,\n \"Viewing figure\" text\n) ### Response: SELECT COUNT(\"#\") FROM table_19808 WHERE \"Episode\" = 'Episode 9'"} {"instruction":"Show the minister who took office after 1961 or before 1959.","input":"CREATE TABLE party_events (\n event_id number,\n event_name text,\n party_id number,\n member_in_charge_id number\n)\n\nCREATE TABLE party (\n party_id number,\n minister text,\n took_office text,\n left_office text,\n region_id number,\n party_name text\n)\n\nCREATE TABLE region (\n region_id number,\n region_name text,\n date text,\n label text,\n format text,\n catalogue text\n)\n\nCREATE TABLE member (\n member_id number,\n member_name text,\n party_id text,\n in_office text\n)","response":"SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the minister who took office after 1961 or before 1959. ### Input: CREATE TABLE party_events (\n event_id number,\n event_name text,\n party_id number,\n member_in_charge_id number\n)\n\nCREATE TABLE party (\n party_id number,\n minister text,\n took_office text,\n left_office text,\n region_id number,\n party_name text\n)\n\nCREATE TABLE region (\n region_id number,\n region_name text,\n date text,\n label text,\n format text,\n catalogue text\n)\n\nCREATE TABLE member (\n member_id number,\n member_name text,\n party_id text,\n in_office text\n) ### Response: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959"} {"instruction":"how many teams did the comets win 2 matches against ?","input":"CREATE TABLE table_204_334 (\n id number,\n \"opposition\" text,\n \"matches\" number,\n \"won\" number,\n \"drawn\" number,\n \"lost\" number,\n \"for\" number,\n \"against\" number,\n \"win%\" text\n)","response":"SELECT COUNT(\"opposition\") FROM table_204_334 WHERE \"won\" = 2","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many teams did the comets win 2 matches against ? ### Input: CREATE TABLE table_204_334 (\n id number,\n \"opposition\" text,\n \"matches\" number,\n \"won\" number,\n \"drawn\" number,\n \"lost\" number,\n \"for\" number,\n \"against\" number,\n \"win%\" text\n) ### Response: SELECT COUNT(\"opposition\") FROM table_204_334 WHERE \"won\" = 2"} {"instruction":"In what City\/State did the ATCC Round 4 series take place?","input":"CREATE TABLE table_name_62 (\n city___state VARCHAR,\n series VARCHAR\n)","response":"SELECT city___state FROM table_name_62 WHERE series = \"atcc round 4\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what City\/State did the ATCC Round 4 series take place? ### Input: CREATE TABLE table_name_62 (\n city___state VARCHAR,\n series VARCHAR\n) ### Response: SELECT city___state FROM table_name_62 WHERE series = \"atcc round 4\""} {"instruction":"Show the product name and total order quantity for each product. Show bar chart.","input":"CREATE TABLE Customer_Address_History (\n customer_id INTEGER,\n address_id INTEGER,\n date_from DATETIME,\n date_to DATETIME\n)\n\nCREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n order_quantity VARCHAR(80)\n)\n\nCREATE TABLE Contacts (\n contact_id INTEGER,\n customer_id INTEGER,\n gender VARCHAR(1),\n first_name VARCHAR(80),\n last_name VARCHAR(50),\n contact_phone VARCHAR(80)\n)\n\nCREATE TABLE Addresses (\n address_id INTEGER,\n line_1_number_building VARCHAR(80),\n city VARCHAR(50),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n payment_method_code VARCHAR(15),\n customer_number VARCHAR(20),\n customer_name VARCHAR(80),\n customer_address VARCHAR(255),\n customer_phone VARCHAR(80),\n customer_email VARCHAR(80)\n)\n\nCREATE TABLE Customer_Orders (\n order_id INTEGER,\n customer_id INTEGER,\n order_date DATETIME,\n order_status_code VARCHAR(15)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n product_type_code VARCHAR(15),\n product_name VARCHAR(80),\n product_price DOUBLE\n)","response":"SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the product name and total order quantity for each product. Show bar chart. ### Input: CREATE TABLE Customer_Address_History (\n customer_id INTEGER,\n address_id INTEGER,\n date_from DATETIME,\n date_to DATETIME\n)\n\nCREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n order_quantity VARCHAR(80)\n)\n\nCREATE TABLE Contacts (\n contact_id INTEGER,\n customer_id INTEGER,\n gender VARCHAR(1),\n first_name VARCHAR(80),\n last_name VARCHAR(50),\n contact_phone VARCHAR(80)\n)\n\nCREATE TABLE Addresses (\n address_id INTEGER,\n line_1_number_building VARCHAR(80),\n city VARCHAR(50),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n payment_method_code VARCHAR(15),\n customer_number VARCHAR(20),\n customer_name VARCHAR(80),\n customer_address VARCHAR(255),\n customer_phone VARCHAR(80),\n customer_email VARCHAR(80)\n)\n\nCREATE TABLE Customer_Orders (\n order_id INTEGER,\n customer_id INTEGER,\n order_date DATETIME,\n order_status_code VARCHAR(15)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n product_type_code VARCHAR(15),\n product_name VARCHAR(80),\n product_price DOUBLE\n) ### Response: SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name"} {"instruction":"How much Played has a Position of 7, and a Drawn smaller than 7?","input":"CREATE TABLE table_60828 (\n \"Position\" real,\n \"Team\" text,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Goals For\" real,\n \"Goals Against\" real,\n \"Goal Difference\" text,\n \"Points 1\" real\n)","response":"SELECT SUM(\"Played\") FROM table_60828 WHERE \"Position\" = '7' AND \"Drawn\" < '7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Played has a Position of 7, and a Drawn smaller than 7? ### Input: CREATE TABLE table_60828 (\n \"Position\" real,\n \"Team\" text,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Goals For\" real,\n \"Goals Against\" real,\n \"Goal Difference\" text,\n \"Points 1\" real\n) ### Response: SELECT SUM(\"Played\") FROM table_60828 WHERE \"Position\" = '7' AND \"Drawn\" < '7'"} {"instruction":"what are the ways to consume guaifenesin?","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)","response":"SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the ways to consume guaifenesin? ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n) ### Response: SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin'"} {"instruction":"Which Gran Hamada has a Block A of tatsuhito takaiwa?","input":"CREATE TABLE table_name_67 (\n gran_hamada VARCHAR,\n block_a VARCHAR\n)","response":"SELECT gran_hamada FROM table_name_67 WHERE block_a = \"tatsuhito takaiwa\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Gran Hamada has a Block A of tatsuhito takaiwa? ### Input: CREATE TABLE table_name_67 (\n gran_hamada VARCHAR,\n block_a VARCHAR\n) ### Response: SELECT gran_hamada FROM table_name_67 WHERE block_a = \"tatsuhito takaiwa\""} {"instruction":"return me the number of papers in VLDB conference in ' University of Michigan ' .","input":"CREATE TABLE domain_conference (\n cid int,\n did int\n)\n\nCREATE TABLE cite (\n cited int,\n citing int\n)\n\nCREATE TABLE domain_keyword (\n did int,\n kid int\n)\n\nCREATE TABLE domain_publication (\n did int,\n pid int\n)\n\nCREATE TABLE domain_author (\n aid int,\n did int\n)\n\nCREATE TABLE domain (\n did int,\n name varchar\n)\n\nCREATE TABLE author (\n aid int,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE organization (\n continent varchar,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE domain_journal (\n did int,\n jid int\n)\n\nCREATE TABLE publication (\n abstract varchar,\n cid int,\n citation_num int,\n jid int,\n pid int,\n reference_num int,\n title varchar,\n year int\n)\n\nCREATE TABLE writes (\n aid int,\n pid int\n)\n\nCREATE TABLE conference (\n cid int,\n homepage varchar,\n name varchar\n)\n\nCREATE TABLE publication_keyword (\n kid int,\n pid int\n)\n\nCREATE TABLE journal (\n homepage varchar,\n jid int,\n name varchar\n)\n\nCREATE TABLE keyword (\n keyword varchar,\n kid int\n)","response":"SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid","source":"academic","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: return me the number of papers in VLDB conference in ' University of Michigan ' . ### Input: CREATE TABLE domain_conference (\n cid int,\n did int\n)\n\nCREATE TABLE cite (\n cited int,\n citing int\n)\n\nCREATE TABLE domain_keyword (\n did int,\n kid int\n)\n\nCREATE TABLE domain_publication (\n did int,\n pid int\n)\n\nCREATE TABLE domain_author (\n aid int,\n did int\n)\n\nCREATE TABLE domain (\n did int,\n name varchar\n)\n\nCREATE TABLE author (\n aid int,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE organization (\n continent varchar,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE domain_journal (\n did int,\n jid int\n)\n\nCREATE TABLE publication (\n abstract varchar,\n cid int,\n citation_num int,\n jid int,\n pid int,\n reference_num int,\n title varchar,\n year int\n)\n\nCREATE TABLE writes (\n aid int,\n pid int\n)\n\nCREATE TABLE conference (\n cid int,\n homepage varchar,\n name varchar\n)\n\nCREATE TABLE publication_keyword (\n kid int,\n pid int\n)\n\nCREATE TABLE journal (\n homepage varchar,\n jid int,\n name varchar\n)\n\nCREATE TABLE keyword (\n keyword varchar,\n kid int\n) ### Response: SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid"} {"instruction":"A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order?","input":"CREATE TABLE route (\n train_id int,\n station_id int\n)\n\nCREATE TABLE train (\n id int,\n train_number int,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n)\n\nCREATE TABLE weekly_weather (\n station_id int,\n day_of_week text,\n high_temperature int,\n low_temperature int,\n precipitation real,\n wind_speed_mph int\n)\n\nCREATE TABLE station (\n id int,\n network_name text,\n services text,\n local_authority text\n)","response":"SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order? ### Input: CREATE TABLE route (\n train_id int,\n station_id int\n)\n\nCREATE TABLE train (\n id int,\n train_number int,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n)\n\nCREATE TABLE weekly_weather (\n station_id int,\n day_of_week text,\n high_temperature int,\n low_temperature int,\n precipitation real,\n wind_speed_mph int\n)\n\nCREATE TABLE station (\n id int,\n network_name text,\n services text,\n local_authority text\n) ### Response: SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC"} {"instruction":"Where did the player who won in 1991 finish?","input":"CREATE TABLE table_61462 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n)","response":"SELECT \"Finish\" FROM table_61462 WHERE \"Year(s) won\" = '1991'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the player who won in 1991 finish? ### Input: CREATE TABLE table_61462 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n) ### Response: SELECT \"Finish\" FROM table_61462 WHERE \"Year(s) won\" = '1991'"} {"instruction":"How much does number 26 weigh?","input":"CREATE TABLE table_name_31 (\n weight VARCHAR,\n number VARCHAR\n)","response":"SELECT weight FROM table_name_31 WHERE number = \"26\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much does number 26 weigh? ### Input: CREATE TABLE table_name_31 (\n weight VARCHAR,\n number VARCHAR\n) ### Response: SELECT weight FROM table_name_31 WHERE number = \"26\""} {"instruction":"Which team has 10 losses?","input":"CREATE TABLE table_41853 (\n \"Team\" text,\n \"Match\" real,\n \"Points\" real,\n \"Draw\" real,\n \"Lost\" real\n)","response":"SELECT \"Team\" FROM table_41853 WHERE \"Lost\" = '10'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team has 10 losses? ### Input: CREATE TABLE table_41853 (\n \"Team\" text,\n \"Match\" real,\n \"Points\" real,\n \"Draw\" real,\n \"Lost\" real\n) ### Response: SELECT \"Team\" FROM table_41853 WHERE \"Lost\" = '10'"} {"instruction":"What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets?","input":"CREATE TABLE table_48303 (\n \"Rank\" real,\n \"Company\" text,\n \"Headquarters\" text,\n \"Industry\" text,\n \"Sales (billion $)\" real,\n \"Profits (billion $)\" real,\n \"Assets (billion $)\" real,\n \"Market Value (billion $)\" real\n)","response":"SELECT MAX(\"Market Value (billion $)\") FROM table_48303 WHERE \"Profits (billion $)\" = '20.96' AND \"Assets (billion $)\" > '166.99'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets? ### Input: CREATE TABLE table_48303 (\n \"Rank\" real,\n \"Company\" text,\n \"Headquarters\" text,\n \"Industry\" text,\n \"Sales (billion $)\" real,\n \"Profits (billion $)\" real,\n \"Assets (billion $)\" real,\n \"Market Value (billion $)\" real\n) ### Response: SELECT MAX(\"Market Value (billion $)\") FROM table_48303 WHERE \"Profits (billion $)\" = '20.96' AND \"Assets (billion $)\" > '166.99'"} {"instruction":"when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit.","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.systemicdiastolic IS NULL ORDER BY vitalperiodic.systemicdiastolic, vitalperiodic.observationtime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit. ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.systemicdiastolic IS NULL ORDER BY vitalperiodic.systemicdiastolic, vitalperiodic.observationtime DESC LIMIT 1"} {"instruction":"What is the LOA of Brindabella?","input":"CREATE TABLE table_25595209_1 (\n loa__metres_ VARCHAR,\n yacht VARCHAR\n)","response":"SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = \"Brindabella\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the LOA of Brindabella? ### Input: CREATE TABLE table_25595209_1 (\n loa__metres_ VARCHAR,\n yacht VARCHAR\n) ### Response: SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = \"Brindabella\""} {"instruction":"what are the top three most common specimen tests performed since 2 years ago?","input":"CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)","response":"SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top three most common specimen tests performed since 2 years ago? ### Input: CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n) ### Response: SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3"} {"instruction":"had patient 3273 excreted urine out ureteral stent #1 when they came to the hospital last time?","input":"CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out ureteral stent #1' AND d_items.linksto = 'outputevents')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 3273 excreted urine out ureteral stent #1 when they came to the hospital last time? ### Input: CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out ureteral stent #1' AND d_items.linksto = 'outputevents')"} {"instruction":"In what season was the conference record for the Pandas 15-1-1?","input":"CREATE TABLE table_29292 (\n \"Season\" text,\n \"Coach\" text,\n \"Conf. Record\" text,\n \"Overall\" text,\n \"Standings\" text,\n \"Postseason\" text\n)","response":"SELECT \"Season\" FROM table_29292 WHERE \"Conf. Record\" = '15-1-1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what season was the conference record for the Pandas 15-1-1? ### Input: CREATE TABLE table_29292 (\n \"Season\" text,\n \"Coach\" text,\n \"Conf. Record\" text,\n \"Overall\" text,\n \"Standings\" text,\n \"Postseason\" text\n) ### Response: SELECT \"Season\" FROM table_29292 WHERE \"Conf. Record\" = '15-1-1'"} {"instruction":"What district has abhayapuri south as the name?","input":"CREATE TABLE table_60842 (\n \"Constituency number\" real,\n \"Name\" text,\n \"Reserved for ( SC \/ ST \/None)\" text,\n \"District\" text,\n \"Electorates (2011)\" real\n)","response":"SELECT \"District\" FROM table_60842 WHERE \"Name\" = 'abhayapuri south'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What district has abhayapuri south as the name? ### Input: CREATE TABLE table_60842 (\n \"Constituency number\" real,\n \"Name\" text,\n \"Reserved for ( SC \/ ST \/None)\" text,\n \"District\" text,\n \"Electorates (2011)\" real\n) ### Response: SELECT \"District\" FROM table_60842 WHERE \"Name\" = 'abhayapuri south'"} {"instruction":"What was Tom Kite's to par?","input":"CREATE TABLE table_7771 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n)","response":"SELECT \"To par\" FROM table_7771 WHERE \"Player\" = 'tom kite'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Tom Kite's to par? ### Input: CREATE TABLE table_7771 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n) ### Response: SELECT \"To par\" FROM table_7771 WHERE \"Player\" = 'tom kite'"} {"instruction":"Which Rank is the Country of soviet union with a Total smaller than 19?","input":"CREATE TABLE table_name_94 (\n rank INTEGER,\n country VARCHAR,\n total VARCHAR\n)","response":"SELECT MIN(rank) FROM table_name_94 WHERE country = \"soviet union\" AND total < 19","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Rank is the Country of soviet union with a Total smaller than 19? ### Input: CREATE TABLE table_name_94 (\n rank INTEGER,\n country VARCHAR,\n total VARCHAR\n) ### Response: SELECT MIN(rank) FROM table_name_94 WHERE country = \"soviet union\" AND total < 19"} {"instruction":"How many people directed episode 3 in the season?","input":"CREATE TABLE table_25277262_2 (\n directed_by VARCHAR,\n no_in_season VARCHAR\n)","response":"SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people directed episode 3 in the season? ### Input: CREATE TABLE table_25277262_2 (\n directed_by VARCHAR,\n no_in_season VARCHAR\n) ### Response: SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3"} {"instruction":"baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 \/ l ) , neutropenia ( < 1500 \/ l ) , or thrombocytopenia ( platelets < 100000 \/ l ) .","input":"CREATE TABLE table_dev_20 (\n \"id\" int,\n \"anemia\" bool,\n \"gender\" string,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"platelets\" int,\n \"dyslipidemia\" bool,\n \"renal_disease\" bool,\n \"creatinine_clearance_cl\" float,\n \"neutropenia\" int,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"thrombocytopenia\" float,\n \"diastolic_blood_pressure_dbp\" int,\n \"lymphopenia\" int,\n \"ldl\" int,\n \"serum_creatinine\" float,\n \"kidney_disease\" bool,\n \"triglyceride_tg\" float,\n \"uncontrolled_blood_pressure\" bool,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 \/ l ) , neutropenia ( < 1500 \/ l ) , or thrombocytopenia ( platelets < 100000 \/ l ) . ### Input: CREATE TABLE table_dev_20 (\n \"id\" int,\n \"anemia\" bool,\n \"gender\" string,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"platelets\" int,\n \"dyslipidemia\" bool,\n \"renal_disease\" bool,\n \"creatinine_clearance_cl\" float,\n \"neutropenia\" int,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"thrombocytopenia\" float,\n \"diastolic_blood_pressure_dbp\" int,\n \"lymphopenia\" int,\n \"ldl\" int,\n \"serum_creatinine\" float,\n \"kidney_disease\" bool,\n \"triglyceride_tg\" float,\n \"uncontrolled_blood_pressure\" bool,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000"} {"instruction":"who was the winning driver after nigel mansell ?","input":"CREATE TABLE table_203_408 (\n id number,\n \"rd.\" number,\n \"grand prix\" text,\n \"date\" text,\n \"location\" text,\n \"pole position\" text,\n \"fastest lap\" text,\n \"winning driver\" text,\n \"constructor\" text,\n \"report\" text\n)","response":"SELECT \"winning driver\" FROM table_203_408 WHERE \"rd.\" > (SELECT \"rd.\" FROM table_203_408 WHERE \"winning driver\" = 'nigel mansell') ORDER BY \"rd.\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the winning driver after nigel mansell ? ### Input: CREATE TABLE table_203_408 (\n id number,\n \"rd.\" number,\n \"grand prix\" text,\n \"date\" text,\n \"location\" text,\n \"pole position\" text,\n \"fastest lap\" text,\n \"winning driver\" text,\n \"constructor\" text,\n \"report\" text\n) ### Response: SELECT \"winning driver\" FROM table_203_408 WHERE \"rd.\" > (SELECT \"rd.\" FROM table_203_408 WHERE \"winning driver\" = 'nigel mansell') ORDER BY \"rd.\" LIMIT 1"} {"instruction":"What type of car has the model 6cm?","input":"CREATE TABLE table_name_11 (\n type VARCHAR,\n model VARCHAR\n)","response":"SELECT type FROM table_name_11 WHERE model = \"6cm\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of car has the model 6cm? ### Input: CREATE TABLE table_name_11 (\n type VARCHAR,\n model VARCHAR\n) ### Response: SELECT type FROM table_name_11 WHERE model = \"6cm\""} {"instruction":"what was the last ward identification for patient 49036 since 4 years ago?","input":"CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)","response":"SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last ward identification for patient 49036 since 4 years ago? ### Input: CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n) ### Response: SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1"} {"instruction":"What is the player from England's score?","input":"CREATE TABLE table_name_98 (\n score VARCHAR,\n country VARCHAR\n)","response":"SELECT score FROM table_name_98 WHERE country = \"england\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the player from England's score? ### Input: CREATE TABLE table_name_98 (\n score VARCHAR,\n country VARCHAR\n) ### Response: SELECT score FROM table_name_98 WHERE country = \"england\""} {"instruction":"Which Maximum episode premiered March 8, 2008?","input":"CREATE TABLE table_2140071_8 (\n episode INTEGER,\n premier_date VARCHAR\n)","response":"SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = \"March 8, 2008\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Maximum episode premiered March 8, 2008? ### Input: CREATE TABLE table_2140071_8 (\n episode INTEGER,\n premier_date VARCHAR\n) ### Response: SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = \"March 8, 2008\""} {"instruction":"How many patients are born before 2197 and with procedure icd9 code 309?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < \"2197\" AND procedures.icd9_code = \"309\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients are born before 2197 and with procedure icd9 code 309? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < \"2197\" AND procedures.icd9_code = \"309\""} {"instruction":"What is the acceleration 1-100km\/h when the name is 1.5 dci?","input":"CREATE TABLE table_name_32 (\n acceleration_0_100km_h VARCHAR,\n name VARCHAR\n)","response":"SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = \"1.5 dci\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the acceleration 1-100km\/h when the name is 1.5 dci? ### Input: CREATE TABLE table_name_32 (\n acceleration_0_100km_h VARCHAR,\n name VARCHAR\n) ### Response: SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = \"1.5 dci\""} {"instruction":"give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"TRANSIENT ISCHEMIC ATTACK\" AND demographic.days_stay > \"4\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"TRANSIENT ISCHEMIC ATTACK\" AND demographic.days_stay > \"4\""} {"instruction":"Which away game was played on 2008-07-18?","input":"CREATE TABLE table_name_5 (\n away VARCHAR,\n date VARCHAR\n)","response":"SELECT away FROM table_name_5 WHERE date = \"2008-07-18\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which away game was played on 2008-07-18? ### Input: CREATE TABLE table_name_5 (\n away VARCHAR,\n date VARCHAR\n) ### Response: SELECT away FROM table_name_5 WHERE date = \"2008-07-18\""} {"instruction":"What is the team whose driver Jeff Simmons?","input":"CREATE TABLE table_17319931_1 (\n team VARCHAR,\n driver VARCHAR\n)","response":"SELECT team FROM table_17319931_1 WHERE driver = \"Jeff Simmons\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the team whose driver Jeff Simmons? ### Input: CREATE TABLE table_17319931_1 (\n team VARCHAR,\n driver VARCHAR\n) ### Response: SELECT team FROM table_17319931_1 WHERE driver = \"Jeff Simmons\""} {"instruction":"What was the final score when tracy austin was runner up?","input":"CREATE TABLE table_20986710_1 (\n score_in_final VARCHAR,\n runner_up VARCHAR\n)","response":"SELECT score_in_final FROM table_20986710_1 WHERE runner_up = \"Tracy Austin\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the final score when tracy austin was runner up? ### Input: CREATE TABLE table_20986710_1 (\n score_in_final VARCHAR,\n runner_up VARCHAR\n) ### Response: SELECT score_in_final FROM table_20986710_1 WHERE runner_up = \"Tracy Austin\""} {"instruction":"Which NBA Draft had Labradford Smith?","input":"CREATE TABLE table_name_61 (\n nba_draft VARCHAR,\n player VARCHAR\n)","response":"SELECT nba_draft FROM table_name_61 WHERE player = \"labradford smith\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which NBA Draft had Labradford Smith? ### Input: CREATE TABLE table_name_61 (\n nba_draft VARCHAR,\n player VARCHAR\n) ### Response: SELECT nba_draft FROM table_name_61 WHERE player = \"labradford smith\""} {"instruction":"Which player has a 92.58 3-dart average?","input":"CREATE TABLE table_24015 (\n \"Player\" text,\n \"Played\" real,\n \"Legs Won\" real,\n \"Legs Lost\" real,\n \"LWAT\" real,\n \"100+\" real,\n \"140+\" real,\n \"180s\" real,\n \"High Checkout\" real,\n \"3-dart Average\" text\n)","response":"SELECT \"Player\" FROM table_24015 WHERE \"3-dart Average\" = '92.58'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player has a 92.58 3-dart average? ### Input: CREATE TABLE table_24015 (\n \"Player\" text,\n \"Played\" real,\n \"Legs Won\" real,\n \"Legs Lost\" real,\n \"LWAT\" real,\n \"100+\" real,\n \"140+\" real,\n \"180s\" real,\n \"High Checkout\" real,\n \"3-dart Average\" text\n) ### Response: SELECT \"Player\" FROM table_24015 WHERE \"3-dart Average\" = '92.58'"} {"instruction":"Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers?","input":"CREATE TABLE table_name_95 (\n conference_joined VARCHAR,\n previous_conference VARCHAR,\n mascot VARCHAR\n)","response":"SELECT conference_joined FROM table_name_95 WHERE previous_conference = \"northwestern\" AND mascot = \"oilers\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers? ### Input: CREATE TABLE table_name_95 (\n conference_joined VARCHAR,\n previous_conference VARCHAR,\n mascot VARCHAR\n) ### Response: SELECT conference_joined FROM table_name_95 WHERE previous_conference = \"northwestern\" AND mascot = \"oilers\""} {"instruction":"If sample 6480 is imported, which country is it originally from?","input":"CREATE TABLE resultsdata15 (\n sample_pk number,\n commod text,\n commtype text,\n lab text,\n pestcode text,\n testclass text,\n concen number,\n lod number,\n conunit text,\n confmethod text,\n confmethod2 text,\n annotate text,\n quantitate text,\n mean text,\n extract text,\n determin text\n)\n\nCREATE TABLE sampledata15 (\n sample_pk number,\n state text,\n year text,\n month text,\n day text,\n site text,\n commod text,\n source_id text,\n variety text,\n origin text,\n country text,\n disttype text,\n commtype text,\n claim text,\n quantity number,\n growst text,\n packst text,\n distst text\n)","response":"SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2","source":"pesticide","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If sample 6480 is imported, which country is it originally from? ### Input: CREATE TABLE resultsdata15 (\n sample_pk number,\n commod text,\n commtype text,\n lab text,\n pestcode text,\n testclass text,\n concen number,\n lod number,\n conunit text,\n confmethod text,\n confmethod2 text,\n annotate text,\n quantitate text,\n mean text,\n extract text,\n determin text\n)\n\nCREATE TABLE sampledata15 (\n sample_pk number,\n state text,\n year text,\n month text,\n day text,\n site text,\n commod text,\n source_id text,\n variety text,\n origin text,\n country text,\n disttype text,\n commtype text,\n claim text,\n quantity number,\n growst text,\n packst text,\n distst text\n) ### Response: SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2"} {"instruction":"Give me the title and highest price for each film Show bar chart, list from low to high by the Y.","input":"CREATE TABLE schedule (\n Cinema_ID int,\n Film_ID int,\n Date text,\n Show_times_per_day int,\n Price float\n)\n\nCREATE TABLE cinema (\n Cinema_ID int,\n Name text,\n Openning_year int,\n Capacity int,\n Location text\n)\n\nCREATE TABLE film (\n Film_ID int,\n Rank_in_series int,\n Number_in_season int,\n Title text,\n Directed_by text,\n Original_air_date text,\n Production_code text\n)","response":"SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the title and highest price for each film Show bar chart, list from low to high by the Y. ### Input: CREATE TABLE schedule (\n Cinema_ID int,\n Film_ID int,\n Date text,\n Show_times_per_day int,\n Price float\n)\n\nCREATE TABLE cinema (\n Cinema_ID int,\n Name text,\n Openning_year int,\n Capacity int,\n Location text\n)\n\nCREATE TABLE film (\n Film_ID int,\n Rank_in_series int,\n Number_in_season int,\n Title text,\n Directed_by text,\n Original_air_date text,\n Production_code text\n) ### Response: SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)"} {"instruction":"What club team did JArrod Maidens play for?","input":"CREATE TABLE table_17204 (\n \"Round\" real,\n \"Overall\" text,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"Club team\" text\n)","response":"SELECT \"Club team\" FROM table_17204 WHERE \"Player\" = 'Jarrod Maidens'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What club team did JArrod Maidens play for? ### Input: CREATE TABLE table_17204 (\n \"Round\" real,\n \"Overall\" text,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"Club team\" text\n) ### Response: SELECT \"Club team\" FROM table_17204 WHERE \"Player\" = 'Jarrod Maidens'"} {"instruction":"Name the least matches for year 2008","input":"CREATE TABLE table_15829930_5 (\n matches INTEGER,\n year VARCHAR\n)","response":"SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least matches for year 2008 ### Input: CREATE TABLE table_15829930_5 (\n matches INTEGER,\n year VARCHAR\n) ### Response: SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008"} {"instruction":"Show me about the distribution of All_Road and Team_ID in a bar chart, display by the y-axis in ascending.","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Road and Team_ID in a bar chart, display by the y-axis in ascending. ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID"} {"instruction":"What is the Placement when the Candidate is Jean-Patrick Berthiaume?","input":"CREATE TABLE table_15441 (\n \"Riding\" text,\n \"Province\" text,\n \"Candidate\" text,\n \"Votes\" real,\n \"Placement\" text\n)","response":"SELECT \"Placement\" FROM table_15441 WHERE \"Candidate\" = 'jean-patrick berthiaume'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Placement when the Candidate is Jean-Patrick Berthiaume? ### Input: CREATE TABLE table_15441 (\n \"Riding\" text,\n \"Province\" text,\n \"Candidate\" text,\n \"Votes\" real,\n \"Placement\" text\n) ### Response: SELECT \"Placement\" FROM table_15441 WHERE \"Candidate\" = 'jean-patrick berthiaume'"} {"instruction":"Questions I have answered where asker has accepted another answer. Lists all questions I have proposed an answer to, and, sadly, the original asker accepted a different answer.","input":"CREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT p.Id AS \"post_link\", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.CreationDate","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions I have answered where asker has accepted another answer. Lists all questions I have proposed an answer to, and, sadly, the original asker accepted a different answer. ### Input: CREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT p.Id AS \"post_link\", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.CreationDate"} {"instruction":"How many winners were there in the race of 1922","input":"CREATE TABLE table_777 (\n \"District\" text,\n \"Incumbent\" text,\n \"Party\" text,\n \"First elected\" real,\n \"Result\" text,\n \"Candidates\" text\n)","response":"SELECT COUNT(\"Incumbent\") FROM table_777 WHERE \"First elected\" = '1922'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many winners were there in the race of 1922 ### Input: CREATE TABLE table_777 (\n \"District\" text,\n \"Incumbent\" text,\n \"Party\" text,\n \"First elected\" real,\n \"Result\" text,\n \"Candidates\" text\n) ### Response: SELECT COUNT(\"Incumbent\") FROM table_777 WHERE \"First elected\" = '1922'"} {"instruction":"What is the title for episode number 7 in the season?","input":"CREATE TABLE table_15431251_1 (\n title VARCHAR,\n no_in_season VARCHAR\n)","response":"SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title for episode number 7 in the season? ### Input: CREATE TABLE table_15431251_1 (\n title VARCHAR,\n no_in_season VARCHAR\n) ### Response: SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7"} {"instruction":"What was the score when the opponent was Dominika Cibulkov ?","input":"CREATE TABLE table_72981 (\n \"Outcome\" text,\n \"Edition\" real,\n \"Round\" text,\n \"Opponent Team\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n)","response":"SELECT \"Score\" FROM table_72981 WHERE \"Opponent\" = 'Dominika Cibulkov\u00e1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score when the opponent was Dominika Cibulkov ? ### Input: CREATE TABLE table_72981 (\n \"Outcome\" text,\n \"Edition\" real,\n \"Round\" text,\n \"Opponent Team\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n) ### Response: SELECT \"Score\" FROM table_72981 WHERE \"Opponent\" = 'Dominika Cibulkov\u00e1'"} {"instruction":"How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1?","input":"CREATE TABLE table_4876 (\n \"Place\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Goals For\" real,\n \"Goals Against\" real\n)","response":"SELECT COUNT(\"Goals Against\") FROM table_4876 WHERE \"Lost\" > '7' AND \"Goals For\" < '27' AND \"Drawn\" > '1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1? ### Input: CREATE TABLE table_4876 (\n \"Place\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Goals For\" real,\n \"Goals Against\" real\n) ### Response: SELECT COUNT(\"Goals Against\") FROM table_4876 WHERE \"Lost\" > '7' AND \"Goals For\" < '27' AND \"Drawn\" > '1'"} {"instruction":"What is the score for Billy Andrade?","input":"CREATE TABLE table_8435 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n)","response":"SELECT \"Score\" FROM table_8435 WHERE \"Player\" = 'billy andrade'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for Billy Andrade? ### Input: CREATE TABLE table_8435 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n) ### Response: SELECT \"Score\" FROM table_8435 WHERE \"Player\" = 'billy andrade'"} {"instruction":"What is the average 2002 value for Sunflower, which had a 2010 value less than 5587 and a 2007 value greater than 546?","input":"CREATE TABLE table_70544 (\n \"Production year\" text,\n \"2001\" real,\n \"2002\" real,\n \"2003\" real,\n \"2004\" real,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011\" real\n)","response":"SELECT AVG(\"2002\") FROM table_70544 WHERE \"2010\" < '5587' AND \"Production year\" = 'sunflower' AND \"2007\" > '546'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average 2002 value for Sunflower, which had a 2010 value less than 5587 and a 2007 value greater than 546? ### Input: CREATE TABLE table_70544 (\n \"Production year\" text,\n \"2001\" real,\n \"2002\" real,\n \"2003\" real,\n \"2004\" real,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011\" real\n) ### Response: SELECT AVG(\"2002\") FROM table_70544 WHERE \"2010\" < '5587' AND \"Production year\" = 'sunflower' AND \"2007\" > '546'"} {"instruction":"Who had the most points and how many did they have on April 22?","input":"CREATE TABLE table_27700530_15 (\n high_points VARCHAR,\n date VARCHAR\n)","response":"SELECT high_points FROM table_27700530_15 WHERE date = \"April 22\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the most points and how many did they have on April 22? ### Input: CREATE TABLE table_27700530_15 (\n high_points VARCHAR,\n date VARCHAR\n) ### Response: SELECT high_points FROM table_27700530_15 WHERE date = \"April 22\""} {"instruction":"which building held the record before the current holder ?","input":"CREATE TABLE table_203_777 (\n id number,\n \"years\" text,\n \"building\" text,\n \"city\" text,\n \"height (ctbuh)\" text,\n \"floors\" number\n)","response":"SELECT \"building\" FROM table_203_777 WHERE \"years\" < present_ref ORDER BY \"years\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which building held the record before the current holder ? ### Input: CREATE TABLE table_203_777 (\n id number,\n \"years\" text,\n \"building\" text,\n \"city\" text,\n \"height (ctbuh)\" text,\n \"floors\" number\n) ### Response: SELECT \"building\" FROM table_203_777 WHERE \"years\" < present_ref ORDER BY \"years\" DESC LIMIT 1"} {"instruction":"What is the attendance of the game on July 26?","input":"CREATE TABLE table_name_1 (\n attendance INTEGER,\n date VARCHAR\n)","response":"SELECT SUM(attendance) FROM table_name_1 WHERE date = \"july 26\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the attendance of the game on July 26? ### Input: CREATE TABLE table_name_1 (\n attendance INTEGER,\n date VARCHAR\n) ### Response: SELECT SUM(attendance) FROM table_name_1 WHERE date = \"july 26\""} {"instruction":"Name the site for game of game 2","input":"CREATE TABLE table_name_26 (\n site VARCHAR,\n game VARCHAR\n)","response":"SELECT site FROM table_name_26 WHERE game = \"game 2\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the site for game of game 2 ### Input: CREATE TABLE table_name_26 (\n site VARCHAR,\n game VARCHAR\n) ### Response: SELECT site FROM table_name_26 WHERE game = \"game 2\""} {"instruction":"microalbuminuria up to 300 mg \/ 24 hours is acceptable if serum creatinine is < 1.4 for female , < 1.5 for male and estimated gfr ( egfr ) is > 60 )","input":"CREATE TABLE table_dev_42 (\n \"id\" int,\n \"gender\" string,\n \"depression\" bool,\n \"familial_hypercholesterolemia\" bool,\n \"microalbuminuria\" int,\n \"renal_disease\" bool,\n \"diabetic\" string,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"serum_creatinine\" float,\n \"fbg\" int,\n \"body_mass_index_bmi\" float,\n \"triglyceride_tg\" float,\n \"a1c\" float,\n \"age\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: microalbuminuria up to 300 mg \/ 24 hours is acceptable if serum creatinine is < 1.4 for female , < 1.5 for male and estimated gfr ( egfr ) is > 60 ) ### Input: CREATE TABLE table_dev_42 (\n \"id\" int,\n \"gender\" string,\n \"depression\" bool,\n \"familial_hypercholesterolemia\" bool,\n \"microalbuminuria\" int,\n \"renal_disease\" bool,\n \"diabetic\" string,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"serum_creatinine\" float,\n \"fbg\" int,\n \"body_mass_index_bmi\" float,\n \"triglyceride_tg\" float,\n \"a1c\" float,\n \"age\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60"} {"instruction":"during the previous year, what were the top three most frequently ordered lab tests for patients during the same month after the diagnosis of accid in resident instit?","input":"CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accid in resident instit') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 3)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during the previous year, what were the top three most frequently ordered lab tests for patients during the same month after the diagnosis of accid in resident instit? ### Input: CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accid in resident instit') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 3)"} {"instruction":"how many total medals did brazil received ?","input":"CREATE TABLE table_204_302 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT \"total\" FROM table_204_302 WHERE \"nation\" = 'brazil'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many total medals did brazil received ? ### Input: CREATE TABLE table_204_302 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT \"total\" FROM table_204_302 WHERE \"nation\" = 'brazil'"} {"instruction":"What play has a base of Athens and was written by Aeschylus?","input":"CREATE TABLE table_name_67 (\n play VARCHAR,\n author VARCHAR,\n base VARCHAR\n)","response":"SELECT play FROM table_name_67 WHERE author = \"aeschylus\" AND base = \"athens\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What play has a base of Athens and was written by Aeschylus? ### Input: CREATE TABLE table_name_67 (\n play VARCHAR,\n author VARCHAR,\n base VARCHAR\n) ### Response: SELECT play FROM table_name_67 WHERE author = \"aeschylus\" AND base = \"athens\""} {"instruction":"Got most down to non-CW answers.","input":"CREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)","response":"SELECT DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, Posts.OwnerUserId AS \"user_link\", Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId = 3 AND Posts.PostTypeId = 2 AND Posts.CommunityOwnedDate IS NULL AND Posts.OwnerUserId > 0 GROUP BY Posts.OwnerUserId ORDER BY Count DESC, UserId LIMIT 100","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Got most down to non-CW answers. ### Input: CREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n) ### Response: SELECT DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, Posts.OwnerUserId AS \"user_link\", Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId = 3 AND Posts.PostTypeId = 2 AND Posts.CommunityOwnedDate IS NULL AND Posts.OwnerUserId > 0 GROUP BY Posts.OwnerUserId ORDER BY Count DESC, UserId LIMIT 100"} {"instruction":"List all church names in descending order of opening date.","input":"CREATE TABLE wedding (\n church_id number,\n male_id number,\n female_id number,\n year number\n)\n\nCREATE TABLE people (\n people_id number,\n name text,\n country text,\n is_male text,\n age number\n)\n\nCREATE TABLE church (\n church_id number,\n name text,\n organized_by text,\n open_date number,\n continuation_of text\n)","response":"SELECT name FROM church ORDER BY open_date DESC","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all church names in descending order of opening date. ### Input: CREATE TABLE wedding (\n church_id number,\n male_id number,\n female_id number,\n year number\n)\n\nCREATE TABLE people (\n people_id number,\n name text,\n country text,\n is_male text,\n age number\n)\n\nCREATE TABLE church (\n church_id number,\n name text,\n organized_by text,\n open_date number,\n continuation_of text\n) ### Response: SELECT name FROM church ORDER BY open_date DESC"} {"instruction":"What is the average attendance after week 16?","input":"CREATE TABLE table_name_10 (\n attendance INTEGER,\n week INTEGER\n)","response":"SELECT AVG(attendance) FROM table_name_10 WHERE week > 16","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average attendance after week 16? ### Input: CREATE TABLE table_name_10 (\n attendance INTEGER,\n week INTEGER\n) ### Response: SELECT AVG(attendance) FROM table_name_10 WHERE week > 16"} {"instruction":"In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?","input":"CREATE TABLE injury_accident (\n game_id VARCHAR,\n injury VARCHAR\n)\n\nCREATE TABLE stadium (\n name VARCHAR,\n id VARCHAR\n)\n\nCREATE TABLE game (\n season VARCHAR,\n stadium_id VARCHAR,\n id VARCHAR\n)","response":"SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'? ### Input: CREATE TABLE injury_accident (\n game_id VARCHAR,\n injury VARCHAR\n)\n\nCREATE TABLE stadium (\n name VARCHAR,\n id VARCHAR\n)\n\nCREATE TABLE game (\n season VARCHAR,\n stadium_id VARCHAR,\n id VARCHAR\n) ### Response: SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'"} {"instruction":"What Secretary has an Internal CO of isabel voets?","input":"CREATE TABLE table_61959 (\n \"President\" text,\n \"Treasurer\" text,\n \"Secretary\" text,\n \"Social AO\" text,\n \"Academic AO\" text,\n \"Internal CO\" text,\n \"External CO\" text\n)","response":"SELECT \"Secretary\" FROM table_61959 WHERE \"Internal CO\" = 'isabel voets'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Secretary has an Internal CO of isabel voets? ### Input: CREATE TABLE table_61959 (\n \"President\" text,\n \"Treasurer\" text,\n \"Secretary\" text,\n \"Social AO\" text,\n \"Academic AO\" text,\n \"Internal CO\" text,\n \"External CO\" text\n) ### Response: SELECT \"Secretary\" FROM table_61959 WHERE \"Internal CO\" = 'isabel voets'"} {"instruction":"what is the number of patients whose discharge location is long term care hospital and procedure long title is incision of vessel, lower limb arteries?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = \"LONG TERM CARE HOSPITAL\" AND procedures.long_title = \"Incision of vessel, lower limb arteries\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose discharge location is long term care hospital and procedure long title is incision of vessel, lower limb arteries? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = \"LONG TERM CARE HOSPITAL\" AND procedures.long_title = \"Incision of vessel, lower limb arteries\""} {"instruction":"how much does it cost for the hospital stay of patient 29540?","input":"CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29540)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much does it cost for the hospital stay of patient 29540? ### Input: CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29540)"} {"instruction":"Give the ids of documents with expenses that have the budget code 'SF'.","input":"CREATE TABLE ref_budget_codes (\n budget_type_code text,\n budget_type_description text\n)\n\nCREATE TABLE accounts (\n account_id number,\n statement_id number,\n account_details text\n)\n\nCREATE TABLE ref_document_types (\n document_type_code text,\n document_type_name text,\n document_type_description text\n)\n\nCREATE TABLE projects (\n project_id number,\n project_details text\n)\n\nCREATE TABLE statements (\n statement_id number,\n statement_details text\n)\n\nCREATE TABLE documents_with_expenses (\n document_id number,\n budget_type_code text,\n document_details text\n)\n\nCREATE TABLE documents (\n document_id number,\n document_type_code text,\n project_id number,\n document_date time,\n document_name text,\n document_description text,\n other_details text\n)","response":"SELECT document_id FROM documents_with_expenses WHERE budget_type_code = 'SF'","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give the ids of documents with expenses that have the budget code 'SF'. ### Input: CREATE TABLE ref_budget_codes (\n budget_type_code text,\n budget_type_description text\n)\n\nCREATE TABLE accounts (\n account_id number,\n statement_id number,\n account_details text\n)\n\nCREATE TABLE ref_document_types (\n document_type_code text,\n document_type_name text,\n document_type_description text\n)\n\nCREATE TABLE projects (\n project_id number,\n project_details text\n)\n\nCREATE TABLE statements (\n statement_id number,\n statement_details text\n)\n\nCREATE TABLE documents_with_expenses (\n document_id number,\n budget_type_code text,\n document_details text\n)\n\nCREATE TABLE documents (\n document_id number,\n document_type_code text,\n project_id number,\n document_date time,\n document_name text,\n document_description text,\n other_details text\n) ### Response: SELECT document_id FROM documents_with_expenses WHERE budget_type_code = 'SF'"} {"instruction":"Which skill is used in fixing the most number of faults? List the skill id and description.","input":"CREATE TABLE Skills_Required_To_Fix (\n skill_id VARCHAR\n)\n\nCREATE TABLE Skills (\n skill_id VARCHAR,\n skill_description VARCHAR\n)","response":"SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which skill is used in fixing the most number of faults? List the skill id and description. ### Input: CREATE TABLE Skills_Required_To_Fix (\n skill_id VARCHAR\n)\n\nCREATE TABLE Skills (\n skill_id VARCHAR,\n skill_description VARCHAR\n) ### Response: SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1"} {"instruction":"Top users under 18 by Reputation.","input":"CREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http:\/\/stackoverflow.com\/users\/' + CAST(Id AS TEXT) AS Url FROM Users AS b WHERE (b.Age <= 18) ORDER BY b.Reputation, b.Age","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top users under 18 by Reputation. ### Input: CREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http:\/\/stackoverflow.com\/users\/' + CAST(Id AS TEXT) AS Url FROM Users AS b WHERE (b.Age <= 18) ORDER BY b.Reputation, b.Age"} {"instruction":"select * from posts limit 10;.","input":"CREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)","response":"SELECT * FROM Posts WHERE Score > 1000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: select * from posts limit 10;. ### Input: CREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n) ### Response: SELECT * FROM Posts WHERE Score > 1000"} {"instruction":"who wrote the most ACL papers in 2010","input":"CREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)","response":"SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who wrote the most ACL papers in 2010 ### Input: CREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n) ### Response: SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC"} {"instruction":"How many Vacators were listed when the district was North Carolina 3rd?","input":"CREATE TABLE table_25065 (\n \"District\" text,\n \"Vacator\" text,\n \"Reason for change\" text,\n \"Successor\" text,\n \"Date successor seated\" text\n)","response":"SELECT COUNT(\"Vacator\") FROM table_25065 WHERE \"District\" = 'North Carolina 3rd'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Vacators were listed when the district was North Carolina 3rd? ### Input: CREATE TABLE table_25065 (\n \"District\" text,\n \"Vacator\" text,\n \"Reason for change\" text,\n \"Successor\" text,\n \"Date successor seated\" text\n) ### Response: SELECT COUNT(\"Vacator\") FROM table_25065 WHERE \"District\" = 'North Carolina 3rd'"} {"instruction":"Where is Bloomington High School North?","input":"CREATE TABLE table_73158 (\n \"School\" text,\n \"City \/ Town\" text,\n \"Website\" text,\n \"Size\" real,\n \"Principal\" text,\n \"Grades\" text,\n \"IDOE Profile\" text\n)","response":"SELECT \"City \/ Town\" FROM table_73158 WHERE \"School\" = 'Bloomington High School North'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is Bloomington High School North? ### Input: CREATE TABLE table_73158 (\n \"School\" text,\n \"City \/ Town\" text,\n \"Website\" text,\n \"Size\" real,\n \"Principal\" text,\n \"Grades\" text,\n \"IDOE Profile\" text\n) ### Response: SELECT \"City \/ Town\" FROM table_73158 WHERE \"School\" = 'Bloomington High School North'"} {"instruction":"list the flights from SALT LAKE CITY to ST. PETERSBURG","input":"CREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the flights from SALT LAKE CITY to ST. PETERSBURG ### Input: CREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"How many artists were there for the show thoroughly modern millie?","input":"CREATE TABLE table_28140141_1 (\n artist VARCHAR,\n show VARCHAR\n)","response":"SELECT COUNT(artist) FROM table_28140141_1 WHERE show = \"Thoroughly Modern Millie\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many artists were there for the show thoroughly modern millie? ### Input: CREATE TABLE table_28140141_1 (\n artist VARCHAR,\n show VARCHAR\n) ### Response: SELECT COUNT(artist) FROM table_28140141_1 WHERE show = \"Thoroughly Modern Millie\""} {"instruction":"What was the result of the game with the record of 3-1?","input":"CREATE TABLE table_20849830_1 (\n result VARCHAR,\n record VARCHAR\n)","response":"SELECT result FROM table_20849830_1 WHERE record = \"3-1\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game with the record of 3-1? ### Input: CREATE TABLE table_20849830_1 (\n result VARCHAR,\n record VARCHAR\n) ### Response: SELECT result FROM table_20849830_1 WHERE record = \"3-1\""} {"instruction":"Which player scored 76-68=144?","input":"CREATE TABLE table_name_28 (\n player VARCHAR,\n score VARCHAR\n)","response":"SELECT player FROM table_name_28 WHERE score = 76 - 68 = 144","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player scored 76-68=144? ### Input: CREATE TABLE table_name_28 (\n player VARCHAR,\n score VARCHAR\n) ### Response: SELECT player FROM table_name_28 WHERE score = 76 - 68 = 144"} {"instruction":"how many unmarried patients have dialys route of drug administration?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = \"SINGLE\" AND prescriptions.route = \"DIALYS\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many unmarried patients have dialys route of drug administration? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = \"SINGLE\" AND prescriptions.route = \"DIALYS\""} {"instruction":"what is minimum age of patients whose primary disease is coronary artery disease\\coronary artery bypass graft with mvr; ? maze and admission year is greater than or equal to 2146?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = \"CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE\" AND demographic.admityear >= \"2146\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose primary disease is coronary artery disease\\coronary artery bypass graft with mvr; ? maze and admission year is greater than or equal to 2146? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = \"CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE\" AND demographic.admityear >= \"2146\""} {"instruction":"Can you tell me the Record that has the Game of 19?","input":"CREATE TABLE table_46830 (\n \"Game\" real,\n \"November\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Record\" text\n)","response":"SELECT \"Record\" FROM table_46830 WHERE \"Game\" = '19'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the Record that has the Game of 19? ### Input: CREATE TABLE table_46830 (\n \"Game\" real,\n \"November\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Record\" text\n) ### Response: SELECT \"Record\" FROM table_46830 WHERE \"Game\" = '19'"} {"instruction":"What's the class of the HMS Heartsease?","input":"CREATE TABLE table_name_75 (\n class VARCHAR,\n name VARCHAR\n)","response":"SELECT class FROM table_name_75 WHERE name = \"hms heartsease\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the class of the HMS Heartsease? ### Input: CREATE TABLE table_name_75 (\n class VARCHAR,\n name VARCHAR\n) ### Response: SELECT class FROM table_name_75 WHERE name = \"hms heartsease\""} {"instruction":"give me the number of patients whose admission type is elective and procedure icd9 code is 3613?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND procedures.icd9_code = \"3613\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission type is elective and procedure icd9 code is 3613? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND procedures.icd9_code = \"3613\""} {"instruction":"What was the original title for the film used in nomination of street days?","input":"CREATE TABLE table_61774 (\n \"Year [e ] (Ceremony)\" text,\n \"Film title used in nomination\" text,\n \"Original title\" text,\n \"Director\" text,\n \"Main Language(s)\" text,\n \"Result\" text\n)","response":"SELECT \"Original title\" FROM table_61774 WHERE \"Film title used in nomination\" = 'street days'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the original title for the film used in nomination of street days? ### Input: CREATE TABLE table_61774 (\n \"Year [e ] (Ceremony)\" text,\n \"Film title used in nomination\" text,\n \"Original title\" text,\n \"Director\" text,\n \"Main Language(s)\" text,\n \"Result\" text\n) ### Response: SELECT \"Original title\" FROM table_61774 WHERE \"Film title used in nomination\" = 'street days'"} {"instruction":"What is the Points against for the ystradgynlais rfc club?","input":"CREATE TABLE table_name_58 (\n points_against VARCHAR,\n club VARCHAR\n)","response":"SELECT points_against FROM table_name_58 WHERE club = \"ystradgynlais rfc\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Points against for the ystradgynlais rfc club? ### Input: CREATE TABLE table_name_58 (\n points_against VARCHAR,\n club VARCHAR\n) ### Response: SELECT points_against FROM table_name_58 WHERE club = \"ystradgynlais rfc\""} {"instruction":"Give me the comparison about the sum of Weight over the Sex , and group by attribute Sex, and could you show Sex in desc order?","input":"CREATE TABLE people (\n People_ID int,\n Sex text,\n Name text,\n Date_of_Birth text,\n Height real,\n Weight real\n)\n\nCREATE TABLE candidate (\n Candidate_ID int,\n People_ID int,\n Poll_Source text,\n Date text,\n Support_rate real,\n Consider_rate real,\n Oppose_rate real,\n Unsure_rate real\n)","response":"SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about the sum of Weight over the Sex , and group by attribute Sex, and could you show Sex in desc order? ### Input: CREATE TABLE people (\n People_ID int,\n Sex text,\n Name text,\n Date_of_Birth text,\n Height real,\n Weight real\n)\n\nCREATE TABLE candidate (\n Candidate_ID int,\n People_ID int,\n Poll_Source text,\n Date text,\n Support_rate real,\n Consider_rate real,\n Oppose_rate real,\n Unsure_rate real\n) ### Response: SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC"} {"instruction":"Which Round has a Name of john goodyear?","input":"CREATE TABLE table_name_55 (\n round VARCHAR,\n name VARCHAR\n)","response":"SELECT round FROM table_name_55 WHERE name = \"john goodyear\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Round has a Name of john goodyear? ### Input: CREATE TABLE table_name_55 (\n round VARCHAR,\n name VARCHAR\n) ### Response: SELECT round FROM table_name_55 WHERE name = \"john goodyear\""} {"instruction":"WHAT IS THE BIRTH DATE THAT HAS Ceased to be Duke of Girona OF 21 NOVEMBER 1582?","input":"CREATE TABLE table_name_22 (\n birth VARCHAR,\n ceased_to_be_duke_of_girona VARCHAR\n)","response":"SELECT birth FROM table_name_22 WHERE ceased_to_be_duke_of_girona = \"21 november 1582\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHAT IS THE BIRTH DATE THAT HAS Ceased to be Duke of Girona OF 21 NOVEMBER 1582? ### Input: CREATE TABLE table_name_22 (\n birth VARCHAR,\n ceased_to_be_duke_of_girona VARCHAR\n) ### Response: SELECT birth FROM table_name_22 WHERE ceased_to_be_duke_of_girona = \"21 november 1582\""} {"instruction":"what is the italian word for the french word 'mer","input":"CREATE TABLE table_name_37 (\n italian VARCHAR,\n french VARCHAR\n)","response":"SELECT italian FROM table_name_37 WHERE french = \"mer\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the italian word for the french word 'mer ### Input: CREATE TABLE table_name_37 (\n italian VARCHAR,\n french VARCHAR\n) ### Response: SELECT italian FROM table_name_37 WHERE french = \"mer\""} {"instruction":"Find the number of professors with a PhD degree in each department Show bar chart, I want to display by the Y from low to high.","input":"CREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)","response":"SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY COUNT(*)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of professors with a PhD degree in each department Show bar chart, I want to display by the Y from low to high. ### Input: CREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n) ### Response: SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY COUNT(*)"} {"instruction":"what is admission time and lab test name of subject id 22377?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT demographic.admittime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = \"22377\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is admission time and lab test name of subject id 22377? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT demographic.admittime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = \"22377\""} {"instruction":"What is the season # where production code is k1505?","input":"CREATE TABLE table_11951237_3 (\n season__number INTEGER,\n production_code VARCHAR\n)","response":"SELECT MIN(season__number) FROM table_11951237_3 WHERE production_code = \"K1505\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the season # where production code is k1505? ### Input: CREATE TABLE table_11951237_3 (\n season__number INTEGER,\n production_code VARCHAR\n) ### Response: SELECT MIN(season__number) FROM table_11951237_3 WHERE production_code = \"K1505\""} {"instruction":"What nationality has a ranking less than 7 with tony stenson as the name?","input":"CREATE TABLE table_name_13 (\n nationality VARCHAR,\n ranking VARCHAR,\n name VARCHAR\n)","response":"SELECT nationality FROM table_name_13 WHERE ranking < 7 AND name = \"tony stenson\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What nationality has a ranking less than 7 with tony stenson as the name? ### Input: CREATE TABLE table_name_13 (\n nationality VARCHAR,\n ranking VARCHAR,\n name VARCHAR\n) ### Response: SELECT nationality FROM table_name_13 WHERE ranking < 7 AND name = \"tony stenson\""} {"instruction":"what is discharge time and procedure icd9 code of subject id 65759?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.dischtime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"65759\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is discharge time and procedure icd9 code of subject id 65759? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.dischtime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"65759\""} {"instruction":"give me the number of patients whose days of hospital stay is greater than 1 and procedure short title is hemodialysis?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > \"1\" AND procedures.short_title = \"Hemodialysis\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose days of hospital stay is greater than 1 and procedure short title is hemodialysis? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > \"1\" AND procedures.short_title = \"Hemodialysis\""} {"instruction":"What is the earliest year a SG has over 650 assists?","input":"CREATE TABLE table_55647 (\n \"Player\" text,\n \"Pos.\" text,\n \"From\" real,\n \"School\/Country\" text,\n \"Rebs\" real,\n \"Asts\" real\n)","response":"SELECT MIN(\"From\") FROM table_55647 WHERE \"Pos.\" = 'sg' AND \"Asts\" > '650'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the earliest year a SG has over 650 assists? ### Input: CREATE TABLE table_55647 (\n \"Player\" text,\n \"Pos.\" text,\n \"From\" real,\n \"School\/Country\" text,\n \"Rebs\" real,\n \"Asts\" real\n) ### Response: SELECT MIN(\"From\") FROM table_55647 WHERE \"Pos.\" = 'sg' AND \"Asts\" > '650'"} {"instruction":"Which patients have hispanic or latino-puerto rican ethnic background?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"HISPANIC\/LATINO - PUERTO RICAN\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which patients have hispanic or latino-puerto rican ethnic background? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"HISPANIC\/LATINO - PUERTO RICAN\""} {"instruction":"What is on the reverse side of the 100 coin?","input":"CREATE TABLE table_298883_5 (\n reverse VARCHAR,\n value VARCHAR\n)","response":"SELECT reverse FROM table_298883_5 WHERE value = \"\u20a9100\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is on the reverse side of the 100 coin? ### Input: CREATE TABLE table_298883_5 (\n reverse VARCHAR,\n value VARCHAR\n) ### Response: SELECT reverse FROM table_298883_5 WHERE value = \"\u20a9100\""} {"instruction":"How many different numbers of cantons does the province with the Armenian name have?","input":"CREATE TABLE table_23887174_1 (\n number_of_cantons__gavars_ VARCHAR,\n armenian_name VARCHAR\n)","response":"SELECT COUNT(number_of_cantons__gavars_) FROM table_23887174_1 WHERE armenian_name = \"\u054e\u0561\u057d\u057a\u0578\u0582\u0580\u0561\u056f\u0561\u0576\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different numbers of cantons does the province with the Armenian name have? ### Input: CREATE TABLE table_23887174_1 (\n number_of_cantons__gavars_ VARCHAR,\n armenian_name VARCHAR\n) ### Response: SELECT COUNT(number_of_cantons__gavars_) FROM table_23887174_1 WHERE armenian_name = \"\u054e\u0561\u057d\u057a\u0578\u0582\u0580\u0561\u056f\u0561\u0576\""} {"instruction":"What is the Name of the Players with a Rank of 18?","input":"CREATE TABLE table_name_67 (\n name VARCHAR,\n rank VARCHAR\n)","response":"SELECT name FROM table_name_67 WHERE rank = 18","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Name of the Players with a Rank of 18? ### Input: CREATE TABLE table_name_67 (\n name VARCHAR,\n rank VARCHAR\n) ### Response: SELECT name FROM table_name_67 WHERE rank = 18"} {"instruction":"What year for geelong player john roberts?","input":"CREATE TABLE table_name_77 (\n year VARCHAR,\n opponent VARCHAR,\n player VARCHAR\n)","response":"SELECT year FROM table_name_77 WHERE opponent = \"geelong\" AND player = \"john roberts\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year for geelong player john roberts? ### Input: CREATE TABLE table_name_77 (\n year VARCHAR,\n opponent VARCHAR,\n player VARCHAR\n) ### Response: SELECT year FROM table_name_77 WHERE opponent = \"geelong\" AND player = \"john roberts\""} {"instruction":"What is the start source of the irl country, which ended on 13 April?","input":"CREATE TABLE table_46537 (\n \"Name\" text,\n \"Country\" text,\n \"Loan Club\" text,\n \"Started\" text,\n \"Ended\" text,\n \"Start Source\" text\n)","response":"SELECT \"Start Source\" FROM table_46537 WHERE \"Country\" = 'irl' AND \"Ended\" = '13 april'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the start source of the irl country, which ended on 13 April? ### Input: CREATE TABLE table_46537 (\n \"Name\" text,\n \"Country\" text,\n \"Loan Club\" text,\n \"Started\" text,\n \"Ended\" text,\n \"Start Source\" text\n) ### Response: SELECT \"Start Source\" FROM table_46537 WHERE \"Country\" = 'irl' AND \"Ended\" = '13 april'"} {"instruction":"What is Country, when Time is 1:29.43.60?","input":"CREATE TABLE table_name_68 (\n country VARCHAR,\n time VARCHAR\n)","response":"SELECT country FROM table_name_68 WHERE time = \"1:29.43.60\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Country, when Time is 1:29.43.60? ### Input: CREATE TABLE table_name_68 (\n country VARCHAR,\n time VARCHAR\n) ### Response: SELECT country FROM table_name_68 WHERE time = \"1:29.43.60\""} {"instruction":"How long was the 16 staged event in 1997?","input":"CREATE TABLE table_name_38 (\n distance VARCHAR,\n stages VARCHAR,\n year VARCHAR\n)","response":"SELECT distance FROM table_name_38 WHERE stages = \"16\" AND year = \"1997\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How long was the 16 staged event in 1997? ### Input: CREATE TABLE table_name_38 (\n distance VARCHAR,\n stages VARCHAR,\n year VARCHAR\n) ### Response: SELECT distance FROM table_name_38 WHERE stages = \"16\" AND year = \"1997\""} {"instruction":"What is Wu Xing ( ) with Korean (RR) of (im)?","input":"CREATE TABLE table_name_80 (\n wu_xing___\u4e94\u884c__ VARCHAR,\n korean___rr__ VARCHAR\n)","response":"SELECT wu_xing___\u4e94\u884c__ FROM table_name_80 WHERE korean___rr__ = \"\uc784 (im)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Wu Xing ( ) with Korean (RR) of (im)? ### Input: CREATE TABLE table_name_80 (\n wu_xing___\u4e94\u884c__ VARCHAR,\n korean___rr__ VARCHAR\n) ### Response: SELECT wu_xing___\u4e94\u884c__ FROM table_name_80 WHERE korean___rr__ = \"\uc784 (im)\""} {"instruction":"max number of dupes on a question.","input":"CREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)","response":"SELECT pl.PostId AS \"post_link\", COUNT(*) FROM PostLinks AS pl INNER JOIN Posts AS p ON p.Id = pl.PostId WHERE LinkTypeId = 3 GROUP BY PostId HAVING COUNT(*) > 2 ORDER BY 2 DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: max number of dupes on a question. ### Input: CREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n) ### Response: SELECT pl.PostId AS \"post_link\", COUNT(*) FROM PostLinks AS pl INNER JOIN Posts AS p ON p.Id = pl.PostId WHERE LinkTypeId = 3 GROUP BY PostId HAVING COUNT(*) > 2 ORDER BY 2 DESC"} {"instruction":"Users' search by Name and AboutME.","input":"CREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT DISTINCT u.Id AS \"user_link\", CONCAT('https:\/\/stackoverflow.com\/users\/', u.Id) AS \"profile_link\", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.Reputation, u.UpVotes, u.DownVotes, u.EmailHash FROM Users AS u WHERE UPPER(u.AboutMe) LIKE UPPER('%##AboutMe##%') AND UPPER(DisplayName) LIKE UPPER('%##DisplayName##%')","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users' search by Name and AboutME. ### Input: CREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT DISTINCT u.Id AS \"user_link\", CONCAT('https:\/\/stackoverflow.com\/users\/', u.Id) AS \"profile_link\", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.Reputation, u.UpVotes, u.DownVotes, u.EmailHash FROM Users AS u WHERE UPPER(u.AboutMe) LIKE UPPER('%##AboutMe##%') AND UPPER(DisplayName) LIKE UPPER('%##DisplayName##%')"} {"instruction":"Which player is from south africa?","input":"CREATE TABLE table_62584 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" real\n)","response":"SELECT \"Player\" FROM table_62584 WHERE \"Country\" = 'south africa'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player is from south africa? ### Input: CREATE TABLE table_62584 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" real\n) ### Response: SELECT \"Player\" FROM table_62584 WHERE \"Country\" = 'south africa'"} {"instruction":"What is the upstream with the price 65 chf?","input":"CREATE TABLE table_44728 (\n \"Internet Plan\" text,\n \"Downstream\" text,\n \"Upstream\" text,\n \"Bandwidth Included\" text,\n \"Price\" text\n)","response":"SELECT \"Upstream\" FROM table_44728 WHERE \"Price\" = '65 chf'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the upstream with the price 65 chf? ### Input: CREATE TABLE table_44728 (\n \"Internet Plan\" text,\n \"Downstream\" text,\n \"Upstream\" text,\n \"Bandwidth Included\" text,\n \"Price\" text\n) ### Response: SELECT \"Upstream\" FROM table_44728 WHERE \"Price\" = '65 chf'"} {"instruction":"What's the Order with an Elector of Marino Bulcani?","input":"CREATE TABLE table_71578 (\n \"Elector\" text,\n \"Order\" text,\n \"Title\" text,\n \"Elevated\" text,\n \"Elevator\" text\n)","response":"SELECT \"Order\" FROM table_71578 WHERE \"Elector\" = 'marino bulcani'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the Order with an Elector of Marino Bulcani? ### Input: CREATE TABLE table_71578 (\n \"Elector\" text,\n \"Order\" text,\n \"Title\" text,\n \"Elevated\" text,\n \"Elevator\" text\n) ### Response: SELECT \"Order\" FROM table_71578 WHERE \"Elector\" = 'marino bulcani'"} {"instruction":"Which Finish has a To par of 1, and a Year(s) won of 1955?","input":"CREATE TABLE table_name_61 (\n finish VARCHAR,\n to_par VARCHAR,\n year_s__won VARCHAR\n)","response":"SELECT finish FROM table_name_61 WHERE to_par = \"\u20131\" AND year_s__won = \"1955\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Finish has a To par of 1, and a Year(s) won of 1955? ### Input: CREATE TABLE table_name_61 (\n finish VARCHAR,\n to_par VARCHAR,\n year_s__won VARCHAR\n) ### Response: SELECT finish FROM table_name_61 WHERE to_par = \"\u20131\" AND year_s__won = \"1955\""} {"instruction":"What nationality has a year larger than 2009 with a position of power forward?","input":"CREATE TABLE table_name_32 (\n nationality VARCHAR,\n year VARCHAR,\n position VARCHAR\n)","response":"SELECT nationality FROM table_name_32 WHERE year > 2009 AND position = \"power forward\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What nationality has a year larger than 2009 with a position of power forward? ### Input: CREATE TABLE table_name_32 (\n nationality VARCHAR,\n year VARCHAR,\n position VARCHAR\n) ### Response: SELECT nationality FROM table_name_32 WHERE year > 2009 AND position = \"power forward\""} {"instruction":"Where was the location attendance when Minnesota played?","input":"CREATE TABLE table_8150 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Location Attendance\" FROM table_8150 WHERE \"Team\" = 'minnesota'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the location attendance when Minnesota played? ### Input: CREATE TABLE table_8150 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Location Attendance\" FROM table_8150 WHERE \"Team\" = 'minnesota'"} {"instruction":"Find the names of all the tracks that contain the word 'you'.","input":"CREATE TABLE customer (\n customerid number,\n firstname text,\n lastname text,\n company text,\n address text,\n city text,\n state text,\n country text,\n postalcode text,\n phone text,\n fax text,\n email text,\n supportrepid number\n)\n\nCREATE TABLE employee (\n employeeid number,\n lastname text,\n firstname text,\n title text,\n reportsto number,\n birthdate time,\n hiredate time,\n address text,\n city text,\n state text,\n country text,\n postalcode text,\n phone text,\n fax text,\n email text\n)\n\nCREATE TABLE playlist (\n playlistid number,\n name text\n)\n\nCREATE TABLE invoice (\n invoiceid number,\n customerid number,\n invoicedate time,\n billingaddress text,\n billingcity text,\n billingstate text,\n billingcountry text,\n billingpostalcode text,\n total number\n)\n\nCREATE TABLE invoiceline (\n invoicelineid number,\n invoiceid number,\n trackid number,\n unitprice number,\n quantity number\n)\n\nCREATE TABLE playlisttrack (\n playlistid number,\n trackid number\n)\n\nCREATE TABLE mediatype (\n mediatypeid number,\n name text\n)\n\nCREATE TABLE artist (\n artistid number,\n name text\n)\n\nCREATE TABLE album (\n albumid number,\n title text,\n artistid number\n)\n\nCREATE TABLE genre (\n genreid number,\n name text\n)\n\nCREATE TABLE track (\n trackid number,\n name text,\n albumid number,\n mediatypeid number,\n genreid number,\n composer text,\n milliseconds number,\n bytes number,\n unitprice number\n)","response":"SELECT name FROM track WHERE name LIKE '%you%'","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the names of all the tracks that contain the word 'you'. ### Input: CREATE TABLE customer (\n customerid number,\n firstname text,\n lastname text,\n company text,\n address text,\n city text,\n state text,\n country text,\n postalcode text,\n phone text,\n fax text,\n email text,\n supportrepid number\n)\n\nCREATE TABLE employee (\n employeeid number,\n lastname text,\n firstname text,\n title text,\n reportsto number,\n birthdate time,\n hiredate time,\n address text,\n city text,\n state text,\n country text,\n postalcode text,\n phone text,\n fax text,\n email text\n)\n\nCREATE TABLE playlist (\n playlistid number,\n name text\n)\n\nCREATE TABLE invoice (\n invoiceid number,\n customerid number,\n invoicedate time,\n billingaddress text,\n billingcity text,\n billingstate text,\n billingcountry text,\n billingpostalcode text,\n total number\n)\n\nCREATE TABLE invoiceline (\n invoicelineid number,\n invoiceid number,\n trackid number,\n unitprice number,\n quantity number\n)\n\nCREATE TABLE playlisttrack (\n playlistid number,\n trackid number\n)\n\nCREATE TABLE mediatype (\n mediatypeid number,\n name text\n)\n\nCREATE TABLE artist (\n artistid number,\n name text\n)\n\nCREATE TABLE album (\n albumid number,\n title text,\n artistid number\n)\n\nCREATE TABLE genre (\n genreid number,\n name text\n)\n\nCREATE TABLE track (\n trackid number,\n name text,\n albumid number,\n mediatypeid number,\n genreid number,\n composer text,\n milliseconds number,\n bytes number,\n unitprice number\n) ### Response: SELECT name FROM track WHERE name LIKE '%you%'"} {"instruction":"In what season did the team get in the conference finals of the playoffs?","input":"CREATE TABLE table_2031 (\n \"Year\" real,\n \"Division\" real,\n \"League\" text,\n \"Regular Season\" text,\n \"Playoffs\" text,\n \"Open Cup\" text\n)","response":"SELECT \"Regular Season\" FROM table_2031 WHERE \"Playoffs\" = 'Conference Finals'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what season did the team get in the conference finals of the playoffs? ### Input: CREATE TABLE table_2031 (\n \"Year\" real,\n \"Division\" real,\n \"League\" text,\n \"Regular Season\" text,\n \"Playoffs\" text,\n \"Open Cup\" text\n) ### Response: SELECT \"Regular Season\" FROM table_2031 WHERE \"Playoffs\" = 'Conference Finals'"} {"instruction":"What was the crowd size when the away team scored 7.19 (61)?","input":"CREATE TABLE table_33397 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT COUNT(\"Crowd\") FROM table_33397 WHERE \"Away team score\" = '7.19 (61)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the crowd size when the away team scored 7.19 (61)? ### Input: CREATE TABLE table_33397 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT COUNT(\"Crowd\") FROM table_33397 WHERE \"Away team score\" = '7.19 (61)'"} {"instruction":"what is the marital status and days of hospital stay of subject id 6983?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.subject_id = \"6983\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the marital status and days of hospital stay of subject id 6983? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.subject_id = \"6983\""} {"instruction":"Which driver was in 8 rounds with a chassis of dallara f306?","input":"CREATE TABLE table_44017 (\n \"Team\" text,\n \"Driver\" text,\n \"Class\" text,\n \"Chassis\" text,\n \"Rounds\" text\n)","response":"SELECT \"Driver\" FROM table_44017 WHERE \"Chassis\" = 'dallara f306' AND \"Rounds\" = '8'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which driver was in 8 rounds with a chassis of dallara f306? ### Input: CREATE TABLE table_44017 (\n \"Team\" text,\n \"Driver\" text,\n \"Class\" text,\n \"Chassis\" text,\n \"Rounds\" text\n) ### Response: SELECT \"Driver\" FROM table_44017 WHERE \"Chassis\" = 'dallara f306' AND \"Rounds\" = '8'"} {"instruction":"get the number of urgent hospital admission patients who have prescription for calcium carbonate.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = \"URGENT\" AND prescriptions.drug = \"Calcium Carbonate\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get the number of urgent hospital admission patients who have prescription for calcium carbonate. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = \"URGENT\" AND prescriptions.drug = \"Calcium Carbonate\""} {"instruction":"Which places have points larger than 10?","input":"CREATE TABLE table_name_8 (\n points INTEGER,\n place INTEGER\n)","response":"SELECT MIN(points) FROM table_name_8 WHERE place > 10","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which places have points larger than 10? ### Input: CREATE TABLE table_name_8 (\n points INTEGER,\n place INTEGER\n) ### Response: SELECT MIN(points) FROM table_name_8 WHERE place > 10"} {"instruction":"What is the Position for the brandon wheat kings (wchl)?","input":"CREATE TABLE table_5865 (\n \"Pick #\" text,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"NHL team\" text,\n \"College\/junior\/club team\" text\n)","response":"SELECT \"Position\" FROM table_5865 WHERE \"College\/junior\/club team\" = 'brandon wheat kings (wchl)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Position for the brandon wheat kings (wchl)? ### Input: CREATE TABLE table_5865 (\n \"Pick #\" text,\n \"Player\" text,\n \"Position\" text,\n \"Nationality\" text,\n \"NHL team\" text,\n \"College\/junior\/club team\" text\n) ### Response: SELECT \"Position\" FROM table_5865 WHERE \"College\/junior\/club team\" = 'brandon wheat kings (wchl)'"} {"instruction":"Return a bar chart about the distribution of Date_of_Birth and Height , display in desc by the names please.","input":"CREATE TABLE people (\n People_ID int,\n Sex text,\n Name text,\n Date_of_Birth text,\n Height real,\n Weight real\n)\n\nCREATE TABLE candidate (\n Candidate_ID int,\n People_ID int,\n Poll_Source text,\n Date text,\n Support_rate real,\n Consider_rate real,\n Oppose_rate real,\n Unsure_rate real\n)","response":"SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of Date_of_Birth and Height , display in desc by the names please. ### Input: CREATE TABLE people (\n People_ID int,\n Sex text,\n Name text,\n Date_of_Birth text,\n Height real,\n Weight real\n)\n\nCREATE TABLE candidate (\n Candidate_ID int,\n People_ID int,\n Poll_Source text,\n Date text,\n Support_rate real,\n Consider_rate real,\n Oppose_rate real,\n Unsure_rate real\n) ### Response: SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth DESC"} {"instruction":"What was the Forbers rank (all companies) in 2012 for cenovus energy?","input":"CREATE TABLE table_2971 (\n \"April 2013 Cum. Rank\" real,\n \"Name\" text,\n \"Rank (all) 2012\" real,\n \"Rank (all) 2013\" real,\n \"2013 Rank (oil companies)\" text,\n \"2013 rev (bil. USD )\" text,\n \"2013 Profit (mil. USD )\" real,\n \"Assets (bil. USD )\" text,\n \"Market cap March 15 (mil. USD )\" real\n)","response":"SELECT \"Rank (all) 2012\" FROM table_2971 WHERE \"Name\" = 'Cenovus Energy'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Forbers rank (all companies) in 2012 for cenovus energy? ### Input: CREATE TABLE table_2971 (\n \"April 2013 Cum. Rank\" real,\n \"Name\" text,\n \"Rank (all) 2012\" real,\n \"Rank (all) 2013\" real,\n \"2013 Rank (oil companies)\" text,\n \"2013 rev (bil. USD )\" text,\n \"2013 Profit (mil. USD )\" real,\n \"Assets (bil. USD )\" text,\n \"Market cap March 15 (mil. USD )\" real\n) ### Response: SELECT \"Rank (all) 2012\" FROM table_2971 WHERE \"Name\" = 'Cenovus Energy'"} {"instruction":"what is minimum age of patients whose marital status is single and primary disease is hypertension;rule out coronary artery disease\\cardiac cath?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = \"SINGLE\" AND demographic.diagnosis = \"HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\\CARDIAC CATH\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose marital status is single and primary disease is hypertension;rule out coronary artery disease\\cardiac cath? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = \"SINGLE\" AND demographic.diagnosis = \"HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\\CARDIAC CATH\""} {"instruction":"Can ORALPATH 696 be used for ULCS ?","input":"CREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)","response":"SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'ORALPATH' AND course.number = 696 AND program_course.category LIKE '%ULCS%'","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can ORALPATH 696 be used for ULCS ? ### Input: CREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n) ### Response: SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'ORALPATH' AND course.number = 696 AND program_course.category LIKE '%ULCS%'"} {"instruction":"How many U.S. viewers (million) are there for the episode whose Production code is 3T7051?","input":"CREATE TABLE table_13183076_3 (\n us_viewers__million_ VARCHAR,\n production_code VARCHAR\n)","response":"SELECT us_viewers__million_ FROM table_13183076_3 WHERE production_code = \"3T7051\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many U.S. viewers (million) are there for the episode whose Production code is 3T7051? ### Input: CREATE TABLE table_13183076_3 (\n us_viewers__million_ VARCHAR,\n production_code VARCHAR\n) ### Response: SELECT us_viewers__million_ FROM table_13183076_3 WHERE production_code = \"3T7051\""} {"instruction":"Which Investing Dragon(s) belong to Episode 9 with the Entrepreneur Ashley Sayed?","input":"CREATE TABLE table_71894 (\n \"Episode\" text,\n \"First aired\" text,\n \"Entrepreneur(s)\" text,\n \"Company or product name\" text,\n \"Money requested (\\u00a3)\" text,\n \"Investing Dragon(s)\" text\n)","response":"SELECT \"Investing Dragon(s)\" FROM table_71894 WHERE \"Episode\" = 'episode 9' AND \"Entrepreneur(s)\" = 'ashley sayed'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Investing Dragon(s) belong to Episode 9 with the Entrepreneur Ashley Sayed? ### Input: CREATE TABLE table_71894 (\n \"Episode\" text,\n \"First aired\" text,\n \"Entrepreneur(s)\" text,\n \"Company or product name\" text,\n \"Money requested (\\u00a3)\" text,\n \"Investing Dragon(s)\" text\n) ### Response: SELECT \"Investing Dragon(s)\" FROM table_71894 WHERE \"Episode\" = 'episode 9' AND \"Entrepreneur(s)\" = 'ashley sayed'"} {"instruction":"Which advisors are advising more than 2 students?","input":"CREATE TABLE voting_record (\n stuid number,\n registration_date text,\n election_cycle text,\n president_vote number,\n vice_president_vote number,\n secretary_vote number,\n treasurer_vote number,\n class_president_vote number,\n class_senator_vote number\n)\n\nCREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n)","response":"SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which advisors are advising more than 2 students? ### Input: CREATE TABLE voting_record (\n stuid number,\n registration_date text,\n election_cycle text,\n president_vote number,\n vice_president_vote number,\n secretary_vote number,\n treasurer_vote number,\n class_president_vote number,\n class_senator_vote number\n)\n\nCREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n) ### Response: SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2"} {"instruction":"What was willie wood's to par?","input":"CREATE TABLE table_name_15 (\n to_par VARCHAR,\n player VARCHAR\n)","response":"SELECT to_par FROM table_name_15 WHERE player = \"willie wood\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was willie wood's to par? ### Input: CREATE TABLE table_name_15 (\n to_par VARCHAR,\n player VARCHAR\n) ### Response: SELECT to_par FROM table_name_15 WHERE player = \"willie wood\""} {"instruction":"tell me the top five most common diagnoses of patients with an age of 20s until 2104?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the top five most common diagnoses of patients with an age of 20s until 2104? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5"} {"instruction":"Name the end date for robert goebbels","input":"CREATE TABLE table_14845 (\n \"Minister\" text,\n \"Party\" text,\n \"Start date\" text,\n \"End date\" text,\n \"Prime Minister\" text\n)","response":"SELECT \"End date\" FROM table_14845 WHERE \"Minister\" = 'robert goebbels'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the end date for robert goebbels ### Input: CREATE TABLE table_14845 (\n \"Minister\" text,\n \"Party\" text,\n \"Start date\" text,\n \"End date\" text,\n \"Prime Minister\" text\n) ### Response: SELECT \"End date\" FROM table_14845 WHERE \"Minister\" = 'robert goebbels'"} {"instruction":"Give me a scatter chart to show the star rating of the movie and reviewer id, group the title.","input":"CREATE TABLE Reviewer (\n rID int,\n name text\n)\n\nCREATE TABLE Rating (\n rID int,\n mID int,\n stars int,\n ratingDate date\n)\n\nCREATE TABLE Movie (\n mID int,\n title text,\n year int,\n director text\n)","response":"SELECT rID, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a scatter chart to show the star rating of the movie and reviewer id, group the title. ### Input: CREATE TABLE Reviewer (\n rID int,\n name text\n)\n\nCREATE TABLE Rating (\n rID int,\n mID int,\n stars int,\n ratingDate date\n)\n\nCREATE TABLE Movie (\n mID int,\n title text,\n year int,\n director text\n) ### Response: SELECT rID, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title"} {"instruction":"What's the production code of the episode titled 'He ain't a hottie, he's my brother'?","input":"CREATE TABLE table_1806 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Prod. code\" text,\n \"Viewers (millions)\" text\n)","response":"SELECT \"Prod. code\" FROM table_1806 WHERE \"Title\" = 'He Ain''t a Hottie, He''s My Brother'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the production code of the episode titled 'He ain't a hottie, he's my brother'? ### Input: CREATE TABLE table_1806 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Prod. code\" text,\n \"Viewers (millions)\" text\n) ### Response: SELECT \"Prod. code\" FROM table_1806 WHERE \"Title\" = 'He Ain''t a Hottie, He''s My Brother'"} {"instruction":"Give me a bar chart for how many name of each name, and order by the names in ascending.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart for how many name of each name, and order by the names in ascending. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name"} {"instruction":"What is the home team score that played away team carlton?","input":"CREATE TABLE table_name_60 (\n home_team VARCHAR,\n away_team VARCHAR\n)","response":"SELECT home_team AS score FROM table_name_60 WHERE away_team = \"carlton\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the home team score that played away team carlton? ### Input: CREATE TABLE table_name_60 (\n home_team VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT home_team AS score FROM table_name_60 WHERE away_team = \"carlton\""} {"instruction":"who received more votes , duncan hunter or alan keyes ?","input":"CREATE TABLE table_204_951 (\n id number,\n \"candidate\" text,\n \"votes\" number,\n \"percentage\" text,\n \"counties\" number,\n \"delegates\" number\n)","response":"SELECT \"candidate\" FROM table_204_951 WHERE \"candidate\" IN ('duncan hunter', 'alan keyes') ORDER BY \"votes\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who received more votes , duncan hunter or alan keyes ? ### Input: CREATE TABLE table_204_951 (\n id number,\n \"candidate\" text,\n \"votes\" number,\n \"percentage\" text,\n \"counties\" number,\n \"delegates\" number\n) ### Response: SELECT \"candidate\" FROM table_204_951 WHERE \"candidate\" IN ('duncan hunter', 'alan keyes') ORDER BY \"votes\" DESC LIMIT 1"} {"instruction":"Count the number of patients on a sulfameth\/trimethoprim ds prescription who were hospitalized for more than 17 days.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > \"17\" AND prescriptions.drug = \"Sulfameth\/Trimethoprim DS\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of patients on a sulfameth\/trimethoprim ds prescription who were hospitalized for more than 17 days. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > \"17\" AND prescriptions.drug = \"Sulfameth\/Trimethoprim DS\""} {"instruction":"What is the sum of Game on february 28?","input":"CREATE TABLE table_5067 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT SUM(\"Game\") FROM table_5067 WHERE \"Date\" = 'february 28'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Game on february 28? ### Input: CREATE TABLE table_5067 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT SUM(\"Game\") FROM table_5067 WHERE \"Date\" = 'february 28'"} {"instruction":"What type of game had a result of 1:2?","input":"CREATE TABLE table_name_7 (\n type_of_game VARCHAR,\n results\u00b9 VARCHAR\n)","response":"SELECT type_of_game FROM table_name_7 WHERE results\u00b9 = \"1:2\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of game had a result of 1:2? ### Input: CREATE TABLE table_name_7 (\n type_of_game VARCHAR,\n results\u00b9 VARCHAR\n) ### Response: SELECT type_of_game FROM table_name_7 WHERE results\u00b9 = \"1:2\""} {"instruction":"Top 50 users from UAE.","input":"CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)","response":"SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS \"#\", Id AS \"user_link\", Reputation FROM Users WHERE LOWER(Location) LIKE '%united arab emirates%' ORDER BY Reputation DESC LIMIT 150","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 50 users from UAE. ### Input: CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS \"#\", Id AS \"user_link\", Reputation FROM Users WHERE LOWER(Location) LIKE '%united arab emirates%' ORDER BY Reputation DESC LIMIT 150"} {"instruction":"tell me the name of the drug to which patient 007-849 was allergic in this hospital encounter?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)","response":"SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL))","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the name of the drug to which patient 007-849 was allergic in this hospital encounter? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n) ### Response: SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL))"} {"instruction":"What place is South Africa?","input":"CREATE TABLE table_44277 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" real\n)","response":"SELECT \"Place\" FROM table_44277 WHERE \"Country\" = 'south africa'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What place is South Africa? ### Input: CREATE TABLE table_44277 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" real\n) ### Response: SELECT \"Place\" FROM table_44277 WHERE \"Country\" = 'south africa'"} {"instruction":"What Date has a Result of l 21 34?","input":"CREATE TABLE table_name_31 (\n date VARCHAR,\n result VARCHAR\n)","response":"SELECT date FROM table_name_31 WHERE result = \"l 21\u201334\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Date has a Result of l 21 34? ### Input: CREATE TABLE table_name_31 (\n date VARCHAR,\n result VARCHAR\n) ### Response: SELECT date FROM table_name_31 WHERE result = \"l 21\u201334\""} {"instruction":"What is the largest lost stat when the difference is - 19?","input":"CREATE TABLE table_7372 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Against\" real,\n \"Difference\" text\n)","response":"SELECT MAX(\"Lost\") FROM table_7372 WHERE \"Difference\" = '- 19'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest lost stat when the difference is - 19? ### Input: CREATE TABLE table_7372 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Against\" real,\n \"Difference\" text\n) ### Response: SELECT MAX(\"Lost\") FROM table_7372 WHERE \"Difference\" = '- 19'"} {"instruction":"Tell me the constructor for grid of 17","input":"CREATE TABLE table_name_9 (\n constructor VARCHAR,\n grid VARCHAR\n)","response":"SELECT constructor FROM table_name_9 WHERE grid = 17","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the constructor for grid of 17 ### Input: CREATE TABLE table_name_9 (\n constructor VARCHAR,\n grid VARCHAR\n) ### Response: SELECT constructor FROM table_name_9 WHERE grid = 17"} {"instruction":"How big was the crowd of the Home team of Collingwood?","input":"CREATE TABLE table_name_92 (\n crowd INTEGER,\n home_team VARCHAR\n)","response":"SELECT MAX(crowd) FROM table_name_92 WHERE home_team = \"collingwood\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How big was the crowd of the Home team of Collingwood? ### Input: CREATE TABLE table_name_92 (\n crowd INTEGER,\n home_team VARCHAR\n) ### Response: SELECT MAX(crowd) FROM table_name_92 WHERE home_team = \"collingwood\""} {"instruction":"Who is the leading scorer of the game on 13 February 2008?","input":"CREATE TABLE table_name_52 (\n leading_scorer VARCHAR,\n date VARCHAR\n)","response":"SELECT leading_scorer FROM table_name_52 WHERE date = \"13 february 2008\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the leading scorer of the game on 13 February 2008? ### Input: CREATE TABLE table_name_52 (\n leading_scorer VARCHAR,\n date VARCHAR\n) ### Response: SELECT leading_scorer FROM table_name_52 WHERE date = \"13 february 2008\""} {"instruction":"count the number of patients whose primary disease is morbid obesity\/sda and year of death is less than or equal to 2183?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"MORBID OBESITY\/SDA\" AND demographic.dod_year <= \"2183.0\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose primary disease is morbid obesity\/sda and year of death is less than or equal to 2183? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"MORBID OBESITY\/SDA\" AND demographic.dod_year <= \"2183.0\""} {"instruction":"What is the highest laps of the year when the rank was 14?","input":"CREATE TABLE table_68142 (\n \"Year\" text,\n \"Start\" text,\n \"Qual\" text,\n \"Rank\" text,\n \"Finish\" text,\n \"Laps\" real\n)","response":"SELECT MAX(\"Laps\") FROM table_68142 WHERE \"Rank\" = '14'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest laps of the year when the rank was 14? ### Input: CREATE TABLE table_68142 (\n \"Year\" text,\n \"Start\" text,\n \"Qual\" text,\n \"Rank\" text,\n \"Finish\" text,\n \"Laps\" real\n) ### Response: SELECT MAX(\"Laps\") FROM table_68142 WHERE \"Rank\" = '14'"} {"instruction":"What day had a time of 29.816?","input":"CREATE TABLE table_53907 (\n \"Record\" text,\n \"Year\" text,\n \"Date\" text,\n \"Driver\" text,\n \"Car Make\" text,\n \"Time\" text,\n \"Average Speed (mph)\" text\n)","response":"SELECT \"Date\" FROM table_53907 WHERE \"Time\" = '29.816'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What day had a time of 29.816? ### Input: CREATE TABLE table_53907 (\n \"Record\" text,\n \"Year\" text,\n \"Date\" text,\n \"Driver\" text,\n \"Car Make\" text,\n \"Time\" text,\n \"Average Speed (mph)\" text\n) ### Response: SELECT \"Date\" FROM table_53907 WHERE \"Time\" = '29.816'"} {"instruction":"What series episode has deli meats under segment B?","input":"CREATE TABLE table_name_98 (\n series_ep VARCHAR,\n segment_b VARCHAR\n)","response":"SELECT series_ep FROM table_name_98 WHERE segment_b = \"deli meats\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What series episode has deli meats under segment B? ### Input: CREATE TABLE table_name_98 (\n series_ep VARCHAR,\n segment_b VARCHAR\n) ### Response: SELECT series_ep FROM table_name_98 WHERE segment_b = \"deli meats\""} {"instruction":"What year was there no competition in Mixed Doubles?","input":"CREATE TABLE table_15773 (\n \"Year\" text,\n \"Men's singles\" text,\n \"Women's singles\" text,\n \"Men's doubles\" text,\n \"Women's doubles\" text,\n \"Mixed doubles\" text\n)","response":"SELECT \"Year\" FROM table_15773 WHERE \"Mixed doubles\" = 'no competition'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was there no competition in Mixed Doubles? ### Input: CREATE TABLE table_15773 (\n \"Year\" text,\n \"Men's singles\" text,\n \"Women's singles\" text,\n \"Men's doubles\" text,\n \"Women's doubles\" text,\n \"Mixed doubles\" text\n) ### Response: SELECT \"Year\" FROM table_15773 WHERE \"Mixed doubles\" = 'no competition'"} {"instruction":"For the game where the away team was North Melbourne, what was the venue?","input":"CREATE TABLE table_33381 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Venue\" FROM table_33381 WHERE \"Away team\" = 'north melbourne'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the game where the away team was North Melbourne, what was the venue? ### Input: CREATE TABLE table_33381 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Venue\" FROM table_33381 WHERE \"Away team\" = 'north melbourne'"} {"instruction":"What was the home team score at Kardinia Park?","input":"CREATE TABLE table_name_43 (\n home_team VARCHAR,\n venue VARCHAR\n)","response":"SELECT home_team AS score FROM table_name_43 WHERE venue = \"kardinia park\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team score at Kardinia Park? ### Input: CREATE TABLE table_name_43 (\n home_team VARCHAR,\n venue VARCHAR\n) ### Response: SELECT home_team AS score FROM table_name_43 WHERE venue = \"kardinia park\""} {"instruction":"What is the most effortless class I can take to satisfy the MDE ?","input":"CREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)","response":"SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the most effortless class I can take to satisfy the MDE ? ### Input: CREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n) ### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')"} {"instruction":"What year was the player with the height 2.04 born?","input":"CREATE TABLE table_12962773_12 (\n year_born INTEGER,\n height VARCHAR\n)","response":"SELECT MIN(year_born) FROM table_12962773_12 WHERE height = \"2.04\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the player with the height 2.04 born? ### Input: CREATE TABLE table_12962773_12 (\n year_born INTEGER,\n height VARCHAR\n) ### Response: SELECT MIN(year_born) FROM table_12962773_12 WHERE height = \"2.04\""} {"instruction":"What number pick was the player with the hometown school of concordia college?","input":"CREATE TABLE table_name_96 (\n pick VARCHAR,\n hometown_school VARCHAR\n)","response":"SELECT pick FROM table_name_96 WHERE hometown_school = \"concordia college\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What number pick was the player with the hometown school of concordia college? ### Input: CREATE TABLE table_name_96 (\n pick VARCHAR,\n hometown_school VARCHAR\n) ### Response: SELECT pick FROM table_name_96 WHERE hometown_school = \"concordia college\""} {"instruction":"Which rank has a more than 0 silver, 4 bronze, and a total smaller than 10?","input":"CREATE TABLE table_name_34 (\n rank INTEGER,\n total VARCHAR,\n silver VARCHAR,\n bronze VARCHAR\n)","response":"SELECT SUM(rank) FROM table_name_34 WHERE silver > 0 AND bronze = 4 AND total < 10","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which rank has a more than 0 silver, 4 bronze, and a total smaller than 10? ### Input: CREATE TABLE table_name_34 (\n rank INTEGER,\n total VARCHAR,\n silver VARCHAR,\n bronze VARCHAR\n) ### Response: SELECT SUM(rank) FROM table_name_34 WHERE silver > 0 AND bronze = 4 AND total < 10"} {"instruction":"Which FCC info has an ERP W of 100 watts?","input":"CREATE TABLE table_75667 (\n \"Call sign\" text,\n \"Frequency MHz\" text,\n \"City of license\" text,\n \"ERP W\" text,\n \"FCC info\" text\n)","response":"SELECT \"FCC info\" FROM table_75667 WHERE \"ERP W\" = '100 watts'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which FCC info has an ERP W of 100 watts? ### Input: CREATE TABLE table_75667 (\n \"Call sign\" text,\n \"Frequency MHz\" text,\n \"City of license\" text,\n \"ERP W\" text,\n \"FCC info\" text\n) ### Response: SELECT \"FCC info\" FROM table_75667 WHERE \"ERP W\" = '100 watts'"} {"instruction":"What position does the saint louis player play?","input":"CREATE TABLE table_name_39 (\n position VARCHAR,\n college VARCHAR\n)","response":"SELECT position FROM table_name_39 WHERE college = \"saint louis\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What position does the saint louis player play? ### Input: CREATE TABLE table_name_39 (\n position VARCHAR,\n college VARCHAR\n) ### Response: SELECT position FROM table_name_39 WHERE college = \"saint louis\""} {"instruction":"Name the total points for 2","input":"CREATE TABLE table_27496841_3 (\n total_points VARCHAR,\n place VARCHAR\n)","response":"SELECT total_points FROM table_27496841_3 WHERE place = 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total points for 2 ### Input: CREATE TABLE table_27496841_3 (\n total_points VARCHAR,\n place VARCHAR\n) ### Response: SELECT total_points FROM table_27496841_3 WHERE place = 2"} {"instruction":"What medal was awarded in the men's freestyle 52 kg?","input":"CREATE TABLE table_35155 (\n \"Medal\" text,\n \"Name\" text,\n \"Games\" text,\n \"Sport\" text,\n \"Event\" text\n)","response":"SELECT \"Medal\" FROM table_35155 WHERE \"Event\" = 'men''s freestyle 52 kg'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What medal was awarded in the men's freestyle 52 kg? ### Input: CREATE TABLE table_35155 (\n \"Medal\" text,\n \"Name\" text,\n \"Games\" text,\n \"Sport\" text,\n \"Event\" text\n) ### Response: SELECT \"Medal\" FROM table_35155 WHERE \"Event\" = 'men''s freestyle 52 kg'"} {"instruction":"When the away team was geelong, what was the away team score?","input":"CREATE TABLE table_10951 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team score\" FROM table_10951 WHERE \"Away team\" = 'geelong'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the away team was geelong, what was the away team score? ### Input: CREATE TABLE table_10951 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team score\" FROM table_10951 WHERE \"Away team\" = 'geelong'"} {"instruction":"Name the number of events for 3031","input":"CREATE TABLE table_26589 (\n \"#\" real,\n \"Player\" text,\n \"Country\" text,\n \"Points\" real,\n \"Reset points\" real,\n \"Events\" real\n)","response":"SELECT COUNT(\"Events\") FROM table_26589 WHERE \"Points\" = '3031'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of events for 3031 ### Input: CREATE TABLE table_26589 (\n \"#\" real,\n \"Player\" text,\n \"Country\" text,\n \"Points\" real,\n \"Reset points\" real,\n \"Events\" real\n) ### Response: SELECT COUNT(\"Events\") FROM table_26589 WHERE \"Points\" = '3031'"} {"instruction":"for how long did the patient id 8323 remain admitted in hospital? also specify death status","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = \"8323\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: for how long did the patient id 8323 remain admitted in hospital? also specify death status ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = \"8323\""} {"instruction":"Which venue had an opponent of Sunderland and a result of a 1-1 draw?","input":"CREATE TABLE table_63248 (\n \"Date\" text,\n \"Opponent\" text,\n \"Venue\" text,\n \"Result\" text,\n \"Attendance\" real\n)","response":"SELECT \"Venue\" FROM table_63248 WHERE \"Opponent\" = 'sunderland' AND \"Result\" = '1-1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue had an opponent of Sunderland and a result of a 1-1 draw? ### Input: CREATE TABLE table_63248 (\n \"Date\" text,\n \"Opponent\" text,\n \"Venue\" text,\n \"Result\" text,\n \"Attendance\" real\n) ### Response: SELECT \"Venue\" FROM table_63248 WHERE \"Opponent\" = 'sunderland' AND \"Result\" = '1-1'"} {"instruction":"name the player for number 5","input":"CREATE TABLE table_26229 (\n \"No\" real,\n \"Player\" text,\n \"Height (m)\" text,\n \"Height (f)\" text,\n \"Position\" text,\n \"Year born\" real,\n \"Current Club\" text\n)","response":"SELECT \"Player\" FROM table_26229 WHERE \"No\" = '5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: name the player for number 5 ### Input: CREATE TABLE table_26229 (\n \"No\" real,\n \"Player\" text,\n \"Height (m)\" text,\n \"Height (f)\" text,\n \"Position\" text,\n \"Year born\" real,\n \"Current Club\" text\n) ### Response: SELECT \"Player\" FROM table_26229 WHERE \"No\" = '5'"} {"instruction":"What is the country of Palmers Shipbuilding and Iron Company?","input":"CREATE TABLE table_13011 (\n \"Country\" text,\n \"Builder\" text,\n \"Location\" text,\n \"Ship\" text,\n \"Class \/ type\" text\n)","response":"SELECT \"Country\" FROM table_13011 WHERE \"Builder\" = 'palmers shipbuilding and iron company'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country of Palmers Shipbuilding and Iron Company? ### Input: CREATE TABLE table_13011 (\n \"Country\" text,\n \"Builder\" text,\n \"Location\" text,\n \"Ship\" text,\n \"Class \/ type\" text\n) ### Response: SELECT \"Country\" FROM table_13011 WHERE \"Builder\" = 'palmers shipbuilding and iron company'"} {"instruction":"What is the Pick # with an Overall of 19?","input":"CREATE TABLE table_36615 (\n \"Round\" real,\n \"Pick #\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT MAX(\"Pick #\") FROM table_36615 WHERE \"Overall\" = '19'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Pick # with an Overall of 19? ### Input: CREATE TABLE table_36615 (\n \"Round\" real,\n \"Pick #\" real,\n \"Overall\" real,\n \"Name\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT MAX(\"Pick #\") FROM table_36615 WHERE \"Overall\" = '19'"} {"instruction":"Who is the perpetrator in Bait Al-Aqari?","input":"CREATE TABLE table_12652 (\n \"Perpetrator\" text,\n \"Year\" text,\n \"Location\" text,\n \"Country\" text,\n \"Killed\" text\n)","response":"SELECT \"Perpetrator\" FROM table_12652 WHERE \"Location\" = 'bait al-aqari'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the perpetrator in Bait Al-Aqari? ### Input: CREATE TABLE table_12652 (\n \"Perpetrator\" text,\n \"Year\" text,\n \"Location\" text,\n \"Country\" text,\n \"Killed\" text\n) ### Response: SELECT \"Perpetrator\" FROM table_12652 WHERE \"Location\" = 'bait al-aqari'"} {"instruction":"What's the Uni# of Timms, who has bats of R?","input":"CREATE TABLE table_name_22 (\n uni_number VARCHAR,\n bats VARCHAR,\n surname VARCHAR\n)","response":"SELECT uni_number FROM table_name_22 WHERE bats = \"r\" AND surname = \"timms\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the Uni# of Timms, who has bats of R? ### Input: CREATE TABLE table_name_22 (\n uni_number VARCHAR,\n bats VARCHAR,\n surname VARCHAR\n) ### Response: SELECT uni_number FROM table_name_22 WHERE bats = \"r\" AND surname = \"timms\""} {"instruction":"What is Score, when Place is 'T8', and when Player is 'Orville Moody'?","input":"CREATE TABLE table_name_40 (\n score VARCHAR,\n place VARCHAR,\n player VARCHAR\n)","response":"SELECT score FROM table_name_40 WHERE place = \"t8\" AND player = \"orville moody\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Score, when Place is 'T8', and when Player is 'Orville Moody'? ### Input: CREATE TABLE table_name_40 (\n score VARCHAR,\n place VARCHAR,\n player VARCHAR\n) ### Response: SELECT score FROM table_name_40 WHERE place = \"t8\" AND player = \"orville moody\""} {"instruction":"What are the descriptions for the aircrafts, and count them by a bar chart","input":"CREATE TABLE airport_aircraft (\n ID int,\n Airport_ID int,\n Aircraft_ID int\n)\n\nCREATE TABLE pilot (\n Pilot_Id int(11),\n Name varchar(50),\n Age int(11)\n)\n\nCREATE TABLE match (\n Round real,\n Location text,\n Country text,\n Date text,\n Fastest_Qualifying text,\n Winning_Pilot text,\n Winning_Aircraft text\n)\n\nCREATE TABLE airport (\n Airport_ID int,\n Airport_Name text,\n Total_Passengers real,\n %_Change_2007 text,\n International_Passengers real,\n Domestic_Passengers real,\n Transit_Passengers real,\n Aircraft_Movements real,\n Freight_Metric_Tonnes real\n)\n\nCREATE TABLE aircraft (\n Aircraft_ID int(11),\n Aircraft varchar(50),\n Description varchar(50),\n Max_Gross_Weight varchar(50),\n Total_disk_area varchar(50),\n Max_disk_Loading varchar(50)\n)","response":"SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the descriptions for the aircrafts, and count them by a bar chart ### Input: CREATE TABLE airport_aircraft (\n ID int,\n Airport_ID int,\n Aircraft_ID int\n)\n\nCREATE TABLE pilot (\n Pilot_Id int(11),\n Name varchar(50),\n Age int(11)\n)\n\nCREATE TABLE match (\n Round real,\n Location text,\n Country text,\n Date text,\n Fastest_Qualifying text,\n Winning_Pilot text,\n Winning_Aircraft text\n)\n\nCREATE TABLE airport (\n Airport_ID int,\n Airport_Name text,\n Total_Passengers real,\n %_Change_2007 text,\n International_Passengers real,\n Domestic_Passengers real,\n Transit_Passengers real,\n Aircraft_Movements real,\n Freight_Metric_Tonnes real\n)\n\nCREATE TABLE aircraft (\n Aircraft_ID int(11),\n Aircraft varchar(50),\n Description varchar(50),\n Max_Gross_Weight varchar(50),\n Total_disk_area varchar(50),\n Max_disk_Loading varchar(50)\n) ### Response: SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description"} {"instruction":"What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois?","input":"CREATE TABLE table_35745 (\n \"Name\" text,\n \"Location\" text,\n \"State\" text,\n \"Opened (closing date if defunct)\" text,\n \"Surface\" text,\n \"Length\" text\n)","response":"SELECT \"Name\" FROM table_35745 WHERE \"Opened (closing date if defunct)\" = '1995' AND \"Length\" = 'miles (m)' AND \"State\" = 'illinois'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois? ### Input: CREATE TABLE table_35745 (\n \"Name\" text,\n \"Location\" text,\n \"State\" text,\n \"Opened (closing date if defunct)\" text,\n \"Surface\" text,\n \"Length\" text\n) ### Response: SELECT \"Name\" FROM table_35745 WHERE \"Opened (closing date if defunct)\" = '1995' AND \"Length\" = 'miles (m)' AND \"State\" = 'illinois'"} {"instruction":"Find the number of patients who were transferred within this facility and were born before the year 2150.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = \"TRSF WITHIN THIS FACILITY\" AND demographic.dob_year < \"2150\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of patients who were transferred within this facility and were born before the year 2150. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = \"TRSF WITHIN THIS FACILITY\" AND demographic.dob_year < \"2150\""} {"instruction":"Name the nation when bronze is less than 4 and the total is more than 4","input":"CREATE TABLE table_name_46 (\n nation VARCHAR,\n total VARCHAR,\n bronze VARCHAR\n)","response":"SELECT nation FROM table_name_46 WHERE total > 4 AND bronze < 4","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the nation when bronze is less than 4 and the total is more than 4 ### Input: CREATE TABLE table_name_46 (\n nation VARCHAR,\n total VARCHAR,\n bronze VARCHAR\n) ### Response: SELECT nation FROM table_name_46 WHERE total > 4 AND bronze < 4"} {"instruction":"On what date was Mike Jackson a handler at the Indianapolis Boat, Sport & Travel Show?","input":"CREATE TABLE table_51074 (\n \"Date\" text,\n \"Distance\" text,\n \"Handler\" text,\n \"Event\" text,\n \"Location\" text\n)","response":"SELECT \"Date\" FROM table_51074 WHERE \"Handler\" = 'mike jackson' AND \"Event\" = 'indianapolis boat, sport & travel show'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date was Mike Jackson a handler at the Indianapolis Boat, Sport & Travel Show? ### Input: CREATE TABLE table_51074 (\n \"Date\" text,\n \"Distance\" text,\n \"Handler\" text,\n \"Event\" text,\n \"Location\" text\n) ### Response: SELECT \"Date\" FROM table_51074 WHERE \"Handler\" = 'mike jackson' AND \"Event\" = 'indianapolis boat, sport & travel show'"} {"instruction":"For the Venue of western oval, what's the Away team playing?","input":"CREATE TABLE table_54575 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team\" FROM table_54575 WHERE \"Venue\" = 'western oval'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the Venue of western oval, what's the Away team playing? ### Input: CREATE TABLE table_54575 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team\" FROM table_54575 WHERE \"Venue\" = 'western oval'"} {"instruction":"what are the top four common diagnoses that patients were diagnosed with within the same hospital visit after having been diagnosed with thrombocytopenia - alcohol-related since 2105?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'thrombocytopenia - alcohol-related' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top four common diagnoses that patients were diagnosed with within the same hospital visit after having been diagnosed with thrombocytopenia - alcohol-related since 2105? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'thrombocytopenia - alcohol-related' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4"} {"instruction":"Name the number of direction for debrecen","input":"CREATE TABLE table_23211 (\n \"Further Cities\" text,\n \"County, Oblast or State\" text,\n \"Country\" text,\n \"Distance\" text,\n \"Direction\" text\n)","response":"SELECT COUNT(\"Direction\") FROM table_23211 WHERE \"Further Cities\" = 'Debrecen'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of direction for debrecen ### Input: CREATE TABLE table_23211 (\n \"Further Cities\" text,\n \"County, Oblast or State\" text,\n \"Country\" text,\n \"Distance\" text,\n \"Direction\" text\n) ### Response: SELECT COUNT(\"Direction\") FROM table_23211 WHERE \"Further Cities\" = 'Debrecen'"} {"instruction":"when does the train departuring at 11.35 arrive","input":"CREATE TABLE table_18333678_2 (\n arrival VARCHAR,\n departure VARCHAR\n)","response":"SELECT arrival FROM table_18333678_2 WHERE departure = \"11.35\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when does the train departuring at 11.35 arrive ### Input: CREATE TABLE table_18333678_2 (\n arrival VARCHAR,\n departure VARCHAR\n) ### Response: SELECT arrival FROM table_18333678_2 WHERE departure = \"11.35\""} {"instruction":"what is the minimum stage where mountains classification is aitor osa and aitor gonz lez won?","input":"CREATE TABLE table_19858 (\n \"Stage\" real,\n \"Winner\" text,\n \"General classification\" text,\n \"Points classification\" text,\n \"Mountains classification\" text,\n \"Combination classification\" text,\n \"Team classification\" text\n)","response":"SELECT MIN(\"Stage\") FROM table_19858 WHERE \"Mountains classification\" = 'Aitor Osa' AND \"Winner\" = 'Aitor Gonz\u00e1lez'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the minimum stage where mountains classification is aitor osa and aitor gonz lez won? ### Input: CREATE TABLE table_19858 (\n \"Stage\" real,\n \"Winner\" text,\n \"General classification\" text,\n \"Points classification\" text,\n \"Mountains classification\" text,\n \"Combination classification\" text,\n \"Team classification\" text\n) ### Response: SELECT MIN(\"Stage\") FROM table_19858 WHERE \"Mountains classification\" = 'Aitor Osa' AND \"Winner\" = 'Aitor Gonz\u00e1lez'"} {"instruction":"What was the time of the games that took place at the cassell coliseum blacksburg, va?","input":"CREATE TABLE table_74398 (\n \"Date\" text,\n \"Time\" text,\n \"ACC Team\" text,\n \"Big Ten Team\" text,\n \"Location\" text,\n \"Television\" text,\n \"Attendance\" real,\n \"Winner\" text,\n \"Challenge Leader\" text\n)","response":"SELECT \"Time\" FROM table_74398 WHERE \"Location\" = 'Cassell Coliseum \u2022 Blacksburg, VA'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the time of the games that took place at the cassell coliseum blacksburg, va? ### Input: CREATE TABLE table_74398 (\n \"Date\" text,\n \"Time\" text,\n \"ACC Team\" text,\n \"Big Ten Team\" text,\n \"Location\" text,\n \"Television\" text,\n \"Attendance\" real,\n \"Winner\" text,\n \"Challenge Leader\" text\n) ### Response: SELECT \"Time\" FROM table_74398 WHERE \"Location\" = 'Cassell Coliseum \u2022 Blacksburg, VA'"} {"instruction":"Who was the writer in the episode directed by Jesse Peretz?","input":"CREATE TABLE table_3683 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (million)\" text\n)","response":"SELECT \"Written by\" FROM table_3683 WHERE \"Directed by\" = 'Jesse Peretz'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the writer in the episode directed by Jesse Peretz? ### Input: CREATE TABLE table_3683 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (million)\" text\n) ### Response: SELECT \"Written by\" FROM table_3683 WHERE \"Directed by\" = 'Jesse Peretz'"} {"instruction":"What time span is listed under years for the 96th congres?","input":"CREATE TABLE table_4022 (\n \"Representative\" text,\n \"Party\" text,\n \"Years\" text,\n \"Congress\" text,\n \"District Home\" text,\n \"Occupation\" text,\n \"Electoral history\" text\n)","response":"SELECT \"Years\" FROM table_4022 WHERE \"Congress\" = '96th'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What time span is listed under years for the 96th congres? ### Input: CREATE TABLE table_4022 (\n \"Representative\" text,\n \"Party\" text,\n \"Years\" text,\n \"Congress\" text,\n \"District Home\" text,\n \"Occupation\" text,\n \"Electoral history\" text\n) ### Response: SELECT \"Years\" FROM table_4022 WHERE \"Congress\" = '96th'"} {"instruction":"compared to last measured on the first hospital visit is chloride of patient 97121 less than second to last measured on the first hospital visit?","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)","response":"SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1) < (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1 OFFSET 1)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: compared to last measured on the first hospital visit is chloride of patient 97121 less than second to last measured on the first hospital visit? ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n) ### Response: SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1) < (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') ORDER BY labevents.charttime DESC LIMIT 1 OFFSET 1)"} {"instruction":"how many patients stayed in hospital for more than 34 days and were procedured with icd9 code 3931?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > \"34\" AND procedures.icd9_code = \"3931\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients stayed in hospital for more than 34 days and were procedured with icd9 code 3931? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > \"34\" AND procedures.icd9_code = \"3931\""} {"instruction":"Take the average of the school enrollment.","input":"CREATE TABLE school_details (\n school_id number,\n nickname text,\n colors text,\n league text,\n class text,\n division text\n)\n\nCREATE TABLE school (\n school_id number,\n school text,\n location text,\n enrollment number,\n founded number,\n denomination text,\n boys_or_girls text,\n day_or_boarding text,\n year_entered_competition number,\n school_colors text\n)\n\nCREATE TABLE player (\n player_id number,\n player text,\n team text,\n age number,\n position text,\n school_id number\n)\n\nCREATE TABLE school_performance (\n school_id number,\n school_year text,\n class_a text,\n class_aa text\n)","response":"SELECT AVG(enrollment) FROM school","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Take the average of the school enrollment. ### Input: CREATE TABLE school_details (\n school_id number,\n nickname text,\n colors text,\n league text,\n class text,\n division text\n)\n\nCREATE TABLE school (\n school_id number,\n school text,\n location text,\n enrollment number,\n founded number,\n denomination text,\n boys_or_girls text,\n day_or_boarding text,\n year_entered_competition number,\n school_colors text\n)\n\nCREATE TABLE player (\n player_id number,\n player text,\n team text,\n age number,\n position text,\n school_id number\n)\n\nCREATE TABLE school_performance (\n school_id number,\n school_year text,\n class_a text,\n class_aa text\n) ### Response: SELECT AVG(enrollment) FROM school"} {"instruction":"what was patient 025-44495's first sputum, tracheal specimen microbiology test time since 09\/2105.","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2105-09' ORDER BY microlab.culturetakentime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 025-44495's first sputum, tracheal specimen microbiology test time since 09\/2105. ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2105-09' ORDER BY microlab.culturetakentime LIMIT 1"} {"instruction":"Which home team played against the away team Carlton?","input":"CREATE TABLE table_56902 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team\" FROM table_56902 WHERE \"Away team\" = 'carlton'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which home team played against the away team Carlton? ### Input: CREATE TABLE table_56902 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team\" FROM table_56902 WHERE \"Away team\" = 'carlton'"} {"instruction":"What TV network is the series aistr em aired on?","input":"CREATE TABLE table_name_21 (\n tv_network_s_ VARCHAR,\n alternate_title_translation VARCHAR\n)","response":"SELECT tv_network_s_ FROM table_name_21 WHERE alternate_title_translation = \"aistr\u0173 \u017eem\u0117\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What TV network is the series aistr em aired on? ### Input: CREATE TABLE table_name_21 (\n tv_network_s_ VARCHAR,\n alternate_title_translation VARCHAR\n) ### Response: SELECT tv_network_s_ FROM table_name_21 WHERE alternate_title_translation = \"aistr\u0173 \u017eem\u0117\""} {"instruction":"what is november 3 when june 10-11 is june 10, 1964?","input":"CREATE TABLE table_25355392_2 (\n november_3 VARCHAR,\n june_10_11 VARCHAR\n)","response":"SELECT november_3 FROM table_25355392_2 WHERE june_10_11 = \"June 10, 1964\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is november 3 when june 10-11 is june 10, 1964? ### Input: CREATE TABLE table_25355392_2 (\n november_3 VARCHAR,\n june_10_11 VARCHAR\n) ### Response: SELECT november_3 FROM table_25355392_2 WHERE june_10_11 = \"June 10, 1964\""} {"instruction":"when did patient 027-149724 get for the last time a lab test since 29 months ago?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-29 month') ORDER BY lab.labresulttime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 027-149724 get for the last time a lab test since 29 months ago? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-29 month') ORDER BY lab.labresulttime DESC LIMIT 1"} {"instruction":"What is the title for the Korean progran on KBS2?","input":"CREATE TABLE table_47993 (\n \"Year\" real,\n \"Network\" text,\n \"Title\" text,\n \"Notes\" text,\n \"Language\" text\n)","response":"SELECT \"Title\" FROM table_47993 WHERE \"Language\" = 'korean' AND \"Network\" = 'kbs2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title for the Korean progran on KBS2? ### Input: CREATE TABLE table_47993 (\n \"Year\" real,\n \"Network\" text,\n \"Title\" text,\n \"Notes\" text,\n \"Language\" text\n) ### Response: SELECT \"Title\" FROM table_47993 WHERE \"Language\" = 'korean' AND \"Network\" = 'kbs2'"} {"instruction":"Who is the professional partner of celebrity ma gorzata foremniak with a season less than 7, an average greater than 34.66, and a rank less than 10?","input":"CREATE TABLE table_name_52 (\n professional_partner VARCHAR,\n celebrity VARCHAR,\n rank VARCHAR,\n season VARCHAR,\n average VARCHAR\n)","response":"SELECT professional_partner FROM table_name_52 WHERE season < 7 AND average > 34.66 AND rank < 10 AND celebrity = \"ma\u0142gorzata foremniak\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the professional partner of celebrity ma gorzata foremniak with a season less than 7, an average greater than 34.66, and a rank less than 10? ### Input: CREATE TABLE table_name_52 (\n professional_partner VARCHAR,\n celebrity VARCHAR,\n rank VARCHAR,\n season VARCHAR,\n average VARCHAR\n) ### Response: SELECT professional_partner FROM table_name_52 WHERE season < 7 AND average > 34.66 AND rank < 10 AND celebrity = \"ma\u0142gorzata foremniak\""} {"instruction":"Bin the hire date of employees into the day of week interval and count them for visualizing a bar chart, and rank in asc by the total number.","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees ORDER BY COUNT(HIRE_DATE)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bin the hire date of employees into the day of week interval and count them for visualizing a bar chart, and rank in asc by the total number. ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees ORDER BY COUNT(HIRE_DATE)"} {"instruction":"Which Result has a Score of 4-1, and a Competition of world cup qualifying?","input":"CREATE TABLE table_34793 (\n \"Date\" text,\n \"Result\" text,\n \"Score\" text,\n \"Brazil scorers\" text,\n \"Competition\" text\n)","response":"SELECT \"Result\" FROM table_34793 WHERE \"Score\" = '4-1' AND \"Competition\" = 'world cup qualifying'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Result has a Score of 4-1, and a Competition of world cup qualifying? ### Input: CREATE TABLE table_34793 (\n \"Date\" text,\n \"Result\" text,\n \"Score\" text,\n \"Brazil scorers\" text,\n \"Competition\" text\n) ### Response: SELECT \"Result\" FROM table_34793 WHERE \"Score\" = '4-1' AND \"Competition\" = 'world cup qualifying'"} {"instruction":"now i need flight information leaving ATLANTA and arriving in BALTIMORE in the afternoon","input":"CREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 1200 AND 1800","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: now i need flight information leaving ATLANTA and arriving in BALTIMORE in the afternoon ### Input: CREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 1200 AND 1800"} {"instruction":"What was the To par of Jack Nicklaus?","input":"CREATE TABLE table_45304 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" text\n)","response":"SELECT \"To par\" FROM table_45304 WHERE \"Player\" = 'jack nicklaus'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the To par of Jack Nicklaus? ### Input: CREATE TABLE table_45304 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" text\n) ### Response: SELECT \"To par\" FROM table_45304 WHERE \"Player\" = 'jack nicklaus'"} {"instruction":"what is the most draw when the competition is soviet league and dynamo is more than 34?","input":"CREATE TABLE table_name_19 (\n draw INTEGER,\n competition VARCHAR,\n dynamo VARCHAR\n)","response":"SELECT MAX(draw) FROM table_name_19 WHERE competition = \"soviet league\" AND dynamo > 34","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the most draw when the competition is soviet league and dynamo is more than 34? ### Input: CREATE TABLE table_name_19 (\n draw INTEGER,\n competition VARCHAR,\n dynamo VARCHAR\n) ### Response: SELECT MAX(draw) FROM table_name_19 WHERE competition = \"soviet league\" AND dynamo > 34"} {"instruction":"COunt the Founded which has a Venue of villa park?","input":"CREATE TABLE table_8187 (\n \"Club\" text,\n \"Sport\" text,\n \"Founded\" real,\n \"League\" text,\n \"Venue\" text\n)","response":"SELECT SUM(\"Founded\") FROM table_8187 WHERE \"Venue\" = 'villa park'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: COunt the Founded which has a Venue of villa park? ### Input: CREATE TABLE table_8187 (\n \"Club\" text,\n \"Sport\" text,\n \"Founded\" real,\n \"League\" text,\n \"Venue\" text\n) ### Response: SELECT SUM(\"Founded\") FROM table_8187 WHERE \"Venue\" = 'villa park'"} {"instruction":"In Ghent in 2011, what was the rank-qualifying value when the score-qualifying value was 14.850","input":"CREATE TABLE table_26681728_1 (\n rank_qualifying INTEGER,\n score_qualifying VARCHAR,\n location VARCHAR,\n year VARCHAR\n)","response":"SELECT MAX(rank_qualifying) FROM table_26681728_1 WHERE location = \"Ghent\" AND year = 2011 AND score_qualifying = \"14.850\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In Ghent in 2011, what was the rank-qualifying value when the score-qualifying value was 14.850 ### Input: CREATE TABLE table_26681728_1 (\n rank_qualifying INTEGER,\n score_qualifying VARCHAR,\n location VARCHAR,\n year VARCHAR\n) ### Response: SELECT MAX(rank_qualifying) FROM table_26681728_1 WHERE location = \"Ghent\" AND year = 2011 AND score_qualifying = \"14.850\""} {"instruction":"Find the details for all chip models.","input":"CREATE TABLE screen_mode (\n graphics_mode number,\n char_cells text,\n pixels text,\n hardware_colours number,\n used_kb number,\n map text,\n type text\n)\n\nCREATE TABLE phone (\n company_name text,\n hardware_model_name text,\n accreditation_type text,\n accreditation_level text,\n date text,\n chip_model text,\n screen_mode text\n)\n\nCREATE TABLE chip_model (\n model_name text,\n launch_year number,\n ram_mib number,\n rom_mib number,\n slots text,\n wifi text,\n bluetooth text\n)","response":"SELECT * FROM chip_model","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the details for all chip models. ### Input: CREATE TABLE screen_mode (\n graphics_mode number,\n char_cells text,\n pixels text,\n hardware_colours number,\n used_kb number,\n map text,\n type text\n)\n\nCREATE TABLE phone (\n company_name text,\n hardware_model_name text,\n accreditation_type text,\n accreditation_level text,\n date text,\n chip_model text,\n screen_mode text\n)\n\nCREATE TABLE chip_model (\n model_name text,\n launch_year number,\n ram_mib number,\n rom_mib number,\n slots text,\n wifi text,\n bluetooth text\n) ### Response: SELECT * FROM chip_model"} {"instruction":"Show the number of documents created in each day and bin document date by weekday with a bar chart, and I want to show by the the number of document date in ascending please.","input":"CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Accounts (\n Account_ID INTEGER,\n Statement_ID INTEGER,\n Account_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Budget_Codes (\n Budget_Type_Code CHAR(15),\n Budget_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n Project_ID INTEGER,\n Project_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents_with_Expenses (\n Document_ID INTEGER,\n Budget_Type_Code CHAR(15),\n Document_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents (\n Document_ID INTEGER,\n Document_Type_Code CHAR(15),\n Project_ID INTEGER,\n Document_Date DATETIME,\n Document_Name VARCHAR(255),\n Document_Description VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Statements (\n Statement_ID INTEGER,\n Statement_Details VARCHAR(255)\n)","response":"SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY COUNT(Document_Date)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of documents created in each day and bin document date by weekday with a bar chart, and I want to show by the the number of document date in ascending please. ### Input: CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Accounts (\n Account_ID INTEGER,\n Statement_ID INTEGER,\n Account_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Budget_Codes (\n Budget_Type_Code CHAR(15),\n Budget_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n Project_ID INTEGER,\n Project_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents_with_Expenses (\n Document_ID INTEGER,\n Budget_Type_Code CHAR(15),\n Document_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents (\n Document_ID INTEGER,\n Document_Type_Code CHAR(15),\n Project_ID INTEGER,\n Document_Date DATETIME,\n Document_Name VARCHAR(255),\n Document_Description VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Statements (\n Statement_ID INTEGER,\n Statement_Details VARCHAR(255)\n) ### Response: SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY COUNT(Document_Date)"} {"instruction":"what is the number of patients whose days of hospital stay is greater than 15 and diagnoses short title is respiratory distress syn?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > \"15\" AND diagnoses.short_title = \"Respiratory distress syn\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose days of hospital stay is greater than 15 and diagnoses short title is respiratory distress syn? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > \"15\" AND diagnoses.short_title = \"Respiratory distress syn\""} {"instruction":"How many million U.S. viewers watched episode number 6 in the series?","input":"CREATE TABLE table_25668962_1 (\n us_viewers__million_ VARCHAR,\n no_in_series VARCHAR\n)","response":"SELECT us_viewers__million_ FROM table_25668962_1 WHERE no_in_series = 6","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many million U.S. viewers watched episode number 6 in the series? ### Input: CREATE TABLE table_25668962_1 (\n us_viewers__million_ VARCHAR,\n no_in_series VARCHAR\n) ### Response: SELECT us_viewers__million_ FROM table_25668962_1 WHERE no_in_series = 6"} {"instruction":"Which Game is the highest one that has High rebounds of pau gasol (11)?","input":"CREATE TABLE table_name_12 (\n game INTEGER,\n high_rebounds VARCHAR\n)","response":"SELECT MAX(game) FROM table_name_12 WHERE high_rebounds = \"pau gasol (11)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Game is the highest one that has High rebounds of pau gasol (11)? ### Input: CREATE TABLE table_name_12 (\n game INTEGER,\n high_rebounds VARCHAR\n) ### Response: SELECT MAX(game) FROM table_name_12 WHERE high_rebounds = \"pau gasol (11)\""} {"instruction":"What was the second qualification time with a first qualification time of 1:02.813?","input":"CREATE TABLE table_name_29 (\n qual_2 VARCHAR,\n qual_1 VARCHAR\n)","response":"SELECT qual_2 FROM table_name_29 WHERE qual_1 = \"1:02.813\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the second qualification time with a first qualification time of 1:02.813? ### Input: CREATE TABLE table_name_29 (\n qual_2 VARCHAR,\n qual_1 VARCHAR\n) ### Response: SELECT qual_2 FROM table_name_29 WHERE qual_1 = \"1:02.813\""} {"instruction":"What position was the player who was drafted by the Washington Capitals?","input":"CREATE TABLE table_2850912_10 (\n position VARCHAR,\n nhl_team VARCHAR\n)","response":"SELECT position FROM table_2850912_10 WHERE nhl_team = \"Washington Capitals\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What position was the player who was drafted by the Washington Capitals? ### Input: CREATE TABLE table_2850912_10 (\n position VARCHAR,\n nhl_team VARCHAR\n) ### Response: SELECT position FROM table_2850912_10 WHERE nhl_team = \"Washington Capitals\""} {"instruction":"For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and I want to sort by the y-axis in desc.","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and I want to sort by the y-axis in desc. ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC"} {"instruction":"Name the literature for pradit prasarttong","input":"CREATE TABLE table_67645 (\n \"Year\" real,\n \"Literature\" text,\n \"Music\" text,\n \"Film\" text,\n \"Performing arts\" text\n)","response":"SELECT \"Literature\" FROM table_67645 WHERE \"Performing arts\" = 'pradit prasarttong'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the literature for pradit prasarttong ### Input: CREATE TABLE table_67645 (\n \"Year\" real,\n \"Literature\" text,\n \"Music\" text,\n \"Film\" text,\n \"Performing arts\" text\n) ### Response: SELECT \"Literature\" FROM table_67645 WHERE \"Performing arts\" = 'pradit prasarttong'"} {"instruction":"What is the years coached by the person with a win percentage of 0.667 and 380 losses?","input":"CREATE TABLE table_34993 (\n \"Name\" text,\n \"Years\" text,\n \"Seasons\" real,\n \"Lost\" real,\n \"Pct.\" real\n)","response":"SELECT \"Years\" FROM table_34993 WHERE \"Pct.\" = '0.667' AND \"Lost\" = '380'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the years coached by the person with a win percentage of 0.667 and 380 losses? ### Input: CREATE TABLE table_34993 (\n \"Name\" text,\n \"Years\" text,\n \"Seasons\" real,\n \"Lost\" real,\n \"Pct.\" real\n) ### Response: SELECT \"Years\" FROM table_34993 WHERE \"Pct.\" = '0.667' AND \"Lost\" = '380'"} {"instruction":"which project had greatest number of platforms ?","input":"CREATE TABLE table_204_398 (\n id number,\n \"title\" text,\n \"year\" number,\n \"publisher\" text,\n \"developer\" text,\n \"platforms\" text\n)","response":"SELECT \"title\" FROM table_204_398 ORDER BY \"platforms\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which project had greatest number of platforms ? ### Input: CREATE TABLE table_204_398 (\n id number,\n \"title\" text,\n \"year\" number,\n \"publisher\" text,\n \"developer\" text,\n \"platforms\" text\n) ### Response: SELECT \"title\" FROM table_204_398 ORDER BY \"platforms\" DESC LIMIT 1"} {"instruction":"provide the number of patients whose insurance is government and procedure icd9 code is 92?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Government\" AND procedures.icd9_code = \"92\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose insurance is government and procedure icd9 code is 92? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Government\" AND procedures.icd9_code = \"92\""} {"instruction":"What is College of Ohio State's pick number with an overall lower than 145?","input":"CREATE TABLE table_name_42 (\n pick__number VARCHAR,\n overall VARCHAR,\n college VARCHAR\n)","response":"SELECT pick__number FROM table_name_42 WHERE overall < 145 AND college = \"ohio state\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is College of Ohio State's pick number with an overall lower than 145? ### Input: CREATE TABLE table_name_42 (\n pick__number VARCHAR,\n overall VARCHAR,\n college VARCHAR\n) ### Response: SELECT pick__number FROM table_name_42 WHERE overall < 145 AND college = \"ohio state\""} {"instruction":"What was the date when the opponent was Sheffield Scimitars and the venue was Home?","input":"CREATE TABLE table_name_4 (\n date VARCHAR,\n opponent VARCHAR,\n venue VARCHAR\n)","response":"SELECT date FROM table_name_4 WHERE opponent = \"sheffield scimitars\" AND venue = \"home\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date when the opponent was Sheffield Scimitars and the venue was Home? ### Input: CREATE TABLE table_name_4 (\n date VARCHAR,\n opponent VARCHAR,\n venue VARCHAR\n) ### Response: SELECT date FROM table_name_4 WHERE opponent = \"sheffield scimitars\" AND venue = \"home\""} {"instruction":"Which Rank has a Silver of 1, and a Gold of 0, and a Nation of austria?","input":"CREATE TABLE table_65989 (\n \"Rank\" text,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT \"Rank\" FROM table_65989 WHERE \"Silver\" = '1' AND \"Gold\" = '0' AND \"Nation\" = 'austria'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Rank has a Silver of 1, and a Gold of 0, and a Nation of austria? ### Input: CREATE TABLE table_65989 (\n \"Rank\" text,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT \"Rank\" FROM table_65989 WHERE \"Silver\" = '1' AND \"Gold\" = '0' AND \"Nation\" = 'austria'"} {"instruction":"What is the highest amount of points for rank 95?","input":"CREATE TABLE table_name_49 (\n highest_point VARCHAR,\n rank VARCHAR\n)","response":"SELECT highest_point FROM table_name_49 WHERE rank = 95","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest amount of points for rank 95? ### Input: CREATE TABLE table_name_49 (\n highest_point VARCHAR,\n rank VARCHAR\n) ### Response: SELECT highest_point FROM table_name_49 WHERE rank = 95"} {"instruction":"Show the customer name, customer address city, date from, and date to for each customer address history.","input":"CREATE TABLE order_items (\n order_item_id number,\n order_id number,\n product_id number,\n order_quantity text\n)\n\nCREATE TABLE customers (\n customer_id number,\n payment_method_code text,\n customer_number text,\n customer_name text,\n customer_address text,\n customer_phone text,\n customer_email text\n)\n\nCREATE TABLE customer_address_history (\n customer_id number,\n address_id number,\n date_from time,\n date_to time\n)\n\nCREATE TABLE customer_orders (\n order_id number,\n customer_id number,\n order_date time,\n order_status_code text\n)\n\nCREATE TABLE addresses (\n address_id number,\n line_1_number_building text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE products (\n product_id number,\n product_type_code text,\n product_name text,\n product_price number\n)\n\nCREATE TABLE contacts (\n contact_id number,\n customer_id number,\n gender text,\n first_name text,\n last_name text,\n contact_phone text\n)","response":"SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the customer name, customer address city, date from, and date to for each customer address history. ### Input: CREATE TABLE order_items (\n order_item_id number,\n order_id number,\n product_id number,\n order_quantity text\n)\n\nCREATE TABLE customers (\n customer_id number,\n payment_method_code text,\n customer_number text,\n customer_name text,\n customer_address text,\n customer_phone text,\n customer_email text\n)\n\nCREATE TABLE customer_address_history (\n customer_id number,\n address_id number,\n date_from time,\n date_to time\n)\n\nCREATE TABLE customer_orders (\n order_id number,\n customer_id number,\n order_date time,\n order_status_code text\n)\n\nCREATE TABLE addresses (\n address_id number,\n line_1_number_building text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE products (\n product_id number,\n product_type_code text,\n product_name text,\n product_price number\n)\n\nCREATE TABLE contacts (\n contact_id number,\n customer_id number,\n gender text,\n first_name text,\n last_name text,\n contact_phone text\n) ### Response: SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id"} {"instruction":"What is the maximum t20 on green lane?","input":"CREATE TABLE table_1176371_1 (\n t20_matches INTEGER,\n name_of_ground VARCHAR\n)","response":"SELECT MAX(t20_matches) FROM table_1176371_1 WHERE name_of_ground = \"Green Lane\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the maximum t20 on green lane? ### Input: CREATE TABLE table_1176371_1 (\n t20_matches INTEGER,\n name_of_ground VARCHAR\n) ### Response: SELECT MAX(t20_matches) FROM table_1176371_1 WHERE name_of_ground = \"Green Lane\""} {"instruction":"Most questions with upvoted self-answers.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)","response":"SELECT q.OwnerUserId AS \"user_link\", COUNT(DISTINCT q.Id) AS \"count\" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.OwnerUserId = a.OwnerUserId AND a.Score > 0 GROUP BY q.OwnerUserId ORDER BY 'count' DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Most questions with upvoted self-answers. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n) ### Response: SELECT q.OwnerUserId AS \"user_link\", COUNT(DISTINCT q.Id) AS \"count\" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.OwnerUserId = a.OwnerUserId AND a.Score > 0 GROUP BY q.OwnerUserId ORDER BY 'count' DESC"} {"instruction":"What is the largest number of episodes for a 1989 season dvd release?","input":"CREATE TABLE table_1753 (\n \"DVD Title\" text,\n \"No. of Discs\" real,\n \"Year\" text,\n \"No. of Episodes\" real,\n \"Region 1\" text,\n \"Region 2\" text,\n \"Region 4\" text\n)","response":"SELECT MAX(\"No. of Episodes\") FROM table_1753 WHERE \"Year\" = '1989'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest number of episodes for a 1989 season dvd release? ### Input: CREATE TABLE table_1753 (\n \"DVD Title\" text,\n \"No. of Discs\" real,\n \"Year\" text,\n \"No. of Episodes\" real,\n \"Region 1\" text,\n \"Region 2\" text,\n \"Region 4\" text\n) ### Response: SELECT MAX(\"No. of Episodes\") FROM table_1753 WHERE \"Year\" = '1989'"} {"instruction":"How many millions of U.S. viewers watched the episode titled 'New Beginnings'?","input":"CREATE TABLE table_30683 (\n \"No. in series\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (million)\" text\n)","response":"SELECT \"U.S. viewers (million)\" FROM table_30683 WHERE \"Title\" = 'New Beginnings'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many millions of U.S. viewers watched the episode titled 'New Beginnings'? ### Input: CREATE TABLE table_30683 (\n \"No. in series\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (million)\" text\n) ### Response: SELECT \"U.S. viewers (million)\" FROM table_30683 WHERE \"Title\" = 'New Beginnings'"} {"instruction":"Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment.","input":"CREATE TABLE College (\n cName varchar(20),\n state varchar(2),\n enr numeric(5,0)\n)\n\nCREATE TABLE Player (\n pID numeric(5,0),\n pName varchar(20),\n yCard varchar(3),\n HS numeric(5,0)\n)\n\nCREATE TABLE Tryout (\n pID numeric(5,0),\n cName varchar(20),\n pPos varchar(8),\n decision varchar(3)\n)","response":"SELECT state, MIN(enr) FROM College GROUP BY state","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment. ### Input: CREATE TABLE College (\n cName varchar(20),\n state varchar(2),\n enr numeric(5,0)\n)\n\nCREATE TABLE Player (\n pID numeric(5,0),\n pName varchar(20),\n yCard varchar(3),\n HS numeric(5,0)\n)\n\nCREATE TABLE Tryout (\n pID numeric(5,0),\n cName varchar(20),\n pPos varchar(8),\n decision varchar(3)\n) ### Response: SELECT state, MIN(enr) FROM College GROUP BY state"} {"instruction":"When dwhr-tv is the call sign how many station types are there?","input":"CREATE TABLE table_23394920_1 (\n station_type VARCHAR,\n callsign VARCHAR\n)","response":"SELECT COUNT(station_type) FROM table_23394920_1 WHERE callsign = \"DWHR-TV\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When dwhr-tv is the call sign how many station types are there? ### Input: CREATE TABLE table_23394920_1 (\n station_type VARCHAR,\n callsign VARCHAR\n) ### Response: SELECT COUNT(station_type) FROM table_23394920_1 WHERE callsign = \"DWHR-TV\""} {"instruction":"What is the average Wins, when Points is less than '19'?","input":"CREATE TABLE table_name_32 (\n wins INTEGER,\n points INTEGER\n)","response":"SELECT AVG(wins) FROM table_name_32 WHERE points < 19","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Wins, when Points is less than '19'? ### Input: CREATE TABLE table_name_32 (\n wins INTEGER,\n points INTEGER\n) ### Response: SELECT AVG(wins) FROM table_name_32 WHERE points < 19"} {"instruction":"how many mayors were in office for a total of 9 years ?","input":"CREATE TABLE table_201_10 (\n id number,\n \"#\" number,\n \"name\" text,\n \"office\" text,\n \"political party\" text,\n \"occupation\" text\n)","response":"SELECT COUNT(\"name\") FROM table_201_10 WHERE \"office\" - \"office\" = 9","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many mayors were in office for a total of 9 years ? ### Input: CREATE TABLE table_201_10 (\n id number,\n \"#\" number,\n \"name\" text,\n \"office\" text,\n \"political party\" text,\n \"occupation\" text\n) ### Response: SELECT COUNT(\"name\") FROM table_201_10 WHERE \"office\" - \"office\" = 9"} {"instruction":"Who got the loss for the game ending in a record of 55-41?","input":"CREATE TABLE table_name_74 (\n loss VARCHAR,\n record VARCHAR\n)","response":"SELECT loss FROM table_name_74 WHERE record = \"55-41\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who got the loss for the game ending in a record of 55-41? ### Input: CREATE TABLE table_name_74 (\n loss VARCHAR,\n record VARCHAR\n) ### Response: SELECT loss FROM table_name_74 WHERE record = \"55-41\""} {"instruction":"Which venue has 1st as the result?","input":"CREATE TABLE table_name_45 (\n venue VARCHAR,\n result VARCHAR\n)","response":"SELECT venue FROM table_name_45 WHERE result = \"1st\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue has 1st as the result? ### Input: CREATE TABLE table_name_45 (\n venue VARCHAR,\n result VARCHAR\n) ### Response: SELECT venue FROM table_name_45 WHERE result = \"1st\""} {"instruction":"What was the average year for a coin that had a mintage smaller than 10,000?","input":"CREATE TABLE table_name_13 (\n year INTEGER,\n mintage INTEGER\n)","response":"SELECT AVG(year) FROM table_name_13 WHERE mintage < 10 OFFSET 000","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the average year for a coin that had a mintage smaller than 10,000? ### Input: CREATE TABLE table_name_13 (\n year INTEGER,\n mintage INTEGER\n) ### Response: SELECT AVG(year) FROM table_name_13 WHERE mintage < 10 OFFSET 000"} {"instruction":"Name the south american rank for venezuela","input":"CREATE TABLE table_2249087_1 (\n south_american_rank INTEGER,\n nation VARCHAR\n)","response":"SELECT MIN(south_american_rank) FROM table_2249087_1 WHERE nation = \"Venezuela\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the south american rank for venezuela ### Input: CREATE TABLE table_2249087_1 (\n south_american_rank INTEGER,\n nation VARCHAR\n) ### Response: SELECT MIN(south_american_rank) FROM table_2249087_1 WHERE nation = \"Venezuela\""} {"instruction":"Show me about the distribution of All_Road and All_Games_Percent in a bar chart, and I want to show by the names in desc please.","input":"CREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)\n\nCREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)","response":"SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Road and All_Games_Percent in a bar chart, and I want to show by the names in desc please. ### Input: CREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)\n\nCREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n) ### Response: SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road DESC"} {"instruction":"For the game on 13 December 1975 with Halifax Town as the away team what was the score?","input":"CREATE TABLE table_name_4 (\n score VARCHAR,\n date VARCHAR,\n away_team VARCHAR\n)","response":"SELECT score FROM table_name_4 WHERE date = \"13 december 1975\" AND away_team = \"halifax town\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the game on 13 December 1975 with Halifax Town as the away team what was the score? ### Input: CREATE TABLE table_name_4 (\n score VARCHAR,\n date VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT score FROM table_name_4 WHERE date = \"13 december 1975\" AND away_team = \"halifax town\""} {"instruction":"what flight goes from DENVER to BALTIMORE FIRST class on UA arriving on 5 7","input":"CREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, fare_basis AS FARE_BASIS_2, flight, flight_fare AS FLIGHT_FARE_0, flight_fare AS FLIGHT_FARE_1 WHERE (((((((flight.departure_time > flight.arrival_time) AND DATE_DAY_1.day_number = 6 AND DATE_DAY_1.month_number = 5 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code) AND DATE_DAY_0.day_number = 6 AND DATE_DAY_0.month_number = 5 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND FARE_BASIS_0.class_type = 'FIRST' AND FARE_BASIS_1.basis_days = DAYS_0.days_code AND FARE_0.fare_basis_code = FARE_BASIS_0.fare_basis_code AND FARE_0.fare_basis_code = FARE_BASIS_1.fare_basis_code AND FLIGHT_FARE_0.fare_id = FARE_0.fare_id AND flight.flight_id = FLIGHT_FARE_0.flight_id) OR ((DATE_DAY_1.day_number = 7 AND DATE_DAY_1.month_number = 5 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code AND NOT (flight.departure_time > flight.arrival_time)) AND DATE_DAY_0.day_number = 7 AND DATE_DAY_0.month_number = 5 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND FARE_BASIS_0.class_type = 'FIRST' AND FARE_BASIS_1.basis_days = DAYS_0.days_code AND FARE_0.fare_basis_code = FARE_BASIS_0.fare_basis_code AND FARE_0.fare_basis_code = FARE_BASIS_1.fare_basis_code AND FLIGHT_FARE_0.fare_id = FARE_0.fare_id AND flight.flight_id = FLIGHT_FARE_0.flight_id)) AND FARE_BASIS_2.class_type = 'FIRST' AND FARE_1.fare_basis_code = FARE_BASIS_2.fare_basis_code AND FLIGHT_FARE_1.fare_id = FARE_1.fare_id AND flight.flight_id = FLIGHT_FARE_1.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'UA'","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flight goes from DENVER to BALTIMORE FIRST class on UA arriving on 5 7 ### Input: CREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, fare_basis AS FARE_BASIS_2, flight, flight_fare AS FLIGHT_FARE_0, flight_fare AS FLIGHT_FARE_1 WHERE (((((((flight.departure_time > flight.arrival_time) AND DATE_DAY_1.day_number = 6 AND DATE_DAY_1.month_number = 5 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code) AND DATE_DAY_0.day_number = 6 AND DATE_DAY_0.month_number = 5 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND FARE_BASIS_0.class_type = 'FIRST' AND FARE_BASIS_1.basis_days = DAYS_0.days_code AND FARE_0.fare_basis_code = FARE_BASIS_0.fare_basis_code AND FARE_0.fare_basis_code = FARE_BASIS_1.fare_basis_code AND FLIGHT_FARE_0.fare_id = FARE_0.fare_id AND flight.flight_id = FLIGHT_FARE_0.flight_id) OR ((DATE_DAY_1.day_number = 7 AND DATE_DAY_1.month_number = 5 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code AND NOT (flight.departure_time > flight.arrival_time)) AND DATE_DAY_0.day_number = 7 AND DATE_DAY_0.month_number = 5 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND FARE_BASIS_0.class_type = 'FIRST' AND FARE_BASIS_1.basis_days = DAYS_0.days_code AND FARE_0.fare_basis_code = FARE_BASIS_0.fare_basis_code AND FARE_0.fare_basis_code = FARE_BASIS_1.fare_basis_code AND FLIGHT_FARE_0.fare_id = FARE_0.fare_id AND flight.flight_id = FLIGHT_FARE_0.flight_id)) AND FARE_BASIS_2.class_type = 'FIRST' AND FARE_1.fare_basis_code = FARE_BASIS_2.fare_basis_code AND FLIGHT_FARE_1.fare_id = FARE_1.fare_id AND flight.flight_id = FLIGHT_FARE_1.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'UA'"} {"instruction":"What is the lowest number of participants in 2010 when there were 0 participants in 2012?","input":"CREATE TABLE table_7828 (\n \"Country\" text,\n \"2010\" real,\n \"2011\" real,\n \"2012\" real,\n \"2013\" real\n)","response":"SELECT MIN(\"2010\") FROM table_7828 WHERE \"2012\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of participants in 2010 when there were 0 participants in 2012? ### Input: CREATE TABLE table_7828 (\n \"Country\" text,\n \"2010\" real,\n \"2011\" real,\n \"2012\" real,\n \"2013\" real\n) ### Response: SELECT MIN(\"2010\") FROM table_7828 WHERE \"2012\" < '0'"} {"instruction":"When was the date of appointment for the manager replacing Wim Jansen?","input":"CREATE TABLE table_20539 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n)","response":"SELECT \"Date of appointment\" FROM table_20539 WHERE \"Outgoing manager\" = 'Wim Jansen'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the date of appointment for the manager replacing Wim Jansen? ### Input: CREATE TABLE table_20539 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text\n) ### Response: SELECT \"Date of appointment\" FROM table_20539 WHERE \"Outgoing manager\" = 'Wim Jansen'"} {"instruction":"What was Barreto's song choice when the theme was samba?","input":"CREATE TABLE table_27614571_1 (\n song_choice VARCHAR,\n theme VARCHAR\n)","response":"SELECT song_choice FROM table_27614571_1 WHERE theme = \"Samba\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Barreto's song choice when the theme was samba? ### Input: CREATE TABLE table_27614571_1 (\n song_choice VARCHAR,\n theme VARCHAR\n) ### Response: SELECT song_choice FROM table_27614571_1 WHERE theme = \"Samba\""} {"instruction":"Give me a histogram for what are the total number of credits offered by each department?, could you rank by the names from low to high?","input":"CREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)","response":"SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a histogram for what are the total number of credits offered by each department?, could you rank by the names from low to high? ### Input: CREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n) ### Response: SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE"} {"instruction":"What was the max points you when when you place 9th?","input":"CREATE TABLE table_1653 (\n \"Season\" text,\n \"Series\" text,\n \"Team Name\" text,\n \"Races\" real,\n \"Poles\" real,\n \"Wins\" real,\n \"Points\" real,\n \"Final Placing\" text\n)","response":"SELECT MAX(\"Points\") FROM table_1653 WHERE \"Final Placing\" = '9th'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the max points you when when you place 9th? ### Input: CREATE TABLE table_1653 (\n \"Season\" text,\n \"Series\" text,\n \"Team Name\" text,\n \"Races\" real,\n \"Poles\" real,\n \"Wins\" real,\n \"Points\" real,\n \"Final Placing\" text\n) ### Response: SELECT MAX(\"Points\") FROM table_1653 WHERE \"Final Placing\" = '9th'"} {"instruction":"What was the finish for Lanny Wadkins of the United States?","input":"CREATE TABLE table_59667 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n)","response":"SELECT \"Finish\" FROM table_59667 WHERE \"Country\" = 'united states' AND \"Player\" = 'lanny wadkins'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the finish for Lanny Wadkins of the United States? ### Input: CREATE TABLE table_59667 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n) ### Response: SELECT \"Finish\" FROM table_59667 WHERE \"Country\" = 'united states' AND \"Player\" = 'lanny wadkins'"} {"instruction":"List the scores of all games when Miami were listed as the first Semi finalist","input":"CREATE TABLE table_72167 (\n \"Year\" real,\n \"Champion\" text,\n \"Score\" text,\n \"Runner-Up\" text,\n \"Location\" text,\n \"Semi-Finalist #1\" text,\n \"Semi-Finalist #2\" text\n)","response":"SELECT \"Score\" FROM table_72167 WHERE \"Semi-Finalist #1\" = 'Miami'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the scores of all games when Miami were listed as the first Semi finalist ### Input: CREATE TABLE table_72167 (\n \"Year\" real,\n \"Champion\" text,\n \"Score\" text,\n \"Runner-Up\" text,\n \"Location\" text,\n \"Semi-Finalist #1\" text,\n \"Semi-Finalist #2\" text\n) ### Response: SELECT \"Score\" FROM table_72167 WHERE \"Semi-Finalist #1\" = 'Miami'"} {"instruction":"What category was the nominated in after 2008?","input":"CREATE TABLE table_name_31 (\n category VARCHAR,\n outcome VARCHAR,\n year VARCHAR\n)","response":"SELECT category FROM table_name_31 WHERE outcome = \"nominated\" AND year > 2008","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What category was the nominated in after 2008? ### Input: CREATE TABLE table_name_31 (\n category VARCHAR,\n outcome VARCHAR,\n year VARCHAR\n) ### Response: SELECT category FROM table_name_31 WHERE outcome = \"nominated\" AND year > 2008"} {"instruction":"what are the number of patients who had received a open reduct mandible fx procedure since 3 years ago?","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open reduct mandible fx') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year'))","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the number of patients who had received a open reduct mandible fx procedure since 3 years ago? ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open reduct mandible fx') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year'))"} {"instruction":"How many times does November 3rd occur when January 15, 1991 does?","input":"CREATE TABLE table_27465 (\n \"June 10-11\" text,\n \"March 27-29\" text,\n \"January 15-16\" text,\n \"November 3\" text,\n \"August 21-22\" text\n)","response":"SELECT COUNT(\"November 3\") FROM table_27465 WHERE \"January 15-16\" = 'January 15, 1991'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times does November 3rd occur when January 15, 1991 does? ### Input: CREATE TABLE table_27465 (\n \"June 10-11\" text,\n \"March 27-29\" text,\n \"January 15-16\" text,\n \"November 3\" text,\n \"August 21-22\" text\n) ### Response: SELECT COUNT(\"November 3\") FROM table_27465 WHERE \"January 15-16\" = 'January 15, 1991'"} {"instruction":"Which date has a week larger than 14?","input":"CREATE TABLE table_31800 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Venue\" text,\n \"Attendance\" text\n)","response":"SELECT \"Date\" FROM table_31800 WHERE \"Week\" > '14'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which date has a week larger than 14? ### Input: CREATE TABLE table_31800 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Venue\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Date\" FROM table_31800 WHERE \"Week\" > '14'"} {"instruction":"count the number of times patient 006-76924 has had an urinary catheter output: indwelling\/continuous ure output since 12\/02\/2100.","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urinary catheter output: indwelling\/continuous ure' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2100-12-02'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of times patient 006-76924 has had an urinary catheter output: indwelling\/continuous ure output since 12\/02\/2100. ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urinary catheter output: indwelling\/continuous ure' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2100-12-02'"} {"instruction":"What is the overall number of the player from Utah with a pick # higher than 7?","input":"CREATE TABLE table_name_54 (\n overall INTEGER,\n college VARCHAR,\n pick__number VARCHAR\n)","response":"SELECT SUM(overall) FROM table_name_54 WHERE college = \"utah\" AND pick__number < 7","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the overall number of the player from Utah with a pick # higher than 7? ### Input: CREATE TABLE table_name_54 (\n overall INTEGER,\n college VARCHAR,\n pick__number VARCHAR\n) ### Response: SELECT SUM(overall) FROM table_name_54 WHERE college = \"utah\" AND pick__number < 7"} {"instruction":"What is the score for the Dec 11 game?","input":"CREATE TABLE table_name_83 (\n score VARCHAR,\n december VARCHAR\n)","response":"SELECT score FROM table_name_83 WHERE december = 11","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for the Dec 11 game? ### Input: CREATE TABLE table_name_83 (\n score VARCHAR,\n december VARCHAR\n) ### Response: SELECT score FROM table_name_83 WHERE december = 11"} {"instruction":"What is the total when bronze has a silver larger than 2?","input":"CREATE TABLE table_6350 (\n \"Country\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT COUNT(\"Bronze\") FROM table_6350 WHERE \"Silver\" > '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total when bronze has a silver larger than 2? ### Input: CREATE TABLE table_6350 (\n \"Country\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT COUNT(\"Bronze\") FROM table_6350 WHERE \"Silver\" > '2'"} {"instruction":"How many seasons have a production code of 204?","input":"CREATE TABLE table_16581695_3 (\n no_in_season VARCHAR,\n production_code VARCHAR\n)","response":"SELECT COUNT(no_in_season) FROM table_16581695_3 WHERE production_code = 204","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many seasons have a production code of 204? ### Input: CREATE TABLE table_16581695_3 (\n no_in_season VARCHAR,\n production_code VARCHAR\n) ### Response: SELECT COUNT(no_in_season) FROM table_16581695_3 WHERE production_code = 204"} {"instruction":"What is Petersville's census ranking?","input":"CREATE TABLE table_21378 (\n \"Official Name\" text,\n \"Status\" text,\n \"Area km 2\" text,\n \"Population\" real,\n \"Census Ranking\" text\n)","response":"SELECT \"Census Ranking\" FROM table_21378 WHERE \"Official Name\" = 'Petersville'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Petersville's census ranking? ### Input: CREATE TABLE table_21378 (\n \"Official Name\" text,\n \"Status\" text,\n \"Area km 2\" text,\n \"Population\" real,\n \"Census Ranking\" text\n) ### Response: SELECT \"Census Ranking\" FROM table_21378 WHERE \"Official Name\" = 'Petersville'"} {"instruction":"Which Club or province has a caps larger than 15 and has Chris Cusiter playing for them?","input":"CREATE TABLE table_37217 (\n \"Player\" text,\n \"Position\" text,\n \"Date of Birth (Age)\" text,\n \"Caps\" real,\n \"Club\/province\" text\n)","response":"SELECT \"Club\/province\" FROM table_37217 WHERE \"Caps\" > '15' AND \"Player\" = 'chris cusiter'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Club or province has a caps larger than 15 and has Chris Cusiter playing for them? ### Input: CREATE TABLE table_37217 (\n \"Player\" text,\n \"Position\" text,\n \"Date of Birth (Age)\" text,\n \"Caps\" real,\n \"Club\/province\" text\n) ### Response: SELECT \"Club\/province\" FROM table_37217 WHERE \"Caps\" > '15' AND \"Player\" = 'chris cusiter'"} {"instruction":"Which Byes have an Against larger than 1018, and a Wimmera FL of horsham diggers?","input":"CREATE TABLE table_65614 (\n \"Wimmera FL\" text,\n \"Wins\" real,\n \"Byes\" real,\n \"Losses\" real,\n \"Draws\" real,\n \"Against\" real\n)","response":"SELECT MIN(\"Byes\") FROM table_65614 WHERE \"Against\" > '1018' AND \"Wimmera FL\" = 'horsham diggers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Byes have an Against larger than 1018, and a Wimmera FL of horsham diggers? ### Input: CREATE TABLE table_65614 (\n \"Wimmera FL\" text,\n \"Wins\" real,\n \"Byes\" real,\n \"Losses\" real,\n \"Draws\" real,\n \"Against\" real\n) ### Response: SELECT MIN(\"Byes\") FROM table_65614 WHERE \"Against\" > '1018' AND \"Wimmera FL\" = 'horsham diggers'"} {"instruction":"how many tons does the te class displace ?","input":"CREATE TABLE table_203_764 (\n id number,\n \"name\" text,\n \"date\" number,\n \"nation\" text,\n \"displacement\" text,\n \"speed\" text,\n \"number\" number,\n \"notes\" text\n)","response":"SELECT \"displacement\" FROM table_203_764 WHERE \"name\" = 'te-class'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many tons does the te class displace ? ### Input: CREATE TABLE table_203_764 (\n id number,\n \"name\" text,\n \"date\" number,\n \"nation\" text,\n \"displacement\" text,\n \"speed\" text,\n \"number\" number,\n \"notes\" text\n) ### Response: SELECT \"displacement\" FROM table_203_764 WHERE \"name\" = 'te-class'"} {"instruction":"When the Home team score was 15.18 (108), what's the lowest Crowd turnout?","input":"CREATE TABLE table_77874 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT MIN(\"Crowd\") FROM table_77874 WHERE \"Home team score\" = '15.18 (108)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Home team score was 15.18 (108), what's the lowest Crowd turnout? ### Input: CREATE TABLE table_77874 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT MIN(\"Crowd\") FROM table_77874 WHERE \"Home team score\" = '15.18 (108)'"} {"instruction":"what was the first time patient 24894 received calcium, total in a lab test during the first hospital visit?","input":"CREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first time patient 24894 received calcium, total in a lab test during the first hospital visit? ### Input: CREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1"} {"instruction":"tell me the number of stations tv azteca owns .","input":"CREATE TABLE table_204_796 (\n id number,\n \"network name\" text,\n \"flagship\" text,\n \"programming type\" text,\n \"owner\" text,\n \"affiliates\" number\n)","response":"SELECT COUNT(\"network name\") FROM table_204_796 WHERE \"owner\" = 'tv azteca'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the number of stations tv azteca owns . ### Input: CREATE TABLE table_204_796 (\n id number,\n \"network name\" text,\n \"flagship\" text,\n \"programming type\" text,\n \"owner\" text,\n \"affiliates\" number\n) ### Response: SELECT COUNT(\"network name\") FROM table_204_796 WHERE \"owner\" = 'tv azteca'"} {"instruction":"What place has the score of 67-74=141?","input":"CREATE TABLE table_name_2 (\n place VARCHAR,\n score VARCHAR\n)","response":"SELECT place FROM table_name_2 WHERE score = 67 - 74 = 141","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What place has the score of 67-74=141? ### Input: CREATE TABLE table_name_2 (\n place VARCHAR,\n score VARCHAR\n) ### Response: SELECT place FROM table_name_2 WHERE score = 67 - 74 = 141"} {"instruction":"What is the census ranking for the Perth parish?","input":"CREATE TABLE table_176524_2 (\n census_ranking VARCHAR,\n official_name VARCHAR\n)","response":"SELECT census_ranking FROM table_176524_2 WHERE official_name = \"Perth\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the census ranking for the Perth parish? ### Input: CREATE TABLE table_176524_2 (\n census_ranking VARCHAR,\n official_name VARCHAR\n) ### Response: SELECT census_ranking FROM table_176524_2 WHERE official_name = \"Perth\""} {"instruction":"Who was the home team on March 5, 2008?","input":"CREATE TABLE table_10100 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT \"Home\" FROM table_10100 WHERE \"Date\" = 'march 5, 2008'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team on March 5, 2008? ### Input: CREATE TABLE table_10100 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT \"Home\" FROM table_10100 WHERE \"Date\" = 'march 5, 2008'"} {"instruction":"how many player with no being 12","input":"CREATE TABLE table_12962773_5 (\n player VARCHAR,\n no VARCHAR\n)","response":"SELECT COUNT(player) FROM table_12962773_5 WHERE no = 12","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many player with no being 12 ### Input: CREATE TABLE table_12962773_5 (\n player VARCHAR,\n no VARCHAR\n) ### Response: SELECT COUNT(player) FROM table_12962773_5 WHERE no = 12"} {"instruction":"Which driver has a # smaller than 40, less than 151 points, and Winnings of $84,400?","input":"CREATE TABLE table_12045 (\n \"Driver\" text,\n \"Car #\" real,\n \"Make\" text,\n \"Points\" real,\n \"Laps\" real,\n \"Winnings\" text\n)","response":"SELECT \"Make\" FROM table_12045 WHERE \"Car #\" < '40' AND \"Points\" < '151' AND \"Winnings\" = '$84,400'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which driver has a # smaller than 40, less than 151 points, and Winnings of $84,400? ### Input: CREATE TABLE table_12045 (\n \"Driver\" text,\n \"Car #\" real,\n \"Make\" text,\n \"Points\" real,\n \"Laps\" real,\n \"Winnings\" text\n) ### Response: SELECT \"Make\" FROM table_12045 WHERE \"Car #\" < '40' AND \"Points\" < '151' AND \"Winnings\" = '$84,400'"} {"instruction":"How many documents in different starting date? Return a line chart grouping by starting date.","input":"CREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)","response":"SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many documents in different starting date? Return a line chart grouping by starting date. ### Input: CREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n) ### Response: SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From"} {"instruction":"How many places have an Artist of august , and a Draw smaller than 6?","input":"CREATE TABLE table_64729 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Points\" real,\n \"Place\" real\n)","response":"SELECT COUNT(\"Place\") FROM table_64729 WHERE \"Artist\" = 'august\u0117' AND \"Draw\" < '6'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many places have an Artist of august , and a Draw smaller than 6? ### Input: CREATE TABLE table_64729 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Points\" real,\n \"Place\" real\n) ### Response: SELECT COUNT(\"Place\") FROM table_64729 WHERE \"Artist\" = 'august\u0117' AND \"Draw\" < '6'"} {"instruction":"On what date was game 3?","input":"CREATE TABLE table_79596 (\n \"Game\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Date\" FROM table_79596 WHERE \"Game\" = '3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date was game 3? ### Input: CREATE TABLE table_79596 (\n \"Game\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Date\" FROM table_79596 WHERE \"Game\" = '3'"} {"instruction":"What is the region 4 (Aus) date associated with a region 1 (US) date of January 16, 2007?","input":"CREATE TABLE table_240936_2 (\n region_4__australia_ VARCHAR,\n region_1__us_ VARCHAR\n)","response":"SELECT region_4__australia_ FROM table_240936_2 WHERE region_1__us_ = \"January 16, 2007\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the region 4 (Aus) date associated with a region 1 (US) date of January 16, 2007? ### Input: CREATE TABLE table_240936_2 (\n region_4__australia_ VARCHAR,\n region_1__us_ VARCHAR\n) ### Response: SELECT region_4__australia_ FROM table_240936_2 WHERE region_1__us_ = \"January 16, 2007\""} {"instruction":"What is the highest React that has a 7.61 Mark and a heat bigger than 1?","input":"CREATE TABLE table_name_84 (\n react INTEGER,\n mark VARCHAR,\n heat VARCHAR\n)","response":"SELECT MAX(react) FROM table_name_84 WHERE mark = \"7.61\" AND heat > 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest React that has a 7.61 Mark and a heat bigger than 1? ### Input: CREATE TABLE table_name_84 (\n react INTEGER,\n mark VARCHAR,\n heat VARCHAR\n) ### Response: SELECT MAX(react) FROM table_name_84 WHERE mark = \"7.61\" AND heat > 1"} {"instruction":"What year was USF founded?","input":"CREATE TABLE table_1160660_1 (\n date_founded VARCHAR,\n acronym VARCHAR\n)","response":"SELECT date_founded FROM table_1160660_1 WHERE acronym = \"USF\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was USF founded? ### Input: CREATE TABLE table_1160660_1 (\n date_founded VARCHAR,\n acronym VARCHAR\n) ### Response: SELECT date_founded FROM table_1160660_1 WHERE acronym = \"USF\""} {"instruction":"what is the position in table when the team is hartlepool united?","input":"CREATE TABLE table_64562 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text,\n \"Position in table\" text\n)","response":"SELECT \"Position in table\" FROM table_64562 WHERE \"Team\" = 'hartlepool united'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the position in table when the team is hartlepool united? ### Input: CREATE TABLE table_64562 (\n \"Team\" text,\n \"Outgoing manager\" text,\n \"Manner of departure\" text,\n \"Date of vacancy\" text,\n \"Replaced by\" text,\n \"Date of appointment\" text,\n \"Position in table\" text\n) ### Response: SELECT \"Position in table\" FROM table_64562 WHERE \"Team\" = 'hartlepool united'"} {"instruction":"What was the position of the player from Butler High School?","input":"CREATE TABLE table_17065 (\n \"Player\" text,\n \"Position\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text\n)","response":"SELECT \"Position\" FROM table_17065 WHERE \"School\" = 'Butler High School'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the position of the player from Butler High School? ### Input: CREATE TABLE table_17065 (\n \"Player\" text,\n \"Position\" text,\n \"School\" text,\n \"Hometown\" text,\n \"College\" text\n) ### Response: SELECT \"Position\" FROM table_17065 WHERE \"School\" = 'Butler High School'"} {"instruction":"what is age and religion of subject id 84129?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = \"84129\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is age and religion of subject id 84129? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = \"84129\""} {"instruction":"how many prescriptions for multivitamins have been ordered?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT COUNT(*) FROM medication WHERE medication.drugname = 'multivitamins'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many prescriptions for multivitamins have been ordered? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT COUNT(*) FROM medication WHERE medication.drugname = 'multivitamins'"} {"instruction":"Which analog channel is Fox on?","input":"CREATE TABLE table_52794 (\n \"Analog Channel\" text,\n \"Digital Channel\" text,\n \"Call sign\" text,\n \"Name\" text,\n \"Network\" text\n)","response":"SELECT \"Analog Channel\" FROM table_52794 WHERE \"Network\" = 'fox'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which analog channel is Fox on? ### Input: CREATE TABLE table_52794 (\n \"Analog Channel\" text,\n \"Digital Channel\" text,\n \"Call sign\" text,\n \"Name\" text,\n \"Network\" text\n) ### Response: SELECT \"Analog Channel\" FROM table_52794 WHERE \"Network\" = 'fox'"} {"instruction":"first opponent to defeat mocho cota in mexico city","input":"CREATE TABLE table_204_373 (\n id number,\n \"wager\" text,\n \"winner\" text,\n \"loser\" text,\n \"location\" text,\n \"date\" text\n)","response":"SELECT \"winner\" FROM table_204_373 WHERE \"loser\" = 'mocho cota' AND \"location\" = 'mexico city' ORDER BY \"date\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: first opponent to defeat mocho cota in mexico city ### Input: CREATE TABLE table_204_373 (\n id number,\n \"wager\" text,\n \"winner\" text,\n \"loser\" text,\n \"location\" text,\n \"date\" text\n) ### Response: SELECT \"winner\" FROM table_204_373 WHERE \"loser\" = 'mocho cota' AND \"location\" = 'mexico city' ORDER BY \"date\" LIMIT 1"} {"instruction":"what is admission time and drug dose of subject id 74032?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT demographic.admittime, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = \"74032\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is admission time and drug dose of subject id 74032? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT demographic.admittime, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = \"74032\""} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of salary over the job_id , and group by attribute job_id, I want to order in descending by the JOB_ID please.","input":"CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of salary over the job_id , and group by attribute job_id, I want to order in descending by the JOB_ID please. ### Input: CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC"} {"instruction":"What is the highest Aug 2013 with a Nov 2011 smaller than 968, and a Jul 2012 with 31, and a Jun 2011 larger than 30?","input":"CREATE TABLE table_51528 (\n \"Feb 2010\" text,\n \"Mar 2010\" text,\n \"May 2010\" real,\n \"Jun 2010\" real,\n \"Jul 2010\" real,\n \"Aug 2010\" real,\n \"Sep 2010\" real,\n \"Oct 2010\" real,\n \"Nov 2010\" real,\n \"Dec 2010\" real,\n \"Jan 2011\" real,\n \"Feb 2011\" real,\n \"Mar 2011\" real,\n \"Apr 2011\" real,\n \"May 2011\" real,\n \"Jun 2011\" real,\n \"Jul 2011\" real,\n \"Aug 2011\" real,\n \"Sep 2011\" real,\n \"Oct 2011\" real,\n \"Nov 2011\" real,\n \"Dec 2011\" real,\n \"Jan 2012\" real,\n \"Feb 2012\" real,\n \"Mar 2012\" real,\n \"Apr 2012\" real,\n \"May 2012\" real,\n \"Jun 2012\" real,\n \"Jul 2012\" real,\n \"Aug 2012\" real,\n \"Sep 2012\" real,\n \"Oct 2012\" real,\n \"Nov 2012\" real,\n \"Dec 2012\" real,\n \"Jan 2013\" real,\n \"Feb 2013\" real,\n \"Mar 2013\" real,\n \"Apr 2013\" real,\n \"May 2013\" real,\n \"Jun 2013\" real,\n \"Jul 2013\" real,\n \"Aug 2013\" real,\n \"Sep 2013\" real,\n \"Oct 2013\" real\n)","response":"SELECT MAX(\"Aug 2013\") FROM table_51528 WHERE \"Nov 2011\" < '968' AND \"Jul 2012\" = '31' AND \"Jun 2011\" > '30'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Aug 2013 with a Nov 2011 smaller than 968, and a Jul 2012 with 31, and a Jun 2011 larger than 30? ### Input: CREATE TABLE table_51528 (\n \"Feb 2010\" text,\n \"Mar 2010\" text,\n \"May 2010\" real,\n \"Jun 2010\" real,\n \"Jul 2010\" real,\n \"Aug 2010\" real,\n \"Sep 2010\" real,\n \"Oct 2010\" real,\n \"Nov 2010\" real,\n \"Dec 2010\" real,\n \"Jan 2011\" real,\n \"Feb 2011\" real,\n \"Mar 2011\" real,\n \"Apr 2011\" real,\n \"May 2011\" real,\n \"Jun 2011\" real,\n \"Jul 2011\" real,\n \"Aug 2011\" real,\n \"Sep 2011\" real,\n \"Oct 2011\" real,\n \"Nov 2011\" real,\n \"Dec 2011\" real,\n \"Jan 2012\" real,\n \"Feb 2012\" real,\n \"Mar 2012\" real,\n \"Apr 2012\" real,\n \"May 2012\" real,\n \"Jun 2012\" real,\n \"Jul 2012\" real,\n \"Aug 2012\" real,\n \"Sep 2012\" real,\n \"Oct 2012\" real,\n \"Nov 2012\" real,\n \"Dec 2012\" real,\n \"Jan 2013\" real,\n \"Feb 2013\" real,\n \"Mar 2013\" real,\n \"Apr 2013\" real,\n \"May 2013\" real,\n \"Jun 2013\" real,\n \"Jul 2013\" real,\n \"Aug 2013\" real,\n \"Sep 2013\" real,\n \"Oct 2013\" real\n) ### Response: SELECT MAX(\"Aug 2013\") FROM table_51528 WHERE \"Nov 2011\" < '968' AND \"Jul 2012\" = '31' AND \"Jun 2011\" > '30'"} {"instruction":"How many rounds were on July 10?","input":"CREATE TABLE table_24626 (\n \"Round\" real,\n \"Date\" text,\n \"City and venue\" text,\n \"Winner\" text,\n \"Runner-up\" text,\n \"3rd placed\" text,\n \"4th placed\" text,\n \"Results\" text\n)","response":"SELECT COUNT(\"Round\") FROM table_24626 WHERE \"Date\" = 'July 10'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many rounds were on July 10? ### Input: CREATE TABLE table_24626 (\n \"Round\" real,\n \"Date\" text,\n \"City and venue\" text,\n \"Winner\" text,\n \"Runner-up\" text,\n \"3rd placed\" text,\n \"4th placed\" text,\n \"Results\" text\n) ### Response: SELECT COUNT(\"Round\") FROM table_24626 WHERE \"Date\" = 'July 10'"} {"instruction":"what country lost the most ships to u-502 ?","input":"CREATE TABLE table_203_268 (\n id number,\n \"date\" text,\n \"name\" text,\n \"nationality\" text,\n \"tonnage\\n(grt)\" number,\n \"fate\" text\n)","response":"SELECT \"nationality\" FROM table_203_268 GROUP BY \"nationality\" ORDER BY COUNT(\"name\") DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what country lost the most ships to u-502 ? ### Input: CREATE TABLE table_203_268 (\n id number,\n \"date\" text,\n \"name\" text,\n \"nationality\" text,\n \"tonnage\\n(grt)\" number,\n \"fate\" text\n) ### Response: SELECT \"nationality\" FROM table_203_268 GROUP BY \"nationality\" ORDER BY COUNT(\"name\") DESC LIMIT 1"} {"instruction":"how many hours have it been since the first time patient 027-140654 received procedures during their current hospital encounter?","input":"CREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)","response":"SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours have it been since the first time patient 027-140654 received procedures during their current hospital encounter? ### Input: CREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime LIMIT 1"} {"instruction":"What district has counties represented by Baltimore county, a committee of health and government operations, and a first elected smaller than 2002?","input":"CREATE TABLE table_15822 (\n \"District\" text,\n \"Counties Represented\" text,\n \"Party\" text,\n \"First Elected\" real,\n \"Committee\" text\n)","response":"SELECT \"District\" FROM table_15822 WHERE \"Counties Represented\" = 'baltimore county' AND \"Committee\" = 'health and government operations' AND \"First Elected\" < '2002'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What district has counties represented by Baltimore county, a committee of health and government operations, and a first elected smaller than 2002? ### Input: CREATE TABLE table_15822 (\n \"District\" text,\n \"Counties Represented\" text,\n \"Party\" text,\n \"First Elected\" real,\n \"Committee\" text\n) ### Response: SELECT \"District\" FROM table_15822 WHERE \"Counties Represented\" = 'baltimore county' AND \"Committee\" = 'health and government operations' AND \"First Elected\" < '2002'"} {"instruction":"what is the number of routes that intersect highway 91 ?","input":"CREATE TABLE table_203_333 (\n id number,\n \"kilometers\" number,\n \"name\" text,\n \"location\" text,\n \"intersecting routes\" text\n)","response":"SELECT COUNT(\"intersecting routes\") FROM table_203_333","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of routes that intersect highway 91 ? ### Input: CREATE TABLE table_203_333 (\n id number,\n \"kilometers\" number,\n \"name\" text,\n \"location\" text,\n \"intersecting routes\" text\n) ### Response: SELECT COUNT(\"intersecting routes\") FROM table_203_333"} {"instruction":"Who is the home side when the away side scores 11.15 (81)?","input":"CREATE TABLE table_33617 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team\" FROM table_33617 WHERE \"Away team score\" = '11.15 (81)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the home side when the away side scores 11.15 (81)? ### Input: CREATE TABLE table_33617 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team\" FROM table_33617 WHERE \"Away team score\" = '11.15 (81)'"} {"instruction":"What is the frequency of the dates (bin into weekday interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and could you sort from low to high by the y-axis?","input":"CREATE TABLE status (\n station_id INTEGER,\n bikes_available INTEGER,\n docks_available INTEGER,\n time TEXT\n)\n\nCREATE TABLE station (\n id INTEGER,\n name TEXT,\n lat NUMERIC,\n long NUMERIC,\n dock_count INTEGER,\n city TEXT,\n installation_date TEXT\n)\n\nCREATE TABLE weather (\n date TEXT,\n max_temperature_f INTEGER,\n mean_temperature_f INTEGER,\n min_temperature_f INTEGER,\n max_dew_point_f INTEGER,\n mean_dew_point_f INTEGER,\n min_dew_point_f INTEGER,\n max_humidity INTEGER,\n mean_humidity INTEGER,\n min_humidity INTEGER,\n max_sea_level_pressure_inches NUMERIC,\n mean_sea_level_pressure_inches NUMERIC,\n min_sea_level_pressure_inches NUMERIC,\n max_visibility_miles INTEGER,\n mean_visibility_miles INTEGER,\n min_visibility_miles INTEGER,\n max_wind_Speed_mph INTEGER,\n mean_wind_speed_mph INTEGER,\n max_gust_speed_mph INTEGER,\n precipitation_inches INTEGER,\n cloud_cover INTEGER,\n events TEXT,\n wind_dir_degrees INTEGER,\n zip_code INTEGER\n)\n\nCREATE TABLE trip (\n id INTEGER,\n duration INTEGER,\n start_date TEXT,\n start_station_name TEXT,\n start_station_id INTEGER,\n end_date TEXT,\n end_station_name TEXT,\n end_station_id INTEGER,\n bike_id INTEGER,\n subscription_type TEXT,\n zip_code INTEGER\n)","response":"SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the frequency of the dates (bin into weekday interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and could you sort from low to high by the y-axis? ### Input: CREATE TABLE status (\n station_id INTEGER,\n bikes_available INTEGER,\n docks_available INTEGER,\n time TEXT\n)\n\nCREATE TABLE station (\n id INTEGER,\n name TEXT,\n lat NUMERIC,\n long NUMERIC,\n dock_count INTEGER,\n city TEXT,\n installation_date TEXT\n)\n\nCREATE TABLE weather (\n date TEXT,\n max_temperature_f INTEGER,\n mean_temperature_f INTEGER,\n min_temperature_f INTEGER,\n max_dew_point_f INTEGER,\n mean_dew_point_f INTEGER,\n min_dew_point_f INTEGER,\n max_humidity INTEGER,\n mean_humidity INTEGER,\n min_humidity INTEGER,\n max_sea_level_pressure_inches NUMERIC,\n mean_sea_level_pressure_inches NUMERIC,\n min_sea_level_pressure_inches NUMERIC,\n max_visibility_miles INTEGER,\n mean_visibility_miles INTEGER,\n min_visibility_miles INTEGER,\n max_wind_Speed_mph INTEGER,\n mean_wind_speed_mph INTEGER,\n max_gust_speed_mph INTEGER,\n precipitation_inches INTEGER,\n cloud_cover INTEGER,\n events TEXT,\n wind_dir_degrees INTEGER,\n zip_code INTEGER\n)\n\nCREATE TABLE trip (\n id INTEGER,\n duration INTEGER,\n start_date TEXT,\n start_station_name TEXT,\n start_station_id INTEGER,\n end_date TEXT,\n end_station_name TEXT,\n end_station_id INTEGER,\n bike_id INTEGER,\n subscription_type TEXT,\n zip_code INTEGER\n) ### Response: SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date)"} {"instruction":"what is the diagnosis icd9 code for patient name kurt buczek?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = \"Kurt Buczek\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the diagnosis icd9 code for patient name kurt buczek? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = \"Kurt Buczek\""} {"instruction":"Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart.","input":"CREATE TABLE exhibition_record (\n Exhibition_ID int,\n Date text,\n Attendance int\n)\n\nCREATE TABLE artist (\n Artist_ID int,\n Name text,\n Country text,\n Year_Join int,\n Age int\n)\n\nCREATE TABLE exhibition (\n Exhibition_ID int,\n Year int,\n Theme text,\n Artist_ID int,\n Ticket_Price real\n)","response":"SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart. ### Input: CREATE TABLE exhibition_record (\n Exhibition_ID int,\n Date text,\n Attendance int\n)\n\nCREATE TABLE artist (\n Artist_ID int,\n Name text,\n Country text,\n Year_Join int,\n Age int\n)\n\nCREATE TABLE exhibition (\n Exhibition_ID int,\n Year int,\n Theme text,\n Artist_ID int,\n Ticket_Price real\n) ### Response: SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004"} {"instruction":"Short Favorited Commented Questions with no Answers.","input":"CREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT Id AS \"post_link\", Tags FROM Posts WHERE LENGTH(Body) < 100 AND PostTypeId = 1 AND ClosedDate IS NULL AND DeletionDate IS NULL AND CommunityOwnedDate IS NULL AND AnswerCount = 0 AND CommentCount > 0 AND FavoriteCount > 0","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Short Favorited Commented Questions with no Answers. ### Input: CREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT Id AS \"post_link\", Tags FROM Posts WHERE LENGTH(Body) < 100 AND PostTypeId = 1 AND ClosedDate IS NULL AND DeletionDate IS NULL AND CommunityOwnedDate IS NULL AND AnswerCount = 0 AND CommentCount > 0 AND FavoriteCount > 0"} {"instruction":"For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to show from high to low by the x axis.","input":"CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)","response":"SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to show from high to low by the x axis. ### Input: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n) ### Response: SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC"} {"instruction":"Which club lost exactly 7 matches?","input":"CREATE TABLE table_74082 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Points\" text\n)","response":"SELECT \"Club\" FROM table_74082 WHERE \"Lost\" = '7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which club lost exactly 7 matches? ### Input: CREATE TABLE table_74082 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Points\" text\n) ### Response: SELECT \"Club\" FROM table_74082 WHERE \"Lost\" = '7'"} {"instruction":"What is Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'?","input":"CREATE TABLE table_name_32 (\n tie_no VARCHAR,\n date VARCHAR,\n home_team VARCHAR\n)","response":"SELECT tie_no FROM table_name_32 WHERE date = \"18 nov 1989\" AND home_team = \"doncaster rovers\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'? ### Input: CREATE TABLE table_name_32 (\n tie_no VARCHAR,\n date VARCHAR,\n home_team VARCHAR\n) ### Response: SELECT tie_no FROM table_name_32 WHERE date = \"18 nov 1989\" AND home_team = \"doncaster rovers\""} {"instruction":"On August 22, how many people came to the game?","input":"CREATE TABLE table_67152 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT \"Attendance\" FROM table_67152 WHERE \"Date\" = 'august 22'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On August 22, how many people came to the game? ### Input: CREATE TABLE table_67152 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT \"Attendance\" FROM table_67152 WHERE \"Date\" = 'august 22'"} {"instruction":"What is the latest year any of the incumbents were first elected?","input":"CREATE TABLE table_1342270_42 (\n first_elected INTEGER\n)","response":"SELECT MAX(first_elected) FROM table_1342270_42","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the latest year any of the incumbents were first elected? ### Input: CREATE TABLE table_1342270_42 (\n first_elected INTEGER\n) ### Response: SELECT MAX(first_elected) FROM table_1342270_42"} {"instruction":"count the number of people who were prescribed chlorhexidine gluconate 0.12% oral rinse within 2 months following a diagnosis of oth spf gastrt w hmrhg until 2102.","input":"CREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth spf gastrt w hmrhg') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2102') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorhexidine gluconate 0.12% oral rinse' AND STRFTIME('%y', prescriptions.startdate) <= '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of people who were prescribed chlorhexidine gluconate 0.12% oral rinse within 2 months following a diagnosis of oth spf gastrt w hmrhg until 2102. ### Input: CREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth spf gastrt w hmrhg') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2102') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorhexidine gluconate 0.12% oral rinse' AND STRFTIME('%y', prescriptions.startdate) <= '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month')"} {"instruction":"when was the last time since 04\/2104 that patient 88659 was prescribed vial and iso-osmotic dextrose at the same time?","input":"CREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)","response":"SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vial' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time since 04\/2104 that patient 88659 was prescribed vial and iso-osmotic dextrose at the same time? ### Input: CREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n) ### Response: SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vial' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate DESC LIMIT 1"} {"instruction":"Name the ppv for sky famiglia and dar 16:9 for mtv dance","input":"CREATE TABLE table_20379 (\n \"N\\u00b0\" real,\n \"Television service\" text,\n \"Country\" text,\n \"Language\" text,\n \"Content\" text,\n \"DAR\" text,\n \"HDTV\" text,\n \"PPV\" text,\n \"Package\/Option\" text\n)","response":"SELECT \"PPV\" FROM table_20379 WHERE \"Package\/Option\" = 'Sky Famiglia' AND \"DAR\" = '16:9' AND \"Television service\" = 'MTV Dance'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the ppv for sky famiglia and dar 16:9 for mtv dance ### Input: CREATE TABLE table_20379 (\n \"N\\u00b0\" real,\n \"Television service\" text,\n \"Country\" text,\n \"Language\" text,\n \"Content\" text,\n \"DAR\" text,\n \"HDTV\" text,\n \"PPV\" text,\n \"Package\/Option\" text\n) ### Response: SELECT \"PPV\" FROM table_20379 WHERE \"Package\/Option\" = 'Sky Famiglia' AND \"DAR\" = '16:9' AND \"Television service\" = 'MTV Dance'"} {"instruction":"Show institution names along with the number of proteins for each institution in a bar chart, and order by the y-axis in desc.","input":"CREATE TABLE protein (\n common_name text,\n protein_name text,\n divergence_from_human_lineage real,\n accession_number text,\n sequence_length real,\n sequence_identity_to_human_protein text,\n Institution_id text\n)\n\nCREATE TABLE building (\n building_id text,\n Name text,\n Street_address text,\n Years_as_tallest text,\n Height_feet int,\n Floors int\n)\n\nCREATE TABLE Institution (\n Institution_id text,\n Institution text,\n Location text,\n Founded real,\n Type text,\n Enrollment int,\n Team text,\n Primary_Conference text,\n building_id text\n)","response":"SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY COUNT(*) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show institution names along with the number of proteins for each institution in a bar chart, and order by the y-axis in desc. ### Input: CREATE TABLE protein (\n common_name text,\n protein_name text,\n divergence_from_human_lineage real,\n accession_number text,\n sequence_length real,\n sequence_identity_to_human_protein text,\n Institution_id text\n)\n\nCREATE TABLE building (\n building_id text,\n Name text,\n Street_address text,\n Years_as_tallest text,\n Height_feet int,\n Floors int\n)\n\nCREATE TABLE Institution (\n Institution_id text,\n Institution text,\n Location text,\n Founded real,\n Type text,\n Enrollment int,\n Team text,\n Primary_Conference text,\n building_id text\n) ### Response: SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY COUNT(*) DESC"} {"instruction":"what is the record when the round is before 3 and the time si 4:59?","input":"CREATE TABLE table_48174 (\n \"Res.\" text,\n \"Record\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Event\" text,\n \"Round\" real,\n \"Time\" text,\n \"Location\" text\n)","response":"SELECT \"Record\" FROM table_48174 WHERE \"Round\" < '3' AND \"Time\" = '4:59'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the record when the round is before 3 and the time si 4:59? ### Input: CREATE TABLE table_48174 (\n \"Res.\" text,\n \"Record\" text,\n \"Opponent\" text,\n \"Method\" text,\n \"Event\" text,\n \"Round\" real,\n \"Time\" text,\n \"Location\" text\n) ### Response: SELECT \"Record\" FROM table_48174 WHERE \"Round\" < '3' AND \"Time\" = '4:59'"} {"instruction":"A line chart for finding the number of the enrollment date for all the tests that have 'Pass' result.","input":"CREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n)","response":"SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Pass\" GROUP BY date_of_enrolment","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A line chart for finding the number of the enrollment date for all the tests that have 'Pass' result. ### Input: CREATE TABLE Subjects (\n subject_id INTEGER,\n subject_name VARCHAR(120)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n date_of_registration DATETIME,\n date_of_latest_logon DATETIME,\n login_name VARCHAR(40),\n password VARCHAR(10),\n personal_name VARCHAR(40),\n middle_name VARCHAR(40),\n family_name VARCHAR(40)\n)\n\nCREATE TABLE Course_Authors_and_Tutors (\n author_id INTEGER,\n author_tutor_ATB VARCHAR(3),\n login_name VARCHAR(40),\n password VARCHAR(40),\n personal_name VARCHAR(80),\n middle_name VARCHAR(80),\n family_name VARCHAR(80),\n gender_mf VARCHAR(1),\n address_line_1 VARCHAR(80)\n)\n\nCREATE TABLE Student_Course_Enrolment (\n registration_id INTEGER,\n student_id INTEGER,\n course_id INTEGER,\n date_of_enrolment DATETIME,\n date_of_completion DATETIME\n)\n\nCREATE TABLE Courses (\n course_id INTEGER,\n author_id INTEGER,\n subject_id INTEGER,\n course_name VARCHAR(120),\n course_description VARCHAR(255)\n)\n\nCREATE TABLE Student_Tests_Taken (\n registration_id INTEGER,\n date_test_taken DATETIME,\n test_result VARCHAR(255)\n) ### Response: SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Pass\" GROUP BY date_of_enrolment"} {"instruction":"When was 11-8 the record?","input":"CREATE TABLE table_name_43 (\n date VARCHAR,\n record VARCHAR\n)","response":"SELECT date FROM table_name_43 WHERE record = \"11-8\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was 11-8 the record? ### Input: CREATE TABLE table_name_43 (\n date VARCHAR,\n record VARCHAR\n) ### Response: SELECT date FROM table_name_43 WHERE record = \"11-8\""} {"instruction":"provide the number of patients whose primary disease is left colon cancer and age is less than 67?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"LEFT COLON CANCER\" AND demographic.age < \"67\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose primary disease is left colon cancer and age is less than 67? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"LEFT COLON CANCER\" AND demographic.age < \"67\""} {"instruction":"What is the smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million?","input":"CREATE TABLE table_name_67 (\n share INTEGER,\n viewers__m_ VARCHAR,\n timeslot_rank VARCHAR\n)","response":"SELECT MIN(share) FROM table_name_67 WHERE viewers__m_ < 8.78 AND timeslot_rank < 4","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million? ### Input: CREATE TABLE table_name_67 (\n share INTEGER,\n viewers__m_ VARCHAR,\n timeslot_rank VARCHAR\n) ### Response: SELECT MIN(share) FROM table_name_67 WHERE viewers__m_ < 8.78 AND timeslot_rank < 4"} {"instruction":"What surface was played on with a score of 6 4, 6 3 and on 4 May 1992?","input":"CREATE TABLE table_41299 (\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Partnering\" text,\n \"Opponent in the final\" text,\n \"Score\" text\n)","response":"SELECT \"Surface\" FROM table_41299 WHERE \"Score\" = '6\u20134, 6\u20133' AND \"Date\" = '4 may 1992'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What surface was played on with a score of 6 4, 6 3 and on 4 May 1992? ### Input: CREATE TABLE table_41299 (\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Partnering\" text,\n \"Opponent in the final\" text,\n \"Score\" text\n) ### Response: SELECT \"Surface\" FROM table_41299 WHERE \"Score\" = '6\u20134, 6\u20133' AND \"Date\" = '4 may 1992'"} {"instruction":"Average Accepted Answer Score by Question Score for Users Like Me.","input":"CREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)","response":"SELECT Questions.Score AS QuestionScore, AVG(Answers.Score) AS AnswerScore FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS Answers ON Answers.Id = Questions.AcceptedAnswerId WHERE Questions.Score BETWEEN 1 AND 20 AND Tags.TagName IN ('javascript', 'css', 'html', 'css3', 'html5') AND Answers.OwnerUserId = 918414 GROUP BY Questions.Score","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Average Accepted Answer Score by Question Score for Users Like Me. ### Input: CREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n) ### Response: SELECT Questions.Score AS QuestionScore, AVG(Answers.Score) AS AnswerScore FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS Answers ON Answers.Id = Questions.AcceptedAnswerId WHERE Questions.Score BETWEEN 1 AND 20 AND Tags.TagName IN ('javascript', 'css', 'html', 'css3', 'html5') AND Answers.OwnerUserId = 918414 GROUP BY Questions.Score"} {"instruction":"WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME\/RETIRED?","input":"CREATE TABLE table_47681 (\n \"Rider\" text,\n \"Manufacturer\" text,\n \"Laps\" text,\n \"Time\/Retired\" text,\n \"Grid\" text\n)","response":"SELECT \"Manufacturer\" FROM table_47681 WHERE \"Laps\" = '24' AND \"Time\/Retired\" = '+1.965'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME\/RETIRED? ### Input: CREATE TABLE table_47681 (\n \"Rider\" text,\n \"Manufacturer\" text,\n \"Laps\" text,\n \"Time\/Retired\" text,\n \"Grid\" text\n) ### Response: SELECT \"Manufacturer\" FROM table_47681 WHERE \"Laps\" = '24' AND \"Time\/Retired\" = '+1.965'"} {"instruction":"in what year was the last design of passenger baseplates for vehicle registration issued in vermont ?","input":"CREATE TABLE table_203_498 (\n id number,\n \"first issued\" text,\n \"design\" text,\n \"slogan\" text,\n \"serial format\" text,\n \"serials issued\" text,\n \"notes\" text\n)","response":"SELECT MAX(\"first issued\") FROM table_203_498","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in what year was the last design of passenger baseplates for vehicle registration issued in vermont ? ### Input: CREATE TABLE table_203_498 (\n id number,\n \"first issued\" text,\n \"design\" text,\n \"slogan\" text,\n \"serial format\" text,\n \"serials issued\" text,\n \"notes\" text\n) ### Response: SELECT MAX(\"first issued\") FROM table_203_498"} {"instruction":"What day was the oppenent the detroit lions?","input":"CREATE TABLE table_19500 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Final score\" text,\n \"Team record\" text,\n \"Game site\" text,\n \"Attendance\" real\n)","response":"SELECT \"Date\" FROM table_19500 WHERE \"Opponent\" = 'Detroit Lions'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What day was the oppenent the detroit lions? ### Input: CREATE TABLE table_19500 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Final score\" text,\n \"Team record\" text,\n \"Game site\" text,\n \"Attendance\" real\n) ### Response: SELECT \"Date\" FROM table_19500 WHERE \"Opponent\" = 'Detroit Lions'"} {"instruction":"What is the market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart.","input":"CREATE TABLE gas_station (\n Station_ID int,\n Open_Year int,\n Location text,\n Manager_Name text,\n Vice_Manager_Name text,\n Representative_Name text\n)\n\nCREATE TABLE company (\n Company_ID int,\n Rank int,\n Company text,\n Headquarters text,\n Main_Industry text,\n Sales_billion real,\n Profits_billion real,\n Assets_billion real,\n Market_Value real\n)\n\nCREATE TABLE station_company (\n Station_ID int,\n Company_ID int,\n Rank_of_the_Year int\n)","response":"SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart. ### Input: CREATE TABLE gas_station (\n Station_ID int,\n Open_Year int,\n Location text,\n Manager_Name text,\n Vice_Manager_Name text,\n Representative_Name text\n)\n\nCREATE TABLE company (\n Company_ID int,\n Rank int,\n Company text,\n Headquarters text,\n Main_Industry text,\n Sales_billion real,\n Profits_billion real,\n Assets_billion real,\n Market_Value real\n)\n\nCREATE TABLE station_company (\n Station_ID int,\n Company_ID int,\n Rank_of_the_Year int\n) ### Response: SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion"} {"instruction":"tell me the name of the last specimen test patient 26612 had received in 12\/2102?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2102-12' ORDER BY microbiologyevents.charttime DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the name of the last specimen test patient 26612 had received in 12\/2102? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2102-12' ORDER BY microbiologyevents.charttime DESC LIMIT 1"} {"instruction":"what are the new prescriptions today of patient 006-47576 compared to the prescriptions yesterday?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the new prescriptions today of patient 006-47576 compared to the prescriptions yesterday? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day')"} {"instruction":"For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of code , and group by attribute founder, show by the X from high to low please.","input":"CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)","response":"SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of code , and group by attribute founder, show by the X from high to low please. ### Input: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n) ### Response: SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC"} {"instruction":"For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and price , and group by attribute headquarter, and rank y-axis from low to high order please.","input":"CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)","response":"SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and price , and group by attribute headquarter, and rank y-axis from low to high order please. ### Input: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n) ### Response: SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price"} {"instruction":"When was the game that ended with a score of 6-4?","input":"CREATE TABLE table_name_38 (\n date VARCHAR,\n score VARCHAR\n)","response":"SELECT date FROM table_name_38 WHERE score = \"6-4\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the game that ended with a score of 6-4? ### Input: CREATE TABLE table_name_38 (\n date VARCHAR,\n score VARCHAR\n) ### Response: SELECT date FROM table_name_38 WHERE score = \"6-4\""} {"instruction":"How many goals were scored by Eugene Galekovi ?","input":"CREATE TABLE table_name_54 (\n goals VARCHAR,\n player VARCHAR\n)","response":"SELECT goals FROM table_name_54 WHERE player = \"eugene galekovi\u0107\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many goals were scored by Eugene Galekovi ? ### Input: CREATE TABLE table_name_54 (\n goals VARCHAR,\n player VARCHAR\n) ### Response: SELECT goals FROM table_name_54 WHERE player = \"eugene galekovi\u0107\""} {"instruction":"Plot total number of memory in g by grouped by carrier as a bar graph, display by the sum memory in g in asc.","input":"CREATE TABLE phone (\n Name text,\n Phone_ID int,\n Memory_in_G int,\n Carrier text,\n Price real\n)\n\nCREATE TABLE market (\n Market_ID int,\n District text,\n Num_of_employees int,\n Num_of_shops real,\n Ranking int\n)\n\nCREATE TABLE phone_market (\n Market_ID int,\n Phone_ID text,\n Num_of_stock int\n)","response":"SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot total number of memory in g by grouped by carrier as a bar graph, display by the sum memory in g in asc. ### Input: CREATE TABLE phone (\n Name text,\n Phone_ID int,\n Memory_in_G int,\n Carrier text,\n Price real\n)\n\nCREATE TABLE market (\n Market_ID int,\n District text,\n Num_of_employees int,\n Num_of_shops real,\n Ranking int\n)\n\nCREATE TABLE phone_market (\n Market_ID int,\n Phone_ID text,\n Num_of_stock int\n) ### Response: SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G)"} {"instruction":"Which Source has a Remainder of 15%, and a Topinka of 26%?","input":"CREATE TABLE table_75308 (\n \"Source\" text,\n \"Date\" text,\n \"Blagojevich (D)\" text,\n \"Topinka (R)\" text,\n \"Remainder\" text\n)","response":"SELECT \"Source\" FROM table_75308 WHERE \"Remainder\" = '15%' AND \"Topinka (R)\" = '26%'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Source has a Remainder of 15%, and a Topinka of 26%? ### Input: CREATE TABLE table_75308 (\n \"Source\" text,\n \"Date\" text,\n \"Blagojevich (D)\" text,\n \"Topinka (R)\" text,\n \"Remainder\" text\n) ### Response: SELECT \"Source\" FROM table_75308 WHERE \"Remainder\" = '15%' AND \"Topinka (R)\" = '26%'"} {"instruction":"What is the date of the Cubs game when the Cubs had a record of 1-0?","input":"CREATE TABLE table_name_2 (\n date VARCHAR,\n record VARCHAR\n)","response":"SELECT date FROM table_name_2 WHERE record = \"1-0\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date of the Cubs game when the Cubs had a record of 1-0? ### Input: CREATE TABLE table_name_2 (\n date VARCHAR,\n record VARCHAR\n) ### Response: SELECT date FROM table_name_2 WHERE record = \"1-0\""} {"instruction":"give the number of patients whose drug code is phen10i and lab test category is blood gas.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = \"PHEN10I\" AND lab.\"CATEGORY\" = \"Blood Gas\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients whose drug code is phen10i and lab test category is blood gas. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = \"PHEN10I\" AND lab.\"CATEGORY\" = \"Blood Gas\""} {"instruction":"How many patients were admitted with pure hyperglyceridemia before 2187?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < \"2187\" AND diagnoses.long_title = \"Pure hyperglyceridemia\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients were admitted with pure hyperglyceridemia before 2187? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < \"2187\" AND diagnoses.long_title = \"Pure hyperglyceridemia\""} {"instruction":"What is the name of the artist that issued the single on 23 February?","input":"CREATE TABLE table_9850 (\n \"Volume:Issue\" text,\n \"Issue Date(s)\" text,\n \"Weeks on Top\" text,\n \"Song\" text,\n \"Artist\" text\n)","response":"SELECT \"Artist\" FROM table_9850 WHERE \"Issue Date(s)\" = '23 february'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the artist that issued the single on 23 February? ### Input: CREATE TABLE table_9850 (\n \"Volume:Issue\" text,\n \"Issue Date(s)\" text,\n \"Weeks on Top\" text,\n \"Song\" text,\n \"Artist\" text\n) ### Response: SELECT \"Artist\" FROM table_9850 WHERE \"Issue Date(s)\" = '23 february'"} {"instruction":"What is the result of the game on April 17 against Los Angeles?","input":"CREATE TABLE table_8232 (\n \"Game\" text,\n \"Date\" text,\n \"Home Team\" text,\n \"Result\" text,\n \"Road Team\" text\n)","response":"SELECT \"Result\" FROM table_8232 WHERE \"Road Team\" = 'los angeles' AND \"Date\" = 'april 17'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result of the game on April 17 against Los Angeles? ### Input: CREATE TABLE table_8232 (\n \"Game\" text,\n \"Date\" text,\n \"Home Team\" text,\n \"Result\" text,\n \"Road Team\" text\n) ### Response: SELECT \"Result\" FROM table_8232 WHERE \"Road Team\" = 'los angeles' AND \"Date\" = 'april 17'"} {"instruction":"List the record from the game where Wildcats had 48 points.","input":"CREATE TABLE table_24561550_1 (\n record VARCHAR,\n wildcats_points VARCHAR\n)","response":"SELECT record FROM table_24561550_1 WHERE wildcats_points = 48","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the record from the game where Wildcats had 48 points. ### Input: CREATE TABLE table_24561550_1 (\n record VARCHAR,\n wildcats_points VARCHAR\n) ### Response: SELECT record FROM table_24561550_1 WHERE wildcats_points = 48"} {"instruction":"show me the flights from PHILADELPHIA to DALLAS with 1 stop","input":"CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the flights from PHILADELPHIA to DALLAS with 1 stop ### Input: CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"Show all card type codes and the number of cards in each type.","input":"CREATE TABLE customers (\n customer_id number,\n customer_first_name text,\n customer_last_name text,\n customer_address text,\n customer_phone text,\n customer_email text,\n other_customer_details text\n)\n\nCREATE TABLE financial_transactions (\n transaction_id number,\n previous_transaction_id number,\n account_id number,\n card_id number,\n transaction_type text,\n transaction_date time,\n transaction_amount number,\n transaction_comment text,\n other_transaction_details text\n)\n\nCREATE TABLE customers_cards (\n card_id number,\n customer_id number,\n card_type_code text,\n card_number text,\n date_valid_from time,\n date_valid_to time,\n other_card_details text\n)\n\nCREATE TABLE accounts (\n account_id number,\n customer_id number,\n account_name text,\n other_account_details text\n)","response":"SELECT card_type_code, COUNT(*) FROM customers_cards GROUP BY card_type_code","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all card type codes and the number of cards in each type. ### Input: CREATE TABLE customers (\n customer_id number,\n customer_first_name text,\n customer_last_name text,\n customer_address text,\n customer_phone text,\n customer_email text,\n other_customer_details text\n)\n\nCREATE TABLE financial_transactions (\n transaction_id number,\n previous_transaction_id number,\n account_id number,\n card_id number,\n transaction_type text,\n transaction_date time,\n transaction_amount number,\n transaction_comment text,\n other_transaction_details text\n)\n\nCREATE TABLE customers_cards (\n card_id number,\n customer_id number,\n card_type_code text,\n card_number text,\n date_valid_from time,\n date_valid_to time,\n other_card_details text\n)\n\nCREATE TABLE accounts (\n account_id number,\n customer_id number,\n account_name text,\n other_account_details text\n) ### Response: SELECT card_type_code, COUNT(*) FROM customers_cards GROUP BY card_type_code"} {"instruction":"Name the song choice for michael jackson","input":"CREATE TABLE table_23048 (\n \"Week #\" text,\n \"Theme\" text,\n \"Song choice\" text,\n \"Original artist\" text,\n \"Order #\" text,\n \"Result\" text\n)","response":"SELECT \"Song choice\" FROM table_23048 WHERE \"Original artist\" = 'Michael Jackson'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the song choice for michael jackson ### Input: CREATE TABLE table_23048 (\n \"Week #\" text,\n \"Theme\" text,\n \"Song choice\" text,\n \"Original artist\" text,\n \"Order #\" text,\n \"Result\" text\n) ### Response: SELECT \"Song choice\" FROM table_23048 WHERE \"Original artist\" = 'Michael Jackson'"} {"instruction":"How many points did the ESC Riverrats Geretsried, who lost more than 3 games, score?","input":"CREATE TABLE table_name_17 (\n points INTEGER,\n lost VARCHAR,\n name VARCHAR\n)","response":"SELECT SUM(points) FROM table_name_17 WHERE lost > 3 AND name = \"esc riverrats geretsried\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many points did the ESC Riverrats Geretsried, who lost more than 3 games, score? ### Input: CREATE TABLE table_name_17 (\n points INTEGER,\n lost VARCHAR,\n name VARCHAR\n) ### Response: SELECT SUM(points) FROM table_name_17 WHERE lost > 3 AND name = \"esc riverrats geretsried\""} {"instruction":"How big was the crowd when the away team was Richmond?","input":"CREATE TABLE table_name_4 (\n crowd VARCHAR,\n away_team VARCHAR\n)","response":"SELECT crowd FROM table_name_4 WHERE away_team = \"richmond\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How big was the crowd when the away team was Richmond? ### Input: CREATE TABLE table_name_4 (\n crowd VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT crowd FROM table_name_4 WHERE away_team = \"richmond\""} {"instruction":"Name the cyrillic name for melenci","input":"CREATE TABLE table_3334 (\n \"Settlement\" text,\n \"Cyrillic Name Other Names\" text,\n \"Type\" text,\n \"Population (2011)\" real,\n \"Largest ethnic group (2002)\" text,\n \"Dominant religion (2002)\" text\n)","response":"SELECT \"Cyrillic Name Other Names\" FROM table_3334 WHERE \"Settlement\" = 'Melenci'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the cyrillic name for melenci ### Input: CREATE TABLE table_3334 (\n \"Settlement\" text,\n \"Cyrillic Name Other Names\" text,\n \"Type\" text,\n \"Population (2011)\" real,\n \"Largest ethnic group (2002)\" text,\n \"Dominant religion (2002)\" text\n) ### Response: SELECT \"Cyrillic Name Other Names\" FROM table_3334 WHERE \"Settlement\" = 'Melenci'"} {"instruction":"current alcohol abuse","input":"CREATE TABLE table_train_185 (\n \"id\" int,\n \"dyscrasia\" bool,\n \"bleeding\" int,\n \"panic_disorder\" bool,\n \"renal_disease\" bool,\n \"anxiety\" bool,\n \"creatinine_clearance_cl\" float,\n \"alcohol_abuse\" bool,\n \"retinopathy\" bool,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_185 WHERE alcohol_abuse = 1","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: current alcohol abuse ### Input: CREATE TABLE table_train_185 (\n \"id\" int,\n \"dyscrasia\" bool,\n \"bleeding\" int,\n \"panic_disorder\" bool,\n \"renal_disease\" bool,\n \"anxiety\" bool,\n \"creatinine_clearance_cl\" float,\n \"alcohol_abuse\" bool,\n \"retinopathy\" bool,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_185 WHERE alcohol_abuse = 1"} {"instruction":"For week number of the top 40, what was the results?","input":"CREATE TABLE table_22736523_1 (\n result VARCHAR,\n week__number VARCHAR\n)","response":"SELECT result FROM table_22736523_1 WHERE week__number = \"Top 40\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For week number of the top 40, what was the results? ### Input: CREATE TABLE table_22736523_1 (\n result VARCHAR,\n week__number VARCHAR\n) ### Response: SELECT result FROM table_22736523_1 WHERE week__number = \"Top 40\""} {"instruction":"Number of posts in past 30 days.","input":"CREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)","response":"SELECT COUNT(*) FROM Posts WHERE PostTypeId IN (1, 2) AND CreationDate >= DATEADD(DAY, -30, GETDATE())","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of posts in past 30 days. ### Input: CREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n) ### Response: SELECT COUNT(*) FROM Posts WHERE PostTypeId IN (1, 2) AND CreationDate >= DATEADD(DAY, -30, GETDATE())"} {"instruction":"What are the age groups for the Big League World Series?","input":"CREATE TABLE table_name_26 (\n age_groups VARCHAR,\n competition_name VARCHAR\n)","response":"SELECT age_groups FROM table_name_26 WHERE competition_name = \"big league world series\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the age groups for the Big League World Series? ### Input: CREATE TABLE table_name_26 (\n age_groups VARCHAR,\n competition_name VARCHAR\n) ### Response: SELECT age_groups FROM table_name_26 WHERE competition_name = \"big league world series\""} {"instruction":"What is the money with a Score of 76-70-75-72=293?","input":"CREATE TABLE table_58997 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real,\n \"Money ( \\u00a3 )\" text\n)","response":"SELECT \"Money ( \\u00a3 )\" FROM table_58997 WHERE \"Score\" = '76-70-75-72=293'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the money with a Score of 76-70-75-72=293? ### Input: CREATE TABLE table_58997 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real,\n \"Money ( \\u00a3 )\" text\n) ### Response: SELECT \"Money ( \\u00a3 )\" FROM table_58997 WHERE \"Score\" = '76-70-75-72=293'"} {"instruction":"give me the number of patients whose language is cape and age is less than 67?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = \"CAPE\" AND demographic.age < \"67\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose language is cape and age is less than 67? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = \"CAPE\" AND demographic.age < \"67\""} {"instruction":"Which year has an Organization of new york yankees, and a Team of johnson city yankees?","input":"CREATE TABLE table_name_61 (\n year VARCHAR,\n organization VARCHAR,\n team VARCHAR\n)","response":"SELECT year FROM table_name_61 WHERE organization = \"new york yankees\" AND team = \"johnson city yankees\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which year has an Organization of new york yankees, and a Team of johnson city yankees? ### Input: CREATE TABLE table_name_61 (\n year VARCHAR,\n organization VARCHAR,\n team VARCHAR\n) ### Response: SELECT year FROM table_name_61 WHERE organization = \"new york yankees\" AND team = \"johnson city yankees\""} {"instruction":"calculate the minimum age of patients who are 83 years of age or older and were hospitalized for 43 days.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= \"83\" AND demographic.days_stay = \"43\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the minimum age of patients who are 83 years of age or older and were hospitalized for 43 days. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= \"83\" AND demographic.days_stay = \"43\""} {"instruction":"What are the names of storms that did not affect two or more regions?","input":"CREATE TABLE region (\n region_id number,\n region_code text,\n region_name text\n)\n\nCREATE TABLE affected_region (\n region_id number,\n storm_id number,\n number_city_affected number\n)\n\nCREATE TABLE storm (\n storm_id number,\n name text,\n dates_active text,\n max_speed number,\n damage_millions_usd number,\n number_deaths number\n)","response":"SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of storms that did not affect two or more regions? ### Input: CREATE TABLE region (\n region_id number,\n region_code text,\n region_name text\n)\n\nCREATE TABLE affected_region (\n region_id number,\n storm_id number,\n number_city_affected number\n)\n\nCREATE TABLE storm (\n storm_id number,\n name text,\n dates_active text,\n max_speed number,\n damage_millions_usd number,\n number_deaths number\n) ### Response: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2"} {"instruction":"What is the average pick of player paul maclean, who had a draft before 1978?","input":"CREATE TABLE table_12802 (\n \"Draft\" real,\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Nationality\" text\n)","response":"SELECT AVG(\"Pick\") FROM table_12802 WHERE \"Player\" = 'paul maclean' AND \"Draft\" < '1978'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average pick of player paul maclean, who had a draft before 1978? ### Input: CREATE TABLE table_12802 (\n \"Draft\" real,\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Nationality\" text\n) ### Response: SELECT AVG(\"Pick\") FROM table_12802 WHERE \"Player\" = 'paul maclean' AND \"Draft\" < '1978'"} {"instruction":"Name the class for boten","input":"CREATE TABLE table_1745843_9 (\n class VARCHAR,\n part_3 VARCHAR\n)","response":"SELECT class FROM table_1745843_9 WHERE part_3 = \"boten\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the class for boten ### Input: CREATE TABLE table_1745843_9 (\n class VARCHAR,\n part_3 VARCHAR\n) ### Response: SELECT class FROM table_1745843_9 WHERE part_3 = \"boten\""} {"instruction":"Name the segment 1 for episode # 2\/225","input":"CREATE TABLE table_26635 (\n \"Episode #\" text,\n \"Segment 1\" text,\n \"Segment 2\" text,\n \"Original airdate\" text,\n \"Lessons taught\" text\n)","response":"SELECT \"Segment 1\" FROM table_26635 WHERE \"Episode #\" = '2\/225'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the segment 1 for episode # 2\/225 ### Input: CREATE TABLE table_26635 (\n \"Episode #\" text,\n \"Segment 1\" text,\n \"Segment 2\" text,\n \"Original airdate\" text,\n \"Lessons taught\" text\n) ### Response: SELECT \"Segment 1\" FROM table_26635 WHERE \"Episode #\" = '2\/225'"} {"instruction":"Find retaggable AS questions that are open or don't roomba.","input":"CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"SELECT Id AS \"post_link\", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find retaggable AS questions that are open or don't roomba. ### Input: CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: SELECT Id AS \"post_link\", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000"} {"instruction":"what are the four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104?","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '29-30 comp wks gestation') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 4","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104? ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '29-30 comp wks gestation') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 4"} {"instruction":"Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494?","input":"CREATE TABLE table_name_12 (\n director VARCHAR,\n release_date VARCHAR,\n series VARCHAR,\n production_num VARCHAR\n)","response":"SELECT director FROM table_name_12 WHERE series = \"mm\" AND production_num < 6494 AND release_date = \"1934-09-15\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494? ### Input: CREATE TABLE table_name_12 (\n director VARCHAR,\n release_date VARCHAR,\n series VARCHAR,\n production_num VARCHAR\n) ### Response: SELECT director FROM table_name_12 WHERE series = \"mm\" AND production_num < 6494 AND release_date = \"1934-09-15\""} {"instruction":"Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5?","input":"CREATE TABLE table_name_32 (\n pick__number INTEGER,\n name VARCHAR,\n round VARCHAR\n)","response":"SELECT MAX(pick__number) FROM table_name_32 WHERE name = \"william middleton\" AND round > 5","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5? ### Input: CREATE TABLE table_name_32 (\n pick__number INTEGER,\n name VARCHAR,\n round VARCHAR\n) ### Response: SELECT MAX(pick__number) FROM table_name_32 WHERE name = \"william middleton\" AND round > 5"} {"instruction":"count the number of patients who have had a remove fb from periton procedure performed two or more times since 2104.","input":"CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)","response":"SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove fb from periton') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have had a remove fb from periton procedure performed two or more times since 2104. ### Input: CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remove fb from periton') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2"} {"instruction":"Which Fictional narrator has a Published as serial of february july 1912, all-story?","input":"CREATE TABLE table_14163 (\n \"Order\" real,\n \"Published as serial\" text,\n \"Published as novel\" text,\n \"Fictional narrator\" text,\n \"Year in novel\" text\n)","response":"SELECT \"Fictional narrator\" FROM table_14163 WHERE \"Published as serial\" = 'february\u2013july 1912, all-story'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Fictional narrator has a Published as serial of february july 1912, all-story? ### Input: CREATE TABLE table_14163 (\n \"Order\" real,\n \"Published as serial\" text,\n \"Published as novel\" text,\n \"Fictional narrator\" text,\n \"Year in novel\" text\n) ### Response: SELECT \"Fictional narrator\" FROM table_14163 WHERE \"Published as serial\" = 'february\u2013july 1912, all-story'"} {"instruction":"Would EEB 412 qualify for ULCS ?","input":"CREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)","response":"SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%'","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Would EEB 412 qualify for ULCS ? ### Input: CREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n) ### Response: SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%'"} {"instruction":"Which time\/retired has a qual of 144.02?","input":"CREATE TABLE table_name_75 (\n time_retired VARCHAR,\n qual VARCHAR\n)","response":"SELECT time_retired FROM table_name_75 WHERE qual = 144.02","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which time\/retired has a qual of 144.02? ### Input: CREATE TABLE table_name_75 (\n time_retired VARCHAR,\n qual VARCHAR\n) ### Response: SELECT time_retired FROM table_name_75 WHERE qual = 144.02"} {"instruction":"did patient 030-6441 have a wound care procedure at other hospitals?","input":"CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'wound care'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 030-6441 have a wound care procedure at other hospitals? ### Input: CREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'wound care'"} {"instruction":"count the number of patients who until 4 years ago have been prescribed acd-a for crrt.","input":"CREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year'))","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who until 4 years ago have been prescribed acd-a for crrt. ### Input: CREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year'))"} {"instruction":"In season is 2008 09, how many wins did they have?","input":"CREATE TABLE table_23959 (\n \"Season\" text,\n \"GP\" real,\n \"W (OT\/SO)\" text,\n \"L (OT\/SO)\" text,\n \"Pts\" real,\n \"Pts\/GP\" text,\n \"GF \\u2013 GA\" text,\n \"Rank (league\/conference)\" text,\n \"Top Scorer\" text\n)","response":"SELECT \"W (OT\/SO)\" FROM table_23959 WHERE \"Season\" = '2008\u201309'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In season is 2008 09, how many wins did they have? ### Input: CREATE TABLE table_23959 (\n \"Season\" text,\n \"GP\" real,\n \"W (OT\/SO)\" text,\n \"L (OT\/SO)\" text,\n \"Pts\" real,\n \"Pts\/GP\" text,\n \"GF \\u2013 GA\" text,\n \"Rank (league\/conference)\" text,\n \"Top Scorer\" text\n) ### Response: SELECT \"W (OT\/SO)\" FROM table_23959 WHERE \"Season\" = '2008\u201309'"} {"instruction":"How many people scored the most points during the game on December 10?","input":"CREATE TABLE table_27756014_6 (\n high_points VARCHAR,\n date VARCHAR\n)","response":"SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = \"December 10\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people scored the most points during the game on December 10? ### Input: CREATE TABLE table_27756014_6 (\n high_points VARCHAR,\n date VARCHAR\n) ### Response: SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = \"December 10\""} {"instruction":"For the match with a home team score of 11.14 (80), what was the venue?","input":"CREATE TABLE table_33317 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Venue\" FROM table_33317 WHERE \"Home team score\" = '11.14 (80)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the match with a home team score of 11.14 (80), what was the venue? ### Input: CREATE TABLE table_33317 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Venue\" FROM table_33317 WHERE \"Home team score\" = '11.14 (80)'"} {"instruction":"How many positions are there for RB1 Motorsports?","input":"CREATE TABLE table_3588 (\n \"Year\" real,\n \"Starts\" real,\n \"Wins\" real,\n \"Top 10\" real,\n \"Avg. Start\" text,\n \"Avg. Finish\" text,\n \"Winnings\" text,\n \"Position\" text,\n \"Team(s)\" text\n)","response":"SELECT COUNT(\"Position\") FROM table_3588 WHERE \"Team(s)\" = 'RB1 Motorsports'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many positions are there for RB1 Motorsports? ### Input: CREATE TABLE table_3588 (\n \"Year\" real,\n \"Starts\" real,\n \"Wins\" real,\n \"Top 10\" real,\n \"Avg. Start\" text,\n \"Avg. Finish\" text,\n \"Winnings\" text,\n \"Position\" text,\n \"Team(s)\" text\n) ### Response: SELECT COUNT(\"Position\") FROM table_3588 WHERE \"Team(s)\" = 'RB1 Motorsports'"} {"instruction":"what is minimum days of hospital stay of patients whose age is greater than or equal to 41?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= \"41\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum days of hospital stay of patients whose age is greater than or equal to 41? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= \"41\""} {"instruction":"Who is every high points for the Pistons team?","input":"CREATE TABLE table_23248910_9 (\n high_points VARCHAR,\n team VARCHAR\n)","response":"SELECT high_points FROM table_23248910_9 WHERE team = \"Pistons\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is every high points for the Pistons team? ### Input: CREATE TABLE table_23248910_9 (\n high_points VARCHAR,\n team VARCHAR\n) ### Response: SELECT high_points FROM table_23248910_9 WHERE team = \"Pistons\""} {"instruction":"what is the price for amylase, body fluid?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)","response":"SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'amylase, body fluid'))","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the price for amylase, body fluid? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'amylase, body fluid'))"} {"instruction":"Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what total number?","input":"CREATE TABLE table_5631 (\n \"Frequency (MHz)\" real,\n \"Call letters\" text,\n \"Licensed location\" text,\n \"Type\" text,\n \"Format\" text\n)","response":"SELECT COUNT(\"Frequency (MHz)\") FROM table_5631 WHERE \"Type\" = 'primary' AND \"Call letters\" = 'ktbb-fm'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what total number? ### Input: CREATE TABLE table_5631 (\n \"Frequency (MHz)\" real,\n \"Call letters\" text,\n \"Licensed location\" text,\n \"Type\" text,\n \"Format\" text\n) ### Response: SELECT COUNT(\"Frequency (MHz)\") FROM table_5631 WHERE \"Type\" = 'primary' AND \"Call letters\" = 'ktbb-fm'"} {"instruction":"A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and sort by the x axis from high to low.","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and sort by the x axis from high to low. ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC"} {"instruction":"How many types of valves were used on this engine that was built on 1902-05?","input":"CREATE TABLE table_25695027_1 (\n valves VARCHAR,\n years_built VARCHAR\n)","response":"SELECT COUNT(valves) FROM table_25695027_1 WHERE years_built = \"1902-05\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many types of valves were used on this engine that was built on 1902-05? ### Input: CREATE TABLE table_25695027_1 (\n valves VARCHAR,\n years_built VARCHAR\n) ### Response: SELECT COUNT(valves) FROM table_25695027_1 WHERE years_built = \"1902-05\""} {"instruction":"Who won with the fastest lap of daijiro hiura on March 29?","input":"CREATE TABLE table_name_97 (\n race_winner VARCHAR,\n fastest_lap VARCHAR,\n date VARCHAR\n)","response":"SELECT race_winner FROM table_name_97 WHERE fastest_lap = \"daijiro hiura\" AND date = \"march 29\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who won with the fastest lap of daijiro hiura on March 29? ### Input: CREATE TABLE table_name_97 (\n race_winner VARCHAR,\n fastest_lap VARCHAR,\n date VARCHAR\n) ### Response: SELECT race_winner FROM table_name_97 WHERE fastest_lap = \"daijiro hiura\" AND date = \"march 29\""} {"instruction":"since 2100 what are the five most frequently ordered lab tests for patients 40s?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)","response":"SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 2100 what are the five most frequently ordered lab tests for patients 40s? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n) ### Response: SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5"} {"instruction":"What is the Elevation (m) of the Peak with a Prominence (m) larger than 2,143 and Col (m) of 2012?","input":"CREATE TABLE table_79478 (\n \"Peak\" text,\n \"Country\" text,\n \"Elevation (m)\" real,\n \"Prominence (m)\" real,\n \"Col (m)\" real\n)","response":"SELECT \"Elevation (m)\" FROM table_79478 WHERE \"Prominence (m)\" > '2,143' AND \"Col (m)\" = '2012'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Elevation (m) of the Peak with a Prominence (m) larger than 2,143 and Col (m) of 2012? ### Input: CREATE TABLE table_79478 (\n \"Peak\" text,\n \"Country\" text,\n \"Elevation (m)\" real,\n \"Prominence (m)\" real,\n \"Col (m)\" real\n) ### Response: SELECT \"Elevation (m)\" FROM table_79478 WHERE \"Prominence (m)\" > '2,143' AND \"Col (m)\" = '2012'"} {"instruction":"What is the country of the airport with the highest elevation?","input":"CREATE TABLE airlines (\n alid number,\n name text,\n iata text,\n icao text,\n callsign text,\n country text,\n active text\n)\n\nCREATE TABLE airports (\n apid number,\n name text,\n city text,\n country text,\n x number,\n y number,\n elevation number,\n iata text,\n icao text\n)\n\nCREATE TABLE routes (\n rid number,\n dst_apid number,\n dst_ap text,\n src_apid number,\n src_ap text,\n alid number,\n airline text,\n codeshare text\n)","response":"SELECT country FROM airports ORDER BY elevation DESC LIMIT 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country of the airport with the highest elevation? ### Input: CREATE TABLE airlines (\n alid number,\n name text,\n iata text,\n icao text,\n callsign text,\n country text,\n active text\n)\n\nCREATE TABLE airports (\n apid number,\n name text,\n city text,\n country text,\n x number,\n y number,\n elevation number,\n iata text,\n icao text\n)\n\nCREATE TABLE routes (\n rid number,\n dst_apid number,\n dst_ap text,\n src_apid number,\n src_ap text,\n alid number,\n airline text,\n codeshare text\n) ### Response: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1"} {"instruction":"What was the losing bonus that had 1 draw and a 10 try bonus?","input":"CREATE TABLE table_name_51 (\n losing_bonus VARCHAR,\n drawn VARCHAR,\n try_bonus VARCHAR\n)","response":"SELECT losing_bonus FROM table_name_51 WHERE drawn = \"1\" AND try_bonus = \"10\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the losing bonus that had 1 draw and a 10 try bonus? ### Input: CREATE TABLE table_name_51 (\n losing_bonus VARCHAR,\n drawn VARCHAR,\n try_bonus VARCHAR\n) ### Response: SELECT losing_bonus FROM table_name_51 WHERE drawn = \"1\" AND try_bonus = \"10\""} {"instruction":"List the first name and last name of customers have the amount of outstanding between 1000 and 3000.","input":"CREATE TABLE addresses (\n address_id number,\n line_1_number_building text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE vehicles (\n vehicle_id number,\n vehicle_details text\n)\n\nCREATE TABLE lessons (\n lesson_id number,\n customer_id number,\n lesson_status_code text,\n staff_id number,\n vehicle_id number,\n lesson_date time,\n lesson_time text,\n price number\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_address_id number,\n customer_status_code text,\n date_became_customer time,\n date_of_birth time,\n first_name text,\n last_name text,\n amount_outstanding number,\n email_address text,\n phone_number text,\n cell_mobile_phone_number text\n)\n\nCREATE TABLE staff (\n staff_id number,\n staff_address_id number,\n nickname text,\n first_name text,\n middle_name text,\n last_name text,\n date_of_birth time,\n date_joined_staff time,\n date_left_staff time\n)\n\nCREATE TABLE customer_payments (\n customer_id number,\n datetime_payment time,\n payment_method_code text,\n amount_payment number\n)","response":"SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the first name and last name of customers have the amount of outstanding between 1000 and 3000. ### Input: CREATE TABLE addresses (\n address_id number,\n line_1_number_building text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE vehicles (\n vehicle_id number,\n vehicle_details text\n)\n\nCREATE TABLE lessons (\n lesson_id number,\n customer_id number,\n lesson_status_code text,\n staff_id number,\n vehicle_id number,\n lesson_date time,\n lesson_time text,\n price number\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_address_id number,\n customer_status_code text,\n date_became_customer time,\n date_of_birth time,\n first_name text,\n last_name text,\n amount_outstanding number,\n email_address text,\n phone_number text,\n cell_mobile_phone_number text\n)\n\nCREATE TABLE staff (\n staff_id number,\n staff_address_id number,\n nickname text,\n first_name text,\n middle_name text,\n last_name text,\n date_of_birth time,\n date_joined_staff time,\n date_left_staff time\n)\n\nCREATE TABLE customer_payments (\n customer_id number,\n datetime_payment time,\n payment_method_code text,\n amount_payment number\n) ### Response: SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000"} {"instruction":"What shuttle Run (sec) time has a 2.4km Run (min:sec) of 12:21-13:00?","input":"CREATE TABLE table_56767 (\n \"Grade\" text,\n \"Points\" real,\n \"Sit-up (reps)\" text,\n \"Standing Broad Jump (cm)\" text,\n \"Chin-up (reps)\" text,\n \"Shuttle Run (sec)\" text,\n \"2.4km Run (min:sec)\" text\n)","response":"SELECT \"Shuttle Run (sec)\" FROM table_56767 WHERE \"2.4km Run (min:sec)\" = '12:21-13:00'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shuttle Run (sec) time has a 2.4km Run (min:sec) of 12:21-13:00? ### Input: CREATE TABLE table_56767 (\n \"Grade\" text,\n \"Points\" real,\n \"Sit-up (reps)\" text,\n \"Standing Broad Jump (cm)\" text,\n \"Chin-up (reps)\" text,\n \"Shuttle Run (sec)\" text,\n \"2.4km Run (min:sec)\" text\n) ### Response: SELECT \"Shuttle Run (sec)\" FROM table_56767 WHERE \"2.4km Run (min:sec)\" = '12:21-13:00'"} {"instruction":"Which highest Round has a Result of loss?","input":"CREATE TABLE table_name_27 (\n round INTEGER,\n result VARCHAR\n)","response":"SELECT MAX(round) FROM table_name_27 WHERE result = \"loss\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which highest Round has a Result of loss? ### Input: CREATE TABLE table_name_27 (\n round INTEGER,\n result VARCHAR\n) ### Response: SELECT MAX(round) FROM table_name_27 WHERE result = \"loss\""} {"instruction":"Name the publication date when the fictional date is 2112","input":"CREATE TABLE table_name_25 (\n publication_date VARCHAR,\n fictional_date VARCHAR\n)","response":"SELECT publication_date FROM table_name_25 WHERE fictional_date = \"2112\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the publication date when the fictional date is 2112 ### Input: CREATE TABLE table_name_25 (\n publication_date VARCHAR,\n fictional_date VARCHAR\n) ### Response: SELECT publication_date FROM table_name_25 WHERE fictional_date = \"2112\""} {"instruction":"What township is 28.597 square miles of land?","input":"CREATE TABLE table_22466 (\n \"Township\" text,\n \"County\" text,\n \"Pop. (2010)\" real,\n \"Land ( sqmi )\" text,\n \"Water (sqmi)\" text,\n \"Latitude\" text,\n \"Longitude\" text,\n \"GEO ID\" real,\n \"ANSI code\" real\n)","response":"SELECT \"Township\" FROM table_22466 WHERE \"Land ( sqmi )\" = '28.597'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What township is 28.597 square miles of land? ### Input: CREATE TABLE table_22466 (\n \"Township\" text,\n \"County\" text,\n \"Pop. (2010)\" real,\n \"Land ( sqmi )\" text,\n \"Water (sqmi)\" text,\n \"Latitude\" text,\n \"Longitude\" text,\n \"GEO ID\" real,\n \"ANSI code\" real\n) ### Response: SELECT \"Township\" FROM table_22466 WHERE \"Land ( sqmi )\" = '28.597'"} {"instruction":"For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, and display from low to high by the sum employee id.","input":"CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)","response":"SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, and display from low to high by the sum employee id. ### Input: CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n) ### Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)"} {"instruction":"What is the lowest number of laps obtained by driver Nick Heidfeld?","input":"CREATE TABLE table_name_32 (\n laps INTEGER,\n driver VARCHAR\n)","response":"SELECT MIN(laps) FROM table_name_32 WHERE driver = \"nick heidfeld\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of laps obtained by driver Nick Heidfeld? ### Input: CREATE TABLE table_name_32 (\n laps INTEGER,\n driver VARCHAR\n) ### Response: SELECT MIN(laps) FROM table_name_32 WHERE driver = \"nick heidfeld\""} {"instruction":"Show the name of each county along with the corresponding number of delegates from that county.","input":"CREATE TABLE county (\n County_Id int,\n County_name text,\n Population real,\n Zip_code text\n)\n\nCREATE TABLE party (\n Party_ID int,\n Year real,\n Party text,\n Governor text,\n Lieutenant_Governor text,\n Comptroller text,\n Attorney_General text,\n US_Senate text\n)\n\nCREATE TABLE election (\n Election_ID int,\n Counties_Represented text,\n District int,\n Delegate text,\n Party int,\n First_Elected real,\n Committee text\n)","response":"SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name of each county along with the corresponding number of delegates from that county. ### Input: CREATE TABLE county (\n County_Id int,\n County_name text,\n Population real,\n Zip_code text\n)\n\nCREATE TABLE party (\n Party_ID int,\n Year real,\n Party text,\n Governor text,\n Lieutenant_Governor text,\n Comptroller text,\n Attorney_General text,\n US_Senate text\n)\n\nCREATE TABLE election (\n Election_ID int,\n Counties_Represented text,\n District int,\n Delegate text,\n Party int,\n First_Elected real,\n Committee text\n) ### Response: SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id"} {"instruction":"give me the top four most common diagnoses since 1 year ago.","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the top four most common diagnoses since 1 year ago. ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4"} {"instruction":"what is drug type of drug name cephalexin?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = \"Cephalexin\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is drug type of drug name cephalexin? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = \"Cephalexin\""} {"instruction":"What is the career SR with a 1r in 1985?","input":"CREATE TABLE table_name_43 (\n career_sr VARCHAR\n)","response":"SELECT career_sr FROM table_name_43 WHERE 1985 = \"1r\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the career SR with a 1r in 1985? ### Input: CREATE TABLE table_name_43 (\n career_sr VARCHAR\n) ### Response: SELECT career_sr FROM table_name_43 WHERE 1985 = \"1r\""} {"instruction":"What party was first elected in 1974?","input":"CREATE TABLE table_1341453_7 (\n party VARCHAR,\n first_elected VARCHAR\n)","response":"SELECT party FROM table_1341453_7 WHERE first_elected = 1974","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What party was first elected in 1974? ### Input: CREATE TABLE table_1341453_7 (\n party VARCHAR,\n first_elected VARCHAR\n) ### Response: SELECT party FROM table_1341453_7 WHERE first_elected = 1974"} {"instruction":"SELECT TOP 10 Id AS [Post Link] FROM Posts ORDER BY CreationDate DESC.","input":"CREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)","response":"SELECT Id AS \"post_link\" FROM Posts ORDER BY CreationDate DESC LIMIT 10","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: SELECT TOP 10 Id AS [Post Link] FROM Posts ORDER BY CreationDate DESC. ### Input: CREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n) ### Response: SELECT Id AS \"post_link\" FROM Posts ORDER BY CreationDate DESC LIMIT 10"} {"instruction":"what is lab test name of subject name kelly gallardo?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = \"Kelly Gallardo\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is lab test name of subject name kelly gallardo? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = \"Kelly Gallardo\""} {"instruction":"How many attended the game on 12\/17 with stephen jackson as the leading scorer?","input":"CREATE TABLE table_name_45 (\n attendance INTEGER,\n leading_scorer VARCHAR,\n date VARCHAR\n)","response":"SELECT SUM(attendance) FROM table_name_45 WHERE leading_scorer = \"stephen jackson\" AND date = \"12\/17\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many attended the game on 12\/17 with stephen jackson as the leading scorer? ### Input: CREATE TABLE table_name_45 (\n attendance INTEGER,\n leading_scorer VARCHAR,\n date VARCHAR\n) ### Response: SELECT SUM(attendance) FROM table_name_45 WHERE leading_scorer = \"stephen jackson\" AND date = \"12\/17\""} {"instruction":"what is the least number of points that daly won in a single seasons","input":"CREATE TABLE table_204_722 (\n id number,\n \"season\" text,\n \"series\" text,\n \"team\" text,\n \"races\" number,\n \"wins\" number,\n \"poles\" number,\n \"f\/lap\" number,\n \"podiums\" number,\n \"points\" number,\n \"position\" text\n)","response":"SELECT MIN(\"points\") FROM table_204_722","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the least number of points that daly won in a single seasons ### Input: CREATE TABLE table_204_722 (\n id number,\n \"season\" text,\n \"series\" text,\n \"team\" text,\n \"races\" number,\n \"wins\" number,\n \"poles\" number,\n \"f\/lap\" number,\n \"podiums\" number,\n \"points\" number,\n \"position\" text\n) ### Response: SELECT MIN(\"points\") FROM table_204_722"} {"instruction":"what is the number of patients who have had a tpn d9.0 intake until 2103?","input":"CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)","response":"SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d9.0' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y', inputevents_cv.charttime) <= '2103'))","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients who have had a tpn d9.0 intake until 2103? ### Input: CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d9.0' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y', inputevents_cv.charttime) <= '2103'))"} {"instruction":"count the number of patients whose year of death is less than or equal to 2186 and diagnoses long title is hyperacusis?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= \"2186.0\" AND diagnoses.long_title = \"Hyperacusis\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose year of death is less than or equal to 2186 and diagnoses long title is hyperacusis? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= \"2186.0\" AND diagnoses.long_title = \"Hyperacusis\""} {"instruction":"Return the number of the categories of music festivals that have the result 'Awarded'.","input":"CREATE TABLE volume (\n Volume_ID int,\n Volume_Issue text,\n Issue_Date text,\n Weeks_on_Top real,\n Song text,\n Artist_ID int\n)\n\nCREATE TABLE music_festival (\n ID int,\n Music_Festival text,\n Date_of_ceremony text,\n Category text,\n Volume int,\n Result text\n)\n\nCREATE TABLE artist (\n Artist_ID int,\n Artist text,\n Age int,\n Famous_Title text,\n Famous_Release_date text\n)","response":"SELECT Category, COUNT(Category) FROM music_festival WHERE Result = \"Awarded\" GROUP BY Category","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the number of the categories of music festivals that have the result 'Awarded'. ### Input: CREATE TABLE volume (\n Volume_ID int,\n Volume_Issue text,\n Issue_Date text,\n Weeks_on_Top real,\n Song text,\n Artist_ID int\n)\n\nCREATE TABLE music_festival (\n ID int,\n Music_Festival text,\n Date_of_ceremony text,\n Category text,\n Volume int,\n Result text\n)\n\nCREATE TABLE artist (\n Artist_ID int,\n Artist text,\n Age int,\n Famous_Title text,\n Famous_Release_date text\n) ### Response: SELECT Category, COUNT(Category) FROM music_festival WHERE Result = \"Awarded\" GROUP BY Category"} {"instruction":"how many patients under the age of 80 years had their lab test fluid as joint fluid?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < \"80\" AND lab.fluid = \"Joint Fluid\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients under the age of 80 years had their lab test fluid as joint fluid? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < \"80\" AND lab.fluid = \"Joint Fluid\""} {"instruction":"What is listed under L when the ends won is 21?","input":"CREATE TABLE table_31228 (\n \"Skip (Club)\" text,\n \"W\" real,\n \"L\" real,\n \"PF\" real,\n \"PA\" real,\n \"Ends Won\" real,\n \"Ends Lost\" real,\n \"Blank Ends\" real,\n \"Stolen Ends\" real\n)","response":"SELECT MAX(\"L\") FROM table_31228 WHERE \"Ends Won\" = '21'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is listed under L when the ends won is 21? ### Input: CREATE TABLE table_31228 (\n \"Skip (Club)\" text,\n \"W\" real,\n \"L\" real,\n \"PF\" real,\n \"PA\" real,\n \"Ends Won\" real,\n \"Ends Lost\" real,\n \"Blank Ends\" real,\n \"Stolen Ends\" real\n) ### Response: SELECT MAX(\"L\") FROM table_31228 WHERE \"Ends Won\" = '21'"} {"instruction":"What job is at red bank?","input":"CREATE TABLE table_15803 (\n \"Riding\" text,\n \"Candidate's Name\" text,\n \"Gender\" text,\n \"Residence\" text,\n \"Occupation\" text,\n \"Votes\" real,\n \"Rank\" text\n)","response":"SELECT \"Occupation\" FROM table_15803 WHERE \"Residence\" = 'red bank'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What job is at red bank? ### Input: CREATE TABLE table_15803 (\n \"Riding\" text,\n \"Candidate's Name\" text,\n \"Gender\" text,\n \"Residence\" text,\n \"Occupation\" text,\n \"Votes\" real,\n \"Rank\" text\n) ### Response: SELECT \"Occupation\" FROM table_15803 WHERE \"Residence\" = 'red bank'"} {"instruction":"What is the score of the game against away team queens park rangers on 23 january 1982?","input":"CREATE TABLE table_59579 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n)","response":"SELECT \"Score\" FROM table_59579 WHERE \"Date\" = '23 january 1982' AND \"Away team\" = 'queens park rangers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of the game against away team queens park rangers on 23 january 1982? ### Input: CREATE TABLE table_59579 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n) ### Response: SELECT \"Score\" FROM table_59579 WHERE \"Date\" = '23 january 1982' AND \"Away team\" = 'queens park rangers'"} {"instruction":"How much do the tickets cost for August 7, 1987?","input":"CREATE TABLE table_1845 (\n \"Date(s)\" text,\n \"Venue\" text,\n \"City, state\" text,\n \"Ticket price(s)\" text,\n \"Ticket sold \/ available\" text,\n \"Ticket grossing\" text\n)","response":"SELECT \"Ticket price(s)\" FROM table_1845 WHERE \"Date(s)\" = 'August 7, 1987'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much do the tickets cost for August 7, 1987? ### Input: CREATE TABLE table_1845 (\n \"Date(s)\" text,\n \"Venue\" text,\n \"City, state\" text,\n \"Ticket price(s)\" text,\n \"Ticket sold \/ available\" text,\n \"Ticket grossing\" text\n) ### Response: SELECT \"Ticket price(s)\" FROM table_1845 WHERE \"Date(s)\" = 'August 7, 1987'"} {"instruction":"How many finals had more than 0 goals and 8 assists?","input":"CREATE TABLE table_63272 (\n \"Name\" text,\n \"Games\" text,\n \"A-League\" text,\n \"Finals\" text,\n \"Goals\" real,\n \"Assists\" real,\n \"Years\" text\n)","response":"SELECT \"Finals\" FROM table_63272 WHERE \"Goals\" > '0' AND \"Assists\" = '8'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many finals had more than 0 goals and 8 assists? ### Input: CREATE TABLE table_63272 (\n \"Name\" text,\n \"Games\" text,\n \"A-League\" text,\n \"Finals\" text,\n \"Goals\" real,\n \"Assists\" real,\n \"Years\" text\n) ### Response: SELECT \"Finals\" FROM table_63272 WHERE \"Goals\" > '0' AND \"Assists\" = '8'"} {"instruction":"After 15:45 A.M. , what upper level electives are available next Spring-Summer ?","input":"CREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '15:45' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2017","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: After 15:45 A.M. , what upper level electives are available next Spring-Summer ? ### Input: CREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '15:45' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2017"} {"instruction":"When did Deng Xuan first win Women's singles?","input":"CREATE TABLE table_71765 (\n \"Year\" real,\n \"Men's singles\" text,\n \"Women's singles\" text,\n \"Men's doubles\" text,\n \"Women's doubles\" text,\n \"Mixed doubles\" text\n)","response":"SELECT MIN(\"Year\") FROM table_71765 WHERE \"Women's singles\" = 'deng xuan'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did Deng Xuan first win Women's singles? ### Input: CREATE TABLE table_71765 (\n \"Year\" real,\n \"Men's singles\" text,\n \"Women's singles\" text,\n \"Men's doubles\" text,\n \"Women's doubles\" text,\n \"Mixed doubles\" text\n) ### Response: SELECT MIN(\"Year\") FROM table_71765 WHERE \"Women's singles\" = 'deng xuan'"} {"instruction":"Who is the away team that played home team Footscray?","input":"CREATE TABLE table_55219 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team\" FROM table_55219 WHERE \"Home team\" = 'footscray'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the away team that played home team Footscray? ### Input: CREATE TABLE table_55219 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team\" FROM table_55219 WHERE \"Home team\" = 'footscray'"} {"instruction":"provide the number of patients whose admission year is less than 2133 and drug route is po?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < \"2133\" AND prescriptions.route = \"PO\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission year is less than 2133 and drug route is po? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < \"2133\" AND prescriptions.route = \"PO\""} {"instruction":"What Rank has a Team of roma?","input":"CREATE TABLE table_12517 (\n \"Rank\" real,\n \"Name\" text,\n \"Team\" text,\n \"Goals\" real,\n \"Appearances\" real,\n \"Minutes played\" text\n)","response":"SELECT \"Rank\" FROM table_12517 WHERE \"Team\" = 'roma'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Rank has a Team of roma? ### Input: CREATE TABLE table_12517 (\n \"Rank\" real,\n \"Name\" text,\n \"Team\" text,\n \"Goals\" real,\n \"Appearances\" real,\n \"Minutes played\" text\n) ### Response: SELECT \"Rank\" FROM table_12517 WHERE \"Team\" = 'roma'"} {"instruction":"What is the population of northfield parish that has an area less than 342.4?","input":"CREATE TABLE table_name_50 (\n population INTEGER,\n area_km_2 VARCHAR,\n official_name VARCHAR\n)","response":"SELECT SUM(population) FROM table_name_50 WHERE area_km_2 < 342.4 AND official_name = \"northfield\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the population of northfield parish that has an area less than 342.4? ### Input: CREATE TABLE table_name_50 (\n population INTEGER,\n area_km_2 VARCHAR,\n official_name VARCHAR\n) ### Response: SELECT SUM(population) FROM table_name_50 WHERE area_km_2 < 342.4 AND official_name = \"northfield\""} {"instruction":"What are 12 -credit Anthropology of Contemporary American Culture courses ?","input":"CREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)","response":"SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Anthropology of Contemporary American Culture%' OR name LIKE '%Anthropology of Contemporary American Culture%') AND credits = 12","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are 12 -credit Anthropology of Contemporary American Culture courses ? ### Input: CREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n) ### Response: SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Anthropology of Contemporary American Culture%' OR name LIKE '%Anthropology of Contemporary American Culture%') AND credits = 12"} {"instruction":"In what grid did Richard Robarts make 36 laps?","input":"CREATE TABLE table_54515 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT SUM(\"Grid\") FROM table_54515 WHERE \"Driver\" = 'richard robarts' AND \"Laps\" < '36'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what grid did Richard Robarts make 36 laps? ### Input: CREATE TABLE table_54515 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT SUM(\"Grid\") FROM table_54515 WHERE \"Driver\" = 'richard robarts' AND \"Laps\" < '36'"} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, order total number in asc order.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)","response":"SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, order total number in asc order. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n) ### Response: SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY)"} {"instruction":"How many members did Europe have the year that America had 403892?","input":"CREATE TABLE table_1914090_2 (\n europe VARCHAR,\n america VARCHAR\n)","response":"SELECT europe FROM table_1914090_2 WHERE america = 403892","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many members did Europe have the year that America had 403892? ### Input: CREATE TABLE table_1914090_2 (\n europe VARCHAR,\n america VARCHAR\n) ### Response: SELECT europe FROM table_1914090_2 WHERE america = 403892"} {"instruction":"how many patients were diagnosed for laparoscopic surgical procedure converted to open procedure and the death status is 0?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = \"0\" AND diagnoses.long_title = \"Laparoscopic surgical procedure converted to open procedure\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients were diagnosed for laparoscopic surgical procedure converted to open procedure and the death status is 0? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = \"0\" AND diagnoses.long_title = \"Laparoscopic surgical procedure converted to open procedure\""} {"instruction":"For those employees who did not have any job in the past, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, and rank by the total number of manager id in asc please.","input":"CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)","response":"SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, and rank by the total number of manager id in asc please. ### Input: CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n) ### Response: SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)"} {"instruction":"What is the time\/retired of Driver Masten Gregory Carroll Shelby when the constructor was Maserati, the Grid was larger than 10 and there were more than 2 laps?","input":"CREATE TABLE table_11847 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT \"Time\/Retired\" FROM table_11847 WHERE \"Grid\" > '10' AND \"Laps\" > '2' AND \"Constructor\" = 'maserati' AND \"Driver\" = 'masten gregory carroll shelby'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the time\/retired of Driver Masten Gregory Carroll Shelby when the constructor was Maserati, the Grid was larger than 10 and there were more than 2 laps? ### Input: CREATE TABLE table_11847 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT \"Time\/Retired\" FROM table_11847 WHERE \"Grid\" > '10' AND \"Laps\" > '2' AND \"Constructor\" = 'maserati' AND \"Driver\" = 'masten gregory carroll shelby'"} {"instruction":"How many hebrew forms are there for the arabic form yuktibu ?","input":"CREATE TABLE table_30036 (\n \"Semitological abbreviation\" text,\n \"Hebrew name\" text,\n \"Arabic name\" text,\n \"Morphological category\" text,\n \"Hebrew Form\" text,\n \"Arabic form\" text,\n \"Approximate translation\" text\n)","response":"SELECT COUNT(\"Hebrew Form\") FROM table_30036 WHERE \"Arabic form\" = 'yuktibu \u064a\u0643\u062a\u0628'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many hebrew forms are there for the arabic form yuktibu ? ### Input: CREATE TABLE table_30036 (\n \"Semitological abbreviation\" text,\n \"Hebrew name\" text,\n \"Arabic name\" text,\n \"Morphological category\" text,\n \"Hebrew Form\" text,\n \"Arabic form\" text,\n \"Approximate translation\" text\n) ### Response: SELECT COUNT(\"Hebrew Form\") FROM table_30036 WHERE \"Arabic form\" = 'yuktibu \u064a\u0643\u062a\u0628'"} {"instruction":"Which round was Joe Taylor selected in?","input":"CREATE TABLE table_name_40 (\n round INTEGER,\n player VARCHAR\n)","response":"SELECT SUM(round) FROM table_name_40 WHERE player = \"joe taylor\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which round was Joe Taylor selected in? ### Input: CREATE TABLE table_name_40 (\n round INTEGER,\n player VARCHAR\n) ### Response: SELECT SUM(round) FROM table_name_40 WHERE player = \"joe taylor\""} {"instruction":"A bar chart for what are the number of the descriptions of the service types with product price above 100?, and could you list in descending by the how many service type description please?","input":"CREATE TABLE Invoice_Items (\n Invoice_Item_ID INTEGER,\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n Order_Item_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity INTEGER,\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoices (\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n payment_method_code CHAR(15),\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255),\n Order_Item_ID INTEGER\n)\n\nCREATE TABLE Order_Items (\n Order_Item_ID INTEGER,\n Order_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Addresses (\n Address_ID VARCHAR(100),\n Line_1 VARCHAR(255),\n Line_2 VARCHAR(255),\n City_Town VARCHAR(255),\n State_County VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings (\n Booking_ID INTEGER,\n Customer_ID INTEGER,\n Workshop_Group_ID VARCHAR(100),\n Status_Code CHAR(15),\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Clients (\n Client_ID INTEGER,\n Address_ID INTEGER,\n Customer_Email_Address VARCHAR(255),\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers_in_Bookings (\n Order_ID INTEGER,\n Performer_ID INTEGER\n)\n\nCREATE TABLE Stores (\n Store_ID VARCHAR(100),\n Address_ID INTEGER,\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n Product_ID VARCHAR(100),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Product_Description VARCHAR(255),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Service_Types (\n Service_Type_Code CHAR(15),\n Parent_Service_Type_Code CHAR(15),\n Service_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15),\n Workshop_Group_ID INTEGER,\n Product_Description VARCHAR(255),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Marketing_Regions (\n Marketing_Region_Code CHAR(15),\n Marketing_Region_Name VARCHAR(255),\n Marketing_Region_Descriptrion VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings_Services (\n Order_ID INTEGER,\n Product_ID INTEGER\n)\n\nCREATE TABLE Customer_Orders (\n Order_ID INTEGER,\n Customer_ID INTEGER,\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Payment_Methods (\n payment_method_code CHAR(10),\n payment_method_description VARCHAR(80)\n)\n\nCREATE TABLE Performers (\n Performer_ID INTEGER,\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Drama_Workshop_Groups (\n Workshop_Group_ID INTEGER,\n Address_ID INTEGER,\n Currency_Code CHAR(15),\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n Customer_ID VARCHAR(100),\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)","response":"SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the descriptions of the service types with product price above 100?, and could you list in descending by the how many service type description please? ### Input: CREATE TABLE Invoice_Items (\n Invoice_Item_ID INTEGER,\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n Order_Item_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity INTEGER,\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoices (\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n payment_method_code CHAR(15),\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255),\n Order_Item_ID INTEGER\n)\n\nCREATE TABLE Order_Items (\n Order_Item_ID INTEGER,\n Order_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Addresses (\n Address_ID VARCHAR(100),\n Line_1 VARCHAR(255),\n Line_2 VARCHAR(255),\n City_Town VARCHAR(255),\n State_County VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings (\n Booking_ID INTEGER,\n Customer_ID INTEGER,\n Workshop_Group_ID VARCHAR(100),\n Status_Code CHAR(15),\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Clients (\n Client_ID INTEGER,\n Address_ID INTEGER,\n Customer_Email_Address VARCHAR(255),\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers_in_Bookings (\n Order_ID INTEGER,\n Performer_ID INTEGER\n)\n\nCREATE TABLE Stores (\n Store_ID VARCHAR(100),\n Address_ID INTEGER,\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n Product_ID VARCHAR(100),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Product_Description VARCHAR(255),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Service_Types (\n Service_Type_Code CHAR(15),\n Parent_Service_Type_Code CHAR(15),\n Service_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15),\n Workshop_Group_ID INTEGER,\n Product_Description VARCHAR(255),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Marketing_Regions (\n Marketing_Region_Code CHAR(15),\n Marketing_Region_Name VARCHAR(255),\n Marketing_Region_Descriptrion VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings_Services (\n Order_ID INTEGER,\n Product_ID INTEGER\n)\n\nCREATE TABLE Customer_Orders (\n Order_ID INTEGER,\n Customer_ID INTEGER,\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Payment_Methods (\n payment_method_code CHAR(10),\n payment_method_description VARCHAR(80)\n)\n\nCREATE TABLE Performers (\n Performer_ID INTEGER,\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Drama_Workshop_Groups (\n Workshop_Group_ID INTEGER,\n Address_ID INTEGER,\n Currency_Code CHAR(15),\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n Customer_ID VARCHAR(100),\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n) ### Response: SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC"} {"instruction":"Who is on the David's Team for the episode with the Lees Team of Jack Dee and Peter Serafinowicz","input":"CREATE TABLE table_2908 (\n \"Episode\" text,\n \"First broadcast\" text,\n \"Davids team\" text,\n \"Lees team\" text,\n \"Scores\" text\n)","response":"SELECT \"Davids team\" FROM table_2908 WHERE \"Lees team\" = 'Jack Dee and Peter Serafinowicz'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is on the David's Team for the episode with the Lees Team of Jack Dee and Peter Serafinowicz ### Input: CREATE TABLE table_2908 (\n \"Episode\" text,\n \"First broadcast\" text,\n \"Davids team\" text,\n \"Lees team\" text,\n \"Scores\" text\n) ### Response: SELECT \"Davids team\" FROM table_2908 WHERE \"Lees team\" = 'Jack Dee and Peter Serafinowicz'"} {"instruction":"If a variant without niqqud is as final letter: or , what is the phonetic realisation?","input":"CREATE TABLE table_56984 (\n \"Variant (with Niqqud )\" text,\n \"without Niqqud\" text,\n \"Phonemic Value\" text,\n \"Phonetic Realisation\" text,\n \"English example\" text\n)","response":"SELECT \"Phonetic Realisation\" FROM table_56984 WHERE \"without Niqqud\" = 'as final letter: \u05d5 or \u05d9\u05d5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If a variant without niqqud is as final letter: or , what is the phonetic realisation? ### Input: CREATE TABLE table_56984 (\n \"Variant (with Niqqud )\" text,\n \"without Niqqud\" text,\n \"Phonemic Value\" text,\n \"Phonetic Realisation\" text,\n \"English example\" text\n) ### Response: SELECT \"Phonetic Realisation\" FROM table_56984 WHERE \"without Niqqud\" = 'as final letter: \u05d5 or \u05d9\u05d5'"} {"instruction":"Sublimetext post counts by date.","input":"CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)","response":"SELECT TIME_TO_STR(CreationDate, '%d') AS \"day\", TIME_TO_STR(CreationDate, '%M') AS \"month\", TIME_TO_STR(CreationDate, '%Y') AS \"year\", COUNT(*) FROM Posts WHERE (STR_POSITION(Tags, '') > 0) GROUP BY TIME_TO_STR(CreationDate, '%d'), TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '%Y')","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Sublimetext post counts by date. ### Input: CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n) ### Response: SELECT TIME_TO_STR(CreationDate, '%d') AS \"day\", TIME_TO_STR(CreationDate, '%M') AS \"month\", TIME_TO_STR(CreationDate, '%Y') AS \"year\", COUNT(*) FROM Posts WHERE (STR_POSITION(Tags, '') > 0) GROUP BY TIME_TO_STR(CreationDate, '%d'), TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '%Y')"} {"instruction":"What was the year Bernadette Peters was a nominee for the Tony award?","input":"CREATE TABLE table_name_67 (\n year INTEGER,\n award VARCHAR,\n nominee VARCHAR\n)","response":"SELECT SUM(year) FROM table_name_67 WHERE award = \"tony award\" AND nominee = \"bernadette peters\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the year Bernadette Peters was a nominee for the Tony award? ### Input: CREATE TABLE table_name_67 (\n year INTEGER,\n award VARCHAR,\n nominee VARCHAR\n) ### Response: SELECT SUM(year) FROM table_name_67 WHERE award = \"tony award\" AND nominee = \"bernadette peters\""} {"instruction":"what is death status of subject id 3343?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = \"3343\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is death status of subject id 3343? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = \"3343\""} {"instruction":"Which Field goals is the highest one that has Touchdowns of 0, and Points larger than 4?","input":"CREATE TABLE table_name_76 (\n field_goals INTEGER,\n touchdowns VARCHAR,\n points VARCHAR\n)","response":"SELECT MAX(field_goals) FROM table_name_76 WHERE touchdowns = 0 AND points > 4","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Field goals is the highest one that has Touchdowns of 0, and Points larger than 4? ### Input: CREATE TABLE table_name_76 (\n field_goals INTEGER,\n touchdowns VARCHAR,\n points VARCHAR\n) ### Response: SELECT MAX(field_goals) FROM table_name_76 WHERE touchdowns = 0 AND points > 4"} {"instruction":"What are the purchase details of transactions with amount bigger than 10000, and count them by a bar chart, list by the the number of purchase details from low to high.","input":"CREATE TABLE Transactions_Lots (\n transaction_id INTEGER,\n lot_id INTEGER\n)\n\nCREATE TABLE Transactions (\n transaction_id INTEGER,\n investor_id INTEGER,\n transaction_type_code VARCHAR(10),\n date_of_transaction DATETIME,\n amount_of_transaction DECIMAL(19,4),\n share_count VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Lots (\n lot_id INTEGER,\n investor_id INTEGER,\n lot_details VARCHAR(255)\n)\n\nCREATE TABLE Sales (\n sales_transaction_id INTEGER,\n sales_details VARCHAR(255)\n)\n\nCREATE TABLE Investors (\n investor_id INTEGER,\n Investor_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Transaction_Types (\n transaction_type_code VARCHAR(10),\n transaction_type_description VARCHAR(80)\n)\n\nCREATE TABLE Purchases (\n purchase_transaction_id INTEGER,\n purchase_details VARCHAR(255)\n)","response":"SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the purchase details of transactions with amount bigger than 10000, and count them by a bar chart, list by the the number of purchase details from low to high. ### Input: CREATE TABLE Transactions_Lots (\n transaction_id INTEGER,\n lot_id INTEGER\n)\n\nCREATE TABLE Transactions (\n transaction_id INTEGER,\n investor_id INTEGER,\n transaction_type_code VARCHAR(10),\n date_of_transaction DATETIME,\n amount_of_transaction DECIMAL(19,4),\n share_count VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Lots (\n lot_id INTEGER,\n investor_id INTEGER,\n lot_details VARCHAR(255)\n)\n\nCREATE TABLE Sales (\n sales_transaction_id INTEGER,\n sales_details VARCHAR(255)\n)\n\nCREATE TABLE Investors (\n investor_id INTEGER,\n Investor_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Transaction_Types (\n transaction_type_code VARCHAR(10),\n transaction_type_description VARCHAR(80)\n)\n\nCREATE TABLE Purchases (\n purchase_transaction_id INTEGER,\n purchase_details VARCHAR(255)\n) ### Response: SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)"} {"instruction":"What is Part 1, when Part 3 is 'heldu'?","input":"CREATE TABLE table_name_83 (\n part_1 VARCHAR,\n part_3 VARCHAR\n)","response":"SELECT part_1 FROM table_name_83 WHERE part_3 = \"heldu\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Part 1, when Part 3 is 'heldu'? ### Input: CREATE TABLE table_name_83 (\n part_1 VARCHAR,\n part_3 VARCHAR\n) ### Response: SELECT part_1 FROM table_name_83 WHERE part_3 = \"heldu\""} {"instruction":"What school\/club had pick 33?","input":"CREATE TABLE table_name_31 (\n school_club_team VARCHAR,\n pick VARCHAR\n)","response":"SELECT school_club_team FROM table_name_31 WHERE pick = 33","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What school\/club had pick 33? ### Input: CREATE TABLE table_name_31 (\n school_club_team VARCHAR,\n pick VARCHAR\n) ### Response: SELECT school_club_team FROM table_name_31 WHERE pick = 33"} {"instruction":"Who is the h.s. principal during 1973-1974?","input":"CREATE TABLE table_name_81 (\n hs_principal VARCHAR,\n year VARCHAR\n)","response":"SELECT hs_principal FROM table_name_81 WHERE year = \"1973-1974\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the h.s. principal during 1973-1974? ### Input: CREATE TABLE table_name_81 (\n hs_principal VARCHAR,\n year VARCHAR\n) ### Response: SELECT hs_principal FROM table_name_81 WHERE year = \"1973-1974\""} {"instruction":"What is the highest field goals when there were more than 1 touchdown and 0 extra points?","input":"CREATE TABLE table_75348 (\n \"Player\" text,\n \"Position\" text,\n \"Starter\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n)","response":"SELECT MAX(\"Field goals\") FROM table_75348 WHERE \"Touchdowns\" > '1' AND \"Extra points\" > '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest field goals when there were more than 1 touchdown and 0 extra points? ### Input: CREATE TABLE table_75348 (\n \"Player\" text,\n \"Position\" text,\n \"Starter\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n) ### Response: SELECT MAX(\"Field goals\") FROM table_75348 WHERE \"Touchdowns\" > '1' AND \"Extra points\" > '0'"} {"instruction":"when did patient 14054 get discharged from hospital for the first time since 2105?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 14054 AND STRFTIME('%y', admissions.dischtime) >= '2105' ORDER BY admissions.dischtime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 14054 get discharged from hospital for the first time since 2105? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 14054 AND STRFTIME('%y', admissions.dischtime) >= '2105' ORDER BY admissions.dischtime LIMIT 1"} {"instruction":"What role was at the Sydney Film Festival in 2008?","input":"CREATE TABLE table_name_4 (\n role VARCHAR,\n year VARCHAR,\n festival_organization VARCHAR\n)","response":"SELECT role FROM table_name_4 WHERE year = 2008 AND festival_organization = \"sydney film festival\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What role was at the Sydney Film Festival in 2008? ### Input: CREATE TABLE table_name_4 (\n role VARCHAR,\n year VARCHAR,\n festival_organization VARCHAR\n) ### Response: SELECT role FROM table_name_4 WHERE year = 2008 AND festival_organization = \"sydney film festival\""} {"instruction":"What is the 2007 value with a 1r in 2009?","input":"CREATE TABLE table_63515 (\n \"Tournament\" text,\n \"2003\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text,\n \"Win %\" text\n)","response":"SELECT \"2007\" FROM table_63515 WHERE \"2009\" = '1r'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2007 value with a 1r in 2009? ### Input: CREATE TABLE table_63515 (\n \"Tournament\" text,\n \"2003\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text,\n \"Win %\" text\n) ### Response: SELECT \"2007\" FROM table_63515 WHERE \"2009\" = '1r'"} {"instruction":"What was the number of fatalities for the Viscount 700?","input":"CREATE TABLE table_name_71 (\n fatalities VARCHAR,\n aircraft VARCHAR\n)","response":"SELECT fatalities FROM table_name_71 WHERE aircraft = \"viscount 700\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the number of fatalities for the Viscount 700? ### Input: CREATE TABLE table_name_71 (\n fatalities VARCHAR,\n aircraft VARCHAR\n) ### Response: SELECT fatalities FROM table_name_71 WHERE aircraft = \"viscount 700\""} {"instruction":"What are the different statement ids on accounts, and the number of accounts for each?","input":"CREATE TABLE ref_document_types (\n document_type_code text,\n document_type_name text,\n document_type_description text\n)\n\nCREATE TABLE accounts (\n account_id number,\n statement_id number,\n account_details text\n)\n\nCREATE TABLE projects (\n project_id number,\n project_details text\n)\n\nCREATE TABLE documents (\n document_id number,\n document_type_code text,\n project_id number,\n document_date time,\n document_name text,\n document_description text,\n other_details text\n)\n\nCREATE TABLE documents_with_expenses (\n document_id number,\n budget_type_code text,\n document_details text\n)\n\nCREATE TABLE ref_budget_codes (\n budget_type_code text,\n budget_type_description text\n)\n\nCREATE TABLE statements (\n statement_id number,\n statement_details text\n)","response":"SELECT statement_id, COUNT(*) FROM accounts GROUP BY statement_id","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the different statement ids on accounts, and the number of accounts for each? ### Input: CREATE TABLE ref_document_types (\n document_type_code text,\n document_type_name text,\n document_type_description text\n)\n\nCREATE TABLE accounts (\n account_id number,\n statement_id number,\n account_details text\n)\n\nCREATE TABLE projects (\n project_id number,\n project_details text\n)\n\nCREATE TABLE documents (\n document_id number,\n document_type_code text,\n project_id number,\n document_date time,\n document_name text,\n document_description text,\n other_details text\n)\n\nCREATE TABLE documents_with_expenses (\n document_id number,\n budget_type_code text,\n document_details text\n)\n\nCREATE TABLE ref_budget_codes (\n budget_type_code text,\n budget_type_description text\n)\n\nCREATE TABLE statements (\n statement_id number,\n statement_details text\n) ### Response: SELECT statement_id, COUNT(*) FROM accounts GROUP BY statement_id"} {"instruction":"what is the cpu for the calculator with 28 kb of ram and display size 128 64 pixels 21 8 characters?","input":"CREATE TABLE table_17130 (\n \"Calculator\" text,\n \"CPU\" text,\n \"RAM\" text,\n \"Display Size\" text,\n \"Programming Languages\" text,\n \"Link Abilities\" text,\n \"Year Released\" text,\n \"Predecessors\" text,\n \"Successors\" text\n)","response":"SELECT \"CPU\" FROM table_17130 WHERE \"RAM\" = '28 KB of RAM' AND \"Display Size\" = '128\u00d764 pixels 21\u00d78 characters'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the cpu for the calculator with 28 kb of ram and display size 128 64 pixels 21 8 characters? ### Input: CREATE TABLE table_17130 (\n \"Calculator\" text,\n \"CPU\" text,\n \"RAM\" text,\n \"Display Size\" text,\n \"Programming Languages\" text,\n \"Link Abilities\" text,\n \"Year Released\" text,\n \"Predecessors\" text,\n \"Successors\" text\n) ### Response: SELECT \"CPU\" FROM table_17130 WHERE \"RAM\" = '28 KB of RAM' AND \"Display Size\" = '128\u00d764 pixels 21\u00d78 characters'"} {"instruction":"what is june 10-11 when march 27-29 is 149?","input":"CREATE TABLE table_25355392_2 (\n june_10_11 VARCHAR,\n march_27_29 VARCHAR\n)","response":"SELECT june_10_11 FROM table_25355392_2 WHERE march_27_29 = \"149\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is june 10-11 when march 27-29 is 149? ### Input: CREATE TABLE table_25355392_2 (\n june_10_11 VARCHAR,\n march_27_29 VARCHAR\n) ### Response: SELECT june_10_11 FROM table_25355392_2 WHERE march_27_29 = \"149\""} {"instruction":"What is the Shirt No for Henry Bell Cisnero whose height is less than 190?","input":"CREATE TABLE table_64515 (\n \"Shirt No\" real,\n \"Nationality\" text,\n \"Player\" text,\n \"Birth Date\" text,\n \"Height\" real,\n \"Position\" text\n)","response":"SELECT MAX(\"Shirt No\") FROM table_64515 WHERE \"Height\" < '190' AND \"Player\" = 'henry bell cisnero'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Shirt No for Henry Bell Cisnero whose height is less than 190? ### Input: CREATE TABLE table_64515 (\n \"Shirt No\" real,\n \"Nationality\" text,\n \"Player\" text,\n \"Birth Date\" text,\n \"Height\" real,\n \"Position\" text\n) ### Response: SELECT MAX(\"Shirt No\") FROM table_64515 WHERE \"Height\" < '190' AND \"Player\" = 'henry bell cisnero'"} {"instruction":"Which tournament had a 2010 finish of 4R?","input":"CREATE TABLE table_68293 (\n \"Tournament\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text,\n \"2013\" text\n)","response":"SELECT \"Tournament\" FROM table_68293 WHERE \"2010\" = '4r'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which tournament had a 2010 finish of 4R? ### Input: CREATE TABLE table_68293 (\n \"Tournament\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text,\n \"2013\" text\n) ### Response: SELECT \"Tournament\" FROM table_68293 WHERE \"2010\" = '4r'"} {"instruction":"when was the first time patient 006-124193 was prescribed medication through the iv flush route since 14 months ago?","input":"CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-124193')) AND medication.routeadmin = 'iv flush' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-14 month') ORDER BY medication.drugstarttime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time patient 006-124193 was prescribed medication through the iv flush route since 14 months ago? ### Input: CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-124193')) AND medication.routeadmin = 'iv flush' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-14 month') ORDER BY medication.drugstarttime LIMIT 1"} {"instruction":"Just list the first name of the employee and show the location id of the corresponding department using a bar chart.","input":"CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT FIRST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Just list the first name of the employee and show the location id of the corresponding department using a bar chart. ### Input: CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT FIRST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID"} {"instruction":"What was the discipline for the euroboss championship?","input":"CREATE TABLE table_8627 (\n \"Discipline\" text,\n \"Championship\" text,\n \"Circuit\" text,\n \"Session\" text,\n \"Cause\" text\n)","response":"SELECT \"Discipline\" FROM table_8627 WHERE \"Championship\" = 'euroboss'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the discipline for the euroboss championship? ### Input: CREATE TABLE table_8627 (\n \"Discipline\" text,\n \"Championship\" text,\n \"Circuit\" text,\n \"Session\" text,\n \"Cause\" text\n) ### Response: SELECT \"Discipline\" FROM table_8627 WHERE \"Championship\" = 'euroboss'"} {"instruction":"Negative questions with a single negative-but-accepted answer this year.","input":"CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)","response":"SELECT q.Id AS \"post_link\", q.Score AS \"Q Score\", a.Score AS \"A Score\" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.Score < 0 AND a.Score < 0 AND q.CreationDate > '2016-01-01 01:01:01' AND q.ClosedDate > '2016-01-01 01:01:01' AND NOT q.AcceptedAnswerId IS NULL AND q.AnswerCount = 1 ORDER BY q.CreationDate DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Negative questions with a single negative-but-accepted answer this year. ### Input: CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n) ### Response: SELECT q.Id AS \"post_link\", q.Score AS \"Q Score\", a.Score AS \"A Score\" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.Score < 0 AND a.Score < 0 AND q.CreationDate > '2016-01-01 01:01:01' AND q.ClosedDate > '2016-01-01 01:01:01' AND NOT q.AcceptedAnswerId IS NULL AND q.AnswerCount = 1 ORDER BY q.CreationDate DESC"} {"instruction":"Bar chart x axis year y axis the number of year","input":"CREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC\n)\n\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC\n)\n\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC\n)\n\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT\n)\n\nCREATE TABLE player_college (\n player_id TEXT,\n college_id TEXT,\n year INTEGER\n)\n\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER\n)\n\nCREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC\n)\n\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER\n)\n\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER\n)\n\nCREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT\n)\n\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE player_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes TEXT\n)\n\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT\n)\n\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT\n)\n\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT\n)\n\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER\n)\n\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER\n)\n\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER\n)\n\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC\n)\n\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC\n)\n\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC\n)\n\nCREATE TABLE batting (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)","response":"SELECT year, COUNT(year) FROM home_game","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis year y axis the number of year ### Input: CREATE TABLE fielding_outfield (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n glf NUMERIC,\n gcf NUMERIC,\n grf NUMERIC\n)\n\nCREATE TABLE player_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won NUMERIC,\n points_max INTEGER,\n votes_first NUMERIC\n)\n\nCREATE TABLE fielding_postseason (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n round TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po INTEGER,\n a INTEGER,\n e INTEGER,\n dp INTEGER,\n tp INTEGER,\n pb NUMERIC,\n sb NUMERIC,\n cs NUMERIC\n)\n\nCREATE TABLE manager (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank NUMERIC,\n plyr_mgr TEXT\n)\n\nCREATE TABLE player_college (\n player_id TEXT,\n college_id TEXT,\n year INTEGER\n)\n\nCREATE TABLE batting_postseason (\n year INTEGER,\n round TEXT,\n player_id TEXT,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab INTEGER,\n r INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n rbi INTEGER,\n sb INTEGER,\n cs NUMERIC,\n bb INTEGER,\n so INTEGER,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE postseason (\n year INTEGER,\n round TEXT,\n team_id_winner TEXT,\n league_id_winner TEXT,\n team_id_loser TEXT,\n league_id_loser TEXT,\n wins INTEGER,\n losses INTEGER,\n ties INTEGER\n)\n\nCREATE TABLE all_star (\n player_id TEXT,\n year INTEGER,\n game_num INTEGER,\n game_id TEXT,\n team_id TEXT,\n league_id TEXT,\n gp NUMERIC,\n starting_pos NUMERIC\n)\n\nCREATE TABLE team_half (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n half INTEGER,\n div_id TEXT,\n div_win TEXT,\n rank INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER\n)\n\nCREATE TABLE manager_half (\n player_id TEXT,\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n inseason INTEGER,\n half INTEGER,\n g INTEGER,\n w INTEGER,\n l INTEGER,\n rank INTEGER\n)\n\nCREATE TABLE team_franchise (\n franchise_id TEXT,\n franchise_name TEXT,\n active TEXT,\n na_assoc TEXT\n)\n\nCREATE TABLE pitching_postseason (\n player_id TEXT,\n year INTEGER,\n round TEXT,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp TEXT,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk NUMERIC,\n bfp NUMERIC,\n gf INTEGER,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE player_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes TEXT\n)\n\nCREATE TABLE park (\n park_id TEXT,\n park_name TEXT,\n park_alias TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE hall_of_fame (\n player_id TEXT,\n yearid INTEGER,\n votedby TEXT,\n ballots NUMERIC,\n needed NUMERIC,\n votes NUMERIC,\n inducted TEXT,\n category TEXT,\n needed_note TEXT\n)\n\nCREATE TABLE team (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n franchise_id TEXT,\n div_id TEXT,\n rank INTEGER,\n g INTEGER,\n ghome NUMERIC,\n w INTEGER,\n l INTEGER,\n div_win TEXT,\n wc_win TEXT,\n lg_win TEXT,\n ws_win TEXT,\n r INTEGER,\n ab INTEGER,\n h INTEGER,\n double INTEGER,\n triple INTEGER,\n hr INTEGER,\n bb INTEGER,\n so NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n hbp NUMERIC,\n sf NUMERIC,\n ra INTEGER,\n er INTEGER,\n era NUMERIC,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts INTEGER,\n ha INTEGER,\n hra INTEGER,\n bba INTEGER,\n soa INTEGER,\n e INTEGER,\n dp NUMERIC,\n fp NUMERIC,\n name TEXT,\n park TEXT,\n attendance NUMERIC,\n bpf INTEGER,\n ppf INTEGER,\n team_id_br TEXT,\n team_id_lahman45 TEXT,\n team_id_retro TEXT\n)\n\nCREATE TABLE player (\n player_id TEXT,\n birth_year NUMERIC,\n birth_month NUMERIC,\n birth_day NUMERIC,\n birth_country TEXT,\n birth_state TEXT,\n birth_city TEXT,\n death_year NUMERIC,\n death_month NUMERIC,\n death_day NUMERIC,\n death_country TEXT,\n death_state TEXT,\n death_city TEXT,\n name_first TEXT,\n name_last TEXT,\n name_given TEXT,\n weight NUMERIC,\n height NUMERIC,\n bats TEXT,\n throws TEXT,\n debut TEXT,\n final_game TEXT,\n retro_id TEXT,\n bbref_id TEXT\n)\n\nCREATE TABLE salary (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n salary INTEGER\n)\n\nCREATE TABLE home_game (\n year INTEGER,\n league_id TEXT,\n team_id TEXT,\n park_id TEXT,\n span_first TEXT,\n span_last TEXT,\n games INTEGER,\n openings INTEGER,\n attendance INTEGER\n)\n\nCREATE TABLE manager_award_vote (\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n player_id TEXT,\n points_won INTEGER,\n points_max INTEGER,\n votes_first INTEGER\n)\n\nCREATE TABLE college (\n college_id TEXT,\n name_full TEXT,\n city TEXT,\n state TEXT,\n country TEXT\n)\n\nCREATE TABLE appearances (\n year INTEGER,\n team_id TEXT,\n league_id TEXT,\n player_id TEXT,\n g_all NUMERIC,\n gs NUMERIC,\n g_batting INTEGER,\n g_defense NUMERIC,\n g_p INTEGER,\n g_c INTEGER,\n g_1b INTEGER,\n g_2b INTEGER,\n g_3b INTEGER,\n g_ss INTEGER,\n g_lf INTEGER,\n g_cf INTEGER,\n g_rf INTEGER,\n g_of INTEGER,\n g_dh NUMERIC,\n g_ph NUMERIC,\n g_pr NUMERIC\n)\n\nCREATE TABLE pitching (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n w INTEGER,\n l INTEGER,\n g INTEGER,\n gs INTEGER,\n cg INTEGER,\n sho INTEGER,\n sv INTEGER,\n ipouts NUMERIC,\n h INTEGER,\n er INTEGER,\n hr INTEGER,\n bb INTEGER,\n so INTEGER,\n baopp NUMERIC,\n era NUMERIC,\n ibb NUMERIC,\n wp NUMERIC,\n hbp NUMERIC,\n bk INTEGER,\n bfp NUMERIC,\n gf NUMERIC,\n r INTEGER,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n)\n\nCREATE TABLE manager_award (\n player_id TEXT,\n award_id TEXT,\n year INTEGER,\n league_id TEXT,\n tie TEXT,\n notes NUMERIC\n)\n\nCREATE TABLE fielding (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n pos TEXT,\n g INTEGER,\n gs NUMERIC,\n inn_outs NUMERIC,\n po NUMERIC,\n a NUMERIC,\n e NUMERIC,\n dp NUMERIC,\n pb NUMERIC,\n wp NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n zr NUMERIC\n)\n\nCREATE TABLE batting (\n player_id TEXT,\n year INTEGER,\n stint INTEGER,\n team_id TEXT,\n league_id TEXT,\n g INTEGER,\n ab NUMERIC,\n r NUMERIC,\n h NUMERIC,\n double NUMERIC,\n triple NUMERIC,\n hr NUMERIC,\n rbi NUMERIC,\n sb NUMERIC,\n cs NUMERIC,\n bb NUMERIC,\n so NUMERIC,\n ibb NUMERIC,\n hbp NUMERIC,\n sh NUMERIC,\n sf NUMERIC,\n g_idp NUMERIC\n) ### Response: SELECT year, COUNT(year) FROM home_game"} {"instruction":"what is the cost of a drug, permethrin?","input":"CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)","response":"SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'permethrin')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the cost of a drug, permethrin? ### Input: CREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'permethrin')"} {"instruction":"What was the score for the game that had an attendance of 41,087?","input":"CREATE TABLE table_68420 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" text\n)","response":"SELECT \"Score\" FROM table_68420 WHERE \"Attendance\" = '41,087'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score for the game that had an attendance of 41,087? ### Input: CREATE TABLE table_68420 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Score\" FROM table_68420 WHERE \"Attendance\" = '41,087'"} {"instruction":"Name the density for","input":"CREATE TABLE table_2013618_1 (\n density VARCHAR,\n traditional VARCHAR\n)","response":"SELECT density FROM table_2013618_1 WHERE traditional = \"\u53e4\u7530\u7e23\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the density for ### Input: CREATE TABLE table_2013618_1 (\n density VARCHAR,\n traditional VARCHAR\n) ### Response: SELECT density FROM table_2013618_1 WHERE traditional = \"\u53e4\u7530\u7e23\""} {"instruction":"List the number of the names of products that are not in any event, and rank x axis from high to low order please.","input":"CREATE TABLE Parties_in_Events (\n Party_ID INTEGER,\n Event_ID INTEGER,\n Role_Code CHAR(15)\n)\n\nCREATE TABLE Agreements (\n Document_ID INTEGER,\n Event_ID INTEGER\n)\n\nCREATE TABLE Parties (\n Party_ID INTEGER,\n Party_Details VARCHAR(255)\n)\n\nCREATE TABLE Events (\n Event_ID INTEGER,\n Address_ID INTEGER,\n Channel_ID INTEGER,\n Event_Type_Code CHAR(15),\n Finance_ID INTEGER,\n Location_ID INTEGER\n)\n\nCREATE TABLE Channels (\n Channel_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Finances (\n Finance_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n Product_ID INTEGER,\n Product_Type_Code CHAR(15),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4)\n)\n\nCREATE TABLE Addresses (\n Address_ID INTEGER,\n address_details VARCHAR(255)\n)\n\nCREATE TABLE Locations (\n Location_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Products_in_Events (\n Product_in_Event_ID INTEGER,\n Event_ID INTEGER,\n Product_ID INTEGER\n)\n\nCREATE TABLE Assets (\n Asset_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Assets_in_Events (\n Asset_ID INTEGER,\n Event_ID INTEGER\n)","response":"SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY Product_Name DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the number of the names of products that are not in any event, and rank x axis from high to low order please. ### Input: CREATE TABLE Parties_in_Events (\n Party_ID INTEGER,\n Event_ID INTEGER,\n Role_Code CHAR(15)\n)\n\nCREATE TABLE Agreements (\n Document_ID INTEGER,\n Event_ID INTEGER\n)\n\nCREATE TABLE Parties (\n Party_ID INTEGER,\n Party_Details VARCHAR(255)\n)\n\nCREATE TABLE Events (\n Event_ID INTEGER,\n Address_ID INTEGER,\n Channel_ID INTEGER,\n Event_Type_Code CHAR(15),\n Finance_ID INTEGER,\n Location_ID INTEGER\n)\n\nCREATE TABLE Channels (\n Channel_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Finances (\n Finance_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n Product_ID INTEGER,\n Product_Type_Code CHAR(15),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4)\n)\n\nCREATE TABLE Addresses (\n Address_ID INTEGER,\n address_details VARCHAR(255)\n)\n\nCREATE TABLE Locations (\n Location_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Products_in_Events (\n Product_in_Event_ID INTEGER,\n Event_ID INTEGER,\n Product_ID INTEGER\n)\n\nCREATE TABLE Assets (\n Asset_ID INTEGER,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Assets_in_Events (\n Asset_ID INTEGER,\n Event_ID INTEGER\n) ### Response: SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY Product_Name DESC"} {"instruction":"provide the time of admission and prescribed drug for the patient with patient id 18480.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT demographic.admittime, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = \"18480\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the time of admission and prescribed drug for the patient with patient id 18480. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT demographic.admittime, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = \"18480\""} {"instruction":"count the number of patients whose marital status is widowed and procedure long title is laryngoscopy and other tracheoscopy.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"WIDOWED\" AND procedures.long_title = \"Laryngoscopy and other tracheoscopy\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose marital status is widowed and procedure long title is laryngoscopy and other tracheoscopy. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"WIDOWED\" AND procedures.long_title = \"Laryngoscopy and other tracheoscopy\""} {"instruction":"How many lessons did the customer with the first name Ray take?","input":"CREATE TABLE customers (\n customer_id number,\n customer_address_id number,\n customer_status_code text,\n date_became_customer time,\n date_of_birth time,\n first_name text,\n last_name text,\n amount_outstanding number,\n email_address text,\n phone_number text,\n cell_mobile_phone_number text\n)\n\nCREATE TABLE addresses (\n address_id number,\n line_1_number_building text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE vehicles (\n vehicle_id number,\n vehicle_details text\n)\n\nCREATE TABLE lessons (\n lesson_id number,\n customer_id number,\n lesson_status_code text,\n staff_id number,\n vehicle_id number,\n lesson_date time,\n lesson_time text,\n price number\n)\n\nCREATE TABLE staff (\n staff_id number,\n staff_address_id number,\n nickname text,\n first_name text,\n middle_name text,\n last_name text,\n date_of_birth time,\n date_joined_staff time,\n date_left_staff time\n)\n\nCREATE TABLE customer_payments (\n customer_id number,\n datetime_payment time,\n payment_method_code text,\n amount_payment number\n)","response":"SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Ray\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many lessons did the customer with the first name Ray take? ### Input: CREATE TABLE customers (\n customer_id number,\n customer_address_id number,\n customer_status_code text,\n date_became_customer time,\n date_of_birth time,\n first_name text,\n last_name text,\n amount_outstanding number,\n email_address text,\n phone_number text,\n cell_mobile_phone_number text\n)\n\nCREATE TABLE addresses (\n address_id number,\n line_1_number_building text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE vehicles (\n vehicle_id number,\n vehicle_details text\n)\n\nCREATE TABLE lessons (\n lesson_id number,\n customer_id number,\n lesson_status_code text,\n staff_id number,\n vehicle_id number,\n lesson_date time,\n lesson_time text,\n price number\n)\n\nCREATE TABLE staff (\n staff_id number,\n staff_address_id number,\n nickname text,\n first_name text,\n middle_name text,\n last_name text,\n date_of_birth time,\n date_joined_staff time,\n date_left_staff time\n)\n\nCREATE TABLE customer_payments (\n customer_id number,\n datetime_payment time,\n payment_method_code text,\n amount_payment number\n) ### Response: SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Ray\""} {"instruction":"If the qatari female is 918, what is the total number of females?","input":"CREATE TABLE table_3509 (\n \"Year\" real,\n \"Qatari Male\" real,\n \"Qatari Female\" real,\n \"Total Qatari\" real,\n \"Non Qatari Male\" real,\n \"Non Qatari Female\" real,\n \"Total Non Qatar\" real,\n \"Total Male\" real,\n \"Total Female\" real,\n \"Grand Total\" real\n)","response":"SELECT \"Total Female\" FROM table_3509 WHERE \"Qatari Female\" = '918'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the qatari female is 918, what is the total number of females? ### Input: CREATE TABLE table_3509 (\n \"Year\" real,\n \"Qatari Male\" real,\n \"Qatari Female\" real,\n \"Total Qatari\" real,\n \"Non Qatari Male\" real,\n \"Non Qatari Female\" real,\n \"Total Non Qatar\" real,\n \"Total Male\" real,\n \"Total Female\" real,\n \"Grand Total\" real\n) ### Response: SELECT \"Total Female\" FROM table_3509 WHERE \"Qatari Female\" = '918'"} {"instruction":"show me all direct flights from DALLAS FORT WORTH to either SAN FRANCISCO or OAKLAND","input":"CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT WORTH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND ((flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'SAN FRANCISCO') OR (flight.to_airport = AIRPORT_SERVICE_3.airport_code AND CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'OAKLAND'))) AND flight.connections = 0","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all direct flights from DALLAS FORT WORTH to either SAN FRANCISCO or OAKLAND ### Input: CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT WORTH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND ((flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'SAN FRANCISCO') OR (flight.to_airport = AIRPORT_SERVICE_3.airport_code AND CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'OAKLAND'))) AND flight.connections = 0"} {"instruction":"what is the county when the year left is 1998?","input":"CREATE TABLE table_name_36 (\n county VARCHAR,\n year_left VARCHAR\n)","response":"SELECT county FROM table_name_36 WHERE year_left = \"1998\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the county when the year left is 1998? ### Input: CREATE TABLE table_name_36 (\n county VARCHAR,\n year_left VARCHAR\n) ### Response: SELECT county FROM table_name_36 WHERE year_left = \"1998\""} {"instruction":"When Grey's Anatomy aired at 9:30 what aired at 9:00?","input":"CREATE TABLE table_42062 (\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"9:30\" text,\n \"10:00\" text\n)","response":"SELECT \"9:00\" FROM table_42062 WHERE \"9:30\" = 'grey''s anatomy'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When Grey's Anatomy aired at 9:30 what aired at 9:00? ### Input: CREATE TABLE table_42062 (\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"9:30\" text,\n \"10:00\" text\n) ### Response: SELECT \"9:00\" FROM table_42062 WHERE \"9:30\" = 'grey''s anatomy'"} {"instruction":"Which Team wins has an Individual winner smaller than 1 and Total win larger than 1?","input":"CREATE TABLE table_name_60 (\n team_wins INTEGER,\n individual_winners VARCHAR,\n total_wins VARCHAR\n)","response":"SELECT SUM(team_wins) FROM table_name_60 WHERE individual_winners < 1 AND total_wins > 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Team wins has an Individual winner smaller than 1 and Total win larger than 1? ### Input: CREATE TABLE table_name_60 (\n team_wins INTEGER,\n individual_winners VARCHAR,\n total_wins VARCHAR\n) ### Response: SELECT SUM(team_wins) FROM table_name_60 WHERE individual_winners < 1 AND total_wins > 1"} {"instruction":"Which ZX Spectrum has a Year larger than 1984, and a Genre of arcade\/strategy?","input":"CREATE TABLE table_36826 (\n \"Title\" text,\n \"Genre\" text,\n \"C=64\" text,\n \"ZX Spectrum\" text,\n \"Others\" text,\n \"Year\" real,\n \"Format\" text\n)","response":"SELECT \"ZX Spectrum\" FROM table_36826 WHERE \"Year\" > '1984' AND \"Genre\" = 'arcade\/strategy'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which ZX Spectrum has a Year larger than 1984, and a Genre of arcade\/strategy? ### Input: CREATE TABLE table_36826 (\n \"Title\" text,\n \"Genre\" text,\n \"C=64\" text,\n \"ZX Spectrum\" text,\n \"Others\" text,\n \"Year\" real,\n \"Format\" text\n) ### Response: SELECT \"ZX Spectrum\" FROM table_36826 WHERE \"Year\" > '1984' AND \"Genre\" = 'arcade\/strategy'"} {"instruction":"After December 19, what is the Game number with a Record of 21 4 7?","input":"CREATE TABLE table_38946 (\n \"Game\" real,\n \"December\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Record\" text,\n \"Points\" real\n)","response":"SELECT COUNT(\"Game\") FROM table_38946 WHERE \"Record\" = '21\u20134\u20137' AND \"December\" > '19'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: After December 19, what is the Game number with a Record of 21 4 7? ### Input: CREATE TABLE table_38946 (\n \"Game\" real,\n \"December\" real,\n \"Opponent\" text,\n \"Score\" text,\n \"Record\" text,\n \"Points\" real\n) ### Response: SELECT COUNT(\"Game\") FROM table_38946 WHERE \"Record\" = '21\u20134\u20137' AND \"December\" > '19'"} {"instruction":"What are the distinct buildings with capacities of greater than 50?","input":"CREATE TABLE student (\n id text,\n name text,\n dept_name text,\n tot_cred number\n)\n\nCREATE TABLE advisor (\n s_id text,\n i_id text\n)\n\nCREATE TABLE course (\n course_id text,\n title text,\n dept_name text,\n credits number\n)\n\nCREATE TABLE instructor (\n id text,\n name text,\n dept_name text,\n salary number\n)\n\nCREATE TABLE teaches (\n id text,\n course_id text,\n sec_id text,\n semester text,\n year number\n)\n\nCREATE TABLE section (\n course_id text,\n sec_id text,\n semester text,\n year number,\n building text,\n room_number text,\n time_slot_id text\n)\n\nCREATE TABLE takes (\n id text,\n course_id text,\n sec_id text,\n semester text,\n year number,\n grade text\n)\n\nCREATE TABLE classroom (\n building text,\n room_number text,\n capacity number\n)\n\nCREATE TABLE department (\n dept_name text,\n building text,\n budget number\n)\n\nCREATE TABLE time_slot (\n time_slot_id text,\n day text,\n start_hr number,\n start_min number,\n end_hr number,\n end_min number\n)\n\nCREATE TABLE prereq (\n course_id text,\n prereq_id text\n)","response":"SELECT DISTINCT building FROM classroom WHERE capacity > 50","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the distinct buildings with capacities of greater than 50? ### Input: CREATE TABLE student (\n id text,\n name text,\n dept_name text,\n tot_cred number\n)\n\nCREATE TABLE advisor (\n s_id text,\n i_id text\n)\n\nCREATE TABLE course (\n course_id text,\n title text,\n dept_name text,\n credits number\n)\n\nCREATE TABLE instructor (\n id text,\n name text,\n dept_name text,\n salary number\n)\n\nCREATE TABLE teaches (\n id text,\n course_id text,\n sec_id text,\n semester text,\n year number\n)\n\nCREATE TABLE section (\n course_id text,\n sec_id text,\n semester text,\n year number,\n building text,\n room_number text,\n time_slot_id text\n)\n\nCREATE TABLE takes (\n id text,\n course_id text,\n sec_id text,\n semester text,\n year number,\n grade text\n)\n\nCREATE TABLE classroom (\n building text,\n room_number text,\n capacity number\n)\n\nCREATE TABLE department (\n dept_name text,\n building text,\n budget number\n)\n\nCREATE TABLE time_slot (\n time_slot_id text,\n day text,\n start_hr number,\n start_min number,\n end_hr number,\n end_min number\n)\n\nCREATE TABLE prereq (\n course_id text,\n prereq_id text\n) ### Response: SELECT DISTINCT building FROM classroom WHERE capacity > 50"} {"instruction":"Are they any Other classes offered next Winter ?","input":"CREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%Other%' AND semester.semester = 'Winter' AND semester.year = 2017","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are they any Other classes offered next Winter ? ### Input: CREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%Other%' AND semester.semester = 'Winter' AND semester.year = 2017"} {"instruction":"Bar chart x axis dept code y axis minimal stu gpa, and display Y-axis in descending order.","input":"CREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n)","response":"SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY MIN(STU_GPA) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis dept code y axis minimal stu gpa, and display Y-axis in descending order. ### Input: CREATE TABLE EMPLOYEE (\n EMP_NUM int,\n EMP_LNAME varchar(15),\n EMP_FNAME varchar(12),\n EMP_INITIAL varchar(1),\n EMP_JOBCODE varchar(5),\n EMP_HIREDATE datetime,\n EMP_DOB datetime\n)\n\nCREATE TABLE DEPARTMENT (\n DEPT_CODE varchar(10),\n DEPT_NAME varchar(30),\n SCHOOL_CODE varchar(8),\n EMP_NUM int,\n DEPT_ADDRESS varchar(20),\n DEPT_EXTENSION varchar(4)\n)\n\nCREATE TABLE ENROLL (\n CLASS_CODE varchar(5),\n STU_NUM int,\n ENROLL_GRADE varchar(50)\n)\n\nCREATE TABLE COURSE (\n CRS_CODE varchar(10),\n DEPT_CODE varchar(10),\n CRS_DESCRIPTION varchar(35),\n CRS_CREDIT float(8)\n)\n\nCREATE TABLE PROFESSOR (\n EMP_NUM int,\n DEPT_CODE varchar(10),\n PROF_OFFICE varchar(50),\n PROF_EXTENSION varchar(4),\n PROF_HIGH_DEGREE varchar(5)\n)\n\nCREATE TABLE STUDENT (\n STU_NUM int,\n STU_LNAME varchar(15),\n STU_FNAME varchar(15),\n STU_INIT varchar(1),\n STU_DOB datetime,\n STU_HRS int,\n STU_CLASS varchar(2),\n STU_GPA float(8),\n STU_TRANSFER numeric,\n DEPT_CODE varchar(18),\n STU_PHONE varchar(4),\n PROF_NUM int\n)\n\nCREATE TABLE CLASS (\n CLASS_CODE varchar(5),\n CRS_CODE varchar(10),\n CLASS_SECTION varchar(2),\n CLASS_TIME varchar(20),\n CLASS_ROOM varchar(8),\n PROF_NUM int\n) ### Response: SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY MIN(STU_GPA) DESC"} {"instruction":"provide the maximum age of patients whose marital status is widowed and stayed in the hospital for 23 days.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = \"WIDOWED\" AND demographic.days_stay = \"23\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the maximum age of patients whose marital status is widowed and stayed in the hospital for 23 days. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = \"WIDOWED\" AND demographic.days_stay = \"23\""} {"instruction":"No Decision listed above has a visitor of Montreal.","input":"CREATE TABLE table_name_62 (\n decision VARCHAR,\n visitor VARCHAR\n)","response":"SELECT decision FROM table_name_62 WHERE visitor = \"montreal\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: No Decision listed above has a visitor of Montreal. ### Input: CREATE TABLE table_name_62 (\n decision VARCHAR,\n visitor VARCHAR\n) ### Response: SELECT decision FROM table_name_62 WHERE visitor = \"montreal\""} {"instruction":"Which requirements do I need to meet for a CS-LSA degree ?","input":"CREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)","response":"SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which requirements do I need to meet for a CS-LSA degree ? ### Input: CREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n) ### Response: SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id"} {"instruction":"What player had the high point on July 7?","input":"CREATE TABLE table_name_21 (\n high_points VARCHAR,\n date VARCHAR\n)","response":"SELECT high_points FROM table_name_21 WHERE date = \"july 7\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player had the high point on July 7? ### Input: CREATE TABLE table_name_21 (\n high_points VARCHAR,\n date VARCHAR\n) ### Response: SELECT high_points FROM table_name_21 WHERE date = \"july 7\""} {"instruction":"When did the team play an away game against the Toronto Eagles?","input":"CREATE TABLE table_7343 (\n \"Date\" text,\n \"Time\" text,\n \"Home\" text,\n \"Away\" text,\n \"Score\" text,\n \"Ground\" text\n)","response":"SELECT \"Date\" FROM table_7343 WHERE \"Away\" = 'toronto eagles'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the team play an away game against the Toronto Eagles? ### Input: CREATE TABLE table_7343 (\n \"Date\" text,\n \"Time\" text,\n \"Home\" text,\n \"Away\" text,\n \"Score\" text,\n \"Ground\" text\n) ### Response: SELECT \"Date\" FROM table_7343 WHERE \"Away\" = 'toronto eagles'"} {"instruction":"What Golden point(s) scorer has the Away Brisbane Broncos and Home South Sydney Rabbitohs?","input":"CREATE TABLE table_name_14 (\n golden_point_s__scorer VARCHAR,\n away VARCHAR,\n home VARCHAR\n)","response":"SELECT golden_point_s__scorer FROM table_name_14 WHERE away = \"brisbane broncos\" AND home = \"south sydney rabbitohs\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Golden point(s) scorer has the Away Brisbane Broncos and Home South Sydney Rabbitohs? ### Input: CREATE TABLE table_name_14 (\n golden_point_s__scorer VARCHAR,\n away VARCHAR,\n home VARCHAR\n) ### Response: SELECT golden_point_s__scorer FROM table_name_14 WHERE away = \"brisbane broncos\" AND home = \"south sydney rabbitohs\""} {"instruction":"What is Party, when Minister is 'Franco Frattini'?","input":"CREATE TABLE table_name_55 (\n party VARCHAR,\n minister VARCHAR\n)","response":"SELECT party FROM table_name_55 WHERE minister = \"franco frattini\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Party, when Minister is 'Franco Frattini'? ### Input: CREATE TABLE table_name_55 (\n party VARCHAR,\n minister VARCHAR\n) ### Response: SELECT party FROM table_name_55 WHERE minister = \"franco frattini\""} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, could you rank in ascending by the X-axis?","input":"CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)","response":"SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, could you rank in ascending by the X-axis? ### Input: CREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n) ### Response: SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID"} {"instruction":"What is the size of the windfarm in wexford that has more than 19 turbines and a vendor of Enercon?","input":"CREATE TABLE table_39540 (\n \"Wind Farm\" text,\n \"Capacity (MW)\" real,\n \"Turbines\" real,\n \"Turbine Vendor\" text,\n \"Size (MW)\" text,\n \"County\" text\n)","response":"SELECT \"Size (MW)\" FROM table_39540 WHERE \"Turbines\" > '19' AND \"Turbine Vendor\" = 'enercon' AND \"County\" = 'wexford'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the size of the windfarm in wexford that has more than 19 turbines and a vendor of Enercon? ### Input: CREATE TABLE table_39540 (\n \"Wind Farm\" text,\n \"Capacity (MW)\" real,\n \"Turbines\" real,\n \"Turbine Vendor\" text,\n \"Size (MW)\" text,\n \"County\" text\n) ### Response: SELECT \"Size (MW)\" FROM table_39540 WHERE \"Turbines\" > '19' AND \"Turbine Vendor\" = 'enercon' AND \"County\" = 'wexford'"} {"instruction":"What is the maximum 2006 census population of LGA name Opobo\/Nkoro?","input":"CREATE TABLE table_23155 (\n \"LGA Name\" text,\n \"Area (km 2 )\" real,\n \"Census 2006 population\" real,\n \"Administrative capital\" text,\n \"Postal Code\" real\n)","response":"SELECT MAX(\"Census 2006 population\") FROM table_23155 WHERE \"LGA Name\" = 'Opobo\/Nkoro'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the maximum 2006 census population of LGA name Opobo\/Nkoro? ### Input: CREATE TABLE table_23155 (\n \"LGA Name\" text,\n \"Area (km 2 )\" real,\n \"Census 2006 population\" real,\n \"Administrative capital\" text,\n \"Postal Code\" real\n) ### Response: SELECT MAX(\"Census 2006 population\") FROM table_23155 WHERE \"LGA Name\" = 'Opobo\/Nkoro'"} {"instruction":"Which Jushin Liger has a Gran Hamada of kendo kashin?","input":"CREATE TABLE table_name_60 (\n jushin_liger VARCHAR,\n gran_hamada VARCHAR\n)","response":"SELECT jushin_liger FROM table_name_60 WHERE gran_hamada = \"kendo kashin\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Jushin Liger has a Gran Hamada of kendo kashin? ### Input: CREATE TABLE table_name_60 (\n jushin_liger VARCHAR,\n gran_hamada VARCHAR\n) ### Response: SELECT jushin_liger FROM table_name_60 WHERE gran_hamada = \"kendo kashin\""} {"instruction":"What engine has an output of ps (kw; hp) @4700 rpm?","input":"CREATE TABLE table_60251 (\n \"Name\" text,\n \"Volume\" text,\n \"Engine\" text,\n \"Fuel\" text,\n \"Output\" text,\n \"Torque\" text,\n \"Engine ID code(s)\" text,\n \"0\\u2013100km\/h,s\" real,\n \"Top speed\" text,\n \"Years\" text\n)","response":"SELECT \"Engine\" FROM table_60251 WHERE \"Output\" = 'ps (kw; hp) @4700 rpm'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What engine has an output of ps (kw; hp) @4700 rpm? ### Input: CREATE TABLE table_60251 (\n \"Name\" text,\n \"Volume\" text,\n \"Engine\" text,\n \"Fuel\" text,\n \"Output\" text,\n \"Torque\" text,\n \"Engine ID code(s)\" text,\n \"0\\u2013100km\/h,s\" real,\n \"Top speed\" text,\n \"Years\" text\n) ### Response: SELECT \"Engine\" FROM table_60251 WHERE \"Output\" = 'ps (kw; hp) @4700 rpm'"} {"instruction":"Who was the HP winning team when the EP winning team was Hans Zereis and the GM winning team was Charles Gibson?","input":"CREATE TABLE table_31014 (\n \"Rnd\" text,\n \"Circuit\" text,\n \"AP Winning Team\" text,\n \"BP Winning Team\" text,\n \"CM Winning Team\" text,\n \"CP Winning Team\" text,\n \"DM Winning Team\" text,\n \"DP Winning Team\" text,\n \"EM Winning Team\" text,\n \"EP Winning Team\" text,\n \"FM Winning Team\" text,\n \"FP Winning Team\" text,\n \"GM Winning Team\" text,\n \"GP Winning Team\" text,\n \"HM Winning Team\" text,\n \"HP Winning Team\" text,\n \"Results\" text\n)","response":"SELECT \"HP Winning Team\" FROM table_31014 WHERE \"EP Winning Team\" = 'Hans Zereis' AND \"GM Winning Team\" = 'Charles Gibson'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the HP winning team when the EP winning team was Hans Zereis and the GM winning team was Charles Gibson? ### Input: CREATE TABLE table_31014 (\n \"Rnd\" text,\n \"Circuit\" text,\n \"AP Winning Team\" text,\n \"BP Winning Team\" text,\n \"CM Winning Team\" text,\n \"CP Winning Team\" text,\n \"DM Winning Team\" text,\n \"DP Winning Team\" text,\n \"EM Winning Team\" text,\n \"EP Winning Team\" text,\n \"FM Winning Team\" text,\n \"FP Winning Team\" text,\n \"GM Winning Team\" text,\n \"GP Winning Team\" text,\n \"HM Winning Team\" text,\n \"HP Winning Team\" text,\n \"Results\" text\n) ### Response: SELECT \"HP Winning Team\" FROM table_31014 WHERE \"EP Winning Team\" = 'Hans Zereis' AND \"GM Winning Team\" = 'Charles Gibson'"} {"instruction":"What mean number of extra points was there when James Lawrence was a player and the touchdown number was less than 1?","input":"CREATE TABLE table_name_7 (\n extra_points INTEGER,\n player VARCHAR,\n touchdowns VARCHAR\n)","response":"SELECT AVG(extra_points) FROM table_name_7 WHERE player = \"james lawrence\" AND touchdowns < 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What mean number of extra points was there when James Lawrence was a player and the touchdown number was less than 1? ### Input: CREATE TABLE table_name_7 (\n extra_points INTEGER,\n player VARCHAR,\n touchdowns VARCHAR\n) ### Response: SELECT AVG(extra_points) FROM table_name_7 WHERE player = \"james lawrence\" AND touchdowns < 1"} {"instruction":"who is the only player to have denmark listed as their nationality ?","input":"CREATE TABLE table_203_305 (\n id number,\n \"round\" number,\n \"#\" number,\n \"player\" text,\n \"nationality\" text,\n \"college\/junior\/club team (league)\" text\n)","response":"SELECT \"player\" FROM table_203_305 WHERE \"nationality\" = 'denmark'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the only player to have denmark listed as their nationality ? ### Input: CREATE TABLE table_203_305 (\n id number,\n \"round\" number,\n \"#\" number,\n \"player\" text,\n \"nationality\" text,\n \"college\/junior\/club team (league)\" text\n) ### Response: SELECT \"player\" FROM table_203_305 WHERE \"nationality\" = 'denmark'"} {"instruction":"count the number of dead patients who were diagnosed with noninf gastroenterit nec.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = \"1\" AND diagnoses.short_title = \"Noninf gastroenterit NEC\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of dead patients who were diagnosed with noninf gastroenterit nec. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = \"1\" AND diagnoses.short_title = \"Noninf gastroenterit NEC\""} {"instruction":"What year and where was the tournament when fan ying won the womens singles?","input":"CREATE TABLE table_28138035_26 (\n year_location VARCHAR,\n womens_singles VARCHAR\n)","response":"SELECT year_location FROM table_28138035_26 WHERE womens_singles = \"Fan Ying\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year and where was the tournament when fan ying won the womens singles? ### Input: CREATE TABLE table_28138035_26 (\n year_location VARCHAR,\n womens_singles VARCHAR\n) ### Response: SELECT year_location FROM table_28138035_26 WHERE womens_singles = \"Fan Ying\""} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and employee_id , show X-axis in desc order please.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)","response":"SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and employee_id , show X-axis in desc order please. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n) ### Response: SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC"} {"instruction":"What label shows an Album of cover version v?","input":"CREATE TABLE table_name_24 (\n label VARCHAR,\n album VARCHAR\n)","response":"SELECT label FROM table_name_24 WHERE album = \"cover version v\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What label shows an Album of cover version v? ### Input: CREATE TABLE table_name_24 (\n label VARCHAR,\n album VARCHAR\n) ### Response: SELECT label FROM table_name_24 WHERE album = \"cover version v\""} {"instruction":"What genre was Music in the Air?","input":"CREATE TABLE table_name_7 (\n genre VARCHAR,\n title VARCHAR\n)","response":"SELECT genre FROM table_name_7 WHERE title = \"music in the air\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What genre was Music in the Air? ### Input: CREATE TABLE table_name_7 (\n genre VARCHAR,\n title VARCHAR\n) ### Response: SELECT genre FROM table_name_7 WHERE title = \"music in the air\""} {"instruction":"In how many counties di McCain win 41.62% of the vote?","input":"CREATE TABLE table_23740 (\n \"County\" text,\n \"Obama%\" text,\n \"Obama#\" real,\n \"McCain%\" text,\n \"McCain#\" real\n)","response":"SELECT COUNT(\"County\") FROM table_23740 WHERE \"McCain%\" = '41.62%'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In how many counties di McCain win 41.62% of the vote? ### Input: CREATE TABLE table_23740 (\n \"County\" text,\n \"Obama%\" text,\n \"Obama#\" real,\n \"McCain%\" text,\n \"McCain#\" real\n) ### Response: SELECT COUNT(\"County\") FROM table_23740 WHERE \"McCain%\" = '41.62%'"} {"instruction":"What is the date of appointment for outgoing manager Campbell Money","input":"CREATE TABLE table_11206916_2 (\n date_of_appointment VARCHAR,\n outgoing_manager VARCHAR\n)","response":"SELECT date_of_appointment FROM table_11206916_2 WHERE outgoing_manager = \"Campbell Money\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date of appointment for outgoing manager Campbell Money ### Input: CREATE TABLE table_11206916_2 (\n date_of_appointment VARCHAR,\n outgoing_manager VARCHAR\n) ### Response: SELECT date_of_appointment FROM table_11206916_2 WHERE outgoing_manager = \"Campbell Money\""} {"instruction":"What year was the winners vote 55.99%?","input":"CREATE TABLE table_1808 (\n \"Year\" real,\n \"Lok Sabha\" text,\n \"Members of Parliament\" text,\n \"Party Won\" text,\n \"Winners % votes\" text,\n \"Trailing Party\" text,\n \"Trailing Party % votes\" text\n)","response":"SELECT MIN(\"Year\") FROM table_1808 WHERE \"Winners % votes\" = '55.99%'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the winners vote 55.99%? ### Input: CREATE TABLE table_1808 (\n \"Year\" real,\n \"Lok Sabha\" text,\n \"Members of Parliament\" text,\n \"Party Won\" text,\n \"Winners % votes\" text,\n \"Trailing Party\" text,\n \"Trailing Party % votes\" text\n) ### Response: SELECT MIN(\"Year\") FROM table_1808 WHERE \"Winners % votes\" = '55.99%'"} {"instruction":"What is the lowest number of points of the team with 2 losses and a lower than 1 position?","input":"CREATE TABLE table_name_73 (\n points INTEGER,\n losses VARCHAR,\n position VARCHAR\n)","response":"SELECT MIN(points) FROM table_name_73 WHERE losses = 2 AND position > 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of points of the team with 2 losses and a lower than 1 position? ### Input: CREATE TABLE table_name_73 (\n points INTEGER,\n losses VARCHAR,\n position VARCHAR\n) ### Response: SELECT MIN(points) FROM table_name_73 WHERE losses = 2 AND position > 1"} {"instruction":"What is the away team's score when the Home team score is 14.18 (102)?","input":"CREATE TABLE table_57966 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Away team score\" FROM table_57966 WHERE \"Home team score\" = '14.18 (102)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the away team's score when the Home team score is 14.18 (102)? ### Input: CREATE TABLE table_57966 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Away team score\" FROM table_57966 WHERE \"Home team score\" = '14.18 (102)'"} {"instruction":"what label was italy on ?","input":"CREATE TABLE table_204_966 (\n id number,\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalog\" text\n)","response":"SELECT \"label\" FROM table_204_966 WHERE \"region\" = 'italy'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what label was italy on ? ### Input: CREATE TABLE table_204_966 (\n id number,\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalog\" text\n) ### Response: SELECT \"label\" FROM table_204_966 WHERE \"region\" = 'italy'"} {"instruction":"What national has 4.45 for o and 4.55 for xo?","input":"CREATE TABLE table_65762 (\n \"Name\" text,\n \"Nationality\" text,\n \"4.30\" text,\n \"4.45\" text,\n \"4.55\" text,\n \"Result\" real\n)","response":"SELECT \"Nationality\" FROM table_65762 WHERE \"4.45\" = 'o' AND \"4.55\" = 'xo'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What national has 4.45 for o and 4.55 for xo? ### Input: CREATE TABLE table_65762 (\n \"Name\" text,\n \"Nationality\" text,\n \"4.30\" text,\n \"4.45\" text,\n \"4.55\" text,\n \"Result\" real\n) ### Response: SELECT \"Nationality\" FROM table_65762 WHERE \"4.45\" = 'o' AND \"4.55\" = 'xo'"} {"instruction":"Return the average money requested across all entrepreneurs.","input":"CREATE TABLE people (\n people_id number,\n name text,\n height number,\n weight number,\n date_of_birth text\n)\n\nCREATE TABLE entrepreneur (\n entrepreneur_id number,\n people_id number,\n company text,\n money_requested number,\n investor text\n)","response":"SELECT AVG(money_requested) FROM entrepreneur","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the average money requested across all entrepreneurs. ### Input: CREATE TABLE people (\n people_id number,\n name text,\n height number,\n weight number,\n date_of_birth text\n)\n\nCREATE TABLE entrepreneur (\n entrepreneur_id number,\n people_id number,\n company text,\n money_requested number,\n investor text\n) ### Response: SELECT AVG(money_requested) FROM entrepreneur"} {"instruction":"What core clocks ( mhz ) have a 21.3 memory bandwidth ( gb\/s )?","input":"CREATE TABLE table_28157 (\n \"Graphics\" text,\n \"Launch\" real,\n \"Market\" text,\n \"CPU\" text,\n \"Code name\" text,\n \"Device ID\" real,\n \"Core clock ( MHz )\" text,\n \"Execution units\" real,\n \"Shader model\" text,\n \"DirectX\" text,\n \"OpenGL\" text,\n \"OpenCL\" text,\n \"Memory bandwidth ( GB\/s )\" text,\n \"DVMT ( MB )\" real,\n \"CVT HD\" text,\n \"QSV\" text\n)","response":"SELECT \"Core clock ( MHz )\" FROM table_28157 WHERE \"Memory bandwidth ( GB\/s )\" = '21.3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What core clocks ( mhz ) have a 21.3 memory bandwidth ( gb\/s )? ### Input: CREATE TABLE table_28157 (\n \"Graphics\" text,\n \"Launch\" real,\n \"Market\" text,\n \"CPU\" text,\n \"Code name\" text,\n \"Device ID\" real,\n \"Core clock ( MHz )\" text,\n \"Execution units\" real,\n \"Shader model\" text,\n \"DirectX\" text,\n \"OpenGL\" text,\n \"OpenCL\" text,\n \"Memory bandwidth ( GB\/s )\" text,\n \"DVMT ( MB )\" real,\n \"CVT HD\" text,\n \"QSV\" text\n) ### Response: SELECT \"Core clock ( MHz )\" FROM table_28157 WHERE \"Memory bandwidth ( GB\/s )\" = '21.3'"} {"instruction":"Who the GM winning team when the EP winning team was #37 Porsche?","input":"CREATE TABLE table_31012 (\n \"Rnd\" text,\n \"Circuit\" text,\n \"AP Winning Team\" text,\n \"BP Winning Team\" text,\n \"CM Winning Team\" text,\n \"CP Winning Team\" text,\n \"DM Winning Team\" text,\n \"DP Winning Team\" text,\n \"EM Winning Team\" text,\n \"EP Winning Team\" text,\n \"FM Winning Team\" text,\n \"FP Winning Team\" text,\n \"GM Winning Team\" text,\n \"GP Winning Team\" text,\n \"HM Winning Team\" text,\n \"HP Winning Team\" text,\n \"Results\" text\n)","response":"SELECT \"GM Winning Team\" FROM table_31012 WHERE \"EP Winning Team\" = '#37 Porsche'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who the GM winning team when the EP winning team was #37 Porsche? ### Input: CREATE TABLE table_31012 (\n \"Rnd\" text,\n \"Circuit\" text,\n \"AP Winning Team\" text,\n \"BP Winning Team\" text,\n \"CM Winning Team\" text,\n \"CP Winning Team\" text,\n \"DM Winning Team\" text,\n \"DP Winning Team\" text,\n \"EM Winning Team\" text,\n \"EP Winning Team\" text,\n \"FM Winning Team\" text,\n \"FP Winning Team\" text,\n \"GM Winning Team\" text,\n \"GP Winning Team\" text,\n \"HM Winning Team\" text,\n \"HP Winning Team\" text,\n \"Results\" text\n) ### Response: SELECT \"GM Winning Team\" FROM table_31012 WHERE \"EP Winning Team\" = '#37 Porsche'"} {"instruction":"What is their position when the b score is more than 8.975 for Ekaterina Kramarenko ( rus )?","input":"CREATE TABLE table_name_57 (\n position VARCHAR,\n b_score VARCHAR,\n gymnast VARCHAR\n)","response":"SELECT position FROM table_name_57 WHERE b_score > 8.975 AND gymnast = \"ekaterina kramarenko ( rus )\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is their position when the b score is more than 8.975 for Ekaterina Kramarenko ( rus )? ### Input: CREATE TABLE table_name_57 (\n position VARCHAR,\n b_score VARCHAR,\n gymnast VARCHAR\n) ### Response: SELECT position FROM table_name_57 WHERE b_score > 8.975 AND gymnast = \"ekaterina kramarenko ( rus )\""} {"instruction":"known renal disease with a baseline serum creatinine > 1.5 mg \/ dl","input":"CREATE TABLE table_train_157 (\n \"id\" int,\n \"gender\" string,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"platelets\" int,\n \"renal_disease\" bool,\n \"c_reactive_protein\" float,\n \"creatinine_clearance_cl\" float,\n \"urine_protein\" int,\n \"serum_creatinine\" float,\n \"proteinuria\" int,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_157 WHERE renal_disease = 1 AND serum_creatinine > 1.5","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: known renal disease with a baseline serum creatinine > 1.5 mg \/ dl ### Input: CREATE TABLE table_train_157 (\n \"id\" int,\n \"gender\" string,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"platelets\" int,\n \"renal_disease\" bool,\n \"c_reactive_protein\" float,\n \"creatinine_clearance_cl\" float,\n \"urine_protein\" int,\n \"serum_creatinine\" float,\n \"proteinuria\" int,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_157 WHERE renal_disease = 1 AND serum_creatinine > 1.5"} {"instruction":"List the dates and vote percents of elections.","input":"CREATE TABLE election (\n Date VARCHAR,\n Vote_Percent VARCHAR\n)","response":"SELECT Date, Vote_Percent FROM election","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the dates and vote percents of elections. ### Input: CREATE TABLE election (\n Date VARCHAR,\n Vote_Percent VARCHAR\n) ### Response: SELECT Date, Vote_Percent FROM election"} {"instruction":"which date had the least attendance ?","input":"CREATE TABLE table_204_123 (\n id number,\n \"week\" number,\n \"date\" text,\n \"kickoff\" text,\n \"opponent\" text,\n \"results\\nfinal score\" text,\n \"results\\nteam record\" text,\n \"game site\" text,\n \"attendance\" number\n)","response":"SELECT \"date\" FROM table_204_123 ORDER BY \"attendance\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which date had the least attendance ? ### Input: CREATE TABLE table_204_123 (\n id number,\n \"week\" number,\n \"date\" text,\n \"kickoff\" text,\n \"opponent\" text,\n \"results\\nfinal score\" text,\n \"results\\nteam record\" text,\n \"game site\" text,\n \"attendance\" number\n) ### Response: SELECT \"date\" FROM table_204_123 ORDER BY \"attendance\" LIMIT 1"} {"instruction":"What enrollement would you expect if you were attending the university in St. Louis?","input":"CREATE TABLE table_2319 (\n \"School\" text,\n \"Location(s)\" text,\n \"Control\" text,\n \"Type\" text,\n \"Enrollment\" real,\n \"Founded\" real\n)","response":"SELECT \"Enrollment\" FROM table_2319 WHERE \"Location(s)\" = 'St. Louis'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What enrollement would you expect if you were attending the university in St. Louis? ### Input: CREATE TABLE table_2319 (\n \"School\" text,\n \"Location(s)\" text,\n \"Control\" text,\n \"Type\" text,\n \"Enrollment\" real,\n \"Founded\" real\n) ### Response: SELECT \"Enrollment\" FROM table_2319 WHERE \"Location(s)\" = 'St. Louis'"} {"instruction":"what is the total number of painters who scored 12 in composition ?","input":"CREATE TABLE table_203_186 (\n id number,\n \"painter\" text,\n \"composition\" number,\n \"drawing\" number,\n \"color\" number,\n \"expression\" number\n)","response":"SELECT COUNT(\"painter\") FROM table_203_186 WHERE \"composition\" = 12","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of painters who scored 12 in composition ? ### Input: CREATE TABLE table_203_186 (\n id number,\n \"painter\" text,\n \"composition\" number,\n \"drawing\" number,\n \"color\" number,\n \"expression\" number\n) ### Response: SELECT COUNT(\"painter\") FROM table_203_186 WHERE \"composition\" = 12"} {"instruction":"Who were the away teams when the competition was the 1st republic of srpska football day and the home team was u 14 republic of srpska?","input":"CREATE TABLE table_29728596_2 (\n away_team VARCHAR,\n competition VARCHAR,\n home_team VARCHAR\n)","response":"SELECT away_team FROM table_29728596_2 WHERE competition = \"1st ``Republic of Srpska Football Day``\" AND home_team = \"U 14 Republic of Srpska\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the away teams when the competition was the 1st republic of srpska football day and the home team was u 14 republic of srpska? ### Input: CREATE TABLE table_29728596_2 (\n away_team VARCHAR,\n competition VARCHAR,\n home_team VARCHAR\n) ### Response: SELECT away_team FROM table_29728596_2 WHERE competition = \"1st ``Republic of Srpska Football Day``\" AND home_team = \"U 14 Republic of Srpska\""} {"instruction":"Which chassis did fondmetal f1 spa use after 1990?","input":"CREATE TABLE table_name_32 (\n chassis VARCHAR,\n year VARCHAR,\n entrant VARCHAR\n)","response":"SELECT chassis FROM table_name_32 WHERE year > 1990 AND entrant = \"fondmetal f1 spa\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which chassis did fondmetal f1 spa use after 1990? ### Input: CREATE TABLE table_name_32 (\n chassis VARCHAR,\n year VARCHAR,\n entrant VARCHAR\n) ### Response: SELECT chassis FROM table_name_32 WHERE year > 1990 AND entrant = \"fondmetal f1 spa\""} {"instruction":"what is the number of patients who are in ward 650 until 2104?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 650 AND STRFTIME('%y', patient.unitadmittime) <= '2104'","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients who are in ward 650 until 2104? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 650 AND STRFTIME('%y', patient.unitadmittime) <= '2104'"} {"instruction":"How far is the olbia to sassari route?","input":"CREATE TABLE table_10194 (\n \"Date\" text,\n \"Course\" text,\n \"Distance\" text,\n \"Type\" text,\n \"Winner\" text\n)","response":"SELECT \"Distance\" FROM table_10194 WHERE \"Course\" = 'olbia to sassari'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How far is the olbia to sassari route? ### Input: CREATE TABLE table_10194 (\n \"Date\" text,\n \"Course\" text,\n \"Distance\" text,\n \"Type\" text,\n \"Winner\" text\n) ### Response: SELECT \"Distance\" FROM table_10194 WHERE \"Course\" = 'olbia to sassari'"} {"instruction":"What competition was held 1 March 1909?","input":"CREATE TABLE table_4377 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n)","response":"SELECT \"Competition\" FROM table_4377 WHERE \"Date\" = '1 march 1909'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What competition was held 1 March 1909? ### Input: CREATE TABLE table_4377 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n) ### Response: SELECT \"Competition\" FROM table_4377 WHERE \"Date\" = '1 march 1909'"} {"instruction":"can you find the top entered service ?","input":"CREATE TABLE table_204_882 (\n id number,\n \"number\" number,\n \"builder\" text,\n \"entered service\" text,\n \"withdrawn\" text,\n \"notes\" text\n)","response":"SELECT \"entered service\" FROM table_204_882 WHERE id = 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: can you find the top entered service ? ### Input: CREATE TABLE table_204_882 (\n id number,\n \"number\" number,\n \"builder\" text,\n \"entered service\" text,\n \"withdrawn\" text,\n \"notes\" text\n) ### Response: SELECT \"entered service\" FROM table_204_882 WHERE id = 1"} {"instruction":"provide the number of patients whose ethnicity is black\/cape verdean and age is less than 68?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"BLACK\/CAPE VERDEAN\" AND demographic.age < \"68\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose ethnicity is black\/cape verdean and age is less than 68? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = \"BLACK\/CAPE VERDEAN\" AND demographic.age < \"68\""} {"instruction":"Name the 2011 when 2010 is 2r","input":"CREATE TABLE table_80361 (\n \"Tournament\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n)","response":"SELECT \"2011\" FROM table_80361 WHERE \"2010\" = '2r'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the 2011 when 2010 is 2r ### Input: CREATE TABLE table_80361 (\n \"Tournament\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n) ### Response: SELECT \"2011\" FROM table_80361 WHERE \"2010\" = '2r'"} {"instruction":"What was the title of series number 56?","input":"CREATE TABLE table_2468961_4 (\n title VARCHAR,\n no_in_series VARCHAR\n)","response":"SELECT title FROM table_2468961_4 WHERE no_in_series = 56","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the title of series number 56? ### Input: CREATE TABLE table_2468961_4 (\n title VARCHAR,\n no_in_series VARCHAR\n) ### Response: SELECT title FROM table_2468961_4 WHERE no_in_series = 56"} {"instruction":"What was the championship during the match with the opponent of richard fromberg?","input":"CREATE TABLE table_9055 (\n \"Outcome\" text,\n \"Date\" real,\n \"Championship\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n)","response":"SELECT \"Championship\" FROM table_9055 WHERE \"Opponent\" = 'richard fromberg'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the championship during the match with the opponent of richard fromberg? ### Input: CREATE TABLE table_9055 (\n \"Outcome\" text,\n \"Date\" real,\n \"Championship\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Score\" text\n) ### Response: SELECT \"Championship\" FROM table_9055 WHERE \"Opponent\" = 'richard fromberg'"} {"instruction":"Name the most revenue for operating income more than 27 for hamburg and debt as % of value less than 0","input":"CREATE TABLE table_68346 (\n \"Rank\" real,\n \"Team\" text,\n \"Country\" text,\n \"Value ($M)\" real,\n \"Debt as % of value\" real,\n \"% change on year\" text,\n \"Revenue ($M)\" real,\n \"Operating income ($m)\" real\n)","response":"SELECT MAX(\"Revenue ($M)\") FROM table_68346 WHERE \"Operating income ($m)\" > '27' AND \"Team\" = 'hamburg' AND \"Debt as % of value\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most revenue for operating income more than 27 for hamburg and debt as % of value less than 0 ### Input: CREATE TABLE table_68346 (\n \"Rank\" real,\n \"Team\" text,\n \"Country\" text,\n \"Value ($M)\" real,\n \"Debt as % of value\" real,\n \"% change on year\" text,\n \"Revenue ($M)\" real,\n \"Operating income ($m)\" real\n) ### Response: SELECT MAX(\"Revenue ($M)\") FROM table_68346 WHERE \"Operating income ($m)\" > '27' AND \"Team\" = 'hamburg' AND \"Debt as % of value\" < '0'"} {"instruction":"What is the result for game 5?","input":"CREATE TABLE table_9742 (\n \"Game\" text,\n \"Date\" text,\n \"Home Team\" text,\n \"Result\" text,\n \"Road Team\" text\n)","response":"SELECT \"Result\" FROM table_9742 WHERE \"Game\" = 'game 5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result for game 5? ### Input: CREATE TABLE table_9742 (\n \"Game\" text,\n \"Date\" text,\n \"Home Team\" text,\n \"Result\" text,\n \"Road Team\" text\n) ### Response: SELECT \"Result\" FROM table_9742 WHERE \"Game\" = 'game 5'"} {"instruction":"count the number of patients who were diagnosed with oth nonauto hem anemia and did not come back to the hospital within 2 months in 2103.","input":"CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)","response":"SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth nonauto hem anemia') AND STRFTIME('%y', diagnoses_icd.charttime) = '2103') AS t1) - (SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth nonauto hem anemia') AND STRFTIME('%y', diagnoses_icd.charttime) = '2103') AS t2 JOIN admissions ON t2.subject_id = admissions.subject_id WHERE t2.charttime < admissions.admittime AND STRFTIME('%y', admissions.admittime) = '2103' AND DATETIME(admissions.admittime) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month'))","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who were diagnosed with oth nonauto hem anemia and did not come back to the hospital within 2 months in 2103. ### Input: CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n) ### Response: SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth nonauto hem anemia') AND STRFTIME('%y', diagnoses_icd.charttime) = '2103') AS t1) - (SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth nonauto hem anemia') AND STRFTIME('%y', diagnoses_icd.charttime) = '2103') AS t2 JOIN admissions ON t2.subject_id = admissions.subject_id WHERE t2.charttime < admissions.admittime AND STRFTIME('%y', admissions.admittime) = '2103' AND DATETIME(admissions.admittime) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month'))"} {"instruction":"What school has the Lancers as their mascot?","input":"CREATE TABLE table_65693 (\n \"School\" text,\n \"Location\" text,\n \"Mascot\" text,\n \"Enrollment\" real,\n \"IHSAA Class\" text,\n \"IHSAA Football Class\" text,\n \"County\" text\n)","response":"SELECT \"Location\" FROM table_65693 WHERE \"Mascot\" = 'lancers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What school has the Lancers as their mascot? ### Input: CREATE TABLE table_65693 (\n \"School\" text,\n \"Location\" text,\n \"Mascot\" text,\n \"Enrollment\" real,\n \"IHSAA Class\" text,\n \"IHSAA Football Class\" text,\n \"County\" text\n) ### Response: SELECT \"Location\" FROM table_65693 WHERE \"Mascot\" = 'lancers'"} {"instruction":"What was the tie number for the game with an away team of Hartlepool United?","input":"CREATE TABLE table_60420 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n)","response":"SELECT \"Tie no\" FROM table_60420 WHERE \"Away team\" = 'hartlepool united'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the tie number for the game with an away team of Hartlepool United? ### Input: CREATE TABLE table_60420 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n) ### Response: SELECT \"Tie no\" FROM table_60420 WHERE \"Away team\" = 'hartlepool united'"} {"instruction":"count the number of patients who had received vitamin k within 2 months after being diagnosed with bone fracture(s) - left lower extremity until 3 years ago.","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bone fracture(s) - left lower extremity' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vitamin k' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 WHERE t1.diagnosistime < t2.treatmenttime AND DATETIME(t2.treatmenttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who had received vitamin k within 2 months after being diagnosed with bone fracture(s) - left lower extremity until 3 years ago. ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bone fracture(s) - left lower extremity' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vitamin k' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 WHERE t1.diagnosistime < t2.treatmenttime AND DATETIME(t2.treatmenttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')"} {"instruction":"What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt?","input":"CREATE TABLE table_name_92 (\n round VARCHAR,\n race VARCHAR\n)","response":"SELECT round FROM table_name_92 WHERE race = \"int. adac-preis der tourenwagen von sachsen-anhalt\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt? ### Input: CREATE TABLE table_name_92 (\n round VARCHAR,\n race VARCHAR\n) ### Response: SELECT round FROM table_name_92 WHERE race = \"int. adac-preis der tourenwagen von sachsen-anhalt\""} {"instruction":"total number of venues that hosted first and second round games .","input":"CREATE TABLE table_203_606 (\n id number,\n \"region\" text,\n \"rnd\" number,\n \"host\" text,\n \"venue\" text,\n \"city\" text,\n \"state\" text\n)","response":"SELECT COUNT(\"venue\") FROM table_203_606 WHERE \"rnd\" = 1 OR \"rnd\" = 2","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: total number of venues that hosted first and second round games . ### Input: CREATE TABLE table_203_606 (\n id number,\n \"region\" text,\n \"rnd\" number,\n \"host\" text,\n \"venue\" text,\n \"city\" text,\n \"state\" text\n) ### Response: SELECT COUNT(\"venue\") FROM table_203_606 WHERE \"rnd\" = 1 OR \"rnd\" = 2"} {"instruction":"Which constructor has laps less than 100 and a time\/retired +10 laps?","input":"CREATE TABLE table_54219 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT \"Constructor\" FROM table_54219 WHERE \"Laps\" < '100' AND \"Time\/Retired\" = '+10 laps'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which constructor has laps less than 100 and a time\/retired +10 laps? ### Input: CREATE TABLE table_54219 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT \"Constructor\" FROM table_54219 WHERE \"Laps\" < '100' AND \"Time\/Retired\" = '+10 laps'"} {"instruction":"what was the first time that patient 003-83 had an intake since 995 days ago?","input":"CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-83')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-995 day') ORDER BY intakeoutput.intakeoutputtime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first time that patient 003-83 had an intake since 995 days ago? ### Input: CREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-83')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-995 day') ORDER BY intakeoutput.intakeoutputtime LIMIT 1"} {"instruction":"What was the winning team where Tim Macrow won the fastest lap on Queensland Raceway circuit?","input":"CREATE TABLE table_22083044_2 (\n winning_team VARCHAR,\n circuit VARCHAR,\n fastest_lap VARCHAR\n)","response":"SELECT winning_team FROM table_22083044_2 WHERE circuit = \"Queensland Raceway\" AND fastest_lap = \"Tim Macrow\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the winning team where Tim Macrow won the fastest lap on Queensland Raceway circuit? ### Input: CREATE TABLE table_22083044_2 (\n winning_team VARCHAR,\n circuit VARCHAR,\n fastest_lap VARCHAR\n) ### Response: SELECT winning_team FROM table_22083044_2 WHERE circuit = \"Queensland Raceway\" AND fastest_lap = \"Tim Macrow\""} {"instruction":"since 3 years ago, count the number of drugs that patient 19428 had been prescribed.","input":"CREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 3 years ago, count the number of drugs that patient 19428 had been prescribed. ### Input: CREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year')"} {"instruction":"Tell me the cast for b. reeves eason and joseph kane","input":"CREATE TABLE table_57614 (\n \"Serial Title\" text,\n \"Year\" text,\n \"Chapters\" text,\n \"Director\" text,\n \"Cast\" text\n)","response":"SELECT \"Cast\" FROM table_57614 WHERE \"Director\" = 'b. reeves eason and joseph kane'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the cast for b. reeves eason and joseph kane ### Input: CREATE TABLE table_57614 (\n \"Serial Title\" text,\n \"Year\" text,\n \"Chapters\" text,\n \"Director\" text,\n \"Cast\" text\n) ### Response: SELECT \"Cast\" FROM table_57614 WHERE \"Director\" = 'b. reeves eason and joseph kane'"} {"instruction":"Which Captain 2 has a Result of final?","input":"CREATE TABLE table_76555 (\n \"Date\" text,\n \"Captain 1\" text,\n \"Team 2\" text,\n \"Captain 2\" text,\n \"Venue\" text,\n \"Result\" text\n)","response":"SELECT \"Captain 2\" FROM table_76555 WHERE \"Result\" = 'final'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Captain 2 has a Result of final? ### Input: CREATE TABLE table_76555 (\n \"Date\" text,\n \"Captain 1\" text,\n \"Team 2\" text,\n \"Captain 2\" text,\n \"Venue\" text,\n \"Result\" text\n) ### Response: SELECT \"Captain 2\" FROM table_76555 WHERE \"Result\" = 'final'"} {"instruction":"when was the last time patient 85895 was prescribed a drug the previous month?","input":"CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time patient 85895 was prescribed a drug the previous month? ### Input: CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1"} {"instruction":"What was the record on April 1?","input":"CREATE TABLE table_33986 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Record\" text\n)","response":"SELECT \"Record\" FROM table_33986 WHERE \"Date\" = 'april 1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record on April 1? ### Input: CREATE TABLE table_33986 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Record\" text\n) ### Response: SELECT \"Record\" FROM table_33986 WHERE \"Date\" = 'april 1'"} {"instruction":"What is the entered service date for serial number 85-1222?","input":"CREATE TABLE table_name_29 (\n entered_service VARCHAR,\n serial_no VARCHAR\n)","response":"SELECT entered_service FROM table_name_29 WHERE serial_no = \"85-1222\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the entered service date for serial number 85-1222? ### Input: CREATE TABLE table_name_29 (\n entered_service VARCHAR,\n serial_no VARCHAR\n) ### Response: SELECT entered_service FROM table_name_29 WHERE serial_no = \"85-1222\""} {"instruction":"How many points does Swedish America's Cup Challenge have for rr1?","input":"CREATE TABLE table_21515673_2 (\n rr1_pts VARCHAR,\n team_name VARCHAR\n)","response":"SELECT COUNT(rr1_pts) FROM table_21515673_2 WHERE team_name = \"Swedish America's Cup Challenge\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many points does Swedish America's Cup Challenge have for rr1? ### Input: CREATE TABLE table_21515673_2 (\n rr1_pts VARCHAR,\n team_name VARCHAR\n) ### Response: SELECT COUNT(rr1_pts) FROM table_21515673_2 WHERE team_name = \"Swedish America's Cup Challenge\""} {"instruction":"Who is teaching PreMajor classes in the Winter term ?","input":"CREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)","response":"SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE program_course.category LIKE '%PreMajor%' AND semester.semester = 'Winter' AND semester.year = 2017","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is teaching PreMajor classes in the Winter term ? ### Input: CREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n) ### Response: SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE program_course.category LIKE '%PreMajor%' AND semester.semester = 'Winter' AND semester.year = 2017"} {"instruction":"For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and commission_pct , and list by the JOB_ID in asc.","input":"CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)","response":"SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and commission_pct , and list by the JOB_ID in asc. ### Input: CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n) ### Response: SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID"} {"instruction":"What is the lowest attendance for a stadium that has an average smaller than 307?","input":"CREATE TABLE table_name_24 (\n lowest INTEGER,\n average INTEGER\n)","response":"SELECT AVG(lowest) FROM table_name_24 WHERE average < 307","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest attendance for a stadium that has an average smaller than 307? ### Input: CREATE TABLE table_name_24 (\n lowest INTEGER,\n average INTEGER\n) ### Response: SELECT AVG(lowest) FROM table_name_24 WHERE average < 307"} {"instruction":"How many people are under 40 for each gender Plot them as bar chart, list x axis in asc order.","input":"CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n)","response":"SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people are under 40 for each gender Plot them as bar chart, list x axis in asc order. ### Input: CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n) ### Response: SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender"} {"instruction":"When 0-1 is the series who has the highest amount of assists?","input":"CREATE TABLE table_22883210_11 (\n high_assists VARCHAR,\n series VARCHAR\n)","response":"SELECT high_assists FROM table_22883210_11 WHERE series = \"0-1\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When 0-1 is the series who has the highest amount of assists? ### Input: CREATE TABLE table_22883210_11 (\n high_assists VARCHAR,\n series VARCHAR\n) ### Response: SELECT high_assists FROM table_22883210_11 WHERE series = \"0-1\""} {"instruction":"What are the first names of all students taking accoutning and Computer Information Systems classes?","input":"CREATE TABLE enroll (\n class_code text,\n stu_num number,\n enroll_grade text\n)\n\nCREATE TABLE employee (\n emp_num number,\n emp_lname text,\n emp_fname text,\n emp_initial text,\n emp_jobcode text,\n emp_hiredate time,\n emp_dob time\n)\n\nCREATE TABLE professor (\n emp_num number,\n dept_code text,\n prof_office text,\n prof_extension text,\n prof_high_degree text\n)\n\nCREATE TABLE class (\n class_code text,\n crs_code text,\n class_section text,\n class_time text,\n class_room text,\n prof_num number\n)\n\nCREATE TABLE course (\n crs_code text,\n dept_code text,\n crs_description text,\n crs_credit number\n)\n\nCREATE TABLE department (\n dept_code text,\n dept_name text,\n school_code text,\n emp_num number,\n dept_address text,\n dept_extension text\n)\n\nCREATE TABLE student (\n stu_num number,\n stu_lname text,\n stu_fname text,\n stu_init text,\n stu_dob time,\n stu_hrs number,\n stu_class text,\n stu_gpa number,\n stu_transfer number,\n dept_code text,\n stu_phone text,\n prof_num number\n)","response":"SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the first names of all students taking accoutning and Computer Information Systems classes? ### Input: CREATE TABLE enroll (\n class_code text,\n stu_num number,\n enroll_grade text\n)\n\nCREATE TABLE employee (\n emp_num number,\n emp_lname text,\n emp_fname text,\n emp_initial text,\n emp_jobcode text,\n emp_hiredate time,\n emp_dob time\n)\n\nCREATE TABLE professor (\n emp_num number,\n dept_code text,\n prof_office text,\n prof_extension text,\n prof_high_degree text\n)\n\nCREATE TABLE class (\n class_code text,\n crs_code text,\n class_section text,\n class_time text,\n class_room text,\n prof_num number\n)\n\nCREATE TABLE course (\n crs_code text,\n dept_code text,\n crs_description text,\n crs_credit number\n)\n\nCREATE TABLE department (\n dept_code text,\n dept_name text,\n school_code text,\n emp_num number,\n dept_address text,\n dept_extension text\n)\n\nCREATE TABLE student (\n stu_num number,\n stu_lname text,\n stu_fname text,\n stu_init text,\n stu_dob time,\n stu_hrs number,\n stu_class text,\n stu_gpa number,\n stu_transfer number,\n dept_code text,\n stu_phone text,\n prof_num number\n) ### Response: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'"} {"instruction":"how many months had more than 55 favor votes ?","input":"CREATE TABLE table_203_43 (\n id number,\n \"polling firm\" text,\n \"month\" text,\n \"link\" text,\n \"favor\" number,\n \"oppose\" number\n)","response":"SELECT COUNT(\"month\") FROM table_203_43 WHERE \"favor\" > 55","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many months had more than 55 favor votes ? ### Input: CREATE TABLE table_203_43 (\n id number,\n \"polling firm\" text,\n \"month\" text,\n \"link\" text,\n \"favor\" number,\n \"oppose\" number\n) ### Response: SELECT COUNT(\"month\") FROM table_203_43 WHERE \"favor\" > 55"} {"instruction":"What was the score for south melbourne at home?","input":"CREATE TABLE table_78401 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team score\" FROM table_78401 WHERE \"Home team\" = 'south melbourne'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score for south melbourne at home? ### Input: CREATE TABLE table_78401 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team score\" FROM table_78401 WHERE \"Home team\" = 'south melbourne'"} {"instruction":"Tell me the time of admission and primary disease for the patient with patient id 53707.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = \"53707\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the time of admission and primary disease for the patient with patient id 53707. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = \"53707\""} {"instruction":"previous gastrointestinal bleeding within 6 months, bleeding diathesis, platelet count < 100000 \/ mm3 or hemoglobin < 10 g \/ dl","input":"CREATE TABLE table_test_24 (\n \"id\" int,\n \"history_of_bleeding_diathesis\" bool,\n \"bleeding\" int,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"blood_draw\" bool,\n \"renal_disease\" bool,\n \"allergy_to_aspirin\" bool,\n \"allergy_to_clopidogrel\" bool,\n \"cardiogenic_shock\" bool,\n \"allergy_to_prasugrel\" bool,\n \"platelet_count\" float,\n \"diastolic_blood_pressure_dbp\" int,\n \"symptomatic_hypotension\" bool,\n \"serum_total_cholesterol\" int,\n \"gastrointestinal_disease\" bool,\n \"serum_creatinine\" float,\n \"hypertension\" bool,\n \"age\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_test_24 WHERE gastrointestinal_disease = 1 OR bleeding = 1 OR platelet_count < 100000 OR hemoglobin_a1c_hba1c < 10","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: previous gastrointestinal bleeding within 6 months, bleeding diathesis, platelet count < 100000 \/ mm3 or hemoglobin < 10 g \/ dl ### Input: CREATE TABLE table_test_24 (\n \"id\" int,\n \"history_of_bleeding_diathesis\" bool,\n \"bleeding\" int,\n \"systolic_blood_pressure_sbp\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"blood_draw\" bool,\n \"renal_disease\" bool,\n \"allergy_to_aspirin\" bool,\n \"allergy_to_clopidogrel\" bool,\n \"cardiogenic_shock\" bool,\n \"allergy_to_prasugrel\" bool,\n \"platelet_count\" float,\n \"diastolic_blood_pressure_dbp\" int,\n \"symptomatic_hypotension\" bool,\n \"serum_total_cholesterol\" int,\n \"gastrointestinal_disease\" bool,\n \"serum_creatinine\" float,\n \"hypertension\" bool,\n \"age\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_test_24 WHERE gastrointestinal_disease = 1 OR bleeding = 1 OR platelet_count < 100000 OR hemoglobin_a1c_hba1c < 10"} {"instruction":"how many games were attended by at least 8,000 people ?","input":"CREATE TABLE table_204_971 (\n id number,\n \"m\" number,\n \"date\" text,\n \"tournament\" text,\n \"round\" text,\n \"ground\" text,\n \"opponent\" text,\n \"score\" text,\n \"attendance\" number,\n \"dinamo scorers\" text,\n \"report\" text\n)","response":"SELECT COUNT(*) FROM table_204_971 WHERE \"attendance\" >= 8000","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many games were attended by at least 8,000 people ? ### Input: CREATE TABLE table_204_971 (\n id number,\n \"m\" number,\n \"date\" text,\n \"tournament\" text,\n \"round\" text,\n \"ground\" text,\n \"opponent\" text,\n \"score\" text,\n \"attendance\" number,\n \"dinamo scorers\" text,\n \"report\" text\n) ### Response: SELECT COUNT(*) FROM table_204_971 WHERE \"attendance\" >= 8000"} {"instruction":"For all storms with at least 1 death, compare the total number of deaths by dates_active attribute, sort by the names from low to high.","input":"CREATE TABLE region (\n Region_id int,\n Region_code text,\n Region_name text\n)\n\nCREATE TABLE storm (\n Storm_ID int,\n Name text,\n Dates_active text,\n Max_speed int,\n Damage_millions_USD real,\n Number_Deaths int\n)\n\nCREATE TABLE affected_region (\n Region_id int,\n Storm_ID int,\n Number_city_affected real\n)","response":"SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all storms with at least 1 death, compare the total number of deaths by dates_active attribute, sort by the names from low to high. ### Input: CREATE TABLE region (\n Region_id int,\n Region_code text,\n Region_name text\n)\n\nCREATE TABLE storm (\n Storm_ID int,\n Name text,\n Dates_active text,\n Max_speed int,\n Damage_millions_USD real,\n Number_Deaths int\n)\n\nCREATE TABLE affected_region (\n Region_id int,\n Storm_ID int,\n Number_city_affected real\n) ### Response: SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active"} {"instruction":"Name the most time for katrin mei ner and rank less than 5","input":"CREATE TABLE table_68512 (\n \"Rank\" real,\n \"Lane\" real,\n \"Name\" text,\n \"Nationality\" text,\n \"Time\" real\n)","response":"SELECT MAX(\"Time\") FROM table_68512 WHERE \"Name\" = 'katrin mei\u00dfner' AND \"Rank\" < '5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most time for katrin mei ner and rank less than 5 ### Input: CREATE TABLE table_68512 (\n \"Rank\" real,\n \"Lane\" real,\n \"Name\" text,\n \"Nationality\" text,\n \"Time\" real\n) ### Response: SELECT MAX(\"Time\") FROM table_68512 WHERE \"Name\" = 'katrin mei\u00dfner' AND \"Rank\" < '5'"} {"instruction":"In the year 2009 who was the under-13?","input":"CREATE TABLE table_26368963_1 (\n under_13 VARCHAR,\n year VARCHAR\n)","response":"SELECT under_13 FROM table_26368963_1 WHERE year = 2009","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the year 2009 who was the under-13? ### Input: CREATE TABLE table_26368963_1 (\n under_13 VARCHAR,\n year VARCHAR\n) ### Response: SELECT under_13 FROM table_26368963_1 WHERE year = 2009"} {"instruction":"Name the highest Horizontal Bar which is in france and Rings smaller than 58.975?","input":"CREATE TABLE table_name_4 (\n horizontal_bar INTEGER,\n country VARCHAR,\n rings VARCHAR\n)","response":"SELECT MAX(horizontal_bar) FROM table_name_4 WHERE country = \"france\" AND rings < 58.975","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the highest Horizontal Bar which is in france and Rings smaller than 58.975? ### Input: CREATE TABLE table_name_4 (\n horizontal_bar INTEGER,\n country VARCHAR,\n rings VARCHAR\n) ### Response: SELECT MAX(horizontal_bar) FROM table_name_4 WHERE country = \"france\" AND rings < 58.975"} {"instruction":"what is the county when the latitude is more than 48.581299, ansi code is more than 1037103 and the geo id is 3801985060?","input":"CREATE TABLE table_name_74 (\n county VARCHAR,\n geo_id VARCHAR,\n latitude VARCHAR,\n ansi_code VARCHAR\n)","response":"SELECT county FROM table_name_74 WHERE latitude > 48.581299 AND ansi_code > 1037103 AND geo_id = 3801985060","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the county when the latitude is more than 48.581299, ansi code is more than 1037103 and the geo id is 3801985060? ### Input: CREATE TABLE table_name_74 (\n county VARCHAR,\n geo_id VARCHAR,\n latitude VARCHAR,\n ansi_code VARCHAR\n) ### Response: SELECT county FROM table_name_74 WHERE latitude > 48.581299 AND ansi_code > 1037103 AND geo_id = 3801985060"} {"instruction":"Recent bounties with a given tag.","input":"CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT p.Id AS \"post_link\", p.Score AS \"Score\", p.AnswerCount AS \"Answers\", bs.BountyAmount AS \"Amount\", p.Tags, CAST(TIME_TO_STR(bs.CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) AS \"Bounty Start\" FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8 AND p.Tags LIKE '%<##Tagname##>%' ORDER BY bs.CreationDate DESC LIMIT 100","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Recent bounties with a given tag. ### Input: CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT p.Id AS \"post_link\", p.Score AS \"Score\", p.AnswerCount AS \"Answers\", bs.BountyAmount AS \"Amount\", p.Tags, CAST(TIME_TO_STR(bs.CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) AS \"Bounty Start\" FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8 AND p.Tags LIKE '%<##Tagname##>%' ORDER BY bs.CreationDate DESC LIMIT 100"} {"instruction":"Show the names of climbers and the heights of mountains they climb Show bar chart, and display in desc by the bars please.","input":"CREATE TABLE climber (\n Climber_ID int,\n Name text,\n Country text,\n Time text,\n Points real,\n Mountain_ID int\n)\n\nCREATE TABLE mountain (\n Mountain_ID int,\n Name text,\n Height real,\n Prominence real,\n Range text,\n Country text\n)","response":"SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names of climbers and the heights of mountains they climb Show bar chart, and display in desc by the bars please. ### Input: CREATE TABLE climber (\n Climber_ID int,\n Name text,\n Country text,\n Time text,\n Points real,\n Mountain_ID int\n)\n\nCREATE TABLE mountain (\n Mountain_ID int,\n Name text,\n Height real,\n Prominence real,\n Range text,\n Country text\n) ### Response: SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name DESC"} {"instruction":"How many strokes for arnold palmer with a to par of greater than 9?","input":"CREATE TABLE table_name_69 (\n total INTEGER,\n to_par VARCHAR,\n player VARCHAR\n)","response":"SELECT AVG(total) FROM table_name_69 WHERE to_par > 9 AND player = \"arnold palmer\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many strokes for arnold palmer with a to par of greater than 9? ### Input: CREATE TABLE table_name_69 (\n total INTEGER,\n to_par VARCHAR,\n player VARCHAR\n) ### Response: SELECT AVG(total) FROM table_name_69 WHERE to_par > 9 AND player = \"arnold palmer\""} {"instruction":"what is a flight that goes from BALTIMORE to SAN FRANCISCO and arrives at SAN FRANCISCO at 2000 on a FRIDAY","input":"CREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code) OR (days.day_name = 'FRIDAY' AND flight.flight_days = days.days_code AND NOT ((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time))) AND flight.arrival_time = 2000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is a flight that goes from BALTIMORE to SAN FRANCISCO and arrives at SAN FRANCISCO at 2000 on a FRIDAY ### Input: CREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code) OR (days.day_name = 'FRIDAY' AND flight.flight_days = days.days_code AND NOT ((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time))) AND flight.arrival_time = 2000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"What were the starts when the points dropped 18?","input":"CREATE TABLE table_73703 (\n \"Name\" text,\n \"Nation\" text,\n \"Seasons\" text,\n \"Championship titles\" text,\n \"Races (Starts)\" text,\n \"Poles\" real,\n \"Wins\" real,\n \"Podiums\" real,\n \"Fastest Laps\" real,\n \"Points (Dropped points)\" text\n)","response":"SELECT \"Races (Starts)\" FROM table_73703 WHERE \"Points (Dropped points)\" = '18'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were the starts when the points dropped 18? ### Input: CREATE TABLE table_73703 (\n \"Name\" text,\n \"Nation\" text,\n \"Seasons\" text,\n \"Championship titles\" text,\n \"Races (Starts)\" text,\n \"Poles\" real,\n \"Wins\" real,\n \"Podiums\" real,\n \"Fastest Laps\" real,\n \"Points (Dropped points)\" text\n) ### Response: SELECT \"Races (Starts)\" FROM table_73703 WHERE \"Points (Dropped points)\" = '18'"} {"instruction":"Who was Henry Hyde's opponent in the race?","input":"CREATE TABLE table_1341568_14 (\n opponent VARCHAR,\n incumbent VARCHAR\n)","response":"SELECT opponent FROM table_1341568_14 WHERE incumbent = \"Henry Hyde\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was Henry Hyde's opponent in the race? ### Input: CREATE TABLE table_1341568_14 (\n opponent VARCHAR,\n incumbent VARCHAR\n) ### Response: SELECT opponent FROM table_1341568_14 WHERE incumbent = \"Henry Hyde\""} {"instruction":"Draw a bar chart about the distribution of All_Road and School_ID , order by the Y-axis from low to high please.","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of All_Road and School_ID , order by the Y-axis from low to high please. ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID"} {"instruction":"which papers used NELL ?","input":"CREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)","response":"SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which papers used NELL ? ### Input: CREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n) ### Response: SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid"} {"instruction":"Which tournament has a Runner(s)-up of Gary McCord?","input":"CREATE TABLE table_name_47 (\n tournament VARCHAR,\n runner_s__up VARCHAR\n)","response":"SELECT tournament FROM table_name_47 WHERE runner_s__up = \"gary mccord\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which tournament has a Runner(s)-up of Gary McCord? ### Input: CREATE TABLE table_name_47 (\n tournament VARCHAR,\n runner_s__up VARCHAR\n) ### Response: SELECT tournament FROM table_name_47 WHERE runner_s__up = \"gary mccord\""} {"instruction":"when did patient 021-221706 come to the hospital for the last time until 4 years ago via an floor?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)","response":"SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '021-221706' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 021-221706 come to the hospital for the last time until 4 years ago via an floor? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n) ### Response: SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '021-221706' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1"} {"instruction":"What's the overall record of the team with 4-3 road record?","input":"CREATE TABLE table_22993636_2 (\n overall_record VARCHAR,\n road_record VARCHAR\n)","response":"SELECT overall_record FROM table_22993636_2 WHERE road_record = \"4-3\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the overall record of the team with 4-3 road record? ### Input: CREATE TABLE table_22993636_2 (\n overall_record VARCHAR,\n road_record VARCHAR\n) ### Response: SELECT overall_record FROM table_22993636_2 WHERE road_record = \"4-3\""} {"instruction":"Which person teaches the easiest course in regards to ULCS ?","input":"CREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)","response":"SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%ULCS%' AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%ULCS%')","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which person teaches the easiest course in regards to ULCS ? ### Input: CREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n) ### Response: SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%ULCS%' AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%ULCS%')"} {"instruction":"who is the constructor when the tyre is d, the engine is talbot 23cv 4.5 l6, the chassis is talbot-lago t26c and the entrant is ecurie belge?","input":"CREATE TABLE table_54042 (\n \"Driver\" text,\n \"Entrant\" text,\n \"Constructor\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyre\" text\n)","response":"SELECT \"Constructor\" FROM table_54042 WHERE \"Tyre\" = 'd' AND \"Engine\" = 'talbot 23cv 4.5 l6' AND \"Chassis\" = 'talbot-lago t26c' AND \"Entrant\" = 'ecurie belge'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the constructor when the tyre is d, the engine is talbot 23cv 4.5 l6, the chassis is talbot-lago t26c and the entrant is ecurie belge? ### Input: CREATE TABLE table_54042 (\n \"Driver\" text,\n \"Entrant\" text,\n \"Constructor\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyre\" text\n) ### Response: SELECT \"Constructor\" FROM table_54042 WHERE \"Tyre\" = 'd' AND \"Engine\" = 'talbot 23cv 4.5 l6' AND \"Chassis\" = 'talbot-lago t26c' AND \"Entrant\" = 'ecurie belge'"} {"instruction":"What is Place, when To Par is '5', and when Score is '72-73=145'?","input":"CREATE TABLE table_47828 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real\n)","response":"SELECT \"Place\" FROM table_47828 WHERE \"To par\" = '5' AND \"Score\" = '72-73=145'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Place, when To Par is '5', and when Score is '72-73=145'? ### Input: CREATE TABLE table_47828 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real\n) ### Response: SELECT \"Place\" FROM table_47828 WHERE \"To par\" = '5' AND \"Score\" = '72-73=145'"} {"instruction":"When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party?","input":"CREATE TABLE table_67462 (\n \"Minister\" text,\n \"Party\" text,\n \"Governments\" text,\n \"Term start\" text,\n \"Term end\" text\n)","response":"SELECT \"Term end\" FROM table_67462 WHERE \"Party\" = 'national religious party' AND \"Minister\" = 'shlomo-yisrael ben-meir'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party? ### Input: CREATE TABLE table_67462 (\n \"Minister\" text,\n \"Party\" text,\n \"Governments\" text,\n \"Term start\" text,\n \"Term end\" text\n) ### Response: SELECT \"Term end\" FROM table_67462 WHERE \"Party\" = 'national religious party' AND \"Minister\" = 'shlomo-yisrael ben-meir'"} {"instruction":"List the names of editors in ascending order of age.","input":"CREATE TABLE editor (\n Name VARCHAR,\n Age VARCHAR\n)","response":"SELECT Name FROM editor ORDER BY Age","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the names of editors in ascending order of age. ### Input: CREATE TABLE editor (\n Name VARCHAR,\n Age VARCHAR\n) ### Response: SELECT Name FROM editor ORDER BY Age"} {"instruction":"what was the last time that patient 009-13409 was prescribed for a drug until 48 months ago?","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-48 month') ORDER BY medication.drugstarttime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last time that patient 009-13409 was prescribed for a drug until 48 months ago? ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-48 month') ORDER BY medication.drugstarttime DESC LIMIT 1"} {"instruction":"what's the minimum cost of a hospital that includes a cortisol lab test until 4 years ago?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.patienthealthsystemstayid) AS t1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the minimum cost of a hospital that includes a cortisol lab test until 4 years ago? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.patienthealthsystemstayid) AS t1"} {"instruction":"What are the different budget type codes, and how many documents are there for each. Show a pie chart.","input":"CREATE TABLE Ref_Budget_Codes (\n Budget_Type_Code CHAR(15),\n Budget_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n Project_ID INTEGER,\n Project_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents (\n Document_ID INTEGER,\n Document_Type_Code CHAR(15),\n Project_ID INTEGER,\n Document_Date DATETIME,\n Document_Name VARCHAR(255),\n Document_Description VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Statements (\n Statement_ID INTEGER,\n Statement_Details VARCHAR(255)\n)\n\nCREATE TABLE Accounts (\n Account_ID INTEGER,\n Statement_ID INTEGER,\n Account_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Documents_with_Expenses (\n Document_ID INTEGER,\n Budget_Type_Code CHAR(15),\n Document_Details VARCHAR(255)\n)","response":"SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the different budget type codes, and how many documents are there for each. Show a pie chart. ### Input: CREATE TABLE Ref_Budget_Codes (\n Budget_Type_Code CHAR(15),\n Budget_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Projects (\n Project_ID INTEGER,\n Project_Details VARCHAR(255)\n)\n\nCREATE TABLE Documents (\n Document_ID INTEGER,\n Document_Type_Code CHAR(15),\n Project_ID INTEGER,\n Document_Date DATETIME,\n Document_Name VARCHAR(255),\n Document_Description VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Statements (\n Statement_ID INTEGER,\n Statement_Details VARCHAR(255)\n)\n\nCREATE TABLE Accounts (\n Account_ID INTEGER,\n Statement_ID INTEGER,\n Account_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Documents_with_Expenses (\n Document_ID INTEGER,\n Budget_Type_Code CHAR(15),\n Document_Details VARCHAR(255)\n) ### Response: SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code"} {"instruction":"In heat rank 7, what is the sum of lanes?","input":"CREATE TABLE table_31969 (\n \"Heat Rank\" real,\n \"Lane\" real,\n \"Swimmer\" text,\n \"Country\" text,\n \"Time\" real,\n \"Overall Rank\" text\n)","response":"SELECT SUM(\"Lane\") FROM table_31969 WHERE \"Heat Rank\" = '7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In heat rank 7, what is the sum of lanes? ### Input: CREATE TABLE table_31969 (\n \"Heat Rank\" real,\n \"Lane\" real,\n \"Swimmer\" text,\n \"Country\" text,\n \"Time\" real,\n \"Overall Rank\" text\n) ### Response: SELECT SUM(\"Lane\") FROM table_31969 WHERE \"Heat Rank\" = '7'"} {"instruction":"What is the city\/state of the circuit where Russell Ingall Larry Perkins was the winner?","input":"CREATE TABLE table_51037 (\n \"Date\" text,\n \"Series\" text,\n \"Circuit\" text,\n \"City \/ State\" text,\n \"Winner\" text,\n \"Team\" text\n)","response":"SELECT \"City \/ State\" FROM table_51037 WHERE \"Winner\" = 'russell ingall larry perkins'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the city\/state of the circuit where Russell Ingall Larry Perkins was the winner? ### Input: CREATE TABLE table_51037 (\n \"Date\" text,\n \"Series\" text,\n \"Circuit\" text,\n \"City \/ State\" text,\n \"Winner\" text,\n \"Team\" text\n) ### Response: SELECT \"City \/ State\" FROM table_51037 WHERE \"Winner\" = 'russell ingall larry perkins'"} {"instruction":"When did construction start on the Power station with a net MWE of 1190","input":"CREATE TABLE table_143352_1 (\n construction_started INTEGER,\n net_mwe VARCHAR\n)","response":"SELECT MIN(construction_started) FROM table_143352_1 WHERE net_mwe = 1190","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did construction start on the Power station with a net MWE of 1190 ### Input: CREATE TABLE table_143352_1 (\n construction_started INTEGER,\n net_mwe VARCHAR\n) ### Response: SELECT MIN(construction_started) FROM table_143352_1 WHERE net_mwe = 1190"} {"instruction":"Who are the directors of the episode in series # 54?","input":"CREATE TABLE table_26866233_1 (\n director VARCHAR,\n series__number VARCHAR\n)","response":"SELECT director FROM table_26866233_1 WHERE series__number = 54","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who are the directors of the episode in series # 54? ### Input: CREATE TABLE table_26866233_1 (\n director VARCHAR,\n series__number VARCHAR\n) ### Response: SELECT director FROM table_26866233_1 WHERE series__number = 54"} {"instruction":"What is the Location, when the Score is 38-29?","input":"CREATE TABLE table_71546 (\n \"Date\" text,\n \"Winner\" text,\n \"Score\" text,\n \"Location\" text,\n \"Series\" text\n)","response":"SELECT \"Location\" FROM table_71546 WHERE \"Score\" = '38-29'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Location, when the Score is 38-29? ### Input: CREATE TABLE table_71546 (\n \"Date\" text,\n \"Winner\" text,\n \"Score\" text,\n \"Location\" text,\n \"Series\" text\n) ### Response: SELECT \"Location\" FROM table_71546 WHERE \"Score\" = '38-29'"} {"instruction":"Which week did the Baltimore Ravens play at home ?","input":"CREATE TABLE table_name_79 (\n week VARCHAR,\n host_team VARCHAR\n)","response":"SELECT week FROM table_name_79 WHERE host_team = \"baltimore ravens\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which week did the Baltimore Ravens play at home ? ### Input: CREATE TABLE table_name_79 (\n week VARCHAR,\n host_team VARCHAR\n) ### Response: SELECT week FROM table_name_79 WHERE host_team = \"baltimore ravens\""} {"instruction":"please show me all airlines with SUNDAY flights from PHILADELPHIA to DENVER","input":"CREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)","response":"SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: please show me all airlines with SUNDAY flights from PHILADELPHIA to DENVER ### Input: CREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n) ### Response: SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"count of unique roles","input":"CREATE TABLE table_203_756 (\n id number,\n \"year\" number,\n \"title\" text,\n \"role\" text,\n \"network\" text,\n \"notes\" text\n)","response":"SELECT COUNT(\"role\") FROM table_203_756","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count of unique roles ### Input: CREATE TABLE table_203_756 (\n id number,\n \"year\" number,\n \"title\" text,\n \"role\" text,\n \"network\" text,\n \"notes\" text\n) ### Response: SELECT COUNT(\"role\") FROM table_203_756"} {"instruction":"what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and procedure icd9 code is 8856?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = \"BRAIN MASS;INTRACRANIAL HEMORRHAGE\" AND procedures.icd9_code = \"8856\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and procedure icd9 code is 8856? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = \"BRAIN MASS;INTRACRANIAL HEMORRHAGE\" AND procedures.icd9_code = \"8856\""} {"instruction":"Which Record has an Attendance of 24,597?","input":"CREATE TABLE table_name_62 (\n record VARCHAR,\n attendance VARCHAR\n)","response":"SELECT record FROM table_name_62 WHERE attendance = \"24,597\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Record has an Attendance of 24,597? ### Input: CREATE TABLE table_name_62 (\n record VARCHAR,\n attendance VARCHAR\n) ### Response: SELECT record FROM table_name_62 WHERE attendance = \"24,597\""} {"instruction":"Who had a finish of t15?","input":"CREATE TABLE table_62596 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n)","response":"SELECT \"Player\" FROM table_62596 WHERE \"Finish\" = 't15'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had a finish of t15? ### Input: CREATE TABLE table_62596 (\n \"Player\" text,\n \"Country\" text,\n \"Year(s) won\" text,\n \"Total\" real,\n \"To par\" text,\n \"Finish\" text\n) ### Response: SELECT \"Player\" FROM table_62596 WHERE \"Finish\" = 't15'"} {"instruction":"In what language is the Lyrics of the release on August 10, 2005 with Catalog number of TOCP-66427?","input":"CREATE TABLE table_62642 (\n \"Region\" text,\n \"Date\" text,\n \"Label\" text,\n \"Format\" text,\n \"Catalog number\" text,\n \"Lyrics\" text\n)","response":"SELECT \"Lyrics\" FROM table_62642 WHERE \"Date\" = 'august 10, 2005' AND \"Catalog number\" = 'tocp-66427'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what language is the Lyrics of the release on August 10, 2005 with Catalog number of TOCP-66427? ### Input: CREATE TABLE table_62642 (\n \"Region\" text,\n \"Date\" text,\n \"Label\" text,\n \"Format\" text,\n \"Catalog number\" text,\n \"Lyrics\" text\n) ### Response: SELECT \"Lyrics\" FROM table_62642 WHERE \"Date\" = 'august 10, 2005' AND \"Catalog number\" = 'tocp-66427'"} {"instruction":"What are all the calendar dates? Show a bar chart binning calendar date by weekday.","input":"CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)\n\nCREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n)","response":"SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the calendar dates? Show a bar chart binning calendar date by weekday. ### Input: CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15),\n Document_Type_Name VARCHAR(255),\n Document_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE All_Documents (\n Document_ID INTEGER,\n Date_Stored DATETIME,\n Document_Type_Code CHAR(15),\n Document_Name CHAR(255),\n Document_Description CHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Roles (\n Role_Code CHAR(15),\n Role_Name VARCHAR(255),\n Role_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Locations (\n Location_Code CHAR(15),\n Location_Name VARCHAR(255),\n Location_Description VARCHAR(255)\n)\n\nCREATE TABLE Ref_Calendar (\n Calendar_Date DATETIME,\n Day_Number INTEGER\n)\n\nCREATE TABLE Documents_to_be_Destroyed (\n Document_ID INTEGER,\n Destruction_Authorised_by_Employee_ID INTEGER,\n Destroyed_by_Employee_ID INTEGER,\n Planned_Destruction_Date DATETIME,\n Actual_Destruction_Date DATETIME,\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Document_Locations (\n Document_ID INTEGER,\n Location_Code CHAR(15),\n Date_in_Location_From DATETIME,\n Date_in_Locaton_To DATETIME\n)\n\nCREATE TABLE Employees (\n Employee_ID INTEGER,\n Role_Code CHAR(15),\n Employee_Name VARCHAR(255),\n Gender_MFU CHAR(1),\n Date_of_Birth DATETIME,\n Other_Details VARCHAR(255)\n) ### Response: SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar"} {"instruction":"Show the names and ids of tourist attractions that are visited at most once. Plot them as pie chart.","input":"CREATE TABLE Photos (\n Photo_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(255),\n Description VARCHAR(255),\n Filename VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Staff (\n Staff_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(40),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Visits (\n Visit_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Tourist_ID INTEGER,\n Visit_Date DATETIME,\n Visit_Details VARCHAR(40)\n)\n\nCREATE TABLE Street_Markets (\n Market_ID INTEGER,\n Market_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attractions (\n Tourist_Attraction_ID INTEGER,\n Attraction_Type_Code CHAR(15),\n Location_ID INTEGER,\n How_to_Get_There VARCHAR(255),\n Name VARCHAR(255),\n Description VARCHAR(255),\n Opening_Hours VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Hotel_Star_Ratings (\n star_rating_code CHAR(15),\n star_rating_description VARCHAR(80)\n)\n\nCREATE TABLE Features (\n Feature_ID INTEGER,\n Feature_Details VARCHAR(255)\n)\n\nCREATE TABLE Shops (\n Shop_ID INTEGER,\n Shop_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Attraction_Types (\n Attraction_Type_Code CHAR(15),\n Attraction_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Locations (\n Location_ID INTEGER,\n Location_Name VARCHAR(255),\n Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Visitors (\n Tourist_ID INTEGER,\n Tourist_Details VARCHAR(255)\n)\n\nCREATE TABLE Hotels (\n hotel_id INTEGER,\n star_rating_code CHAR(15),\n pets_allowed_yn CHAR(1),\n price_range real,\n other_hotel_details VARCHAR(255)\n)\n\nCREATE TABLE Museums (\n Museum_ID INTEGER,\n Museum_Details VARCHAR(255)\n)\n\nCREATE TABLE Royal_Family (\n Royal_Family_ID INTEGER,\n Royal_Family_Details VARCHAR(255)\n)\n\nCREATE TABLE Theme_Parks (\n Theme_Park_ID INTEGER,\n Theme_Park_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attraction_Features (\n Tourist_Attraction_ID INTEGER,\n Feature_ID INTEGER\n)","response":"SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names and ids of tourist attractions that are visited at most once. Plot them as pie chart. ### Input: CREATE TABLE Photos (\n Photo_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(255),\n Description VARCHAR(255),\n Filename VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Staff (\n Staff_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Name VARCHAR(40),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Visits (\n Visit_ID INTEGER,\n Tourist_Attraction_ID INTEGER,\n Tourist_ID INTEGER,\n Visit_Date DATETIME,\n Visit_Details VARCHAR(40)\n)\n\nCREATE TABLE Street_Markets (\n Market_ID INTEGER,\n Market_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attractions (\n Tourist_Attraction_ID INTEGER,\n Attraction_Type_Code CHAR(15),\n Location_ID INTEGER,\n How_to_Get_There VARCHAR(255),\n Name VARCHAR(255),\n Description VARCHAR(255),\n Opening_Hours VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Hotel_Star_Ratings (\n star_rating_code CHAR(15),\n star_rating_description VARCHAR(80)\n)\n\nCREATE TABLE Features (\n Feature_ID INTEGER,\n Feature_Details VARCHAR(255)\n)\n\nCREATE TABLE Shops (\n Shop_ID INTEGER,\n Shop_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Attraction_Types (\n Attraction_Type_Code CHAR(15),\n Attraction_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Locations (\n Location_ID INTEGER,\n Location_Name VARCHAR(255),\n Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Visitors (\n Tourist_ID INTEGER,\n Tourist_Details VARCHAR(255)\n)\n\nCREATE TABLE Hotels (\n hotel_id INTEGER,\n star_rating_code CHAR(15),\n pets_allowed_yn CHAR(1),\n price_range real,\n other_hotel_details VARCHAR(255)\n)\n\nCREATE TABLE Museums (\n Museum_ID INTEGER,\n Museum_Details VARCHAR(255)\n)\n\nCREATE TABLE Royal_Family (\n Royal_Family_ID INTEGER,\n Royal_Family_Details VARCHAR(255)\n)\n\nCREATE TABLE Theme_Parks (\n Theme_Park_ID INTEGER,\n Theme_Park_Details VARCHAR(255)\n)\n\nCREATE TABLE Tourist_Attraction_Features (\n Tourist_Attraction_ID INTEGER,\n Feature_ID INTEGER\n) ### Response: SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID"} {"instruction":"What is the Branding for Group Owner Qantam of Cape Cod, LLC?","input":"CREATE TABLE table_36 (\n \"Calls\" text,\n \"Frequency\" text,\n \"Branding\" text,\n \"Format\" text,\n \"Market\/Rank\" text,\n \"Timeslot\" text,\n \"Group owner\" text\n)","response":"SELECT \"Branding\" FROM table_36 WHERE \"Group owner\" = 'Qantam of Cape Cod, LLC'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Branding for Group Owner Qantam of Cape Cod, LLC? ### Input: CREATE TABLE table_36 (\n \"Calls\" text,\n \"Frequency\" text,\n \"Branding\" text,\n \"Format\" text,\n \"Market\/Rank\" text,\n \"Timeslot\" text,\n \"Group owner\" text\n) ### Response: SELECT \"Branding\" FROM table_36 WHERE \"Group owner\" = 'Qantam of Cape Cod, LLC'"} {"instruction":"What was the Competition on November 16, 2007?","input":"CREATE TABLE table_9053 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Competition\" text,\n \"Report\" text\n)","response":"SELECT \"Competition\" FROM table_9053 WHERE \"Date\" = 'november 16, 2007'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Competition on November 16, 2007? ### Input: CREATE TABLE table_9053 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Competition\" text,\n \"Report\" text\n) ### Response: SELECT \"Competition\" FROM table_9053 WHERE \"Date\" = 'november 16, 2007'"} {"instruction":"Which television service has italian for its language?","input":"CREATE TABLE table_name_46 (\n television_service VARCHAR,\n language VARCHAR\n)","response":"SELECT television_service FROM table_name_46 WHERE language = \"italian\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which television service has italian for its language? ### Input: CREATE TABLE table_name_46 (\n television_service VARCHAR,\n language VARCHAR\n) ### Response: SELECT television_service FROM table_name_46 WHERE language = \"italian\""} {"instruction":"English title of am lie had what year?","input":"CREATE TABLE table_39379 (\n \"Year\" real,\n \"English title\" text,\n \"Original title\" text,\n \"Country\" text,\n \"Director\" text\n)","response":"SELECT \"Year\" FROM table_39379 WHERE \"English title\" = 'am\u00e9lie'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: English title of am lie had what year? ### Input: CREATE TABLE table_39379 (\n \"Year\" real,\n \"English title\" text,\n \"Original title\" text,\n \"Country\" text,\n \"Director\" text\n) ### Response: SELECT \"Year\" FROM table_39379 WHERE \"English title\" = 'am\u00e9lie'"} {"instruction":"Name the professor or teacher teaching CICS 301 ?","input":"CREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)","response":"SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CICS' AND course.number = 301 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the professor or teacher teaching CICS 301 ? ### Input: CREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n) ### Response: SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CICS' AND course.number = 301 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id"} {"instruction":"WHAT ARE THE GOALS WITH DRAWS SMALLER THAN 6, AND LOSSES SMALLER THAN 7?","input":"CREATE TABLE table_61007 (\n \"Position\" real,\n \"Club\" text,\n \"Played\" real,\n \"Points\" real,\n \"Wins\" real,\n \"Draws\" real,\n \"Losses\" real,\n \"Goals for\" real,\n \"Goals against\" real,\n \"Goal Difference\" real\n)","response":"SELECT AVG(\"Goals for\") FROM table_61007 WHERE \"Draws\" < '6' AND \"Losses\" < '7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHAT ARE THE GOALS WITH DRAWS SMALLER THAN 6, AND LOSSES SMALLER THAN 7? ### Input: CREATE TABLE table_61007 (\n \"Position\" real,\n \"Club\" text,\n \"Played\" real,\n \"Points\" real,\n \"Wins\" real,\n \"Draws\" real,\n \"Losses\" real,\n \"Goals for\" real,\n \"Goals against\" real,\n \"Goal Difference\" real\n) ### Response: SELECT AVG(\"Goals for\") FROM table_61007 WHERE \"Draws\" < '6' AND \"Losses\" < '7'"} {"instruction":"Which Inhabitants have a Mayor of matteo renzi, and an Election larger than 2009?","input":"CREATE TABLE table_name_4 (\n inhabitants INTEGER,\n mayor VARCHAR,\n election VARCHAR\n)","response":"SELECT MIN(inhabitants) FROM table_name_4 WHERE mayor = \"matteo renzi\" AND election > 2009","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Inhabitants have a Mayor of matteo renzi, and an Election larger than 2009? ### Input: CREATE TABLE table_name_4 (\n inhabitants INTEGER,\n mayor VARCHAR,\n election VARCHAR\n) ### Response: SELECT MIN(inhabitants) FROM table_name_4 WHERE mayor = \"matteo renzi\" AND election > 2009"} {"instruction":"what was henrick malberg 's first film ?","input":"CREATE TABLE table_204_91 (\n id number,\n \"year\" number,\n \"original title\" text,\n \"english title\" text,\n \"role\" text,\n \"notes\" text\n)","response":"SELECT \"original title\" FROM table_204_91 ORDER BY \"year\" LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was henrick malberg 's first film ? ### Input: CREATE TABLE table_204_91 (\n id number,\n \"year\" number,\n \"original title\" text,\n \"english title\" text,\n \"role\" text,\n \"notes\" text\n) ### Response: SELECT \"original title\" FROM table_204_91 ORDER BY \"year\" LIMIT 1"} {"instruction":"Find the names and average salaries of all departments whose average salary is greater than 42000, and rank by the dept_name in ascending.","input":"CREATE TABLE teaches (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0)\n)\n\nCREATE TABLE classroom (\n building varchar(15),\n room_number varchar(7),\n capacity numeric(4,0)\n)\n\nCREATE TABLE instructor (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n salary numeric(8,2)\n)\n\nCREATE TABLE takes (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n grade varchar(2)\n)\n\nCREATE TABLE student (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n tot_cred numeric(3,0)\n)\n\nCREATE TABLE advisor (\n s_ID varchar(5),\n i_ID varchar(5)\n)\n\nCREATE TABLE section (\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n building varchar(15),\n room_number varchar(7),\n time_slot_id varchar(4)\n)\n\nCREATE TABLE course (\n course_id varchar(8),\n title varchar(50),\n dept_name varchar(20),\n credits numeric(2,0)\n)\n\nCREATE TABLE time_slot (\n time_slot_id varchar(4),\n day varchar(1),\n start_hr numeric(2),\n start_min numeric(2),\n end_hr numeric(2),\n end_min numeric(2)\n)\n\nCREATE TABLE prereq (\n course_id varchar(8),\n prereq_id varchar(8)\n)\n\nCREATE TABLE department (\n dept_name varchar(20),\n building varchar(15),\n budget numeric(12,2)\n)","response":"SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the names and average salaries of all departments whose average salary is greater than 42000, and rank by the dept_name in ascending. ### Input: CREATE TABLE teaches (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0)\n)\n\nCREATE TABLE classroom (\n building varchar(15),\n room_number varchar(7),\n capacity numeric(4,0)\n)\n\nCREATE TABLE instructor (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n salary numeric(8,2)\n)\n\nCREATE TABLE takes (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n grade varchar(2)\n)\n\nCREATE TABLE student (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n tot_cred numeric(3,0)\n)\n\nCREATE TABLE advisor (\n s_ID varchar(5),\n i_ID varchar(5)\n)\n\nCREATE TABLE section (\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n building varchar(15),\n room_number varchar(7),\n time_slot_id varchar(4)\n)\n\nCREATE TABLE course (\n course_id varchar(8),\n title varchar(50),\n dept_name varchar(20),\n credits numeric(2,0)\n)\n\nCREATE TABLE time_slot (\n time_slot_id varchar(4),\n day varchar(1),\n start_hr numeric(2),\n start_min numeric(2),\n end_hr numeric(2),\n end_min numeric(2)\n)\n\nCREATE TABLE prereq (\n course_id varchar(8),\n prereq_id varchar(8)\n)\n\nCREATE TABLE department (\n dept_name varchar(20),\n building varchar(15),\n budget numeric(12,2)\n) ### Response: SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name"} {"instruction":"When are all years that the champion is Ji Min Jeong?","input":"CREATE TABLE table_15315816_1 (\n year VARCHAR,\n champion VARCHAR\n)","response":"SELECT year FROM table_15315816_1 WHERE champion = \"Ji Min Jeong\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When are all years that the champion is Ji Min Jeong? ### Input: CREATE TABLE table_15315816_1 (\n year VARCHAR,\n champion VARCHAR\n) ### Response: SELECT year FROM table_15315816_1 WHERE champion = \"Ji Min Jeong\""} {"instruction":"What upper-level MUSICOL classes are available in the Summer ?","input":"CREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSICOL' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What upper-level MUSICOL classes are available in the Summer ? ### Input: CREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSICOL' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016"} {"instruction":"what is the location when the score is w 105-99?","input":"CREATE TABLE table_name_58 (\n location VARCHAR,\n score VARCHAR\n)","response":"SELECT location FROM table_name_58 WHERE score = \"w 105-99\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the location when the score is w 105-99? ### Input: CREATE TABLE table_name_58 (\n location VARCHAR,\n score VARCHAR\n) ### Response: SELECT location FROM table_name_58 WHERE score = \"w 105-99\""} {"instruction":"Which entrant has a year after 1999?","input":"CREATE TABLE table_69468 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n)","response":"SELECT \"Entrant\" FROM table_69468 WHERE \"Year\" > '1999'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which entrant has a year after 1999? ### Input: CREATE TABLE table_69468 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n) ### Response: SELECT \"Entrant\" FROM table_69468 WHERE \"Year\" > '1999'"} {"instruction":"What is the highest Year, when Opponent is #2 Syracuse?","input":"CREATE TABLE table_name_52 (\n year INTEGER,\n opponent VARCHAR\n)","response":"SELECT MAX(year) FROM table_name_52 WHERE opponent = \"#2 syracuse\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Year, when Opponent is #2 Syracuse? ### Input: CREATE TABLE table_name_52 (\n year INTEGER,\n opponent VARCHAR\n) ### Response: SELECT MAX(year) FROM table_name_52 WHERE opponent = \"#2 syracuse\""} {"instruction":"Who did the Raptors play when their record was 45-36?","input":"CREATE TABLE table_842 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Team\" FROM table_842 WHERE \"Record\" = '45-36'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who did the Raptors play when their record was 45-36? ### Input: CREATE TABLE table_842 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Team\" FROM table_842 WHERE \"Record\" = '45-36'"} {"instruction":"for the first time until 31 months ago, when was patient 7165 prescribed insulin human regular and labetalol hcl at the same time?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)","response":"SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'insulin human regular' AND admissions.subject_id = 7165 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-31 month')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'labetalol hcl' AND admissions.subject_id = 7165 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-31 month')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: for the first time until 31 months ago, when was patient 7165 prescribed insulin human regular and labetalol hcl at the same time? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n) ### Response: SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'insulin human regular' AND admissions.subject_id = 7165 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-31 month')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'labetalol hcl' AND admissions.subject_id = 7165 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-31 month')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate LIMIT 1"} {"instruction":"What are all the possible bleeding time results where prothrombin time and platelet count are both unaffected?","input":"CREATE TABLE table_20137 (\n \"Condition\" text,\n \"Prothrombin time\" text,\n \"Partial thromboplastin time\" text,\n \"Bleeding time\" text,\n \"Platelet count\" text\n)","response":"SELECT \"Bleeding time\" FROM table_20137 WHERE \"Prothrombin time\" = 'Unaffected' AND \"Platelet count\" = 'Unaffected'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the possible bleeding time results where prothrombin time and platelet count are both unaffected? ### Input: CREATE TABLE table_20137 (\n \"Condition\" text,\n \"Prothrombin time\" text,\n \"Partial thromboplastin time\" text,\n \"Bleeding time\" text,\n \"Platelet count\" text\n) ### Response: SELECT \"Bleeding time\" FROM table_20137 WHERE \"Prothrombin time\" = 'Unaffected' AND \"Platelet count\" = 'Unaffected'"} {"instruction":"how many patients whose drug code is teraz5 and lab test fluid is urine?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = \"TERAZ5\" AND lab.fluid = \"Urine\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose drug code is teraz5 and lab test fluid is urine? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = \"TERAZ5\" AND lab.fluid = \"Urine\""} {"instruction":"On what date did the woman married to Louis II become consort?","input":"CREATE TABLE table_61634 (\n \"Name\" text,\n \"Birth\" text,\n \"Marriage\" text,\n \"Became Consort\" text,\n \"Ceased to be Consort\" text,\n \"Spouse\" text\n)","response":"SELECT \"Became Consort\" FROM table_61634 WHERE \"Spouse\" = 'louis ii'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did the woman married to Louis II become consort? ### Input: CREATE TABLE table_61634 (\n \"Name\" text,\n \"Birth\" text,\n \"Marriage\" text,\n \"Became Consort\" text,\n \"Ceased to be Consort\" text,\n \"Spouse\" text\n) ### Response: SELECT \"Became Consort\" FROM table_61634 WHERE \"Spouse\" = 'louis ii'"} {"instruction":"When Richmond is the away team, what is the crowd size?","input":"CREATE TABLE table_name_23 (\n crowd VARCHAR,\n away_team VARCHAR\n)","response":"SELECT crowd FROM table_name_23 WHERE away_team = \"richmond\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When Richmond is the away team, what is the crowd size? ### Input: CREATE TABLE table_name_23 (\n crowd VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT crowd FROM table_name_23 WHERE away_team = \"richmond\""} {"instruction":"Of the upper level classes , how many have labs ?","input":"CREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)","response":"SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Of the upper level classes , how many have labs ? ### Input: CREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n) ### Response: SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'"} {"instruction":"Return a bar chart about the distribution of meter_600 and ID , list in asc by the names please.","input":"CREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n)","response":"SELECT meter_600, ID FROM swimmer ORDER BY meter_600","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of meter_600 and ID , list in asc by the names please. ### Input: CREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n) ### Response: SELECT meter_600, ID FROM swimmer ORDER BY meter_600"} {"instruction":"is the heart rate of patient 1902's body last measured on the current intensive care unit visit less than the value second to last measured on the current intensive care unit visit?","input":"CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime DESC LIMIT 1) < (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime DESC LIMIT 1 OFFSET 1)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the heart rate of patient 1902's body last measured on the current intensive care unit visit less than the value second to last measured on the current intensive care unit visit? ### Input: CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime DESC LIMIT 1) < (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime DESC LIMIT 1 OFFSET 1)"} {"instruction":"cirrhosis of the liver, portal hypertension, or esophageal varices","input":"CREATE TABLE table_dev_22 (\n \"id\" int,\n \"gender\" string,\n \"hemoglobin_a1c_hba1c\" float,\n \"heart_disease\" bool,\n \"cardiovascular_disease\" bool,\n \"esophageal_varices\" bool,\n \"liver_disease\" bool,\n \"diabetes\" bool,\n \"serum_creatinine\" float,\n \"hypertension\" bool,\n \"portal_hypertension\" bool,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_dev_22 WHERE liver_disease = 1 OR portal_hypertension = 1 OR esophageal_varices = 1","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: cirrhosis of the liver, portal hypertension, or esophageal varices ### Input: CREATE TABLE table_dev_22 (\n \"id\" int,\n \"gender\" string,\n \"hemoglobin_a1c_hba1c\" float,\n \"heart_disease\" bool,\n \"cardiovascular_disease\" bool,\n \"esophageal_varices\" bool,\n \"liver_disease\" bool,\n \"diabetes\" bool,\n \"serum_creatinine\" float,\n \"hypertension\" bool,\n \"portal_hypertension\" bool,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_dev_22 WHERE liver_disease = 1 OR portal_hypertension = 1 OR esophageal_varices = 1"} {"instruction":"what was the four most common specimen test ordered in this year?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)","response":"SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the four most common specimen test ordered in this year? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n) ### Response: SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4"} {"instruction":"What's the smallest draw that has a place bigger more than 1 and Anastasia Prikhodko as the artist?","input":"CREATE TABLE table_13971 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Result\" text,\n \"Place\" real\n)","response":"SELECT MIN(\"Draw\") FROM table_13971 WHERE \"Artist\" = 'anastasia prikhodko' AND \"Place\" > '1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the smallest draw that has a place bigger more than 1 and Anastasia Prikhodko as the artist? ### Input: CREATE TABLE table_13971 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Result\" text,\n \"Place\" real\n) ### Response: SELECT MIN(\"Draw\") FROM table_13971 WHERE \"Artist\" = 'anastasia prikhodko' AND \"Place\" > '1'"} {"instruction":", order by the bars from low to high.","input":"CREATE TABLE buildings (\n id int,\n name text,\n City text,\n Height int,\n Stories int,\n Status text\n)\n\nCREATE TABLE Office_locations (\n building_id int,\n company_id int,\n move_in_year int\n)\n\nCREATE TABLE Companies (\n id int,\n name text,\n Headquarters text,\n Industry text,\n Sales_billion real,\n Profits_billion real,\n Assets_billion real,\n Market_Value_billion text\n)","response":"SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY Industry","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: , order by the bars from low to high. ### Input: CREATE TABLE buildings (\n id int,\n name text,\n City text,\n Height int,\n Stories int,\n Status text\n)\n\nCREATE TABLE Office_locations (\n building_id int,\n company_id int,\n move_in_year int\n)\n\nCREATE TABLE Companies (\n id int,\n name text,\n Headquarters text,\n Industry text,\n Sales_billion real,\n Profits_billion real,\n Assets_billion real,\n Market_Value_billion text\n) ### Response: SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY Industry"} {"instruction":"What is the type if the organization name is Gamma RHO Lambda 1?","input":"CREATE TABLE table_27646 (\n \"Letters\" text,\n \"Organization\" text,\n \"Nickname\" text,\n \"Founding Date\" text,\n \"Founding University\" text,\n \"Type\" text\n)","response":"SELECT \"Type\" FROM table_27646 WHERE \"Organization\" = 'Gamma Rho Lambda 1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the type if the organization name is Gamma RHO Lambda 1? ### Input: CREATE TABLE table_27646 (\n \"Letters\" text,\n \"Organization\" text,\n \"Nickname\" text,\n \"Founding Date\" text,\n \"Founding University\" text,\n \"Type\" text\n) ### Response: SELECT \"Type\" FROM table_27646 WHERE \"Organization\" = 'Gamma Rho Lambda 1'"} {"instruction":"How many losses have byes greater than 2?","input":"CREATE TABLE table_42494 (\n \"Ballarat FL\" text,\n \"Wins\" real,\n \"Byes\" real,\n \"Losses\" real,\n \"Draws\" real,\n \"Against\" real\n)","response":"SELECT COUNT(\"Losses\") FROM table_42494 WHERE \"Byes\" > '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many losses have byes greater than 2? ### Input: CREATE TABLE table_42494 (\n \"Ballarat FL\" text,\n \"Wins\" real,\n \"Byes\" real,\n \"Losses\" real,\n \"Draws\" real,\n \"Against\" real\n) ### Response: SELECT COUNT(\"Losses\") FROM table_42494 WHERE \"Byes\" > '2'"} {"instruction":"What is the motive before 2007?","input":"CREATE TABLE table_14685 (\n \"Year\" real,\n \"Award\" text,\n \"Category\" text,\n \"Motive\" text,\n \"Result\" text\n)","response":"SELECT \"Motive\" FROM table_14685 WHERE \"Year\" < '2007'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the motive before 2007? ### Input: CREATE TABLE table_14685 (\n \"Year\" real,\n \"Award\" text,\n \"Category\" text,\n \"Motive\" text,\n \"Result\" text\n) ### Response: SELECT \"Motive\" FROM table_14685 WHERE \"Year\" < '2007'"} {"instruction":"For those employees who was hired before 2002-06-21, give me the comparison about the sum of salary over the hire_date bin hire_date by time by a bar chart, order by the y axis in descending.","input":"CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)","response":"SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the sum of salary over the hire_date bin hire_date by time by a bar chart, order by the y axis in descending. ### Input: CREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n) ### Response: SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC"} {"instruction":"Which Lost has a Position larger than 5, and Points 1 of 37, and less than 63 Goals Against?","input":"CREATE TABLE table_name_87 (\n lost INTEGER,\n goals_against VARCHAR,\n position VARCHAR,\n points_1 VARCHAR\n)","response":"SELECT AVG(lost) FROM table_name_87 WHERE position > 5 AND points_1 = \"37\" AND goals_against < 63","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Lost has a Position larger than 5, and Points 1 of 37, and less than 63 Goals Against? ### Input: CREATE TABLE table_name_87 (\n lost INTEGER,\n goals_against VARCHAR,\n position VARCHAR,\n points_1 VARCHAR\n) ### Response: SELECT AVG(lost) FROM table_name_87 WHERE position > 5 AND points_1 = \"37\" AND goals_against < 63"} {"instruction":"What team was the opponent when the score was 7 1?","input":"CREATE TABLE table_71565 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Record\" text\n)","response":"SELECT \"Opponent\" FROM table_71565 WHERE \"Score\" = '7\u20131'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team was the opponent when the score was 7 1? ### Input: CREATE TABLE table_71565 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Record\" text\n) ### Response: SELECT \"Opponent\" FROM table_71565 WHERE \"Score\" = '7\u20131'"} {"instruction":"What is the record for the result w 33-3?","input":"CREATE TABLE table_name_4 (\n record VARCHAR,\n result VARCHAR\n)","response":"SELECT record FROM table_name_4 WHERE result = \"w 33-3\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the record for the result w 33-3? ### Input: CREATE TABLE table_name_4 (\n record VARCHAR,\n result VARCHAR\n) ### Response: SELECT record FROM table_name_4 WHERE result = \"w 33-3\""} {"instruction":"What were the revising conventions commentary with a denunciation of 21?","input":"CREATE TABLE table_2206 (\n \"ILO code\" text,\n \"Field\" text,\n \"conclusion date\" text,\n \"entry into force\" text,\n \"closure for signature\" text,\n \"Parties (April 2011)\" real,\n \"Denunciations (September 2011)\" real,\n \"revising convention(s)\" text,\n \"text and ratifications\" text\n)","response":"SELECT \"revising convention(s)\" FROM table_2206 WHERE \"Denunciations (September 2011)\" = '21'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were the revising conventions commentary with a denunciation of 21? ### Input: CREATE TABLE table_2206 (\n \"ILO code\" text,\n \"Field\" text,\n \"conclusion date\" text,\n \"entry into force\" text,\n \"closure for signature\" text,\n \"Parties (April 2011)\" real,\n \"Denunciations (September 2011)\" real,\n \"revising convention(s)\" text,\n \"text and ratifications\" text\n) ### Response: SELECT \"revising convention(s)\" FROM table_2206 WHERE \"Denunciations (September 2011)\" = '21'"} {"instruction":"Who wrote the episodes that had a viewership of 7.14?","input":"CREATE TABLE table_27186 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (millions)\" text\n)","response":"SELECT \"Written by\" FROM table_27186 WHERE \"U.S. viewers (millions)\" = '7.14'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who wrote the episodes that had a viewership of 7.14? ### Input: CREATE TABLE table_27186 (\n \"No. in series\" real,\n \"No. in season\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"U.S. viewers (millions)\" text\n) ### Response: SELECT \"Written by\" FROM table_27186 WHERE \"U.S. viewers (millions)\" = '7.14'"} {"instruction":"Who's the captain of the team whose head coach is Alistair Edwards?","input":"CREATE TABLE table_1301373_1 (\n captain VARCHAR,\n head_coach VARCHAR\n)","response":"SELECT captain FROM table_1301373_1 WHERE head_coach = \"Alistair Edwards\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who's the captain of the team whose head coach is Alistair Edwards? ### Input: CREATE TABLE table_1301373_1 (\n captain VARCHAR,\n head_coach VARCHAR\n) ### Response: SELECT captain FROM table_1301373_1 WHERE head_coach = \"Alistair Edwards\""} {"instruction":"View Statistics for all questions.","input":"CREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)","response":"SELECT AVG(ViewCount) AS AvgViews, STDEV(ViewCount) AS StDevViews, COUNT(*) AS N FROM Posts WHERE PostTypeId = 1","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: View Statistics for all questions. ### Input: CREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n) ### Response: SELECT AVG(ViewCount) AS AvgViews, STDEV(ViewCount) AS StDevViews, COUNT(*) AS N FROM Posts WHERE PostTypeId = 1"} {"instruction":"Scatter plot to show department id on x axis and sum salary on y axis.","input":"CREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)","response":"SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Scatter plot to show department id on x axis and sum salary on y axis. ### Input: CREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n) ### Response: SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID"} {"instruction":"Return the name of the category to which the film 'HUNGER ROOF' belongs.","input":"CREATE TABLE actor (\n actor_id number,\n first_name text,\n last_name text,\n last_update time\n)\n\nCREATE TABLE film (\n film_id number,\n title text,\n description text,\n release_year time,\n language_id number,\n original_language_id number,\n rental_duration number,\n rental_rate number,\n length number,\n replacement_cost number,\n rating text,\n special_features text,\n last_update time\n)\n\nCREATE TABLE customer (\n customer_id number,\n store_id number,\n first_name text,\n last_name text,\n email text,\n address_id number,\n active boolean,\n create_date time,\n last_update time\n)\n\nCREATE TABLE category (\n category_id number,\n name text,\n last_update time\n)\n\nCREATE TABLE film_actor (\n actor_id number,\n film_id number,\n last_update time\n)\n\nCREATE TABLE city (\n city_id number,\n city text,\n country_id number,\n last_update time\n)\n\nCREATE TABLE address (\n address_id number,\n address text,\n address2 text,\n district text,\n city_id number,\n postal_code text,\n phone text,\n last_update time\n)\n\nCREATE TABLE country (\n country_id number,\n country text,\n last_update time\n)\n\nCREATE TABLE rental (\n rental_id number,\n rental_date time,\n inventory_id number,\n customer_id number,\n return_date time,\n staff_id number,\n last_update time\n)\n\nCREATE TABLE inventory (\n inventory_id number,\n film_id number,\n store_id number,\n last_update time\n)\n\nCREATE TABLE store (\n store_id number,\n manager_staff_id number,\n address_id number,\n last_update time\n)\n\nCREATE TABLE payment (\n payment_id number,\n customer_id number,\n staff_id number,\n rental_id number,\n amount number,\n payment_date time,\n last_update time\n)\n\nCREATE TABLE film_category (\n film_id number,\n category_id number,\n last_update time\n)\n\nCREATE TABLE film_text (\n film_id number,\n title text,\n description text\n)\n\nCREATE TABLE staff (\n staff_id number,\n first_name text,\n last_name text,\n address_id number,\n picture others,\n email text,\n store_id number,\n active boolean,\n username text,\n password text,\n last_update time\n)\n\nCREATE TABLE language (\n language_id number,\n name text,\n last_update time\n)","response":"SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the name of the category to which the film 'HUNGER ROOF' belongs. ### Input: CREATE TABLE actor (\n actor_id number,\n first_name text,\n last_name text,\n last_update time\n)\n\nCREATE TABLE film (\n film_id number,\n title text,\n description text,\n release_year time,\n language_id number,\n original_language_id number,\n rental_duration number,\n rental_rate number,\n length number,\n replacement_cost number,\n rating text,\n special_features text,\n last_update time\n)\n\nCREATE TABLE customer (\n customer_id number,\n store_id number,\n first_name text,\n last_name text,\n email text,\n address_id number,\n active boolean,\n create_date time,\n last_update time\n)\n\nCREATE TABLE category (\n category_id number,\n name text,\n last_update time\n)\n\nCREATE TABLE film_actor (\n actor_id number,\n film_id number,\n last_update time\n)\n\nCREATE TABLE city (\n city_id number,\n city text,\n country_id number,\n last_update time\n)\n\nCREATE TABLE address (\n address_id number,\n address text,\n address2 text,\n district text,\n city_id number,\n postal_code text,\n phone text,\n last_update time\n)\n\nCREATE TABLE country (\n country_id number,\n country text,\n last_update time\n)\n\nCREATE TABLE rental (\n rental_id number,\n rental_date time,\n inventory_id number,\n customer_id number,\n return_date time,\n staff_id number,\n last_update time\n)\n\nCREATE TABLE inventory (\n inventory_id number,\n film_id number,\n store_id number,\n last_update time\n)\n\nCREATE TABLE store (\n store_id number,\n manager_staff_id number,\n address_id number,\n last_update time\n)\n\nCREATE TABLE payment (\n payment_id number,\n customer_id number,\n staff_id number,\n rental_id number,\n amount number,\n payment_date time,\n last_update time\n)\n\nCREATE TABLE film_category (\n film_id number,\n category_id number,\n last_update time\n)\n\nCREATE TABLE film_text (\n film_id number,\n title text,\n description text\n)\n\nCREATE TABLE staff (\n staff_id number,\n first_name text,\n last_name text,\n address_id number,\n picture others,\n email text,\n store_id number,\n active boolean,\n username text,\n password text,\n last_update time\n)\n\nCREATE TABLE language (\n language_id number,\n name text,\n last_update time\n) ### Response: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'"} {"instruction":"until 8 months ago, when was the first time that patient 002-56583 was prescribed medication via dialysis?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-56583')) AND medication.routeadmin = 'dialysis' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-8 month') ORDER BY medication.drugstarttime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 8 months ago, when was the first time that patient 002-56583 was prescribed medication via dialysis? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-56583')) AND medication.routeadmin = 'dialysis' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-8 month') ORDER BY medication.drugstarttime LIMIT 1"} {"instruction":"what country is listed before france ?","input":"CREATE TABLE table_203_374 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT \"nation\" FROM table_203_374 WHERE id = (SELECT id FROM table_203_374 WHERE \"nation\" = 'france') - 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what country is listed before france ? ### Input: CREATE TABLE table_203_374 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT \"nation\" FROM table_203_374 WHERE id = (SELECT id FROM table_203_374 WHERE \"nation\" = 'france') - 1"} {"instruction":"Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type Show bar chart, I want to sort X-axis from low to high order please.","input":"CREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)\n\nCREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)","response":"SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY Affiliation","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type Show bar chart, I want to sort X-axis from low to high order please. ### Input: CREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)\n\nCREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n) ### Response: SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY Affiliation"} {"instruction":"List all the participant ids and their details using a bar chart, and rank from high to low by the X-axis.","input":"CREATE TABLE Participants (\n Participant_ID INTEGER,\n Participant_Type_Code CHAR(15),\n Participant_Details VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15)\n)\n\nCREATE TABLE Events (\n Event_ID INTEGER,\n Service_ID INTEGER,\n Event_Details VARCHAR(255)\n)\n\nCREATE TABLE Participants_in_Events (\n Event_ID INTEGER,\n Participant_ID INTEGER\n)","response":"SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all the participant ids and their details using a bar chart, and rank from high to low by the X-axis. ### Input: CREATE TABLE Participants (\n Participant_ID INTEGER,\n Participant_Type_Code CHAR(15),\n Participant_Details VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15)\n)\n\nCREATE TABLE Events (\n Event_ID INTEGER,\n Service_ID INTEGER,\n Event_Details VARCHAR(255)\n)\n\nCREATE TABLE Participants_in_Events (\n Event_ID INTEGER,\n Participant_ID INTEGER\n) ### Response: SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details DESC"} {"instruction":"how many patients were diagnosed with stroke during the same month last year after prophylactic antibacterials - for transplant\/hiv.","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prophylactic antibacterials - for transplant\/hiv' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 WHERE t1.treatmenttime < t2.diagnosistime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.diagnosistime, 'start of month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients were diagnosed with stroke during the same month last year after prophylactic antibacterials - for transplant\/hiv. ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prophylactic antibacterials - for transplant\/hiv' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 WHERE t1.treatmenttime < t2.diagnosistime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.diagnosistime, 'start of month')"} {"instruction":"tell me all the airports near WESTCHESTER COUNTY","input":"CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)","response":"SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'WESTCHESTER COUNTY'","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me all the airports near WESTCHESTER COUNTY ### Input: CREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n) ### Response: SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'WESTCHESTER COUNTY'"} {"instruction":"For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter in a bar chart.","input":"CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)","response":"SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter in a bar chart. ### Input: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n) ### Response: SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter"} {"instruction":"What is the largest silver number when the rank is smaller than 1?","input":"CREATE TABLE table_name_92 (\n silver INTEGER,\n rank INTEGER\n)","response":"SELECT MAX(silver) FROM table_name_92 WHERE rank < 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest silver number when the rank is smaller than 1? ### Input: CREATE TABLE table_name_92 (\n silver INTEGER,\n rank INTEGER\n) ### Response: SELECT MAX(silver) FROM table_name_92 WHERE rank < 1"} {"instruction":"Who was the outgoing manager when the incoming manager was augusto in cio?","input":"CREATE TABLE table_61752 (\n \"Team\" text,\n \"Outgoing manage\" text,\n \"Manner\" text,\n \"Date of vacancy\" text,\n \"Incoming manager\" text,\n \"Date of appointment\" text\n)","response":"SELECT \"Outgoing manage\" FROM table_61752 WHERE \"Incoming manager\" = 'augusto in\u00e1cio'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the outgoing manager when the incoming manager was augusto in cio? ### Input: CREATE TABLE table_61752 (\n \"Team\" text,\n \"Outgoing manage\" text,\n \"Manner\" text,\n \"Date of vacancy\" text,\n \"Incoming manager\" text,\n \"Date of appointment\" text\n) ### Response: SELECT \"Outgoing manage\" FROM table_61752 WHERE \"Incoming manager\" = 'augusto in\u00e1cio'"} {"instruction":"What was the venue after 2012?","input":"CREATE TABLE table_79308 (\n \"Year\" real,\n \"Competition\" text,\n \"Venue\" text,\n \"Position\" text,\n \"Notes\" text\n)","response":"SELECT \"Venue\" FROM table_79308 WHERE \"Year\" > '2012'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the venue after 2012? ### Input: CREATE TABLE table_79308 (\n \"Year\" real,\n \"Competition\" text,\n \"Venue\" text,\n \"Position\" text,\n \"Notes\" text\n) ### Response: SELECT \"Venue\" FROM table_79308 WHERE \"Year\" > '2012'"} {"instruction":"Name the score for hawthorn opponent","input":"CREATE TABLE table_name_64 (\n score VARCHAR,\n opponent VARCHAR\n)","response":"SELECT score FROM table_name_64 WHERE opponent = \"hawthorn\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the score for hawthorn opponent ### Input: CREATE TABLE table_name_64 (\n score VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT score FROM table_name_64 WHERE opponent = \"hawthorn\""} {"instruction":"how much are patient 5252's differences in heart rate second measured on the first intensive care unit visit compared to the value first measured on the first intensive care unit visit?","input":"CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)","response":"SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1 OFFSET 1) - (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much are patient 5252's differences in heart rate second measured on the first intensive care unit visit compared to the value first measured on the first intensive care unit visit? ### Input: CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n) ### Response: SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1 OFFSET 1) - (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime LIMIT 1)"} {"instruction":"count the number of patients whose discharge location is home health care and admission year is less than 2158?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"HOME HEALTH CARE\" AND demographic.admityear < \"2158\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose discharge location is home health care and admission year is less than 2158? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"HOME HEALTH CARE\" AND demographic.admityear < \"2158\""} {"instruction":"How many years did the new york giants win with a result of 15-7 at lincoln financial field?","input":"CREATE TABLE table_47791 (\n \"Year\" real,\n \"Date\" text,\n \"Winner\" text,\n \"Result\" text,\n \"Loser\" text,\n \"Location\" text\n)","response":"SELECT COUNT(\"Year\") FROM table_47791 WHERE \"Location\" = 'lincoln financial field' AND \"Winner\" = 'new york giants' AND \"Result\" = '15-7'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many years did the new york giants win with a result of 15-7 at lincoln financial field? ### Input: CREATE TABLE table_47791 (\n \"Year\" real,\n \"Date\" text,\n \"Winner\" text,\n \"Result\" text,\n \"Loser\" text,\n \"Location\" text\n) ### Response: SELECT COUNT(\"Year\") FROM table_47791 WHERE \"Location\" = 'lincoln financial field' AND \"Winner\" = 'new york giants' AND \"Result\" = '15-7'"} {"instruction":"What is the cooper with an Ashmolean less than 21, and hahland smaller than 4?","input":"CREATE TABLE table_67359 (\n \"Image\" real,\n \"Smith\" text,\n \"Ashmolean\" real,\n \"Foster\" real,\n \"Hahland\" real,\n \"Dinsmoor\" text,\n \"Hofkes-Brukker\" text,\n \"Harrison\" text,\n \"Cooper\" text,\n \"BM\/Corbett\" text\n)","response":"SELECT \"Cooper\" FROM table_67359 WHERE \"Ashmolean\" < '21' AND \"Hahland\" < '4'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the cooper with an Ashmolean less than 21, and hahland smaller than 4? ### Input: CREATE TABLE table_67359 (\n \"Image\" real,\n \"Smith\" text,\n \"Ashmolean\" real,\n \"Foster\" real,\n \"Hahland\" real,\n \"Dinsmoor\" text,\n \"Hofkes-Brukker\" text,\n \"Harrison\" text,\n \"Cooper\" text,\n \"BM\/Corbett\" text\n) ### Response: SELECT \"Cooper\" FROM table_67359 WHERE \"Ashmolean\" < '21' AND \"Hahland\" < '4'"} {"instruction":"What Election has a 2nd Member of frederick knight, and a 1st Member of sir edmund lechmere, bt?","input":"CREATE TABLE table_60550 (\n \"Election\" text,\n \"1st Member\" text,\n \"1st Party\" text,\n \"2nd Member\" text,\n \"2nd Party\" text\n)","response":"SELECT \"Election\" FROM table_60550 WHERE \"2nd Member\" = 'frederick knight' AND \"1st Member\" = 'sir edmund lechmere, bt'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Election has a 2nd Member of frederick knight, and a 1st Member of sir edmund lechmere, bt? ### Input: CREATE TABLE table_60550 (\n \"Election\" text,\n \"1st Member\" text,\n \"1st Party\" text,\n \"2nd Member\" text,\n \"2nd Party\" text\n) ### Response: SELECT \"Election\" FROM table_60550 WHERE \"2nd Member\" = 'frederick knight' AND \"1st Member\" = 'sir edmund lechmere, bt'"} {"instruction":"show me cheap flights from BALTIMORE to DALLAS","input":"CREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DALLAS' AND flight.to_airport = AIRPORT_SERVICE_2.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias3, airport_service AS AIRPORT_SERVICEalias4, airport_service AS AIRPORT_SERVICEalias5, city AS CITYalias3, city AS CITYalias4, city AS CITYalias5, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BALTIMORE' AND CITYalias5.city_code = AIRPORT_SERVICEalias5.city_code AND CITYalias5.city_name = 'DALLAS' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias3.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias5.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me cheap flights from BALTIMORE to DALLAS ### Input: CREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DALLAS' AND flight.to_airport = AIRPORT_SERVICE_2.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias3, airport_service AS AIRPORT_SERVICEalias4, airport_service AS AIRPORT_SERVICEalias5, city AS CITYalias3, city AS CITYalias4, city AS CITYalias5, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BALTIMORE' AND CITYalias5.city_code = AIRPORT_SERVICEalias5.city_code AND CITYalias5.city_name = 'DALLAS' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias3.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias5.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id"} {"instruction":"find the number of patients with blood gas lab test category who were hospitalized for more than 7 days.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > \"7\" AND lab.\"CATEGORY\" = \"Blood Gas\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients with blood gas lab test category who were hospitalized for more than 7 days. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > \"7\" AND lab.\"CATEGORY\" = \"Blood Gas\""} {"instruction":"How many ERP W is it that has a Call sign of w273bs?","input":"CREATE TABLE table_name_40 (\n erp_w INTEGER,\n call_sign VARCHAR\n)","response":"SELECT SUM(erp_w) FROM table_name_40 WHERE call_sign = \"w273bs\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many ERP W is it that has a Call sign of w273bs? ### Input: CREATE TABLE table_name_40 (\n erp_w INTEGER,\n call_sign VARCHAR\n) ### Response: SELECT SUM(erp_w) FROM table_name_40 WHERE call_sign = \"w273bs\""} {"instruction":"Who is the club that has 30 points?","input":"CREATE TABLE table_808 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Tries against\" text,\n \"Try bonus\" text,\n \"Losing bonus\" text,\n \"Points\" text\n)","response":"SELECT \"Club\" FROM table_808 WHERE \"Points\" = '30'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the club that has 30 points? ### Input: CREATE TABLE table_808 (\n \"Club\" text,\n \"Played\" text,\n \"Won\" text,\n \"Drawn\" text,\n \"Lost\" text,\n \"Points for\" text,\n \"Points against\" text,\n \"Tries for\" text,\n \"Tries against\" text,\n \"Try bonus\" text,\n \"Losing bonus\" text,\n \"Points\" text\n) ### Response: SELECT \"Club\" FROM table_808 WHERE \"Points\" = '30'"} {"instruction":"What is the site of the game with a Record of 6-2?","input":"CREATE TABLE table_32451 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Kickoff\" text,\n \"Game site\" text,\n \"Record\" text,\n \"Attendance\" text\n)","response":"SELECT \"Game site\" FROM table_32451 WHERE \"Record\" = '6-2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the site of the game with a Record of 6-2? ### Input: CREATE TABLE table_32451 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Kickoff\" text,\n \"Game site\" text,\n \"Record\" text,\n \"Attendance\" text\n) ### Response: SELECT \"Game site\" FROM table_32451 WHERE \"Record\" = '6-2'"} {"instruction":"Can you compare the account balances of customers with the letter 'a' in their names using a bar graph.","input":"CREATE TABLE bank (\n branch_ID int,\n bname varchar(20),\n no_of_customers int,\n city varchar(10),\n state varchar(20)\n)\n\nCREATE TABLE loan (\n loan_ID varchar(3),\n loan_type varchar(15),\n cust_ID varchar(3),\n branch_ID varchar(3),\n amount int\n)\n\nCREATE TABLE customer (\n cust_ID varchar(3),\n cust_name varchar(20),\n acc_type char(1),\n acc_bal int,\n no_of_loans int,\n credit_score int,\n branch_ID int,\n state varchar(20)\n)","response":"SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you compare the account balances of customers with the letter 'a' in their names using a bar graph. ### Input: CREATE TABLE bank (\n branch_ID int,\n bname varchar(20),\n no_of_customers int,\n city varchar(10),\n state varchar(20)\n)\n\nCREATE TABLE loan (\n loan_ID varchar(3),\n loan_type varchar(15),\n cust_ID varchar(3),\n branch_ID varchar(3),\n amount int\n)\n\nCREATE TABLE customer (\n cust_ID varchar(3),\n cust_name varchar(20),\n acc_type char(1),\n acc_bal int,\n no_of_loans int,\n credit_score int,\n branch_ID int,\n state varchar(20)\n) ### Response: SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'"} {"instruction":"Who was the finalist in Miami?","input":"CREATE TABLE table_name_7 (\n finalist VARCHAR,\n tournament VARCHAR\n)","response":"SELECT finalist FROM table_name_7 WHERE tournament = \"miami\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the finalist in Miami? ### Input: CREATE TABLE table_name_7 (\n finalist VARCHAR,\n tournament VARCHAR\n) ### Response: SELECT finalist FROM table_name_7 WHERE tournament = \"miami\""} {"instruction":"what is the total number of patients who were admitted to the hospital?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of patients who were admitted to the hospital? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions"} {"instruction":"What is the tie number when Wigan Athletic is the home team?","input":"CREATE TABLE table_8010 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n)","response":"SELECT \"Tie no\" FROM table_8010 WHERE \"Home team\" = 'wigan athletic'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the tie number when Wigan Athletic is the home team? ### Input: CREATE TABLE table_8010 (\n \"Tie no\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Date\" text\n) ### Response: SELECT \"Tie no\" FROM table_8010 WHERE \"Home team\" = 'wigan athletic'"} {"instruction":"how many patients were prescribed 10 ml vial : calcium chloride 10 % iv soln during the same month after the diagnosis of sinus tachycardia, since 4 years ago?","input":"CREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)","response":"SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sinus tachycardia' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '10 ml vial : calcium chloride 10 % iv soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients were prescribed 10 ml vial : calcium chloride 10 % iv soln during the same month after the diagnosis of sinus tachycardia, since 4 years ago? ### Input: CREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n) ### Response: SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sinus tachycardia' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '10 ml vial : calcium chloride 10 % iv soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month')"} {"instruction":"How many losses had a total of 17 and more than 10 wins?","input":"CREATE TABLE table_39747 (\n \"Year\" text,\n \"Total\" real,\n \"Wins\" real,\n \"Losses\" real,\n \"No result\" real,\n \"% Win\" text\n)","response":"SELECT COUNT(\"Losses\") FROM table_39747 WHERE \"Total\" = '17' AND \"Wins\" > '10'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many losses had a total of 17 and more than 10 wins? ### Input: CREATE TABLE table_39747 (\n \"Year\" text,\n \"Total\" real,\n \"Wins\" real,\n \"Losses\" real,\n \"No result\" real,\n \"% Win\" text\n) ### Response: SELECT COUNT(\"Losses\") FROM table_39747 WHERE \"Total\" = '17' AND \"Wins\" > '10'"} {"instruction":"What date has a place of chernivtsi, and a race winners of etienne bax \/ kaspars stupelis? What","input":"CREATE TABLE table_49576 (\n \"Date\" text,\n \"Place\" text,\n \"Race winners\" text,\n \"GP winner\" text,\n \"Source\" text\n)","response":"SELECT \"Date\" FROM table_49576 WHERE \"Place\" = 'chernivtsi' AND \"Race winners\" = 'etienne bax \/ kaspars stupelis'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date has a place of chernivtsi, and a race winners of etienne bax \/ kaspars stupelis? What ### Input: CREATE TABLE table_49576 (\n \"Date\" text,\n \"Place\" text,\n \"Race winners\" text,\n \"GP winner\" text,\n \"Source\" text\n) ### Response: SELECT \"Date\" FROM table_49576 WHERE \"Place\" = 'chernivtsi' AND \"Race winners\" = 'etienne bax \/ kaspars stupelis'"} {"instruction":"how many patients whose age is less than 41 and lab test category is chemistry?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < \"41\" AND lab.\"CATEGORY\" = \"Chemistry\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose age is less than 41 and lab test category is chemistry? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < \"41\" AND lab.\"CATEGORY\" = \"Chemistry\""} {"instruction":"specify the age of patient paul edwards","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT demographic.age FROM demographic WHERE demographic.name = \"Paul Edwards\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the age of patient paul edwards ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT demographic.age FROM demographic WHERE demographic.name = \"Paul Edwards\""} {"instruction":"Name the least field goals for chantel hilliard","input":"CREATE TABLE table_25693 (\n \"Player\" text,\n \"Games Played\" real,\n \"Minutes\" real,\n \"Field Goals\" real,\n \"Three Pointers\" real,\n \"Free Throws\" real,\n \"Rebounds\" real,\n \"Assists\" real,\n \"Blocks\" real,\n \"Steals\" real,\n \"Points\" real\n)","response":"SELECT MIN(\"Field Goals\") FROM table_25693 WHERE \"Player\" = 'Chantel Hilliard'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least field goals for chantel hilliard ### Input: CREATE TABLE table_25693 (\n \"Player\" text,\n \"Games Played\" real,\n \"Minutes\" real,\n \"Field Goals\" real,\n \"Three Pointers\" real,\n \"Free Throws\" real,\n \"Rebounds\" real,\n \"Assists\" real,\n \"Blocks\" real,\n \"Steals\" real,\n \"Points\" real\n) ### Response: SELECT MIN(\"Field Goals\") FROM table_25693 WHERE \"Player\" = 'Chantel Hilliard'"} {"instruction":"For the Entrant of Sasol Jordan, add up all the points with a Year larger than 1993.","input":"CREATE TABLE table_name_53 (\n points INTEGER,\n year VARCHAR,\n entrant VARCHAR\n)","response":"SELECT SUM(points) FROM table_name_53 WHERE year > 1993 AND entrant = \"sasol jordan\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the Entrant of Sasol Jordan, add up all the points with a Year larger than 1993. ### Input: CREATE TABLE table_name_53 (\n points INTEGER,\n year VARCHAR,\n entrant VARCHAR\n) ### Response: SELECT SUM(points) FROM table_name_53 WHERE year > 1993 AND entrant = \"sasol jordan\""} {"instruction":"Who is the player who played for the Miami Sol and went to school at North Carolina State?","input":"CREATE TABLE table_50402 (\n \"Pick\" real,\n \"Player\" text,\n \"Nationality\" text,\n \"New WNBA Team\" text,\n \"Former WNBA Team\" text,\n \"College\/Country\/Team\" text\n)","response":"SELECT \"Player\" FROM table_50402 WHERE \"New WNBA Team\" = 'miami sol' AND \"College\/Country\/Team\" = 'north carolina state'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the player who played for the Miami Sol and went to school at North Carolina State? ### Input: CREATE TABLE table_50402 (\n \"Pick\" real,\n \"Player\" text,\n \"Nationality\" text,\n \"New WNBA Team\" text,\n \"Former WNBA Team\" text,\n \"College\/Country\/Team\" text\n) ### Response: SELECT \"Player\" FROM table_50402 WHERE \"New WNBA Team\" = 'miami sol' AND \"College\/Country\/Team\" = 'north carolina state'"} {"instruction":"What is the date where the result was L 27-10 in a week before week 9?","input":"CREATE TABLE table_name_94 (\n date VARCHAR,\n week VARCHAR,\n result VARCHAR\n)","response":"SELECT date FROM table_name_94 WHERE week < 9 AND result = \"l 27-10\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date where the result was L 27-10 in a week before week 9? ### Input: CREATE TABLE table_name_94 (\n date VARCHAR,\n week VARCHAR,\n result VARCHAR\n) ### Response: SELECT date FROM table_name_94 WHERE week < 9 AND result = \"l 27-10\""} {"instruction":"Who vacated his post when his successor was formally installed on May 11, 1966?","input":"CREATE TABLE table_22348 (\n \"State (class)\" text,\n \"Vacator\" text,\n \"Reason for change\" text,\n \"Successor\" text,\n \"Date of successors formal installation\" text\n)","response":"SELECT \"Vacator\" FROM table_22348 WHERE \"Date of successors formal installation\" = 'May 11, 1966'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who vacated his post when his successor was formally installed on May 11, 1966? ### Input: CREATE TABLE table_22348 (\n \"State (class)\" text,\n \"Vacator\" text,\n \"Reason for change\" text,\n \"Successor\" text,\n \"Date of successors formal installation\" text\n) ### Response: SELECT \"Vacator\" FROM table_22348 WHERE \"Date of successors formal installation\" = 'May 11, 1966'"} {"instruction":"What is the lowest cuts made that had a Top-25 less than 6 and wins greater than 0?","input":"CREATE TABLE table_42349 (\n \"Tournament\" text,\n \"Wins\" real,\n \"Top-5\" real,\n \"Top-10\" real,\n \"Top-25\" real,\n \"Events\" real,\n \"Cuts made\" real\n)","response":"SELECT MIN(\"Cuts made\") FROM table_42349 WHERE \"Top-25\" < '6' AND \"Wins\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest cuts made that had a Top-25 less than 6 and wins greater than 0? ### Input: CREATE TABLE table_42349 (\n \"Tournament\" text,\n \"Wins\" real,\n \"Top-5\" real,\n \"Top-10\" real,\n \"Top-25\" real,\n \"Events\" real,\n \"Cuts made\" real\n) ### Response: SELECT MIN(\"Cuts made\") FROM table_42349 WHERE \"Top-25\" < '6' AND \"Wins\" < '0'"} {"instruction":"what is the least silver for germany when gold is more than 4?","input":"CREATE TABLE table_66454 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT MIN(\"Silver\") FROM table_66454 WHERE \"Nation\" = 'germany' AND \"Gold\" > '4'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the least silver for germany when gold is more than 4? ### Input: CREATE TABLE table_66454 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT MIN(\"Silver\") FROM table_66454 WHERE \"Nation\" = 'germany' AND \"Gold\" > '4'"} {"instruction":"What is the competition when aggregate is 1 4?","input":"CREATE TABLE table_1233026_4 (\n competition VARCHAR,\n aggregate VARCHAR\n)","response":"SELECT competition FROM table_1233026_4 WHERE aggregate = \"1\u20134\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the competition when aggregate is 1 4? ### Input: CREATE TABLE table_1233026_4 (\n competition VARCHAR,\n aggregate VARCHAR\n) ### Response: SELECT competition FROM table_1233026_4 WHERE aggregate = \"1\u20134\""} {"instruction":"what is the highest points when the chassis is focus rs wrc 08 and 09 and the stage wins is more than 91?","input":"CREATE TABLE table_name_42 (\n points INTEGER,\n chassis VARCHAR,\n stage_wins VARCHAR\n)","response":"SELECT MAX(points) FROM table_name_42 WHERE chassis = \"focus rs wrc 08 and 09\" AND stage_wins > 91","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the highest points when the chassis is focus rs wrc 08 and 09 and the stage wins is more than 91? ### Input: CREATE TABLE table_name_42 (\n points INTEGER,\n chassis VARCHAR,\n stage_wins VARCHAR\n) ### Response: SELECT MAX(points) FROM table_name_42 WHERE chassis = \"focus rs wrc 08 and 09\" AND stage_wins > 91"} {"instruction":"What was Eduardo Romero's score?","input":"CREATE TABLE table_name_59 (\n score VARCHAR,\n player VARCHAR\n)","response":"SELECT score FROM table_name_59 WHERE player = \"eduardo romero\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Eduardo Romero's score? ### Input: CREATE TABLE table_name_59 (\n score VARCHAR,\n player VARCHAR\n) ### Response: SELECT score FROM table_name_59 WHERE player = \"eduardo romero\""} {"instruction":"What is the mascot of Hammond Tech?","input":"CREATE TABLE table_65664 (\n \"School\" text,\n \"City\" text,\n \"Mascot\" text,\n \"County\" text,\n \"Year joined\" real,\n \"Previous Conference\" text,\n \"Year Left\" real,\n \"Conference Joined\" text\n)","response":"SELECT \"Mascot\" FROM table_65664 WHERE \"City\" = 'hammond' AND \"School\" = 'hammond tech'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mascot of Hammond Tech? ### Input: CREATE TABLE table_65664 (\n \"School\" text,\n \"City\" text,\n \"Mascot\" text,\n \"County\" text,\n \"Year joined\" real,\n \"Previous Conference\" text,\n \"Year Left\" real,\n \"Conference Joined\" text\n) ### Response: SELECT \"Mascot\" FROM table_65664 WHERE \"City\" = 'hammond' AND \"School\" = 'hammond tech'"} {"instruction":"What is the lowest number of wins with more than 113 points in 4th rank?","input":"CREATE TABLE table_name_80 (\n wins INTEGER,\n points VARCHAR,\n rank VARCHAR\n)","response":"SELECT MIN(wins) FROM table_name_80 WHERE points > 113 AND rank = \"4th\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of wins with more than 113 points in 4th rank? ### Input: CREATE TABLE table_name_80 (\n wins INTEGER,\n points VARCHAR,\n rank VARCHAR\n) ### Response: SELECT MIN(wins) FROM table_name_80 WHERE points > 113 AND rank = \"4th\""} {"instruction":"how many gold 's has brazil won ?","input":"CREATE TABLE table_204_360 (\n id number,\n \"year\" number,\n \"host\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text\n)","response":"SELECT COUNT(*) FROM table_204_360 WHERE \"gold\" = 'brazil'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many gold 's has brazil won ? ### Input: CREATE TABLE table_204_360 (\n id number,\n \"year\" number,\n \"host\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text\n) ### Response: SELECT COUNT(*) FROM table_204_360 WHERE \"gold\" = 'brazil'"} {"instruction":"What kind of round was played when Hanne Skak Jensen faced Austria?","input":"CREATE TABLE table_3277 (\n \"Edition\" real,\n \"Zone\" text,\n \"Round\" text,\n \"Against\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Outcome\" text,\n \"Result\" text\n)","response":"SELECT \"Round\" FROM table_3277 WHERE \"Against\" = 'Austria'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What kind of round was played when Hanne Skak Jensen faced Austria? ### Input: CREATE TABLE table_3277 (\n \"Edition\" real,\n \"Zone\" text,\n \"Round\" text,\n \"Against\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"Outcome\" text,\n \"Result\" text\n) ### Response: SELECT \"Round\" FROM table_3277 WHERE \"Against\" = 'Austria'"} {"instruction":"What was the type of sussex?","input":"CREATE TABLE table_357 (\n \"L&CR No.\" real,\n \"Type\" text,\n \"Manufacturer\" text,\n \"Delivered\" text,\n \"Name\" text,\n \"Jt. Cttee No.\" real,\n \"1845 disposal\" text\n)","response":"SELECT \"Type\" FROM table_357 WHERE \"Name\" = 'Sussex'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the type of sussex? ### Input: CREATE TABLE table_357 (\n \"L&CR No.\" real,\n \"Type\" text,\n \"Manufacturer\" text,\n \"Delivered\" text,\n \"Name\" text,\n \"Jt. Cttee No.\" real,\n \"1845 disposal\" text\n) ### Response: SELECT \"Type\" FROM table_357 WHERE \"Name\" = 'Sussex'"} {"instruction":"when was patient 20066's arterial bp [diastolic] first measured less than 43.0 on the first icu visit?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)","response":"SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20066) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum < 43.0 ORDER BY chartevents.charttime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 20066's arterial bp [diastolic] first measured less than 43.0 on the first icu visit? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n) ### Response: SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20066) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum < 43.0 ORDER BY chartevents.charttime LIMIT 1"} {"instruction":"What is the total amount of settlement made for all the settlements?","input":"CREATE TABLE claims (\n claim_id number,\n policy_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_details text\n)\n\nCREATE TABLE customer_policies (\n policy_id number,\n customer_id number,\n policy_type_code text,\n start_date time,\n end_date time\n)\n\nCREATE TABLE settlements (\n settlement_id number,\n claim_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number,\n customer_policy_id number\n)\n\nCREATE TABLE payments (\n payment_id number,\n settlement_id number,\n payment_method_code text,\n date_payment_made time,\n amount_payment number\n)","response":"SELECT SUM(amount_settled) FROM settlements","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total amount of settlement made for all the settlements? ### Input: CREATE TABLE claims (\n claim_id number,\n policy_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_details text\n)\n\nCREATE TABLE customer_policies (\n policy_id number,\n customer_id number,\n policy_type_code text,\n start_date time,\n end_date time\n)\n\nCREATE TABLE settlements (\n settlement_id number,\n claim_id number,\n date_claim_made time,\n date_claim_settled time,\n amount_claimed number,\n amount_settled number,\n customer_policy_id number\n)\n\nCREATE TABLE payments (\n payment_id number,\n settlement_id number,\n payment_method_code text,\n date_payment_made time,\n amount_payment number\n) ### Response: SELECT SUM(amount_settled) FROM settlements"} {"instruction":"What is the highest cited paper by jeff dean ?","input":"CREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)","response":"SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'jeff dean' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest cited paper by jeff dean ? ### Input: CREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n) ### Response: SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'jeff dean' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC"} {"instruction":"What is the lowest rank of Hungary where there was a total of 8 medals, including 2 silver?","input":"CREATE TABLE table_name_37 (\n rank INTEGER,\n silver VARCHAR,\n total VARCHAR,\n nation VARCHAR\n)","response":"SELECT MIN(rank) FROM table_name_37 WHERE total = 8 AND nation = \"hungary\" AND silver > 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest rank of Hungary where there was a total of 8 medals, including 2 silver? ### Input: CREATE TABLE table_name_37 (\n rank INTEGER,\n silver VARCHAR,\n total VARCHAR,\n nation VARCHAR\n) ### Response: SELECT MIN(rank) FROM table_name_37 WHERE total = 8 AND nation = \"hungary\" AND silver > 2"} {"instruction":"How many weeks had a Result of w 20 6?","input":"CREATE TABLE table_name_24 (\n week INTEGER,\n result VARCHAR\n)","response":"SELECT SUM(week) FROM table_name_24 WHERE result = \"w 20\u20136\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many weeks had a Result of w 20 6? ### Input: CREATE TABLE table_name_24 (\n week INTEGER,\n result VARCHAR\n) ### Response: SELECT SUM(week) FROM table_name_24 WHERE result = \"w 20\u20136\""} {"instruction":"What is the combined attendance of all games that had a result of w 35-14?","input":"CREATE TABLE table_78334 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n)","response":"SELECT SUM(\"Attendance\") FROM table_78334 WHERE \"Result\" = 'w 35-14'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the combined attendance of all games that had a result of w 35-14? ### Input: CREATE TABLE table_78334 (\n \"Week\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Attendance\" real\n) ### Response: SELECT SUM(\"Attendance\") FROM table_78334 WHERE \"Result\" = 'w 35-14'"} {"instruction":"how many patients whose admission year is less than 2111 and item id is 51446?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < \"2111\" AND lab.itemid = \"51446\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission year is less than 2111 and item id is 51446? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < \"2111\" AND lab.itemid = \"51446\""} {"instruction":"what is the next whitworth size -lrb- in -rrb- below 1\/8 ?","input":"CREATE TABLE table_204_828 (\n id number,\n \"whitworth size (in)\" number,\n \"core diameter (in)\" number,\n \"threads per inch\" number,\n \"pitch (in)\" number,\n \"tapping drill size\" text\n)","response":"SELECT \"whitworth size (in)\" FROM table_204_828 WHERE id = (SELECT id FROM table_204_828 WHERE \"whitworth size (in)\" = '1\/8') + 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the next whitworth size -lrb- in -rrb- below 1\/8 ? ### Input: CREATE TABLE table_204_828 (\n id number,\n \"whitworth size (in)\" number,\n \"core diameter (in)\" number,\n \"threads per inch\" number,\n \"pitch (in)\" number,\n \"tapping drill size\" text\n) ### Response: SELECT \"whitworth size (in)\" FROM table_204_828 WHERE id = (SELECT id FROM table_204_828 WHERE \"whitworth size (in)\" = '1\/8') + 1"} {"instruction":"How many ranks by average for the couple Tana and Stuart?","input":"CREATE TABLE table_26375386_28 (\n rank_by_average VARCHAR,\n couple VARCHAR\n)","response":"SELECT COUNT(rank_by_average) FROM table_26375386_28 WHERE couple = \"Tana and Stuart\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many ranks by average for the couple Tana and Stuart? ### Input: CREATE TABLE table_26375386_28 (\n rank_by_average VARCHAR,\n couple VARCHAR\n) ### Response: SELECT COUNT(rank_by_average) FROM table_26375386_28 WHERE couple = \"Tana and Stuart\""} {"instruction":"What is the share of votes with 3,567,021 NDC votes?","input":"CREATE TABLE table_9551 (\n \"Election\" real,\n \"Number of NDC votes\" text,\n \"Share of votes\" text,\n \"Seats\" real,\n \"Outcome of election\" text\n)","response":"SELECT \"Share of votes\" FROM table_9551 WHERE \"Number of NDC votes\" = '3,567,021'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the share of votes with 3,567,021 NDC votes? ### Input: CREATE TABLE table_9551 (\n \"Election\" real,\n \"Number of NDC votes\" text,\n \"Share of votes\" text,\n \"Seats\" real,\n \"Outcome of election\" text\n) ### Response: SELECT \"Share of votes\" FROM table_9551 WHERE \"Number of NDC votes\" = '3,567,021'"} {"instruction":"Which highest overall figure had Robert Alford as a name and a round of more than 2?","input":"CREATE TABLE table_name_89 (\n overall INTEGER,\n name VARCHAR,\n round VARCHAR\n)","response":"SELECT MAX(overall) FROM table_name_89 WHERE name = \"robert alford\" AND round > 2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which highest overall figure had Robert Alford as a name and a round of more than 2? ### Input: CREATE TABLE table_name_89 (\n overall INTEGER,\n name VARCHAR,\n round VARCHAR\n) ### Response: SELECT MAX(overall) FROM table_name_89 WHERE name = \"robert alford\" AND round > 2"} {"instruction":"Name the total number of points for newell's old boys","input":"CREATE TABLE table_17968282_1 (\n points VARCHAR,\n team VARCHAR\n)","response":"SELECT COUNT(points) FROM table_17968282_1 WHERE team = \"Newell's Old Boys\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of points for newell's old boys ### Input: CREATE TABLE table_17968282_1 (\n points VARCHAR,\n team VARCHAR\n) ### Response: SELECT COUNT(points) FROM table_17968282_1 WHERE team = \"Newell's Old Boys\""} {"instruction":"May I sign up for 100 -level classes in Spring or Summer term ?","input":"CREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)","response":"SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN (DERIVED_TABLEalias0.course_id) AND NOT COURSEalias0.course_id IN (SELECT DISTINCT COURSE_PREREQUISITEalias0.course_id FROM course_prerequisite AS COURSE_PREREQUISITEalias0 WHERE NOT COURSE_PREREQUISITEalias0.pre_course_id IN (DERIVED_TABLEalias0.course_id)) AND COURSEalias0.department = 'EECS' AND COURSEalias0.number BETWEEN 100 AND 100 + 100 AND SEMESTERalias0.semester IN ('SP', 'SS', 'SU') AND SEMESTERalias0.semester_id = COURSE_OFFERINGalias0.semester AND SEMESTERalias0.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: May I sign up for 100 -level classes in Spring or Summer term ? ### Input: CREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n) ### Response: SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN (DERIVED_TABLEalias0.course_id) AND NOT COURSEalias0.course_id IN (SELECT DISTINCT COURSE_PREREQUISITEalias0.course_id FROM course_prerequisite AS COURSE_PREREQUISITEalias0 WHERE NOT COURSE_PREREQUISITEalias0.pre_course_id IN (DERIVED_TABLEalias0.course_id)) AND COURSEalias0.department = 'EECS' AND COURSEalias0.number BETWEEN 100 AND 100 + 100 AND SEMESTERalias0.semester IN ('SP', 'SS', 'SU') AND SEMESTERalias0.semester_id = COURSE_OFFERINGalias0.semester AND SEMESTERalias0.year = 2016"} {"instruction":"What song was in french?","input":"CREATE TABLE table_76347 (\n \"Draw\" real,\n \"Language\" text,\n \"Artist\" text,\n \"Song\" text,\n \"English translation\" text,\n \"Place\" real,\n \"Points\" real\n)","response":"SELECT \"Song\" FROM table_76347 WHERE \"Language\" = 'french'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What song was in french? ### Input: CREATE TABLE table_76347 (\n \"Draw\" real,\n \"Language\" text,\n \"Artist\" text,\n \"Song\" text,\n \"English translation\" text,\n \"Place\" real,\n \"Points\" real\n) ### Response: SELECT \"Song\" FROM table_76347 WHERE \"Language\" = 'french'"} {"instruction":"What's the name of the episode associated with Nick production number 342?","input":"CREATE TABLE table_28767 (\n \"Season #\" real,\n \"Series #\" real,\n \"Episode title\" text,\n \"Original air date\" text,\n \"Nick prod. #\" real\n)","response":"SELECT \"Episode title\" FROM table_28767 WHERE \"Nick prod. #\" = '342'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the name of the episode associated with Nick production number 342? ### Input: CREATE TABLE table_28767 (\n \"Season #\" real,\n \"Series #\" real,\n \"Episode title\" text,\n \"Original air date\" text,\n \"Nick prod. #\" real\n) ### Response: SELECT \"Episode title\" FROM table_28767 WHERE \"Nick prod. #\" = '342'"} {"instruction":"What Leading scorer had a Score of 80 112?","input":"CREATE TABLE table_name_98 (\n leading_scorer VARCHAR,\n score VARCHAR\n)","response":"SELECT leading_scorer FROM table_name_98 WHERE score = \"80\u2013112\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Leading scorer had a Score of 80 112? ### Input: CREATE TABLE table_name_98 (\n leading_scorer VARCHAR,\n score VARCHAR\n) ### Response: SELECT leading_scorer FROM table_name_98 WHERE score = \"80\u2013112\""} {"instruction":"was the value of patient 016-38131's bun last measured on the current hospital visit less than they were first measured on the current hospital visit?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime DESC LIMIT 1) < (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime LIMIT 1)","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the value of patient 016-38131's bun last measured on the current hospital visit less than they were first measured on the current hospital visit? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime DESC LIMIT 1) < (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime LIMIT 1)"} {"instruction":"What is on at 5pm on the channel where As the World Turns is on at 2pm?","input":"CREATE TABLE table_61209 (\n \"7:00 am\" text,\n \"7:30 am\" text,\n \"8:00 am\" text,\n \"9:00 am\" text,\n \"10:00 am\" text,\n \"11:00 am\" text,\n \"noon\" text,\n \"12:30 pm\" text,\n \"1:00 pm\" text,\n \"1:30 pm\" text,\n \"2:00 pm\" text,\n \"3:00 pm\" text,\n \"3:30 pm\" text,\n \"5:00 pm\" text,\n \"6:30 pm\" text\n)","response":"SELECT \"5:00 pm\" FROM table_61209 WHERE \"2:00 pm\" = 'as the world turns'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is on at 5pm on the channel where As the World Turns is on at 2pm? ### Input: CREATE TABLE table_61209 (\n \"7:00 am\" text,\n \"7:30 am\" text,\n \"8:00 am\" text,\n \"9:00 am\" text,\n \"10:00 am\" text,\n \"11:00 am\" text,\n \"noon\" text,\n \"12:30 pm\" text,\n \"1:00 pm\" text,\n \"1:30 pm\" text,\n \"2:00 pm\" text,\n \"3:00 pm\" text,\n \"3:30 pm\" text,\n \"5:00 pm\" text,\n \"6:30 pm\" text\n) ### Response: SELECT \"5:00 pm\" FROM table_61209 WHERE \"2:00 pm\" = 'as the world turns'"} {"instruction":"Are there any sections of EECS 767 offered after 07:30 P.M. ?","input":"CREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)","response":"SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:30' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any sections of EECS 767 offered after 07:30 P.M. ? ### Input: CREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n) ### Response: SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:30' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016"} {"instruction":"Name the most interview for minnesota and average more than 7.901","input":"CREATE TABLE table_57084 (\n \"State\" text,\n \"Interview\" real,\n \"Swimsuit\" real,\n \"Evening gown\" real,\n \"Average\" real\n)","response":"SELECT MAX(\"Interview\") FROM table_57084 WHERE \"State\" = 'minnesota' AND \"Average\" > '7.901'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most interview for minnesota and average more than 7.901 ### Input: CREATE TABLE table_57084 (\n \"State\" text,\n \"Interview\" real,\n \"Swimsuit\" real,\n \"Evening gown\" real,\n \"Average\" real\n) ### Response: SELECT MAX(\"Interview\") FROM table_57084 WHERE \"State\" = 'minnesota' AND \"Average\" > '7.901'"} {"instruction":"In the game where the Hornets were the home team and Clippers the visiting team, what is the score?","input":"CREATE TABLE table_56666 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT \"Score\" FROM table_56666 WHERE \"Home\" = 'hornets' AND \"Visitor\" = 'clippers'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game where the Hornets were the home team and Clippers the visiting team, what is the score? ### Input: CREATE TABLE table_56666 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT \"Score\" FROM table_56666 WHERE \"Home\" = 'hornets' AND \"Visitor\" = 'clippers'"} {"instruction":"Tag Usage - Presentation Frameworks.","input":"CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)","response":"SELECT t.TagName, COUNT(p.Id) AS Posts, SUM(CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered FROM Tags AS t INNER JOIN PostTags AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ('angular', 'ember.js', 'reactjs', 'vuejs2') GROUP BY t.TagName","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tag Usage - Presentation Frameworks. ### Input: CREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n) ### Response: SELECT t.TagName, COUNT(p.Id) AS Posts, SUM(CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered FROM Tags AS t INNER JOIN PostTags AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ('angular', 'ember.js', 'reactjs', 'vuejs2') GROUP BY t.TagName"} {"instruction":"What was the highest money when the score was 69-68-67-69=273?","input":"CREATE TABLE table_62549 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" real\n)","response":"SELECT MAX(\"Money ( $ )\") FROM table_62549 WHERE \"Score\" = '69-68-67-69=273'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest money when the score was 69-68-67-69=273? ### Input: CREATE TABLE table_62549 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( $ )\" real\n) ### Response: SELECT MAX(\"Money ( $ )\") FROM table_62549 WHERE \"Score\" = '69-68-67-69=273'"} {"instruction":"Who were the opponents during week 14?","input":"CREATE TABLE table_name_53 (\n opponent VARCHAR,\n week VARCHAR\n)","response":"SELECT opponent FROM table_name_53 WHERE week = 14","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the opponents during week 14? ### Input: CREATE TABLE table_name_53 (\n opponent VARCHAR,\n week VARCHAR\n) ### Response: SELECT opponent FROM table_name_53 WHERE week = 14"} {"instruction":"tell me patient 10624's minimum bands value this month?","input":"CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me patient 10624's minimum bands value this month? ### Input: CREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')"} {"instruction":"After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23?","input":"CREATE TABLE table_name_64 (\n entrant VARCHAR,\n points VARCHAR,\n year VARCHAR,\n engine VARCHAR\n)","response":"SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = \"ferrari v8\" AND points < 23","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23? ### Input: CREATE TABLE table_name_64 (\n entrant VARCHAR,\n points VARCHAR,\n year VARCHAR,\n engine VARCHAR\n) ### Response: SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = \"ferrari v8\" AND points < 23"} {"instruction":"What are the nationalities and the taotal ages of journalists. Visualize by a bar chart.","input":"CREATE TABLE news_report (\n journalist_ID int,\n Event_ID int,\n Work_Type text\n)\n\nCREATE TABLE event (\n Event_ID int,\n Date text,\n Venue text,\n Name text,\n Event_Attendance int\n)\n\nCREATE TABLE journalist (\n journalist_ID int,\n Name text,\n Nationality text,\n Age text,\n Years_working int\n)","response":"SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the nationalities and the taotal ages of journalists. Visualize by a bar chart. ### Input: CREATE TABLE news_report (\n journalist_ID int,\n Event_ID int,\n Work_Type text\n)\n\nCREATE TABLE event (\n Event_ID int,\n Date text,\n Venue text,\n Name text,\n Event_Attendance int\n)\n\nCREATE TABLE journalist (\n journalist_ID int,\n Name text,\n Nationality text,\n Age text,\n Years_working int\n) ### Response: SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality"} {"instruction":"Which award was given for the role of Elphaba in 2009?","input":"CREATE TABLE table_43430 (\n \"Year\" text,\n \"Award\" text,\n \"Production\" text,\n \"Role\" text,\n \"Result\" text\n)","response":"SELECT \"Award\" FROM table_43430 WHERE \"Role\" = 'elphaba' AND \"Year\" = '2009'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which award was given for the role of Elphaba in 2009? ### Input: CREATE TABLE table_43430 (\n \"Year\" text,\n \"Award\" text,\n \"Production\" text,\n \"Role\" text,\n \"Result\" text\n) ### Response: SELECT \"Award\" FROM table_43430 WHERE \"Role\" = 'elphaba' AND \"Year\" = '2009'"} {"instruction":"What was the result when incumbent Tom Steed was elected?","input":"CREATE TABLE table_1342198_36 (\n result VARCHAR,\n incumbent VARCHAR\n)","response":"SELECT result FROM table_1342198_36 WHERE incumbent = \"Tom Steed\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result when incumbent Tom Steed was elected? ### Input: CREATE TABLE table_1342198_36 (\n result VARCHAR,\n incumbent VARCHAR\n) ### Response: SELECT result FROM table_1342198_36 WHERE incumbent = \"Tom Steed\""} {"instruction":"Term Ending smaller than 2018, and a Nationality of new zealand what is the name?","input":"CREATE TABLE table_5255 (\n \"Name\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Tenure Began\" real,\n \"Term Ending\" real\n)","response":"SELECT \"Name\" FROM table_5255 WHERE \"Term Ending\" < '2018' AND \"Nationality\" = 'new zealand'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Term Ending smaller than 2018, and a Nationality of new zealand what is the name? ### Input: CREATE TABLE table_5255 (\n \"Name\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Tenure Began\" real,\n \"Term Ending\" real\n) ### Response: SELECT \"Name\" FROM table_5255 WHERE \"Term Ending\" < '2018' AND \"Nationality\" = 'new zealand'"} {"instruction":"What is the name of series episode 11-02's segment c?","input":"CREATE TABLE table_15187735_11 (\n segment_c VARCHAR,\n series_ep VARCHAR\n)","response":"SELECT segment_c FROM table_15187735_11 WHERE series_ep = \"11-02\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of series episode 11-02's segment c? ### Input: CREATE TABLE table_15187735_11 (\n segment_c VARCHAR,\n series_ep VARCHAR\n) ### Response: SELECT segment_c FROM table_15187735_11 WHERE series_ep = \"11-02\""} {"instruction":"Can you tell me the High rebounds that has the Date of november 5?","input":"CREATE TABLE table_name_16 (\n high_rebounds VARCHAR,\n date VARCHAR\n)","response":"SELECT high_rebounds FROM table_name_16 WHERE date = \"november 5\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the High rebounds that has the Date of november 5? ### Input: CREATE TABLE table_name_16 (\n high_rebounds VARCHAR,\n date VARCHAR\n) ### Response: SELECT high_rebounds FROM table_name_16 WHERE date = \"november 5\""} {"instruction":"A bar chart shows the number of appellations whose score is higher than 93, and ordered by Name.","input":"CREATE TABLE wine (\n No INTEGER,\n Grape TEXT,\n Winery TEXT,\n Appelation TEXT,\n State TEXT,\n Name TEXT,\n Year INTEGER,\n Price INTEGER,\n Score INTEGER,\n Cases INTEGER,\n Drink TEXT\n)\n\nCREATE TABLE appellations (\n No INTEGER,\n Appelation TEXT,\n County TEXT,\n State TEXT,\n Area TEXT,\n isAVA TEXT\n)\n\nCREATE TABLE grapes (\n ID INTEGER,\n Grape TEXT,\n Color TEXT\n)","response":"SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the number of appellations whose score is higher than 93, and ordered by Name. ### Input: CREATE TABLE wine (\n No INTEGER,\n Grape TEXT,\n Winery TEXT,\n Appelation TEXT,\n State TEXT,\n Name TEXT,\n Year INTEGER,\n Price INTEGER,\n Score INTEGER,\n Cases INTEGER,\n Drink TEXT\n)\n\nCREATE TABLE appellations (\n No INTEGER,\n Appelation TEXT,\n County TEXT,\n State TEXT,\n Area TEXT,\n isAVA TEXT\n)\n\nCREATE TABLE grapes (\n ID INTEGER,\n Grape TEXT,\n Color TEXT\n) ### Response: SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name"} {"instruction":"what is minimum age of patients whose days of hospital stay is 29 and admission year is greater than or equal to 2107?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = \"29\" AND demographic.admityear >= \"2107\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose days of hospital stay is 29 and admission year is greater than or equal to 2107? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = \"29\" AND demographic.admityear >= \"2107\""} {"instruction":"Which Surface has a Week of march 1?","input":"CREATE TABLE table_8542 (\n \"Tournament\" text,\n \"Surface\" text,\n \"Week\" text,\n \"Winner and score\" text,\n \"Finalist\" text,\n \"Semifinalists\" text\n)","response":"SELECT \"Surface\" FROM table_8542 WHERE \"Week\" = 'march 1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Surface has a Week of march 1? ### Input: CREATE TABLE table_8542 (\n \"Tournament\" text,\n \"Surface\" text,\n \"Week\" text,\n \"Winner and score\" text,\n \"Finalist\" text,\n \"Semifinalists\" text\n) ### Response: SELECT \"Surface\" FROM table_8542 WHERE \"Week\" = 'march 1'"} {"instruction":"Find the names of all the product characteristics.","input":"CREATE TABLE CHARACTERISTICS (\n characteristic_name VARCHAR\n)","response":"SELECT DISTINCT characteristic_name FROM CHARACTERISTICS","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the names of all the product characteristics. ### Input: CREATE TABLE CHARACTERISTICS (\n characteristic_name VARCHAR\n) ### Response: SELECT DISTINCT characteristic_name FROM CHARACTERISTICS"} {"instruction":"on what date did the bears win by a difference of 27 points ?","input":"CREATE TABLE table_204_207 (\n id number,\n \"week\" number,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" number,\n \"bye\" text\n)","response":"SELECT \"date\" FROM table_204_207 WHERE \"result\" = 'w' AND \"result\" - \"result\" = 27","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on what date did the bears win by a difference of 27 points ? ### Input: CREATE TABLE table_204_207 (\n id number,\n \"week\" number,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" number,\n \"bye\" text\n) ### Response: SELECT \"date\" FROM table_204_207 WHERE \"result\" = 'w' AND \"result\" - \"result\" = 27"} {"instruction":"Who was in 2nd leg when Boca Juniors was in home (1st leg)?","input":"CREATE TABLE table_14219514_1 (\n home__1st_leg_ VARCHAR\n)","response":"SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = \"Boca Juniors\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was in 2nd leg when Boca Juniors was in home (1st leg)? ### Input: CREATE TABLE table_14219514_1 (\n home__1st_leg_ VARCHAR\n) ### Response: SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = \"Boca Juniors\""} {"instruction":"how many times did debbie black block","input":"CREATE TABLE table_19722233_5 (\n blocks VARCHAR,\n player VARCHAR\n)","response":"SELECT blocks FROM table_19722233_5 WHERE player = \"Debbie Black\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did debbie black block ### Input: CREATE TABLE table_19722233_5 (\n blocks VARCHAR,\n player VARCHAR\n) ### Response: SELECT blocks FROM table_19722233_5 WHERE player = \"Debbie Black\""} {"instruction":"Who had the decision goal when the record was 7-7-2?","input":"CREATE TABLE table_name_83 (\n decision VARCHAR,\n record VARCHAR\n)","response":"SELECT decision FROM table_name_83 WHERE record = \"7-7-2\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the decision goal when the record was 7-7-2? ### Input: CREATE TABLE table_name_83 (\n decision VARCHAR,\n record VARCHAR\n) ### Response: SELECT decision FROM table_name_83 WHERE record = \"7-7-2\""} {"instruction":"what were the top four most common drugs that followed during the same hospital visit for the patients who were given lt heart angiocardiogram during the previous year?","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)","response":"SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lt heart angiocardiogram') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top four most common drugs that followed during the same hospital visit for the patients who were given lt heart angiocardiogram during the previous year? ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lt heart angiocardiogram') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4"} {"instruction":"Show the name, home city, and age for all drivers.","input":"CREATE TABLE driver (\n name VARCHAR,\n home_city VARCHAR,\n age VARCHAR\n)","response":"SELECT name, home_city, age FROM driver","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name, home city, and age for all drivers. ### Input: CREATE TABLE driver (\n name VARCHAR,\n home_city VARCHAR,\n age VARCHAR\n) ### Response: SELECT name, home_city, age FROM driver"} {"instruction":"how many patients are admitted urgently and lab tested for bilirubin,direct?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"URGENT\" AND lab.label = \"Bilirubin, Direct\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are admitted urgently and lab tested for bilirubin,direct? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"URGENT\" AND lab.label = \"Bilirubin, Direct\""} {"instruction":"what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"MARRIED\" AND procedures.long_title = \"Percutaneous [endoscopic] gastrostomy [PEG]\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = \"MARRIED\" AND procedures.long_title = \"Percutaneous [endoscopic] gastrostomy [PEG]\""} {"instruction":"Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0?","input":"CREATE TABLE table_name_70 (\n rd_1 INTEGER,\n province VARCHAR,\n rd_4 VARCHAR\n)","response":"SELECT MAX(rd_1) FROM table_name_70 WHERE province = \"utrecht\" AND rd_4 > 0","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0? ### Input: CREATE TABLE table_name_70 (\n rd_1 INTEGER,\n province VARCHAR,\n rd_4 VARCHAR\n) ### Response: SELECT MAX(rd_1) FROM table_name_70 WHERE province = \"utrecht\" AND rd_4 > 0"} {"instruction":"how old is the youngest person for each job?, and could you order x-axis from low to high order?","input":"CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n)","response":"SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how old is the youngest person for each job?, and could you order x-axis from low to high order? ### Input: CREATE TABLE Person (\n name varchar(20),\n age INTEGER,\n city TEXT,\n gender TEXT,\n job TEXT\n)\n\nCREATE TABLE PersonFriend (\n name varchar(20),\n friend varchar(20),\n year INTEGER\n) ### Response: SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job"} {"instruction":"what was the teams final record","input":"CREATE TABLE table_204_123 (\n id number,\n \"week\" number,\n \"date\" text,\n \"kickoff\" text,\n \"opponent\" text,\n \"results\\nfinal score\" text,\n \"results\\nteam record\" text,\n \"game site\" text,\n \"attendance\" number\n)","response":"SELECT \"results\\nteam record\" FROM table_204_123 ORDER BY \"week\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the teams final record ### Input: CREATE TABLE table_204_123 (\n id number,\n \"week\" number,\n \"date\" text,\n \"kickoff\" text,\n \"opponent\" text,\n \"results\\nfinal score\" text,\n \"results\\nteam record\" text,\n \"game site\" text,\n \"attendance\" number\n) ### Response: SELECT \"results\\nteam record\" FROM table_204_123 ORDER BY \"week\" DESC LIMIT 1"} {"instruction":"What is the average number in attendance on September 16?","input":"CREATE TABLE table_name_23 (\n attendance INTEGER,\n date VARCHAR\n)","response":"SELECT AVG(attendance) FROM table_name_23 WHERE date = \"september 16\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number in attendance on September 16? ### Input: CREATE TABLE table_name_23 (\n attendance INTEGER,\n date VARCHAR\n) ### Response: SELECT AVG(attendance) FROM table_name_23 WHERE date = \"september 16\""} {"instruction":"What classes are required to declare a major in CLARCH ?","input":"CREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What classes are required to declare a major in CLARCH ? ### Input: CREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id"} {"instruction":"How many original air dates were there for the episode with production code 212?","input":"CREATE TABLE table_23937219_3 (\n original_air_date VARCHAR,\n prod_code VARCHAR\n)","response":"SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many original air dates were there for the episode with production code 212? ### Input: CREATE TABLE table_23937219_3 (\n original_air_date VARCHAR,\n prod_code VARCHAR\n) ### Response: SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212"} {"instruction":"what is the capacity when the acceleration 1-100km\/h is 11.1 s?","input":"CREATE TABLE table_name_39 (\n capacity VARCHAR,\n acceleration_0_100km_h VARCHAR\n)","response":"SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = \"11.1 s\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the capacity when the acceleration 1-100km\/h is 11.1 s? ### Input: CREATE TABLE table_name_39 (\n capacity VARCHAR,\n acceleration_0_100km_h VARCHAR\n) ### Response: SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = \"11.1 s\""} {"instruction":"Name the To par of payne stewart?","input":"CREATE TABLE table_name_4 (\n to_par VARCHAR,\n player VARCHAR\n)","response":"SELECT to_par FROM table_name_4 WHERE player = \"payne stewart\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the To par of payne stewart? ### Input: CREATE TABLE table_name_4 (\n to_par VARCHAR,\n player VARCHAR\n) ### Response: SELECT to_par FROM table_name_4 WHERE player = \"payne stewart\""} {"instruction":"what is minimum age of patients whose primary disease is aortic insufficiency\\re-do sternotomy; aortic valve replacement and days of hospital stay is 20?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = \"AORTIC INSUFFICIENCY\\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT \" AND demographic.days_stay = \"20\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose primary disease is aortic insufficiency\\re-do sternotomy; aortic valve replacement and days of hospital stay is 20? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = \"AORTIC INSUFFICIENCY\\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT \" AND demographic.days_stay = \"20\""} {"instruction":"how many employees does vitol have ?","input":"CREATE TABLE table_203_83 (\n id number,\n \"ranking\" number,\n \"company\" text,\n \"industry\" text,\n \"revenue (usd billions)\" text,\n \"fy\" text,\n \"capitalization (usd billions)\" text,\n \"employees\" number,\n \"listing\" text,\n \"headquarters\" text,\n \"ceo\" text\n)","response":"SELECT \"employees\" FROM table_203_83 WHERE \"company\" = 'vitol'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many employees does vitol have ? ### Input: CREATE TABLE table_203_83 (\n id number,\n \"ranking\" number,\n \"company\" text,\n \"industry\" text,\n \"revenue (usd billions)\" text,\n \"fy\" text,\n \"capitalization (usd billions)\" text,\n \"employees\" number,\n \"listing\" text,\n \"headquarters\" text,\n \"ceo\" text\n) ### Response: SELECT \"employees\" FROM table_203_83 WHERE \"company\" = 'vitol'"} {"instruction":"What was E.J. 'Dutch' Harrison's lowest To Par?","input":"CREATE TABLE table_70516 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real,\n \"Money ( $ )\" text\n)","response":"SELECT MIN(\"To par\") FROM table_70516 WHERE \"Player\" = 'e.j. \"dutch\" harrison'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was E.J. 'Dutch' Harrison's lowest To Par? ### Input: CREATE TABLE table_70516 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" real,\n \"Money ( $ )\" text\n) ### Response: SELECT MIN(\"To par\") FROM table_70516 WHERE \"Player\" = 'e.j. \"dutch\" harrison'"} {"instruction":"count the number of private health insurance patients who had transplant from cadaver.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Private\" AND procedures.short_title = \"Transplant cadaver donor\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of private health insurance patients who had transplant from cadaver. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = \"Private\" AND procedures.short_title = \"Transplant cadaver donor\""} {"instruction":"Name the centennial for location","input":"CREATE TABLE table_20448 (\n \"Information\" text,\n \"Akimel A-al The name is Tohono Oodham for children of the river\" text,\n \"Altade\\u00f1a\" text,\n \"Aprende\" text,\n \"Centennial\" text,\n \"Kyrene MS\" text,\n \"del Pueblo\" text\n)","response":"SELECT \"Centennial\" FROM table_20448 WHERE \"Information\" = 'Location'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the centennial for location ### Input: CREATE TABLE table_20448 (\n \"Information\" text,\n \"Akimel A-al The name is Tohono Oodham for children of the river\" text,\n \"Altade\\u00f1a\" text,\n \"Aprende\" text,\n \"Centennial\" text,\n \"Kyrene MS\" text,\n \"del Pueblo\" text\n) ### Response: SELECT \"Centennial\" FROM table_20448 WHERE \"Information\" = 'Location'"} {"instruction":"What are the invoice dates, order ids, and order details for all invoices?","input":"CREATE TABLE financial_transactions (\n transaction_id number,\n account_id number,\n invoice_number number,\n transaction_type text,\n transaction_date time,\n transaction_amount number,\n transaction_comment text,\n other_transaction_details text\n)\n\nCREATE TABLE invoices (\n invoice_number number,\n order_id number,\n invoice_date time\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_first_name text,\n customer_middle_initial text,\n customer_last_name text,\n gender text,\n email_address text,\n login_name text,\n login_password text,\n phone_number text,\n town_city text,\n state_county_province text,\n country text\n)\n\nCREATE TABLE invoice_line_items (\n order_item_id number,\n invoice_number number,\n product_id number,\n product_title text,\n product_quantity text,\n product_price number,\n derived_product_cost number,\n derived_vat_payable number,\n derived_total_cost number\n)\n\nCREATE TABLE accounts (\n account_id number,\n customer_id number,\n date_account_opened time,\n account_name text,\n other_account_details text\n)\n\nCREATE TABLE product_categories (\n production_type_code text,\n product_type_description text,\n vat_rating number\n)\n\nCREATE TABLE products (\n product_id number,\n parent_product_id number,\n production_type_code text,\n unit_price number,\n product_name text,\n product_color text,\n product_size text\n)\n\nCREATE TABLE order_items (\n order_item_id number,\n order_id number,\n product_id number,\n product_quantity text,\n other_order_item_details text\n)\n\nCREATE TABLE orders (\n order_id number,\n customer_id number,\n date_order_placed time,\n order_details text\n)","response":"SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the invoice dates, order ids, and order details for all invoices? ### Input: CREATE TABLE financial_transactions (\n transaction_id number,\n account_id number,\n invoice_number number,\n transaction_type text,\n transaction_date time,\n transaction_amount number,\n transaction_comment text,\n other_transaction_details text\n)\n\nCREATE TABLE invoices (\n invoice_number number,\n order_id number,\n invoice_date time\n)\n\nCREATE TABLE customers (\n customer_id number,\n customer_first_name text,\n customer_middle_initial text,\n customer_last_name text,\n gender text,\n email_address text,\n login_name text,\n login_password text,\n phone_number text,\n town_city text,\n state_county_province text,\n country text\n)\n\nCREATE TABLE invoice_line_items (\n order_item_id number,\n invoice_number number,\n product_id number,\n product_title text,\n product_quantity text,\n product_price number,\n derived_product_cost number,\n derived_vat_payable number,\n derived_total_cost number\n)\n\nCREATE TABLE accounts (\n account_id number,\n customer_id number,\n date_account_opened time,\n account_name text,\n other_account_details text\n)\n\nCREATE TABLE product_categories (\n production_type_code text,\n product_type_description text,\n vat_rating number\n)\n\nCREATE TABLE products (\n product_id number,\n parent_product_id number,\n production_type_code text,\n unit_price number,\n product_name text,\n product_color text,\n product_size text\n)\n\nCREATE TABLE order_items (\n order_item_id number,\n order_id number,\n product_id number,\n product_quantity text,\n other_order_item_details text\n)\n\nCREATE TABLE orders (\n order_id number,\n customer_id number,\n date_order_placed time,\n order_details text\n) ### Response: SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id"} {"instruction":"give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = \"NEWBORN\" AND lab.flag = \"abnormal\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = \"NEWBORN\" AND lab.flag = \"abnormal\""} {"instruction":"what is the home city for the stadion src mladost?","input":"CREATE TABLE table_44912 (\n \"Team\" text,\n \"Manager\" text,\n \"Home city\" text,\n \"Stadium\" text,\n \"Capacity\" real\n)","response":"SELECT \"Home city\" FROM table_44912 WHERE \"Stadium\" = 'stadion src mladost'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the home city for the stadion src mladost? ### Input: CREATE TABLE table_44912 (\n \"Team\" text,\n \"Manager\" text,\n \"Home city\" text,\n \"Stadium\" text,\n \"Capacity\" real\n) ### Response: SELECT \"Home city\" FROM table_44912 WHERE \"Stadium\" = 'stadion src mladost'"} {"instruction":"How close am I to the sportsmanship badge?.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)","response":"WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS \"post_link\", p1.OwnerUserId AS \"user_link\", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY p1.Score DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How close am I to the sportsmanship badge?. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n) ### Response: WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS \"post_link\", p1.OwnerUserId AS \"user_link\", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY p1.Score DESC"} {"instruction":"list ground transportation in BALTIMORE","input":"CREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)","response":"SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list ground transportation in BALTIMORE ### Input: CREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n) ### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code"} {"instruction":"How many players are listed for the school\/club team Washington?","input":"CREATE TABLE table_20094 (\n \"Name\" text,\n \"Position\" text,\n \"Number\" real,\n \"School\/Club Team\" text,\n \"Season\" text,\n \"Acquisition via\" text\n)","response":"SELECT COUNT(\"Name\") FROM table_20094 WHERE \"School\/Club Team\" = 'Washington'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many players are listed for the school\/club team Washington? ### Input: CREATE TABLE table_20094 (\n \"Name\" text,\n \"Position\" text,\n \"Number\" real,\n \"School\/Club Team\" text,\n \"Season\" text,\n \"Acquisition via\" text\n) ### Response: SELECT COUNT(\"Name\") FROM table_20094 WHERE \"School\/Club Team\" = 'Washington'"} {"instruction":"What type of chipset is in the Precision t3400 model with the PCI Express graphics?","input":"CREATE TABLE table_name_97 (\n chipset VARCHAR,\n graphics VARCHAR,\n model VARCHAR\n)","response":"SELECT chipset FROM table_name_97 WHERE graphics = \"pci express\" AND model = \"precision t3400\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of chipset is in the Precision t3400 model with the PCI Express graphics? ### Input: CREATE TABLE table_name_97 (\n chipset VARCHAR,\n graphics VARCHAR,\n model VARCHAR\n) ### Response: SELECT chipset FROM table_name_97 WHERE graphics = \"pci express\" AND model = \"precision t3400\""} {"instruction":"Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.","input":"CREATE TABLE dorm (\n dormid number,\n dorm_name text,\n student_capacity number,\n gender text\n)\n\nCREATE TABLE lives_in (\n stuid number,\n dormid number,\n room_number number\n)\n\nCREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n)\n\nCREATE TABLE has_amenity (\n dormid number,\n amenid number\n)\n\nCREATE TABLE dorm_amenity (\n amenid number,\n amenity_name text\n)","response":"SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100. ### Input: CREATE TABLE dorm (\n dormid number,\n dorm_name text,\n student_capacity number,\n gender text\n)\n\nCREATE TABLE lives_in (\n stuid number,\n dormid number,\n room_number number\n)\n\nCREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n)\n\nCREATE TABLE has_amenity (\n dormid number,\n amenid number\n)\n\nCREATE TABLE dorm_amenity (\n amenid number,\n amenity_name text\n) ### Response: SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100"} {"instruction":"For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis.","input":"CREATE TABLE Customers (\n Customer_ID INTEGER,\n Customer_Details VARCHAR(255)\n)\n\nCREATE TABLE Payments (\n Payment_ID INTEGER,\n Settlement_ID INTEGER,\n Payment_Method_Code VARCHAR(255),\n Date_Payment_Made DATE,\n Amount_Payment INTEGER\n)\n\nCREATE TABLE Settlements (\n Settlement_ID INTEGER,\n Claim_ID INTEGER,\n Date_Claim_Made DATE,\n Date_Claim_Settled DATE,\n Amount_Claimed INTEGER,\n Amount_Settled INTEGER,\n Customer_Policy_ID INTEGER\n)\n\nCREATE TABLE Claims (\n Claim_ID INTEGER,\n Policy_ID INTEGER,\n Date_Claim_Made DATE,\n Date_Claim_Settled DATE,\n Amount_Claimed INTEGER,\n Amount_Settled INTEGER\n)\n\nCREATE TABLE Customer_Policies (\n Policy_ID INTEGER,\n Customer_ID INTEGER,\n Policy_Type_Code CHAR(15),\n Start_Date DATE,\n End_Date DATE\n)","response":"SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis. ### Input: CREATE TABLE Customers (\n Customer_ID INTEGER,\n Customer_Details VARCHAR(255)\n)\n\nCREATE TABLE Payments (\n Payment_ID INTEGER,\n Settlement_ID INTEGER,\n Payment_Method_Code VARCHAR(255),\n Date_Payment_Made DATE,\n Amount_Payment INTEGER\n)\n\nCREATE TABLE Settlements (\n Settlement_ID INTEGER,\n Claim_ID INTEGER,\n Date_Claim_Made DATE,\n Date_Claim_Settled DATE,\n Amount_Claimed INTEGER,\n Amount_Settled INTEGER,\n Customer_Policy_ID INTEGER\n)\n\nCREATE TABLE Claims (\n Claim_ID INTEGER,\n Policy_ID INTEGER,\n Date_Claim_Made DATE,\n Date_Claim_Settled DATE,\n Amount_Claimed INTEGER,\n Amount_Settled INTEGER\n)\n\nCREATE TABLE Customer_Policies (\n Policy_ID INTEGER,\n Customer_ID INTEGER,\n Policy_Type_Code CHAR(15),\n Start_Date DATE,\n End_Date DATE\n) ### Response: SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'"} {"instruction":"Tell me the highest total when the horse is spender s","input":"CREATE TABLE table_name_99 (\n total INTEGER,\n horse VARCHAR\n)","response":"SELECT MAX(total) FROM table_name_99 WHERE horse = \"spender s\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the highest total when the horse is spender s ### Input: CREATE TABLE table_name_99 (\n total INTEGER,\n horse VARCHAR\n) ### Response: SELECT MAX(total) FROM table_name_99 WHERE horse = \"spender s\""} {"instruction":"What is the air date for 'there goes the bride'?","input":"CREATE TABLE table_19608 (\n \"Series #\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production Code\" real,\n \"U.S. viewers (millions)\" text\n)","response":"SELECT \"Original air date\" FROM table_19608 WHERE \"Title\" = 'There Goes the Bride'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the air date for 'there goes the bride'? ### Input: CREATE TABLE table_19608 (\n \"Series #\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production Code\" real,\n \"U.S. viewers (millions)\" text\n) ### Response: SELECT \"Original air date\" FROM table_19608 WHERE \"Title\" = 'There Goes the Bride'"} {"instruction":"list the flights from ST. PAUL to SAN JOSE and from ST. PAUL to HOUSTON","input":"CREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN JOSE') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'HOUSTON')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the flights from ST. PAUL to SAN JOSE and from ST. PAUL to HOUSTON ### Input: CREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN JOSE') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'HOUSTON')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code"} {"instruction":"Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please.","input":"CREATE TABLE train (\n Train_ID int,\n Name text,\n Time text,\n Service text\n)\n\nCREATE TABLE station (\n Station_ID int,\n Name text,\n Annual_entry_exit real,\n Annual_interchanges real,\n Total_Passengers real,\n Location text,\n Main_Services text,\n Number_of_Platforms int\n)\n\nCREATE TABLE train_station (\n Train_ID int,\n Station_ID int\n)","response":"SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please. ### Input: CREATE TABLE train (\n Train_ID int,\n Name text,\n Time text,\n Service text\n)\n\nCREATE TABLE station (\n Station_ID int,\n Name text,\n Annual_entry_exit real,\n Annual_interchanges real,\n Total_Passengers real,\n Location text,\n Main_Services text,\n Number_of_Platforms int\n)\n\nCREATE TABLE train_station (\n Train_ID int,\n Station_ID int\n) ### Response: SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC"} {"instruction":"what is the wins when the f\/laps is test driver and team is lotus racing?","input":"CREATE TABLE table_44077 (\n \"Season\" text,\n \"Series\" text,\n \"Team\" text,\n \"Races\" text,\n \"Wins\" text,\n \"Poles\" text,\n \"F\/Laps\" text,\n \"Podiums\" text,\n \"Points\" text,\n \"Pos.\" text\n)","response":"SELECT \"Wins\" FROM table_44077 WHERE \"F\/Laps\" = 'test driver' AND \"Team\" = 'lotus racing'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the wins when the f\/laps is test driver and team is lotus racing? ### Input: CREATE TABLE table_44077 (\n \"Season\" text,\n \"Series\" text,\n \"Team\" text,\n \"Races\" text,\n \"Wins\" text,\n \"Poles\" text,\n \"F\/Laps\" text,\n \"Podiums\" text,\n \"Points\" text,\n \"Pos.\" text\n) ### Response: SELECT \"Wins\" FROM table_44077 WHERE \"F\/Laps\" = 'test driver' AND \"Team\" = 'lotus racing'"} {"instruction":"What was the final record for the game in which Dirk Nowitzki (19) had the high points?","input":"CREATE TABLE table_21474 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Record\" FROM table_21474 WHERE \"High points\" = 'Dirk Nowitzki (19)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the final record for the game in which Dirk Nowitzki (19) had the high points? ### Input: CREATE TABLE table_21474 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Record\" FROM table_21474 WHERE \"High points\" = 'Dirk Nowitzki (19)'"} {"instruction":"What is the record where high assists is pierce (6)?","input":"CREATE TABLE table_17290 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Record\" FROM table_17290 WHERE \"High assists\" = 'Pierce (6)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the record where high assists is pierce (6)? ### Input: CREATE TABLE table_17290 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Record\" FROM table_17290 WHERE \"High assists\" = 'Pierce (6)'"} {"instruction":"Which Chinese has a Pali of atappa?","input":"CREATE TABLE table_45211 (\n \"English\" text,\n \"Pali\" text,\n \"Sanskrit\" text,\n \"Chinese\" text,\n \"Tibetan\" text\n)","response":"SELECT \"Chinese\" FROM table_45211 WHERE \"Pali\" = 'atappa'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Chinese has a Pali of atappa? ### Input: CREATE TABLE table_45211 (\n \"English\" text,\n \"Pali\" text,\n \"Sanskrit\" text,\n \"Chinese\" text,\n \"Tibetan\" text\n) ### Response: SELECT \"Chinese\" FROM table_45211 WHERE \"Pali\" = 'atappa'"} {"instruction":"what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago?","input":"CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t2.culturetakentime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago? ### Input: CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t2.culturetakentime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4"} {"instruction":"what was the number of aneurysm resection \/ repair procedures that were performed a year before?","input":"CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection \/ repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the number of aneurysm resection \/ repair procedures that were performed a year before? ### Input: CREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection \/ repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')"} {"instruction":"count the number of patients whose ethnicity is asian and diagnoses long title is suicide and self-inflicted injury by hanging?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = \"ASIAN\" AND diagnoses.long_title = \"Suicide and self-inflicted injury by hanging\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose ethnicity is asian and diagnoses long title is suicide and self-inflicted injury by hanging? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = \"ASIAN\" AND diagnoses.long_title = \"Suicide and self-inflicted injury by hanging\""} {"instruction":"What is the total number of losses for the Team of Montreal with Goals For larger than 29?","input":"CREATE TABLE table_11770 (\n \"Team\" text,\n \"Games Played\" real,\n \"Wins\" real,\n \"Losses\" real,\n \"Ties\" real,\n \"Goals For\" real,\n \"Goals Against\" real\n)","response":"SELECT COUNT(\"Losses\") FROM table_11770 WHERE \"Goals For\" > '29' AND \"Team\" = 'montreal'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of losses for the Team of Montreal with Goals For larger than 29? ### Input: CREATE TABLE table_11770 (\n \"Team\" text,\n \"Games Played\" real,\n \"Wins\" real,\n \"Losses\" real,\n \"Ties\" real,\n \"Goals For\" real,\n \"Goals Against\" real\n) ### Response: SELECT COUNT(\"Losses\") FROM table_11770 WHERE \"Goals For\" > '29' AND \"Team\" = 'montreal'"} {"instruction":"what is the side-chain polarity for the amino acid with the 1-letter v?","input":"CREATE TABLE table_55835 (\n \"Amino Acid\" text,\n \"3-Letter\" text,\n \"1-Letter\" text,\n \"Side-chain polarity\" text,\n \"Side-chain charge (pH 7.4)\" text,\n \"Hydropathy index\" text\n)","response":"SELECT \"Side-chain polarity\" FROM table_55835 WHERE \"1-Letter\" = 'v'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the side-chain polarity for the amino acid with the 1-letter v? ### Input: CREATE TABLE table_55835 (\n \"Amino Acid\" text,\n \"3-Letter\" text,\n \"1-Letter\" text,\n \"Side-chain polarity\" text,\n \"Side-chain charge (pH 7.4)\" text,\n \"Hydropathy index\" text\n) ### Response: SELECT \"Side-chain polarity\" FROM table_55835 WHERE \"1-Letter\" = 'v'"} {"instruction":"What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s?","input":"CREATE TABLE table_name_93 (\n cuts_made INTEGER,\n top_10 VARCHAR,\n wins VARCHAR\n)","response":"SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s? ### Input: CREATE TABLE table_name_93 (\n cuts_made INTEGER,\n top_10 VARCHAR,\n wins VARCHAR\n) ### Response: SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1"} {"instruction":"count the number of patients born before the year 2049.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < \"2049\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients born before the year 2049. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < \"2049\""} {"instruction":"give me the number of patients whose primary disease is newborn and procedure icd9 code is 5361?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = \"NEWBORN\" AND procedures.icd9_code = \"5361\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is newborn and procedure icd9 code is 5361? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = \"NEWBORN\" AND procedures.icd9_code = \"5361\""} {"instruction":"What are the open dates and years for the shop named Apple?","input":"CREATE TABLE device (\n device_id number,\n device text,\n carrier text,\n package_version text,\n applications text,\n software_platform text\n)\n\nCREATE TABLE stock (\n shop_id number,\n device_id number,\n quantity number\n)\n\nCREATE TABLE shop (\n shop_id number,\n shop_name text,\n location text,\n open_date text,\n open_year number\n)","response":"SELECT open_date, open_year FROM shop WHERE shop_name = \"Apple\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the open dates and years for the shop named Apple? ### Input: CREATE TABLE device (\n device_id number,\n device text,\n carrier text,\n package_version text,\n applications text,\n software_platform text\n)\n\nCREATE TABLE stock (\n shop_id number,\n device_id number,\n quantity number\n)\n\nCREATE TABLE shop (\n shop_id number,\n shop_name text,\n location text,\n open_date text,\n open_year number\n) ### Response: SELECT open_date, open_year FROM shop WHERE shop_name = \"Apple\""} {"instruction":"specify the type and route of administration of drug digoxin","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = \"Digoxin\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the type and route of administration of drug digoxin ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = \"Digoxin\""} {"instruction":"return me the paper after 2000 in VLDB conference with more than 200 citations .","input":"CREATE TABLE domain_publication (\n did int,\n pid int\n)\n\nCREATE TABLE domain_conference (\n cid int,\n did int\n)\n\nCREATE TABLE publication_keyword (\n kid int,\n pid int\n)\n\nCREATE TABLE domain_keyword (\n did int,\n kid int\n)\n\nCREATE TABLE author (\n aid int,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE publication (\n abstract varchar,\n cid int,\n citation_num int,\n jid int,\n pid int,\n reference_num int,\n title varchar,\n year int\n)\n\nCREATE TABLE journal (\n homepage varchar,\n jid int,\n name varchar\n)\n\nCREATE TABLE organization (\n continent varchar,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE keyword (\n keyword varchar,\n kid int\n)\n\nCREATE TABLE domain (\n did int,\n name varchar\n)\n\nCREATE TABLE writes (\n aid int,\n pid int\n)\n\nCREATE TABLE domain_author (\n aid int,\n did int\n)\n\nCREATE TABLE domain_journal (\n did int,\n jid int\n)\n\nCREATE TABLE cite (\n cited int,\n citing int\n)\n\nCREATE TABLE conference (\n cid int,\n homepage varchar,\n name varchar\n)","response":"SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000","source":"academic","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: return me the paper after 2000 in VLDB conference with more than 200 citations . ### Input: CREATE TABLE domain_publication (\n did int,\n pid int\n)\n\nCREATE TABLE domain_conference (\n cid int,\n did int\n)\n\nCREATE TABLE publication_keyword (\n kid int,\n pid int\n)\n\nCREATE TABLE domain_keyword (\n did int,\n kid int\n)\n\nCREATE TABLE author (\n aid int,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE publication (\n abstract varchar,\n cid int,\n citation_num int,\n jid int,\n pid int,\n reference_num int,\n title varchar,\n year int\n)\n\nCREATE TABLE journal (\n homepage varchar,\n jid int,\n name varchar\n)\n\nCREATE TABLE organization (\n continent varchar,\n homepage varchar,\n name varchar,\n oid int\n)\n\nCREATE TABLE keyword (\n keyword varchar,\n kid int\n)\n\nCREATE TABLE domain (\n did int,\n name varchar\n)\n\nCREATE TABLE writes (\n aid int,\n pid int\n)\n\nCREATE TABLE domain_author (\n aid int,\n did int\n)\n\nCREATE TABLE domain_journal (\n did int,\n jid int\n)\n\nCREATE TABLE cite (\n cited int,\n citing int\n)\n\nCREATE TABLE conference (\n cid int,\n homepage varchar,\n name varchar\n) ### Response: SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000"} {"instruction":"May I look at my transcript ?","input":"CREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)","response":"SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: May I look at my transcript ? ### Input: CREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n) ### Response: SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1"} {"instruction":"All questions with a *single* tag.","input":"CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"SELECT Id AS \"post_link\", AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND ClosedDate IS NULL ORDER BY CreationDate DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: All questions with a *single* tag. ### Input: CREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: SELECT Id AS \"post_link\", AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND ClosedDate IS NULL ORDER BY CreationDate DESC"} {"instruction":"Show me a scatter plot of time of purchase and age for .","input":"CREATE TABLE happy_hour (\n HH_ID int,\n Shop_ID int,\n Month text,\n Num_of_shaff_in_charge int\n)\n\nCREATE TABLE member (\n Member_ID int,\n Name text,\n Membership_card text,\n Age int,\n Time_of_purchase int,\n Level_of_membership int,\n Address text\n)\n\nCREATE TABLE shop (\n Shop_ID int,\n Address text,\n Num_of_staff text,\n Score real,\n Open_Year text\n)\n\nCREATE TABLE happy_hour_member (\n HH_ID int,\n Member_ID int,\n Total_amount real\n)","response":"SELECT Time_of_purchase, Age FROM member","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a scatter plot of time of purchase and age for . ### Input: CREATE TABLE happy_hour (\n HH_ID int,\n Shop_ID int,\n Month text,\n Num_of_shaff_in_charge int\n)\n\nCREATE TABLE member (\n Member_ID int,\n Name text,\n Membership_card text,\n Age int,\n Time_of_purchase int,\n Level_of_membership int,\n Address text\n)\n\nCREATE TABLE shop (\n Shop_ID int,\n Address text,\n Num_of_staff text,\n Score real,\n Open_Year text\n)\n\nCREATE TABLE happy_hour_member (\n HH_ID int,\n Member_ID int,\n Total_amount real\n) ### Response: SELECT Time_of_purchase, Age FROM member"} {"instruction":"actually what are the nonstop flights from LAS VEGAS to BURBANK on saturday 5 22","input":"CREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LAS VEGAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.stops = 0","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: actually what are the nonstop flights from LAS VEGAS to BURBANK on saturday 5 22 ### Input: CREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LAS VEGAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.stops = 0"} {"instruction":"What shirt No has a Birth Date of April 12, 1986 (age27)?","input":"CREATE TABLE table_name_63 (\n shirt_no INTEGER,\n birth_date VARCHAR\n)","response":"SELECT MIN(shirt_no) FROM table_name_63 WHERE birth_date = \"april 12, 1986 (age27)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shirt No has a Birth Date of April 12, 1986 (age27)? ### Input: CREATE TABLE table_name_63 (\n shirt_no INTEGER,\n birth_date VARCHAR\n) ### Response: SELECT MIN(shirt_no) FROM table_name_63 WHERE birth_date = \"april 12, 1986 (age27)\""} {"instruction":"What is the smallest lost when position is larger than 6, drawn is 7, and the points stat is less than 15?","input":"CREATE TABLE table_34592 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Against\" real,\n \"Difference\" text\n)","response":"SELECT MIN(\"Lost\") FROM table_34592 WHERE \"Position\" > '6' AND \"Drawn\" = '7' AND \"Points\" < '15'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest lost when position is larger than 6, drawn is 7, and the points stat is less than 15? ### Input: CREATE TABLE table_34592 (\n \"Position\" real,\n \"Team\" text,\n \"Points\" real,\n \"Played\" real,\n \"Drawn\" real,\n \"Lost\" real,\n \"Against\" real,\n \"Difference\" text\n) ### Response: SELECT MIN(\"Lost\") FROM table_34592 WHERE \"Position\" > '6' AND \"Drawn\" = '7' AND \"Points\" < '15'"} {"instruction":"What was the grid for Bruno Junqueira for Dale Coyne Racing?","input":"CREATE TABLE table_name_45 (\n grid VARCHAR,\n team VARCHAR,\n driver VARCHAR\n)","response":"SELECT grid FROM table_name_45 WHERE team = \"dale coyne racing\" AND driver = \"bruno junqueira\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the grid for Bruno Junqueira for Dale Coyne Racing? ### Input: CREATE TABLE table_name_45 (\n grid VARCHAR,\n team VARCHAR,\n driver VARCHAR\n) ### Response: SELECT grid FROM table_name_45 WHERE team = \"dale coyne racing\" AND driver = \"bruno junqueira\""} {"instruction":"what is the number of patients whose lab test fluid is urine?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = \"Urine\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose lab test fluid is urine? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = \"Urine\""} {"instruction":"what is the number of patients with discharge location as snf diagnosed with primary disease hyperglycemia?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"SNF\" AND demographic.diagnosis = \"HYPERGLYCEMIA\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients with discharge location as snf diagnosed with primary disease hyperglycemia? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = \"SNF\" AND demographic.diagnosis = \"HYPERGLYCEMIA\""} {"instruction":"what was the organism found in the last urine, catheter specimen microbiology test for patient 025-19271 in their last hospital visit?","input":"CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)","response":"SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'urine, catheter specimen' ORDER BY microlab.culturetakentime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the organism found in the last urine, catheter specimen microbiology test for patient 025-19271 in their last hospital visit? ### Input: CREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n) ### Response: SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'urine, catheter specimen' ORDER BY microlab.culturetakentime DESC LIMIT 1"} {"instruction":"how many patients who have private insurance stayed in hospital for more than 9 days?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = \"Private\" AND demographic.days_stay > \"9\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients who have private insurance stayed in hospital for more than 9 days? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = \"Private\" AND demographic.days_stay > \"9\""} {"instruction":"get data for inverted index assignment.","input":"CREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)","response":"SELECT Id, Body, Tags FROM Posts WHERE CreationDate LIKE '%2018%' LIMIT 1000","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get data for inverted index assignment. ### Input: CREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n) ### Response: SELECT Id, Body, Tags FROM Posts WHERE CreationDate LIKE '%2018%' LIMIT 1000"} {"instruction":"In what year was Yauco, which had over 42,043 people in 2010, founded?","input":"CREATE TABLE table_65006 (\n \"Municipality\" text,\n \"FIPS code\" real,\n \"Founded\" real,\n \"Population (2010)\" real,\n \"Area\" text\n)","response":"SELECT AVG(\"Founded\") FROM table_65006 WHERE \"Municipality\" = 'yauco' AND \"Population (2010)\" > '42,043'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what year was Yauco, which had over 42,043 people in 2010, founded? ### Input: CREATE TABLE table_65006 (\n \"Municipality\" text,\n \"FIPS code\" real,\n \"Founded\" real,\n \"Population (2010)\" real,\n \"Area\" text\n) ### Response: SELECT AVG(\"Founded\") FROM table_65006 WHERE \"Municipality\" = 'yauco' AND \"Population (2010)\" > '42,043'"} {"instruction":"Return a histogram on what are the first names and ids for customers who have two or more accounts?","input":"CREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n product_quantity VARCHAR(50),\n other_order_item_details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n parent_product_id INTEGER,\n production_type_code VARCHAR(15),\n unit_price DECIMAL(19,4),\n product_name VARCHAR(80),\n product_color VARCHAR(20),\n product_size VARCHAR(20)\n)\n\nCREATE TABLE Invoices (\n invoice_number INTEGER,\n order_id INTEGER,\n invoice_date DATETIME\n)\n\nCREATE TABLE Product_Categories (\n production_type_code VARCHAR(15),\n product_type_description VARCHAR(80),\n vat_rating DECIMAL(19,4)\n)\n\nCREATE TABLE Orders (\n order_id INTEGER,\n customer_id INTEGER,\n date_order_placed DATETIME,\n order_details VARCHAR(255)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n account_id INTEGER,\n invoice_number INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DECIMAL(19,4),\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Line_Items (\n order_item_id INTEGER,\n invoice_number INTEGER,\n product_id INTEGER,\n product_title VARCHAR(80),\n product_quantity VARCHAR(50),\n product_price DECIMAL(19,4),\n derived_product_cost DECIMAL(19,4),\n derived_vat_payable DECIMAL(19,4),\n derived_total_cost DECIMAL(19,4)\n)\n\nCREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n date_account_opened DATETIME,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(50),\n customer_middle_initial VARCHAR(1),\n customer_last_name VARCHAR(50),\n gender VARCHAR(1),\n email_address VARCHAR(255),\n login_name VARCHAR(80),\n login_password VARCHAR(20),\n phone_number VARCHAR(255),\n town_city VARCHAR(50),\n state_county_province VARCHAR(50),\n country VARCHAR(50)\n)","response":"SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on what are the first names and ids for customers who have two or more accounts? ### Input: CREATE TABLE Order_Items (\n order_item_id INTEGER,\n order_id INTEGER,\n product_id INTEGER,\n product_quantity VARCHAR(50),\n other_order_item_details VARCHAR(255)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n parent_product_id INTEGER,\n production_type_code VARCHAR(15),\n unit_price DECIMAL(19,4),\n product_name VARCHAR(80),\n product_color VARCHAR(20),\n product_size VARCHAR(20)\n)\n\nCREATE TABLE Invoices (\n invoice_number INTEGER,\n order_id INTEGER,\n invoice_date DATETIME\n)\n\nCREATE TABLE Product_Categories (\n production_type_code VARCHAR(15),\n product_type_description VARCHAR(80),\n vat_rating DECIMAL(19,4)\n)\n\nCREATE TABLE Orders (\n order_id INTEGER,\n customer_id INTEGER,\n date_order_placed DATETIME,\n order_details VARCHAR(255)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n account_id INTEGER,\n invoice_number INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DECIMAL(19,4),\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Line_Items (\n order_item_id INTEGER,\n invoice_number INTEGER,\n product_id INTEGER,\n product_title VARCHAR(80),\n product_quantity VARCHAR(50),\n product_price DECIMAL(19,4),\n derived_product_cost DECIMAL(19,4),\n derived_vat_payable DECIMAL(19,4),\n derived_total_cost DECIMAL(19,4)\n)\n\nCREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n date_account_opened DATETIME,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(50),\n customer_middle_initial VARCHAR(1),\n customer_last_name VARCHAR(50),\n gender VARCHAR(1),\n email_address VARCHAR(255),\n login_name VARCHAR(80),\n login_password VARCHAR(20),\n phone_number VARCHAR(255),\n town_city VARCHAR(50),\n state_county_province VARCHAR(50),\n country VARCHAR(50)\n) ### Response: SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id"} {"instruction":"what was the name of the organism found during the first other microbiology examination of patient 031-23724 in their last hospital encounter?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'other' ORDER BY microlab.culturetakentime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the organism found during the first other microbiology examination of patient 031-23724 in their last hospital encounter? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'other' ORDER BY microlab.culturetakentime LIMIT 1"} {"instruction":"what number of patients primarily diagnosed for coronary artery disease were given drug by inhalation?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = \"CORONARY ARTERY DISEASE\" AND prescriptions.route = \"INHALATION\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients primarily diagnosed for coronary artery disease were given drug by inhalation? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = \"CORONARY ARTERY DISEASE\" AND prescriptions.route = \"INHALATION\""} {"instruction":"What is the home team with scarborough as the away team?","input":"CREATE TABLE table_name_50 (\n home_team VARCHAR,\n away_team VARCHAR\n)","response":"SELECT home_team FROM table_name_50 WHERE away_team = \"scarborough\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the home team with scarborough as the away team? ### Input: CREATE TABLE table_name_50 (\n home_team VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT home_team FROM table_name_50 WHERE away_team = \"scarborough\""} {"instruction":"What upper level electives are offered for CS majors ?","input":"CREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)","response":"SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What upper level electives are offered for CS majors ? ### Input: CREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id"} {"instruction":"For the 2nd string of Do and an Accord du 1st string of FA what is the Depart de la main gauche?","input":"CREATE TABLE table_76895 (\n \"Mode\" text,\n \"D\\u00e9part de la main gauche\" text,\n \"Accord du 1st string\" text,\n \"2nd string\" text,\n \"3rd string\" text\n)","response":"SELECT \"D\\u00e9part de la main gauche\" FROM table_76895 WHERE \"2nd string\" = 'do' AND \"Accord du 1st string\" = 'fa'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the 2nd string of Do and an Accord du 1st string of FA what is the Depart de la main gauche? ### Input: CREATE TABLE table_76895 (\n \"Mode\" text,\n \"D\\u00e9part de la main gauche\" text,\n \"Accord du 1st string\" text,\n \"2nd string\" text,\n \"3rd string\" text\n) ### Response: SELECT \"D\\u00e9part de la main gauche\" FROM table_76895 WHERE \"2nd string\" = 'do' AND \"Accord du 1st string\" = 'fa'"} {"instruction":"Find the total number of students for each department with a bar chart, and could you list y axis in descending order?","input":"CREATE TABLE classroom (\n building varchar(15),\n room_number varchar(7),\n capacity numeric(4,0)\n)\n\nCREATE TABLE advisor (\n s_ID varchar(5),\n i_ID varchar(5)\n)\n\nCREATE TABLE instructor (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n salary numeric(8,2)\n)\n\nCREATE TABLE prereq (\n course_id varchar(8),\n prereq_id varchar(8)\n)\n\nCREATE TABLE teaches (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0)\n)\n\nCREATE TABLE section (\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n building varchar(15),\n room_number varchar(7),\n time_slot_id varchar(4)\n)\n\nCREATE TABLE takes (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n grade varchar(2)\n)\n\nCREATE TABLE department (\n dept_name varchar(20),\n building varchar(15),\n budget numeric(12,2)\n)\n\nCREATE TABLE course (\n course_id varchar(8),\n title varchar(50),\n dept_name varchar(20),\n credits numeric(2,0)\n)\n\nCREATE TABLE student (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n tot_cred numeric(3,0)\n)\n\nCREATE TABLE time_slot (\n time_slot_id varchar(4),\n day varchar(1),\n start_hr numeric(2),\n start_min numeric(2),\n end_hr numeric(2),\n end_min numeric(2)\n)","response":"SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the total number of students for each department with a bar chart, and could you list y axis in descending order? ### Input: CREATE TABLE classroom (\n building varchar(15),\n room_number varchar(7),\n capacity numeric(4,0)\n)\n\nCREATE TABLE advisor (\n s_ID varchar(5),\n i_ID varchar(5)\n)\n\nCREATE TABLE instructor (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n salary numeric(8,2)\n)\n\nCREATE TABLE prereq (\n course_id varchar(8),\n prereq_id varchar(8)\n)\n\nCREATE TABLE teaches (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0)\n)\n\nCREATE TABLE section (\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n building varchar(15),\n room_number varchar(7),\n time_slot_id varchar(4)\n)\n\nCREATE TABLE takes (\n ID varchar(5),\n course_id varchar(8),\n sec_id varchar(8),\n semester varchar(6),\n year numeric(4,0),\n grade varchar(2)\n)\n\nCREATE TABLE department (\n dept_name varchar(20),\n building varchar(15),\n budget numeric(12,2)\n)\n\nCREATE TABLE course (\n course_id varchar(8),\n title varchar(50),\n dept_name varchar(20),\n credits numeric(2,0)\n)\n\nCREATE TABLE student (\n ID varchar(5),\n name varchar(20),\n dept_name varchar(20),\n tot_cred numeric(3,0)\n)\n\nCREATE TABLE time_slot (\n time_slot_id varchar(4),\n day varchar(1),\n start_hr numeric(2),\n start_min numeric(2),\n end_hr numeric(2),\n end_min numeric(2)\n) ### Response: SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC"} {"instruction":"does toronto 's population grow more or less than hamilton 's ?","input":"CREATE TABLE table_204_113 (\n id number,\n \"rank\" number,\n \"area\" text,\n \"state\/\\nprovince\" text,\n \"csa\/cma\\n2009 population\" number,\n \"projected\\n2025 population\" number,\n \"projected increase\\n2009-2025\" number\n)","response":"SELECT (SELECT \"projected increase\\n2009-2025\" FROM table_204_113 WHERE \"area\" = 'toronto') > (SELECT \"projected increase\\n2009-2025\" FROM table_204_113 WHERE \"area\" = 'hamilton')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does toronto 's population grow more or less than hamilton 's ? ### Input: CREATE TABLE table_204_113 (\n id number,\n \"rank\" number,\n \"area\" text,\n \"state\/\\nprovince\" text,\n \"csa\/cma\\n2009 population\" number,\n \"projected\\n2025 population\" number,\n \"projected increase\\n2009-2025\" number\n) ### Response: SELECT (SELECT \"projected increase\\n2009-2025\" FROM table_204_113 WHERE \"area\" = 'toronto') > (SELECT \"projected increase\\n2009-2025\" FROM table_204_113 WHERE \"area\" = 'hamilton')"} {"instruction":"provide the number of patients whose marital status is married and admission year is less than 2108?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = \"MARRIED\" AND demographic.admityear < \"2108\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose marital status is married and admission year is less than 2108? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = \"MARRIED\" AND demographic.admityear < \"2108\""} {"instruction":"What is the draw number that has 59 points?","input":"CREATE TABLE table_54761 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Points\" real,\n \"Place\" text\n)","response":"SELECT AVG(\"Draw\") FROM table_54761 WHERE \"Points\" = '59'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the draw number that has 59 points? ### Input: CREATE TABLE table_54761 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Points\" real,\n \"Place\" text\n) ### Response: SELECT AVG(\"Draw\") FROM table_54761 WHERE \"Points\" = '59'"} {"instruction":"what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\\cardiac cath?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = \"ENGL\" AND demographic.diagnosis = \"HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\\CARDIAC CATH\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\\cardiac cath? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = \"ENGL\" AND demographic.diagnosis = \"HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\\CARDIAC CATH\""} {"instruction":"what was patient 025-30850's weight the last time in 06\/2105?","input":"CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)","response":"SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 025-30850's weight the last time in 06\/2105? ### Input: CREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n) ### Response: SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT 1"} {"instruction":"Visualize a pie chart about the proportion of Team_Name and ACC_Percent.","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT Team_Name, ACC_Percent FROM basketball_match","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a pie chart about the proportion of Team_Name and ACC_Percent. ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT Team_Name, ACC_Percent FROM basketball_match"} {"instruction":"please show me flights from PITTSBURGH to BOSTON on saturday morning after 800","input":"CREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 800 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: please show me flights from PITTSBURGH to BOSTON on saturday morning after 800 ### Input: CREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 800 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200"} {"instruction":"Who had a Qualifying 2 time over 58.669 for Team Australia?","input":"CREATE TABLE table_38483 (\n \"Name\" text,\n \"Team\" text,\n \"Qual 1\" text,\n \"Qual 2\" real,\n \"Best\" real\n)","response":"SELECT \"Name\" FROM table_38483 WHERE \"Qual 2\" > '58.669' AND \"Team\" = 'team australia'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had a Qualifying 2 time over 58.669 for Team Australia? ### Input: CREATE TABLE table_38483 (\n \"Name\" text,\n \"Team\" text,\n \"Qual 1\" text,\n \"Qual 2\" real,\n \"Best\" real\n) ### Response: SELECT \"Name\" FROM table_38483 WHERE \"Qual 2\" > '58.669' AND \"Team\" = 'team australia'"} {"instruction":"flights from WESTCHESTER COUNTY to ST. PAUL","input":"CREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from WESTCHESTER COUNTY to ST. PAUL ### Input: CREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"How many songs have a shared vocal?","input":"CREATE TABLE vocals (\n songid VARCHAR\n)\n\nCREATE TABLE songs (\n songid VARCHAR\n)","response":"SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = \"shared\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many songs have a shared vocal? ### Input: CREATE TABLE vocals (\n songid VARCHAR\n)\n\nCREATE TABLE songs (\n songid VARCHAR\n) ### Response: SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = \"shared\""} {"instruction":"Tell me the lowest kazakhstan for kyrghizstan of 4.62 and belarus less than 2.46","input":"CREATE TABLE table_74485 (\n \"Year\" real,\n \"Azerbaijan\" real,\n \"Armenia\" real,\n \"Belarus\" real,\n \"Georgia\" real,\n \"Kazakhstan\" real,\n \"Kyrghizstan\" real,\n \"Latvia\" real,\n \"Lithuania\" real,\n \"Moldova\" real,\n \"Russia\" real,\n \"Tajikistan\" real,\n \"Turkmenikstan\" real,\n \"Uzbekistan\" real,\n \"Ukraine\" real,\n \"Estonia\" real\n)","response":"SELECT MIN(\"Kazakhstan\") FROM table_74485 WHERE \"Kyrghizstan\" = '4.62' AND \"Belarus\" < '2.46'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the lowest kazakhstan for kyrghizstan of 4.62 and belarus less than 2.46 ### Input: CREATE TABLE table_74485 (\n \"Year\" real,\n \"Azerbaijan\" real,\n \"Armenia\" real,\n \"Belarus\" real,\n \"Georgia\" real,\n \"Kazakhstan\" real,\n \"Kyrghizstan\" real,\n \"Latvia\" real,\n \"Lithuania\" real,\n \"Moldova\" real,\n \"Russia\" real,\n \"Tajikistan\" real,\n \"Turkmenikstan\" real,\n \"Uzbekistan\" real,\n \"Ukraine\" real,\n \"Estonia\" real\n) ### Response: SELECT MIN(\"Kazakhstan\") FROM table_74485 WHERE \"Kyrghizstan\" = '4.62' AND \"Belarus\" < '2.46'"} {"instruction":"how many hours has it been since the first time patient 19428 stayed in careunit ccu in their current hospital visit.","input":"CREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours has it been since the first time patient 19428 stayed in careunit ccu in their current hospital visit. ### Input: CREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime LIMIT 1"} {"instruction":"how many games were played in total ?","input":"CREATE TABLE table_204_418 (\n id number,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"overall record\" text,\n \"scba record\" text\n)","response":"SELECT COUNT(*) FROM table_204_418","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many games were played in total ? ### Input: CREATE TABLE table_204_418 (\n id number,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"overall record\" text,\n \"scba record\" text\n) ### Response: SELECT COUNT(*) FROM table_204_418"} {"instruction":"For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart.","input":"CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)","response":"SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. ### Input: CREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> \"null\" OR DEPARTMENT_ID <> 40"} {"instruction":"which institution has the highest amount of enrollment ?","input":"CREATE TABLE table_204_442 (\n id number,\n \"institution\" text,\n \"location\" text,\n \"enrollment\" number,\n \"nickname\" text,\n \"varsity\\nsports\" number,\n \"rugby\\nsince\" text,\n \"head coach\" text\n)","response":"SELECT \"institution\" FROM table_204_442 ORDER BY \"enrollment\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which institution has the highest amount of enrollment ? ### Input: CREATE TABLE table_204_442 (\n id number,\n \"institution\" text,\n \"location\" text,\n \"enrollment\" number,\n \"nickname\" text,\n \"varsity\\nsports\" number,\n \"rugby\\nsince\" text,\n \"head coach\" text\n) ### Response: SELECT \"institution\" FROM table_204_442 ORDER BY \"enrollment\" DESC LIMIT 1"} {"instruction":"What League\/Division has a Location of n\/a?","input":"CREATE TABLE table_name_29 (\n league_division VARCHAR,\n location VARCHAR\n)","response":"SELECT league_division FROM table_name_29 WHERE location = \"n\/a\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What League\/Division has a Location of n\/a? ### Input: CREATE TABLE table_name_29 (\n league_division VARCHAR,\n location VARCHAR\n) ### Response: SELECT league_division FROM table_name_29 WHERE location = \"n\/a\""} {"instruction":"What is the conference record for the year of 1971?","input":"CREATE TABLE table_75478 (\n \"Year\" text,\n \"Overall Record\" text,\n \"Conference Record\" text,\n \"Coach\" text,\n \"Conference\" text\n)","response":"SELECT \"Conference Record\" FROM table_75478 WHERE \"Year\" = '1971'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the conference record for the year of 1971? ### Input: CREATE TABLE table_75478 (\n \"Year\" text,\n \"Overall Record\" text,\n \"Conference Record\" text,\n \"Coach\" text,\n \"Conference\" text\n) ### Response: SELECT \"Conference Record\" FROM table_75478 WHERE \"Year\" = '1971'"} {"instruction":"what is the drug type and route prescribed for the drug code posa200l?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = \"POSA200L\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the drug type and route prescribed for the drug code posa200l? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = \"POSA200L\""} {"instruction":"What years were from Connecticut?","input":"CREATE TABLE table_47224 (\n \"Player\" text,\n \"Nationality\" text,\n \"Jersey Number(s)\" text,\n \"Position\" text,\n \"Years\" text,\n \"From\" text\n)","response":"SELECT \"Years\" FROM table_47224 WHERE \"From\" = 'connecticut'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years were from Connecticut? ### Input: CREATE TABLE table_47224 (\n \"Player\" text,\n \"Nationality\" text,\n \"Jersey Number(s)\" text,\n \"Position\" text,\n \"Years\" text,\n \"From\" text\n) ### Response: SELECT \"Years\" FROM table_47224 WHERE \"From\" = 'connecticut'"} {"instruction":"What message has hd 186408 as a designation HD?","input":"CREATE TABLE table_name_75 (\n message VARCHAR,\n designation_hd VARCHAR\n)","response":"SELECT message FROM table_name_75 WHERE designation_hd = \"hd 186408\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What message has hd 186408 as a designation HD? ### Input: CREATE TABLE table_name_75 (\n message VARCHAR,\n designation_hd VARCHAR\n) ### Response: SELECT message FROM table_name_75 WHERE designation_hd = \"hd 186408\""} {"instruction":"What are the number of the facility codes of the apartments with more than four bedrooms?, and list by the y axis from high to low.","input":"CREATE TABLE Apartment_Buildings (\n building_id INTEGER,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80)\n)\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER,\n apt_id INTEGER,\n guest_id INTEGER,\n booking_status_code CHAR(15),\n booking_start_date DATETIME,\n booking_end_date DATETIME\n)\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER,\n facility_code CHAR(15)\n)\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME,\n available_yn BIT\n)\n\nCREATE TABLE Guests (\n guest_id INTEGER,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME\n)\n\nCREATE TABLE Apartments (\n apt_id INTEGER,\n building_id INTEGER,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5)\n)","response":"SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of the facility codes of the apartments with more than four bedrooms?, and list by the y axis from high to low. ### Input: CREATE TABLE Apartment_Buildings (\n building_id INTEGER,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80)\n)\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER,\n apt_id INTEGER,\n guest_id INTEGER,\n booking_status_code CHAR(15),\n booking_start_date DATETIME,\n booking_end_date DATETIME\n)\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER,\n facility_code CHAR(15)\n)\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME,\n available_yn BIT\n)\n\nCREATE TABLE Guests (\n guest_id INTEGER,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME\n)\n\nCREATE TABLE Apartments (\n apt_id INTEGER,\n building_id INTEGER,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5)\n) ### Response: SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC"} {"instruction":"among patients diagnosed with hemochromatosis due to repeated red blood cell transfusions, how many of them were unmarried?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = \"SINGLE\" AND diagnoses.long_title = \"Hemochromatosis due to repeated red blood cell transfusions\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients diagnosed with hemochromatosis due to repeated red blood cell transfusions, how many of them were unmarried? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = \"SINGLE\" AND diagnoses.long_title = \"Hemochromatosis due to repeated red blood cell transfusions\""} {"instruction":"Name the total number of value for revenue more than 193 and rank less than 12 for manchester united","input":"CREATE TABLE table_name_21 (\n value__ VARCHAR,\n team VARCHAR,\n revenue__$m_ VARCHAR,\n rank VARCHAR\n)","response":"SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = \"manchester united\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of value for revenue more than 193 and rank less than 12 for manchester united ### Input: CREATE TABLE table_name_21 (\n value__ VARCHAR,\n team VARCHAR,\n revenue__$m_ VARCHAR,\n rank VARCHAR\n) ### Response: SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = \"manchester united\""} {"instruction":"Which home team had a score of 85-101?","input":"CREATE TABLE table_49867 (\n \"Date\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Venue\" text,\n \"Box Score\" text,\n \"Report\" text\n)","response":"SELECT \"Home team\" FROM table_49867 WHERE \"Score\" = '85-101'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which home team had a score of 85-101? ### Input: CREATE TABLE table_49867 (\n \"Date\" text,\n \"Home team\" text,\n \"Score\" text,\n \"Away team\" text,\n \"Venue\" text,\n \"Box Score\" text,\n \"Report\" text\n) ### Response: SELECT \"Home team\" FROM table_49867 WHERE \"Score\" = '85-101'"} {"instruction":"Find out who answered first.. Answered in the same second as someone else? No problem, check out the number of milliseconds it differs.","input":"CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)","response":"SELECT p.OwnerUserId, u.DisplayName, DATE(p.CreationDate) AS \"Date\", CAST(p.CreationDate AS TIMESTAMP) AS \"Time\", p.ParentId FROM Posts AS p, Users AS u WHERE p.PostTypeId = 2 AND p.ParentId = @Question AND u.Id = OwnerUserId ORDER BY p.CreationDate","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find out who answered first.. Answered in the same second as someone else? No problem, check out the number of milliseconds it differs. ### Input: CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n) ### Response: SELECT p.OwnerUserId, u.DisplayName, DATE(p.CreationDate) AS \"Date\", CAST(p.CreationDate AS TIMESTAMP) AS \"Time\", p.ParentId FROM Posts AS p, Users AS u WHERE p.PostTypeId = 2 AND p.ParentId = @Question AND u.Id = OwnerUserId ORDER BY p.CreationDate"} {"instruction":"What is the number of each allergie that the student with first name Lisa has? Draw a bar chart.","input":"CREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Allergy_Type (\n Allergy VARCHAR(20),\n AllergyType VARCHAR(20)\n)\n\nCREATE TABLE Has_Allergy (\n StuID INTEGER,\n Allergy VARCHAR(20)\n)","response":"SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = \"Lisa\" GROUP BY T1.Allergy","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of each allergie that the student with first name Lisa has? Draw a bar chart. ### Input: CREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Allergy_Type (\n Allergy VARCHAR(20),\n AllergyType VARCHAR(20)\n)\n\nCREATE TABLE Has_Allergy (\n StuID INTEGER,\n Allergy VARCHAR(20)\n) ### Response: SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = \"Lisa\" GROUP BY T1.Allergy"} {"instruction":"Name the opponent for 3 6, 4 6, 6 1, 6 7 (7 9)","input":"CREATE TABLE table_25437 (\n \"Edition\" text,\n \"Round\" text,\n \"Date\" text,\n \"Against\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"W\\u2013L\" text,\n \"Result\" text\n)","response":"SELECT \"Opponent\" FROM table_25437 WHERE \"Result\" = '3\u20136, 4\u20136, 6\u20131, 6\u20137 (7\u20139)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the opponent for 3 6, 4 6, 6 1, 6 7 (7 9) ### Input: CREATE TABLE table_25437 (\n \"Edition\" text,\n \"Round\" text,\n \"Date\" text,\n \"Against\" text,\n \"Surface\" text,\n \"Opponent\" text,\n \"W\\u2013L\" text,\n \"Result\" text\n) ### Response: SELECT \"Opponent\" FROM table_25437 WHERE \"Result\" = '3\u20136, 4\u20136, 6\u20131, 6\u20137 (7\u20139)'"} {"instruction":"what is the minimum yearly number of patients that are suffering from allergic rhinitis nos until 2104?","input":"CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)","response":"SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'allergic rhinitis nos') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the minimum yearly number of patients that are suffering from allergic rhinitis nos until 2104? ### Input: CREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n) ### Response: SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'allergic rhinitis nos') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1"} {"instruction":"What is High Rebounds, when High Assists is 'Delonte West (10)'?","input":"CREATE TABLE table_name_86 (\n high_rebounds VARCHAR,\n high_assists VARCHAR\n)","response":"SELECT high_rebounds FROM table_name_86 WHERE high_assists = \"delonte west (10)\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is High Rebounds, when High Assists is 'Delonte West (10)'? ### Input: CREATE TABLE table_name_86 (\n high_rebounds VARCHAR,\n high_assists VARCHAR\n) ### Response: SELECT high_rebounds FROM table_name_86 WHERE high_assists = \"delonte west (10)\""} {"instruction":"Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.","input":"CREATE TABLE Movie (\n mID VARCHAR,\n year VARCHAR\n)\n\nCREATE TABLE Rating (\n mID VARCHAR,\n stars VARCHAR\n)","response":"SELECT DISTINCT year FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year. ### Input: CREATE TABLE Movie (\n mID VARCHAR,\n year VARCHAR\n)\n\nCREATE TABLE Rating (\n mID VARCHAR,\n stars VARCHAR\n) ### Response: SELECT DISTINCT year FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year"} {"instruction":"what is the number of patients whose ethnicity is hispanic\/latino - puerto rican and drug name is influenza virus vaccine?","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = \"HISPANIC\/LATINO - PUERTO RICAN\" AND prescriptions.drug = \"Influenza Virus Vaccine\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose ethnicity is hispanic\/latino - puerto rican and drug name is influenza virus vaccine? ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = \"HISPANIC\/LATINO - PUERTO RICAN\" AND prescriptions.drug = \"Influenza Virus Vaccine\""} {"instruction":"What first class team does sanath jayasuriya play for?","input":"CREATE TABLE table_77939 (\n \"Player\" text,\n \"Date of Birth\" text,\n \"Batting Style\" text,\n \"Bowling Style\" text,\n \"First Class Team\" text\n)","response":"SELECT \"First Class Team\" FROM table_77939 WHERE \"Player\" = 'sanath jayasuriya'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What first class team does sanath jayasuriya play for? ### Input: CREATE TABLE table_77939 (\n \"Player\" text,\n \"Date of Birth\" text,\n \"Batting Style\" text,\n \"Bowling Style\" text,\n \"First Class Team\" text\n) ### Response: SELECT \"First Class Team\" FROM table_77939 WHERE \"Player\" = 'sanath jayasuriya'"} {"instruction":"how many verbs have the yo form as sienta?","input":"CREATE TABLE table_23315 (\n \"Verbs\" text,\n \"Yo\" text,\n \"T\\u00fa\" text,\n \"Vos (*)\" text,\n \"\\u00c9l \/ Ella \/ Usted\" text,\n \"Nosotros \/ Nosotras\" text,\n \"Vosotros \/ Vosotras\" text,\n \"Ellos \/ Ellas \/ Ustedes\" text\n)","response":"SELECT COUNT(\"Verbs\") FROM table_23315 WHERE \"Yo\" = 'sienta'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many verbs have the yo form as sienta? ### Input: CREATE TABLE table_23315 (\n \"Verbs\" text,\n \"Yo\" text,\n \"T\\u00fa\" text,\n \"Vos (*)\" text,\n \"\\u00c9l \/ Ella \/ Usted\" text,\n \"Nosotros \/ Nosotras\" text,\n \"Vosotros \/ Vosotras\" text,\n \"Ellos \/ Ellas \/ Ustedes\" text\n) ### Response: SELECT COUNT(\"Verbs\") FROM table_23315 WHERE \"Yo\" = 'sienta'"} {"instruction":"what is the difference in 2012 gdp between albania and algeria ?","input":"CREATE TABLE table_203_530 (\n id number,\n \"country\" text,\n \"gdp (usd bln, 2012)\" number,\n \"gdp (usd bln, 2017)\" number,\n \"gdp (usd ppp bln, 2012)\" number,\n \"gdp (usd ppp bln, 2017)\" number,\n \"per capita (usd, 2012)\" number,\n \"per capita (usd, 2017)\" number,\n \"per capita (usd ppp, 2012)\" number,\n \"per capita (usd ppp, 2017)\" number\n)","response":"SELECT ABS((SELECT \"gdp (usd bln, 2012)\" FROM table_203_530 WHERE \"country\" = 'albania') - (SELECT \"gdp (usd bln, 2012)\" FROM table_203_530 WHERE \"country\" = 'algeria'))","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the difference in 2012 gdp between albania and algeria ? ### Input: CREATE TABLE table_203_530 (\n id number,\n \"country\" text,\n \"gdp (usd bln, 2012)\" number,\n \"gdp (usd bln, 2017)\" number,\n \"gdp (usd ppp bln, 2012)\" number,\n \"gdp (usd ppp bln, 2017)\" number,\n \"per capita (usd, 2012)\" number,\n \"per capita (usd, 2017)\" number,\n \"per capita (usd ppp, 2012)\" number,\n \"per capita (usd ppp, 2017)\" number\n) ### Response: SELECT ABS((SELECT \"gdp (usd bln, 2012)\" FROM table_203_530 WHERE \"country\" = 'albania') - (SELECT \"gdp (usd bln, 2012)\" FROM table_203_530 WHERE \"country\" = 'algeria'))"} {"instruction":"how much different is patient 016-8658's weight last measured on the first hospital visit compared to the value first measured on the first hospital visit?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1)","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much different is patient 016-8658's weight last measured on the first hospital visit compared to the value first measured on the first hospital visit? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1)"} {"instruction":"Number of users on SO.","input":"CREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"SELECT COUNT(*) FROM Users","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of users on SO. ### Input: CREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: SELECT COUNT(*) FROM Users"} {"instruction":"Show all distinct location names.","input":"CREATE TABLE ref_attraction_types (\n attraction_type_code text,\n attraction_type_description text\n)\n\nCREATE TABLE features (\n feature_id number,\n feature_details text\n)\n\nCREATE TABLE tourist_attraction_features (\n tourist_attraction_id number,\n feature_id number\n)\n\nCREATE TABLE staff (\n staff_id number,\n tourist_attraction_id number,\n name text,\n other_details text\n)\n\nCREATE TABLE ref_hotel_star_ratings (\n star_rating_code text,\n star_rating_description text\n)\n\nCREATE TABLE visits (\n visit_id number,\n tourist_attraction_id number,\n tourist_id number,\n visit_date time,\n visit_details text\n)\n\nCREATE TABLE museums (\n museum_id number,\n museum_details text\n)\n\nCREATE TABLE photos (\n photo_id number,\n tourist_attraction_id number,\n name text,\n description text,\n filename text,\n other_details text\n)\n\nCREATE TABLE shops (\n shop_id number,\n shop_details text\n)\n\nCREATE TABLE visitors (\n tourist_id number,\n tourist_details text\n)\n\nCREATE TABLE street_markets (\n market_id number,\n market_details text\n)\n\nCREATE TABLE hotels (\n hotel_id number,\n star_rating_code text,\n pets_allowed_yn text,\n price_range number,\n other_hotel_details text\n)\n\nCREATE TABLE theme_parks (\n theme_park_id number,\n theme_park_details text\n)\n\nCREATE TABLE royal_family (\n royal_family_id number,\n royal_family_details text\n)\n\nCREATE TABLE locations (\n location_id number,\n location_name text,\n address text,\n other_details text\n)\n\nCREATE TABLE tourist_attractions (\n tourist_attraction_id number,\n attraction_type_code text,\n location_id number,\n how_to_get_there text,\n name text,\n description text,\n opening_hours text,\n other_details text\n)","response":"SELECT DISTINCT location_name FROM locations","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all distinct location names. ### Input: CREATE TABLE ref_attraction_types (\n attraction_type_code text,\n attraction_type_description text\n)\n\nCREATE TABLE features (\n feature_id number,\n feature_details text\n)\n\nCREATE TABLE tourist_attraction_features (\n tourist_attraction_id number,\n feature_id number\n)\n\nCREATE TABLE staff (\n staff_id number,\n tourist_attraction_id number,\n name text,\n other_details text\n)\n\nCREATE TABLE ref_hotel_star_ratings (\n star_rating_code text,\n star_rating_description text\n)\n\nCREATE TABLE visits (\n visit_id number,\n tourist_attraction_id number,\n tourist_id number,\n visit_date time,\n visit_details text\n)\n\nCREATE TABLE museums (\n museum_id number,\n museum_details text\n)\n\nCREATE TABLE photos (\n photo_id number,\n tourist_attraction_id number,\n name text,\n description text,\n filename text,\n other_details text\n)\n\nCREATE TABLE shops (\n shop_id number,\n shop_details text\n)\n\nCREATE TABLE visitors (\n tourist_id number,\n tourist_details text\n)\n\nCREATE TABLE street_markets (\n market_id number,\n market_details text\n)\n\nCREATE TABLE hotels (\n hotel_id number,\n star_rating_code text,\n pets_allowed_yn text,\n price_range number,\n other_hotel_details text\n)\n\nCREATE TABLE theme_parks (\n theme_park_id number,\n theme_park_details text\n)\n\nCREATE TABLE royal_family (\n royal_family_id number,\n royal_family_details text\n)\n\nCREATE TABLE locations (\n location_id number,\n location_name text,\n address text,\n other_details text\n)\n\nCREATE TABLE tourist_attractions (\n tourist_attraction_id number,\n attraction_type_code text,\n location_id number,\n how_to_get_there text,\n name text,\n description text,\n opening_hours text,\n other_details text\n) ### Response: SELECT DISTINCT location_name FROM locations"} {"instruction":"Which representative has a Termination of MIssion date Mar 25, 1976?","input":"CREATE TABLE table_name_59 (\n representative VARCHAR,\n termination_of_mission VARCHAR\n)","response":"SELECT representative FROM table_name_59 WHERE termination_of_mission = \"mar 25, 1976\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which representative has a Termination of MIssion date Mar 25, 1976? ### Input: CREATE TABLE table_name_59 (\n representative VARCHAR,\n termination_of_mission VARCHAR\n) ### Response: SELECT representative FROM table_name_59 WHERE termination_of_mission = \"mar 25, 1976\""} {"instruction":"What country is ranked 79?","input":"CREATE TABLE table_name_19 (\n country VARCHAR,\n rank VARCHAR\n)","response":"SELECT country FROM table_name_19 WHERE rank = 79","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What country is ranked 79? ### Input: CREATE TABLE table_name_19 (\n country VARCHAR,\n rank VARCHAR\n) ### Response: SELECT country FROM table_name_19 WHERE rank = 79"} {"instruction":"What is the British Lee-Enfield (data for late model) when the Japanese Type 38 Rifle is 5?","input":"CREATE TABLE table_49483 (\n \"Rifle\" text,\n \"Danish Krag-J\\u00f8rgensen 1889\" text,\n \"US Krag-J\\u00f8rgensen M1892\" text,\n \"Norwegian Krag-J\\u00f8rgensen M1894\" text,\n \"Japanese Type 38 Rifle\" text,\n \"German Gewehr 98\" text,\n \"British Lee-Enfield (data for late model)\" text\n)","response":"SELECT \"British Lee-Enfield (data for late model)\" FROM table_49483 WHERE \"Japanese Type 38 Rifle\" = '5'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the British Lee-Enfield (data for late model) when the Japanese Type 38 Rifle is 5? ### Input: CREATE TABLE table_49483 (\n \"Rifle\" text,\n \"Danish Krag-J\\u00f8rgensen 1889\" text,\n \"US Krag-J\\u00f8rgensen M1892\" text,\n \"Norwegian Krag-J\\u00f8rgensen M1894\" text,\n \"Japanese Type 38 Rifle\" text,\n \"German Gewehr 98\" text,\n \"British Lee-Enfield (data for late model)\" text\n) ### Response: SELECT \"British Lee-Enfield (data for late model)\" FROM table_49483 WHERE \"Japanese Type 38 Rifle\" = '5'"} {"instruction":"What is the Year for Jazz club of Houston?","input":"CREATE TABLE table_52028 (\n \"Player\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Years for Jazz\" text,\n \"School\/Club Team\" text\n)","response":"SELECT \"Years for Jazz\" FROM table_52028 WHERE \"School\/Club Team\" = 'houston'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Year for Jazz club of Houston? ### Input: CREATE TABLE table_52028 (\n \"Player\" text,\n \"Nationality\" text,\n \"Position\" text,\n \"Years for Jazz\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT \"Years for Jazz\" FROM table_52028 WHERE \"School\/Club Team\" = 'houston'"} {"instruction":"Missing R tag in R related tag. Find posts without R tag, but with one of closely related tag","input":"CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"SELECT Id AS \"post_link\", Tags, LastActivityDate FROM Posts WHERE Posts.Id IN (SELECT PostTags.PostId FROM PostTags INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN ('ggplot2', 'lattice', 'plyr', 'data.frame', 'sweave', 'lapply', 'sapply', 'r') GROUP BY PostTags.PostId HAVING COUNT(CASE WHEN Tags.TagName = 'r' THEN 1 END) = 0 AND COUNT(*) > 0) AND LastActivityDate > '2011-03-01' ORDER BY LastActivityDate DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Missing R tag in R related tag. Find posts without R tag, but with one of closely related tag ### Input: CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: SELECT Id AS \"post_link\", Tags, LastActivityDate FROM Posts WHERE Posts.Id IN (SELECT PostTags.PostId FROM PostTags INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN ('ggplot2', 'lattice', 'plyr', 'data.frame', 'sweave', 'lapply', 'sapply', 'r') GROUP BY PostTags.PostId HAVING COUNT(CASE WHEN Tags.TagName = 'r' THEN 1 END) = 0 AND COUNT(*) > 0) AND LastActivityDate > '2011-03-01' ORDER BY LastActivityDate DESC"} {"instruction":"What is detail of the student who most recently registered course?","input":"CREATE TABLE addresses (\n address_id number,\n line_1 text,\n line_2 text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE people_addresses (\n person_address_id number,\n person_id number,\n address_id number,\n date_from time,\n date_to time\n)\n\nCREATE TABLE people (\n person_id number,\n first_name text,\n middle_name text,\n last_name text,\n cell_mobile_number text,\n email_address text,\n login_name text,\n password text\n)\n\nCREATE TABLE students (\n student_id number,\n student_details text\n)\n\nCREATE TABLE student_course_registrations (\n student_id number,\n course_id number,\n registration_date time\n)\n\nCREATE TABLE candidate_assessments (\n candidate_id number,\n qualification text,\n assessment_date time,\n asessment_outcome_code text\n)\n\nCREATE TABLE courses (\n course_id text,\n course_name text,\n course_description text,\n other_details text\n)\n\nCREATE TABLE student_course_attendance (\n student_id number,\n course_id number,\n date_of_attendance time\n)\n\nCREATE TABLE candidates (\n candidate_id number,\n candidate_details text\n)","response":"SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is detail of the student who most recently registered course? ### Input: CREATE TABLE addresses (\n address_id number,\n line_1 text,\n line_2 text,\n city text,\n zip_postcode text,\n state_province_county text,\n country text\n)\n\nCREATE TABLE people_addresses (\n person_address_id number,\n person_id number,\n address_id number,\n date_from time,\n date_to time\n)\n\nCREATE TABLE people (\n person_id number,\n first_name text,\n middle_name text,\n last_name text,\n cell_mobile_number text,\n email_address text,\n login_name text,\n password text\n)\n\nCREATE TABLE students (\n student_id number,\n student_details text\n)\n\nCREATE TABLE student_course_registrations (\n student_id number,\n course_id number,\n registration_date time\n)\n\nCREATE TABLE candidate_assessments (\n candidate_id number,\n qualification text,\n assessment_date time,\n asessment_outcome_code text\n)\n\nCREATE TABLE courses (\n course_id text,\n course_name text,\n course_description text,\n other_details text\n)\n\nCREATE TABLE student_course_attendance (\n student_id number,\n course_id number,\n date_of_attendance time\n)\n\nCREATE TABLE candidates (\n candidate_id number,\n candidate_details text\n) ### Response: SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1"} {"instruction":"which country won the same amount of medals as bulgaria in these olympics ?","input":"CREATE TABLE table_204_822 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n)","response":"SELECT \"nation\" FROM table_204_822 WHERE \"nation\" <> 'bulgaria' AND \"total\" = (SELECT \"total\" FROM table_204_822 WHERE \"nation\" = 'bulgaria')","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which country won the same amount of medals as bulgaria in these olympics ? ### Input: CREATE TABLE table_204_822 (\n id number,\n \"rank\" number,\n \"nation\" text,\n \"gold\" number,\n \"silver\" number,\n \"bronze\" number,\n \"total\" number\n) ### Response: SELECT \"nation\" FROM table_204_822 WHERE \"nation\" <> 'bulgaria' AND \"total\" = (SELECT \"total\" FROM table_204_822 WHERE \"nation\" = 'bulgaria')"} {"instruction":"what title is before dhol in 2007 ?","input":"CREATE TABLE table_204_620 (\n id number,\n \"title\" text,\n \"year\" number,\n \"language\" text,\n \"role\" text,\n \"notes\" text\n)","response":"SELECT \"title\" FROM table_204_620 WHERE id = (SELECT id FROM table_204_620 WHERE \"title\" = 'dhol') - 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what title is before dhol in 2007 ? ### Input: CREATE TABLE table_204_620 (\n id number,\n \"title\" text,\n \"year\" number,\n \"language\" text,\n \"role\" text,\n \"notes\" text\n) ### Response: SELECT \"title\" FROM table_204_620 WHERE id = (SELECT id FROM table_204_620 WHERE \"title\" = 'dhol') - 1"} {"instruction":"Where was held the ceremony for the 12th Pride of Britain Awards?","input":"CREATE TABLE table_19041 (\n \"Episode\" text,\n \"Original Air Date\" text,\n \"Viewers (millions)\" text,\n \"Presenter\" text,\n \"Location\" text\n)","response":"SELECT \"Location\" FROM table_19041 WHERE \"Episode\" = '12th Pride of Britain Awards'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was held the ceremony for the 12th Pride of Britain Awards? ### Input: CREATE TABLE table_19041 (\n \"Episode\" text,\n \"Original Air Date\" text,\n \"Viewers (millions)\" text,\n \"Presenter\" text,\n \"Location\" text\n) ### Response: SELECT \"Location\" FROM table_19041 WHERE \"Episode\" = '12th Pride of Britain Awards'"} {"instruction":"What language does Raj Kamal speak?","input":"CREATE TABLE table_name_62 (\n language VARCHAR,\n music_director VARCHAR\n)","response":"SELECT language FROM table_name_62 WHERE music_director = \"raj kamal\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What language does Raj Kamal speak? ### Input: CREATE TABLE table_name_62 (\n language VARCHAR,\n music_director VARCHAR\n) ### Response: SELECT language FROM table_name_62 WHERE music_director = \"raj kamal\""} {"instruction":"What venue had an event on 17 November 1963?","input":"CREATE TABLE table_76279 (\n \"Season\" real,\n \"Date\" text,\n \"Winner\" text,\n \"Score [C ]\" text,\n \"Venue\" text,\n \"Competition round\" text\n)","response":"SELECT \"Venue\" FROM table_76279 WHERE \"Season\" = '1963' AND \"Date\" = '17 november 1963'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What venue had an event on 17 November 1963? ### Input: CREATE TABLE table_76279 (\n \"Season\" real,\n \"Date\" text,\n \"Winner\" text,\n \"Score [C ]\" text,\n \"Venue\" text,\n \"Competition round\" text\n) ### Response: SELECT \"Venue\" FROM table_76279 WHERE \"Season\" = '1963' AND \"Date\" = '17 november 1963'"} {"instruction":"What is the Date of the Ameritech Senior Open?","input":"CREATE TABLE table_66188 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n)","response":"SELECT \"Date\" FROM table_66188 WHERE \"Tournament\" = 'ameritech senior open'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date of the Ameritech Senior Open? ### Input: CREATE TABLE table_66188 (\n \"Date\" text,\n \"Tournament\" text,\n \"Winning score\" text,\n \"Margin of victory\" text,\n \"Runner(s)-up\" text\n) ### Response: SELECT \"Date\" FROM table_66188 WHERE \"Tournament\" = 'ameritech senior open'"} {"instruction":"select count (*) from Posts.","input":"CREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)","response":"SELECT COUNT(*) FROM Posts","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: select count (*) from Posts. ### Input: CREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n) ### Response: SELECT COUNT(*) FROM Posts"} {"instruction":"For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of code , and group by attribute name, list by the total number in descending.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of code , and group by attribute name, list by the total number in descending. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC"} {"instruction":"What is the highest Red List for the muridae family and species Authority of microtus pinetorum (le conte, 1830)?","input":"CREATE TABLE table_67362 (\n \"Name\" text,\n \"Species Authority\" text,\n \"Order\" text,\n \"Family\" text,\n \"Red List\" real\n)","response":"SELECT MAX(\"Red List\") FROM table_67362 WHERE \"Family\" = 'muridae' AND \"Species Authority\" = 'microtus pinetorum (le conte, 1830)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Red List for the muridae family and species Authority of microtus pinetorum (le conte, 1830)? ### Input: CREATE TABLE table_67362 (\n \"Name\" text,\n \"Species Authority\" text,\n \"Order\" text,\n \"Family\" text,\n \"Red List\" real\n) ### Response: SELECT MAX(\"Red List\") FROM table_67362 WHERE \"Family\" = 'muridae' AND \"Species Authority\" = 'microtus pinetorum (le conte, 1830)'"} {"instruction":"Which Elevator has a Title of bishop of palestrina?","input":"CREATE TABLE table_12911 (\n \"Elector\" text,\n \"Nationality\" text,\n \"Order\" text,\n \"Title\" text,\n \"Elevated\" text,\n \"Elevator\" text\n)","response":"SELECT \"Elevator\" FROM table_12911 WHERE \"Title\" = 'bishop of palestrina'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Elevator has a Title of bishop of palestrina? ### Input: CREATE TABLE table_12911 (\n \"Elector\" text,\n \"Nationality\" text,\n \"Order\" text,\n \"Title\" text,\n \"Elevated\" text,\n \"Elevator\" text\n) ### Response: SELECT \"Elevator\" FROM table_12911 WHERE \"Title\" = 'bishop of palestrina'"} {"instruction":"Group and count brand for each camera lens using a bar chart, and rank X in descending order.","input":"CREATE TABLE photos (\n id int,\n camera_lens_id int,\n mountain_id int,\n color text,\n name text\n)\n\nCREATE TABLE mountain (\n id int,\n name text,\n Height real,\n Prominence real,\n Range text,\n Country text\n)\n\nCREATE TABLE camera_lens (\n id int,\n brand text,\n name text,\n focal_length_mm real,\n max_aperture real\n)","response":"SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY brand DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Group and count brand for each camera lens using a bar chart, and rank X in descending order. ### Input: CREATE TABLE photos (\n id int,\n camera_lens_id int,\n mountain_id int,\n color text,\n name text\n)\n\nCREATE TABLE mountain (\n id int,\n name text,\n Height real,\n Prominence real,\n Range text,\n Country text\n)\n\nCREATE TABLE camera_lens (\n id int,\n brand text,\n name text,\n focal_length_mm real,\n max_aperture real\n) ### Response: SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY brand DESC"} {"instruction":"Who is the youngest male?","input":"CREATE TABLE Person (\n name VARCHAR,\n gender VARCHAR,\n age INTEGER\n)\n\nCREATE TABLE person (\n name VARCHAR,\n gender VARCHAR,\n age INTEGER\n)","response":"SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM Person WHERE gender = 'male')","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the youngest male? ### Input: CREATE TABLE Person (\n name VARCHAR,\n gender VARCHAR,\n age INTEGER\n)\n\nCREATE TABLE person (\n name VARCHAR,\n gender VARCHAR,\n age INTEGER\n) ### Response: SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM Person WHERE gender = 'male')"} {"instruction":"did patient 366 have microbiological test results from the mrsa screen until 1 year ago?","input":"CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)","response":"SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 366) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 366 have microbiological test results from the mrsa screen until 1 year ago? ### Input: CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n) ### Response: SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 366) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')"} {"instruction":"For those records from the products and each product's manufacturer, find founder and the average of manufacturer , and group by attribute founder, and visualize them by a bar chart, I want to sort by the Y-axis in asc.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Manufacturer)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, find founder and the average of manufacturer , and group by attribute founder, and visualize them by a bar chart, I want to sort by the Y-axis in asc. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Manufacturer)"} {"instruction":"Which Place is the highest one that has an Artist of nikolas metaxas, and a Televote larger than 60?","input":"CREATE TABLE table_5943 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Jury\" real,\n \"Televote\" real,\n \"Total\" real,\n \"Place\" real\n)","response":"SELECT MAX(\"Place\") FROM table_5943 WHERE \"Artist\" = 'nikolas metaxas' AND \"Televote\" > '60'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Place is the highest one that has an Artist of nikolas metaxas, and a Televote larger than 60? ### Input: CREATE TABLE table_5943 (\n \"Draw\" real,\n \"Artist\" text,\n \"Song\" text,\n \"Jury\" real,\n \"Televote\" real,\n \"Total\" real,\n \"Place\" real\n) ### Response: SELECT MAX(\"Place\") FROM table_5943 WHERE \"Artist\" = 'nikolas metaxas' AND \"Televote\" > '60'"} {"instruction":"What's the name of Constituency number 108?","input":"CREATE TABLE table_name_65 (\n name VARCHAR,\n constituency_number VARCHAR\n)","response":"SELECT name FROM table_name_65 WHERE constituency_number = \"108\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the name of Constituency number 108? ### Input: CREATE TABLE table_name_65 (\n name VARCHAR,\n constituency_number VARCHAR\n) ### Response: SELECT name FROM table_name_65 WHERE constituency_number = \"108\""} {"instruction":"When Steve Hazlett is the Player, and the PI GP is under 0, what is the average Rd #?","input":"CREATE TABLE table_54910 (\n \"Rd #\" real,\n \"Pick #\" real,\n \"Player\" text,\n \"Team (League)\" text,\n \"Reg GP\" real,\n \"Pl GP\" real\n)","response":"SELECT AVG(\"Rd #\") FROM table_54910 WHERE \"Player\" = 'steve hazlett' AND \"Pl GP\" < '0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When Steve Hazlett is the Player, and the PI GP is under 0, what is the average Rd #? ### Input: CREATE TABLE table_54910 (\n \"Rd #\" real,\n \"Pick #\" real,\n \"Player\" text,\n \"Team (League)\" text,\n \"Reg GP\" real,\n \"Pl GP\" real\n) ### Response: SELECT AVG(\"Rd #\") FROM table_54910 WHERE \"Player\" = 'steve hazlett' AND \"Pl GP\" < '0'"} {"instruction":"has patient 40059 received a lab test?","input":"CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)","response":"SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 40059 received a lab test? ### Input: CREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n) ### Response: SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059)"} {"instruction":"What is the last name of the musicians who has played back position the most?","input":"CREATE TABLE albums (\n aid number,\n title text,\n year number,\n label text,\n type text\n)\n\nCREATE TABLE instruments (\n songid number,\n bandmateid number,\n instrument text\n)\n\nCREATE TABLE band (\n id number,\n firstname text,\n lastname text\n)\n\nCREATE TABLE performance (\n songid number,\n bandmate number,\n stageposition text\n)\n\nCREATE TABLE songs (\n songid number,\n title text\n)\n\nCREATE TABLE tracklists (\n albumid number,\n position number,\n songid number\n)\n\nCREATE TABLE vocals (\n songid number,\n bandmate number,\n type text\n)","response":"SELECT T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE stageposition = \"back\" GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the last name of the musicians who has played back position the most? ### Input: CREATE TABLE albums (\n aid number,\n title text,\n year number,\n label text,\n type text\n)\n\nCREATE TABLE instruments (\n songid number,\n bandmateid number,\n instrument text\n)\n\nCREATE TABLE band (\n id number,\n firstname text,\n lastname text\n)\n\nCREATE TABLE performance (\n songid number,\n bandmate number,\n stageposition text\n)\n\nCREATE TABLE songs (\n songid number,\n title text\n)\n\nCREATE TABLE tracklists (\n albumid number,\n position number,\n songid number\n)\n\nCREATE TABLE vocals (\n songid number,\n bandmate number,\n type text\n) ### Response: SELECT T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE stageposition = \"back\" GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"instruction":"what are the five most frequent lab tests that patients had in the same hospital visit after having received a refus lmb\/lmbsac pst\/pst operation until 2100?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)","response":"SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'refus lmb\/lmbsac pst\/pst') AND STRFTIME('%y', procedures_icd.charttime) <= '2100') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime, admissions.hadm_id FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) <= '2100') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 5)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequent lab tests that patients had in the same hospital visit after having received a refus lmb\/lmbsac pst\/pst operation until 2100? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n) ### Response: SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'refus lmb\/lmbsac pst\/pst') AND STRFTIME('%y', procedures_icd.charttime) <= '2100') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime, admissions.hadm_id FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) <= '2100') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 5)"} {"instruction":"What were all USAF space flights when the aximum speed was 3822?","input":"CREATE TABLE table_221315_3 (\n usaf_space_flights VARCHAR,\n max_speed__mph_ VARCHAR\n)","response":"SELECT usaf_space_flights FROM table_221315_3 WHERE max_speed__mph_ = 3822","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were all USAF space flights when the aximum speed was 3822? ### Input: CREATE TABLE table_221315_3 (\n usaf_space_flights VARCHAR,\n max_speed__mph_ VARCHAR\n) ### Response: SELECT usaf_space_flights FROM table_221315_3 WHERE max_speed__mph_ = 3822"} {"instruction":"When was Will Shields inducted into the Pro Football Hall of Fame?","input":"CREATE TABLE table_29501 (\n \"Number\" real,\n \"Player\" text,\n \"Position\" text,\n \"Seasons by team\" text,\n \"Year of induction into Pro Football Hall of Fame\" text\n)","response":"SELECT \"Year of induction into Pro Football Hall of Fame\" FROM table_29501 WHERE \"Player\" = 'Will Shields'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was Will Shields inducted into the Pro Football Hall of Fame? ### Input: CREATE TABLE table_29501 (\n \"Number\" real,\n \"Player\" text,\n \"Position\" text,\n \"Seasons by team\" text,\n \"Year of induction into Pro Football Hall of Fame\" text\n) ### Response: SELECT \"Year of induction into Pro Football Hall of Fame\" FROM table_29501 WHERE \"Player\" = 'Will Shields'"} {"instruction":"what is the total dose heparin sodium that patient 11826 has been prescribed during their current hospital encounter?","input":"CREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'heparin sodium'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total dose heparin sodium that patient 11826 has been prescribed during their current hospital encounter? ### Input: CREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'heparin sodium'"} {"instruction":"Which pick number attended McMaster College?","input":"CREATE TABLE table_54414 (\n \"Pick #\" real,\n \"CFL Team\" text,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n)","response":"SELECT \"Pick #\" FROM table_54414 WHERE \"College\" = 'mcmaster'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which pick number attended McMaster College? ### Input: CREATE TABLE table_54414 (\n \"Pick #\" real,\n \"CFL Team\" text,\n \"Player\" text,\n \"Position\" text,\n \"College\" text\n) ### Response: SELECT \"Pick #\" FROM table_54414 WHERE \"College\" = 'mcmaster'"} {"instruction":"What is the sum of Metres wiht a Feet that's smaller than 196?","input":"CREATE TABLE table_name_51 (\n metres VARCHAR,\n feet INTEGER\n)","response":"SELECT COUNT(metres) FROM table_name_51 WHERE feet < 196","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Metres wiht a Feet that's smaller than 196? ### Input: CREATE TABLE table_name_51 (\n metres VARCHAR,\n feet INTEGER\n) ### Response: SELECT COUNT(metres) FROM table_name_51 WHERE feet < 196"} {"instruction":"What are the seasons where Marcello Puglisi (formula master italia) was the secondary class champion?","input":"CREATE TABLE table_55689 (\n \"Season\" real,\n \"Series Name\" text,\n \"Champion\" text,\n \"Team Champion\" text,\n \"Secondary Class Champion\" text\n)","response":"SELECT SUM(\"Season\") FROM table_55689 WHERE \"Secondary Class Champion\" = 'marcello puglisi (formula master italia)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the seasons where Marcello Puglisi (formula master italia) was the secondary class champion? ### Input: CREATE TABLE table_55689 (\n \"Season\" real,\n \"Series Name\" text,\n \"Champion\" text,\n \"Team Champion\" text,\n \"Secondary Class Champion\" text\n) ### Response: SELECT SUM(\"Season\") FROM table_55689 WHERE \"Secondary Class Champion\" = 'marcello puglisi (formula master italia)'"} {"instruction":"Create a bar chart showing maximal revenue across headquarter, and sort by the y-axis in asc.","input":"CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)","response":"SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a bar chart showing maximal revenue across headquarter, and sort by the y-axis in asc. ### Input: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)\n\nCREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n) ### Response: SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue)"} {"instruction":"what year was cryptogramophon released","input":"CREATE TABLE table_6019 (\n \"Year\" real,\n \"Artist\" text,\n \"Title\" text,\n \"Genre\" text,\n \"Label\" text\n)","response":"SELECT \"Year\" FROM table_6019 WHERE \"Label\" = 'cryptogramophon'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what year was cryptogramophon released ### Input: CREATE TABLE table_6019 (\n \"Year\" real,\n \"Artist\" text,\n \"Title\" text,\n \"Genre\" text,\n \"Label\" text\n) ### Response: SELECT \"Year\" FROM table_6019 WHERE \"Label\" = 'cryptogramophon'"} {"instruction":"For those products with a price between 60 and 120, show me about the correlation between code and price , and group by attribute name in a scatter chart.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those products with a price between 60 and 120, show me about the correlation between code and price , and group by attribute name in a scatter chart. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name"} {"instruction":"What is the round on 30 June with a.z.k.\/roc-comp tition a.z.k.\/roc-comp tition as the winning team?","input":"CREATE TABLE table_79109 (\n \"Round\" text,\n \"Circuit\" text,\n \"Date\" text,\n \"Winning driver\" text,\n \"Winning team\" text\n)","response":"SELECT \"Round\" FROM table_79109 WHERE \"Winning team\" = 'a.z.k.\/roc-comp\u00e9tition a.z.k.\/roc-comp\u00e9tition' AND \"Date\" = '30 june'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the round on 30 June with a.z.k.\/roc-comp tition a.z.k.\/roc-comp tition as the winning team? ### Input: CREATE TABLE table_79109 (\n \"Round\" text,\n \"Circuit\" text,\n \"Date\" text,\n \"Winning driver\" text,\n \"Winning team\" text\n) ### Response: SELECT \"Round\" FROM table_79109 WHERE \"Winning team\" = 'a.z.k.\/roc-comp\u00e9tition a.z.k.\/roc-comp\u00e9tition' AND \"Date\" = '30 june'"} {"instruction":"find out the age and lab test fluid to be checked for patient with patient id 2560.","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT demographic.age, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = \"2560\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find out the age and lab test fluid to be checked for patient with patient id 2560. ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT demographic.age, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = \"2560\""} {"instruction":"What is the urban sub-area with an East Dunbartonshire council area and a population of 19,020?","input":"CREATE TABLE table_37692 (\n \"Rank\" text,\n \"Urban sub-area\" text,\n \"Population\" text,\n \"Status\" text,\n \"Council area\" text\n)","response":"SELECT \"Urban sub-area\" FROM table_37692 WHERE \"Council area\" = 'east dunbartonshire' AND \"Population\" = '19,020'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the urban sub-area with an East Dunbartonshire council area and a population of 19,020? ### Input: CREATE TABLE table_37692 (\n \"Rank\" text,\n \"Urban sub-area\" text,\n \"Population\" text,\n \"Status\" text,\n \"Council area\" text\n) ### Response: SELECT \"Urban sub-area\" FROM table_37692 WHERE \"Council area\" = 'east dunbartonshire' AND \"Population\" = '19,020'"} {"instruction":"List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.","input":"CREATE TABLE player (\n pid number,\n pname text,\n ycard text,\n hs number\n)\n\nCREATE TABLE college (\n cname text,\n state text,\n enr number\n)\n\nCREATE TABLE tryout (\n pid number,\n cname text,\n ppos text,\n decision text\n)","response":"SELECT cname FROM college WHERE enr > 18000 ORDER BY cname","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the name of the colleges whose enrollment is greater 18000 sorted by the college's name. ### Input: CREATE TABLE player (\n pid number,\n pname text,\n ycard text,\n hs number\n)\n\nCREATE TABLE college (\n cname text,\n state text,\n enr number\n)\n\nCREATE TABLE tryout (\n pid number,\n cname text,\n ppos text,\n decision text\n) ### Response: SELECT cname FROM college WHERE enr > 18000 ORDER BY cname"} {"instruction":"What are the memories and carriers of phones Show bar chart, and show by the mean memory in g in descending.","input":"CREATE TABLE phone_market (\n Market_ID int,\n Phone_ID text,\n Num_of_stock int\n)\n\nCREATE TABLE market (\n Market_ID int,\n District text,\n Num_of_employees int,\n Num_of_shops real,\n Ranking int\n)\n\nCREATE TABLE phone (\n Name text,\n Phone_ID int,\n Memory_in_G int,\n Carrier text,\n Price real\n)","response":"SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the memories and carriers of phones Show bar chart, and show by the mean memory in g in descending. ### Input: CREATE TABLE phone_market (\n Market_ID int,\n Phone_ID text,\n Num_of_stock int\n)\n\nCREATE TABLE market (\n Market_ID int,\n District text,\n Num_of_employees int,\n Num_of_shops real,\n Ranking int\n)\n\nCREATE TABLE phone (\n Name text,\n Phone_ID int,\n Memory_in_G int,\n Carrier text,\n Price real\n) ### Response: SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) DESC"} {"instruction":"what is the number of patients whose death status is 1 and diagnoses icd9 code is 261?","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = \"1\" AND diagnoses.icd9_code = \"261\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose death status is 1 and diagnoses icd9 code is 261? ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = \"1\" AND diagnoses.icd9_code = \"261\""} {"instruction":"which tag is used in questions with the highest average score, excluding tags used in less than 5 q.","input":"CREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)","response":"SELECT Tags.TagName, AVG(CAST(Posts.Score AS FLOAT)) AS avg, COUNT(Posts.Id) AS count FROM Tags LEFT JOIN Posts ON Posts.Tags LIKE '%' + Tags.TagName + '%' GROUP BY Tags.TagName HAVING COUNT(Posts.Id) >= 5 ORDER BY avg DESC LIMIT 1","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which tag is used in questions with the highest average score, excluding tags used in less than 5 q. ### Input: CREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n) ### Response: SELECT Tags.TagName, AVG(CAST(Posts.Score AS FLOAT)) AS avg, COUNT(Posts.Id) AS count FROM Tags LEFT JOIN Posts ON Posts.Tags LIKE '%' + Tags.TagName + '%' GROUP BY Tags.TagName HAVING COUNT(Posts.Id) >= 5 ORDER BY avg DESC LIMIT 1"} {"instruction":"When the Total is less than 1, and Bronze is 0, how many Gold medals are there?","input":"CREATE TABLE table_51383 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT SUM(\"Gold\") FROM table_51383 WHERE \"Bronze\" = '0' AND \"Total\" < '1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Total is less than 1, and Bronze is 0, how many Gold medals are there? ### Input: CREATE TABLE table_51383 (\n \"Rank\" real,\n \"Nation\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT SUM(\"Gold\") FROM table_51383 WHERE \"Bronze\" = '0' AND \"Total\" < '1'"} {"instruction":"March of 29 involves what highest scoring game?","input":"CREATE TABLE table_name_40 (\n game INTEGER,\n march VARCHAR\n)","response":"SELECT MAX(game) FROM table_name_40 WHERE march = 29","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: March of 29 involves what highest scoring game? ### Input: CREATE TABLE table_name_40 (\n game INTEGER,\n march VARCHAR\n) ### Response: SELECT MAX(game) FROM table_name_40 WHERE march = 29"} {"instruction":"The episode with production code 9abx02 was originally aired on what date?","input":"CREATE TABLE table_72086 (\n \"No. in set\" real,\n \"No. in series\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text\n)","response":"SELECT \"Original air date\" FROM table_72086 WHERE \"Production code\" = '9ABX02'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The episode with production code 9abx02 was originally aired on what date? ### Input: CREATE TABLE table_72086 (\n \"No. in set\" real,\n \"No. in series\" real,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original air date\" text,\n \"Production code\" text\n) ### Response: SELECT \"Original air date\" FROM table_72086 WHERE \"Production code\" = '9ABX02'"} {"instruction":"What is the percentage of females where in India and are maharashtra?","input":"CREATE TABLE table_19423 (\n \"State\/UT Code\" real,\n \"India\/State\/UT\" text,\n \"Literate Persons (%)\" text,\n \"Males (%)\" text,\n \"Females (%)\" text\n)","response":"SELECT \"Females (%)\" FROM table_19423 WHERE \"India\/State\/UT\" = 'Maharashtra'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the percentage of females where in India and are maharashtra? ### Input: CREATE TABLE table_19423 (\n \"State\/UT Code\" real,\n \"India\/State\/UT\" text,\n \"Literate Persons (%)\" text,\n \"Males (%)\" text,\n \"Females (%)\" text\n) ### Response: SELECT \"Females (%)\" FROM table_19423 WHERE \"India\/State\/UT\" = 'Maharashtra'"} {"instruction":"Show the name of cities in the county that has the largest number of police officers.","input":"CREATE TABLE county_public_safety (\n county_id number,\n name text,\n population number,\n police_officers number,\n residents_per_officer number,\n case_burden number,\n crime_rate number,\n police_force text,\n location text\n)\n\nCREATE TABLE city (\n city_id number,\n county_id number,\n name text,\n white number,\n black number,\n amerindian number,\n asian number,\n multiracial number,\n hispanic number\n)","response":"SELECT name FROM city WHERE county_id = (SELECT county_id FROM county_public_safety ORDER BY police_officers DESC LIMIT 1)","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name of cities in the county that has the largest number of police officers. ### Input: CREATE TABLE county_public_safety (\n county_id number,\n name text,\n population number,\n police_officers number,\n residents_per_officer number,\n case_burden number,\n crime_rate number,\n police_force text,\n location text\n)\n\nCREATE TABLE city (\n city_id number,\n county_id number,\n name text,\n white number,\n black number,\n amerindian number,\n asian number,\n multiracial number,\n hispanic number\n) ### Response: SELECT name FROM city WHERE county_id = (SELECT county_id FROM county_public_safety ORDER BY police_officers DESC LIMIT 1)"} {"instruction":"What is the skip that has a third of Anna Sloan in season 2012-13?","input":"CREATE TABLE table_50536 (\n \"Season\" text,\n \"Skip\" text,\n \"Third\" text,\n \"Second\" text,\n \"Lead\" text\n)","response":"SELECT \"Skip\" FROM table_50536 WHERE \"Third\" = 'anna sloan' AND \"Season\" = '2012-13'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the skip that has a third of Anna Sloan in season 2012-13? ### Input: CREATE TABLE table_50536 (\n \"Season\" text,\n \"Skip\" text,\n \"Third\" text,\n \"Second\" text,\n \"Lead\" text\n) ### Response: SELECT \"Skip\" FROM table_50536 WHERE \"Third\" = 'anna sloan' AND \"Season\" = '2012-13'"} {"instruction":"since 57 months ago, had patient 84042 been prescribed hydromorphone p.f., fentanyl patch, or vial?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)","response":"SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84042) AND prescriptions.drug IN ('hydromorphone p.f.', 'fentanyl patch', 'vial') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-57 month')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 57 months ago, had patient 84042 been prescribed hydromorphone p.f., fentanyl patch, or vial? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84042) AND prescriptions.drug IN ('hydromorphone p.f.', 'fentanyl patch', 'vial') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-57 month')"} {"instruction":"I want the time\/retired for grid of 24","input":"CREATE TABLE table_name_12 (\n time_retired VARCHAR,\n grid VARCHAR\n)","response":"SELECT time_retired FROM table_name_12 WHERE grid = 24","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want the time\/retired for grid of 24 ### Input: CREATE TABLE table_name_12 (\n time_retired VARCHAR,\n grid VARCHAR\n) ### Response: SELECT time_retired FROM table_name_12 WHERE grid = 24"} {"instruction":"Which spine has 12 issues?","input":"CREATE TABLE table_38310 (\n \"Start month\" text,\n \"End month\" text,\n \"Cover\" text,\n \"Spine\" text,\n \"Indicia\" text,\n \"Masthead\" text,\n \"Number of issues\" real\n)","response":"SELECT \"Spine\" FROM table_38310 WHERE \"Number of issues\" = '12'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which spine has 12 issues? ### Input: CREATE TABLE table_38310 (\n \"Start month\" text,\n \"End month\" text,\n \"Cover\" text,\n \"Spine\" text,\n \"Indicia\" text,\n \"Masthead\" text,\n \"Number of issues\" real\n) ### Response: SELECT \"Spine\" FROM table_38310 WHERE \"Number of issues\" = '12'"} {"instruction":"Tell me the lowest year for shubert theatre","input":"CREATE TABLE table_32109 (\n \"Year\" real,\n \"Play\" text,\n \"Role\" text,\n \"Theatre\" text,\n \"Location\" text\n)","response":"SELECT MIN(\"Year\") FROM table_32109 WHERE \"Theatre\" = 'shubert theatre'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the lowest year for shubert theatre ### Input: CREATE TABLE table_32109 (\n \"Year\" real,\n \"Play\" text,\n \"Role\" text,\n \"Theatre\" text,\n \"Location\" text\n) ### Response: SELECT MIN(\"Year\") FROM table_32109 WHERE \"Theatre\" = 'shubert theatre'"} {"instruction":"What is the least top division titles?","input":"CREATE TABLE table_11250_4 (\n top_division_titles INTEGER\n)","response":"SELECT MIN(top_division_titles) FROM table_11250_4","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least top division titles? ### Input: CREATE TABLE table_11250_4 (\n top_division_titles INTEGER\n) ### Response: SELECT MIN(top_division_titles) FROM table_11250_4"} {"instruction":"calculate the duration of hospital stay of patient 010-20205's last hospital stay.","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)","response":"SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '010-20205' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the duration of hospital stay of patient 010-20205's last hospital stay. ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n) ### Response: SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '010-20205' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1"} {"instruction":"Which round has an opponent of Freiburg?","input":"CREATE TABLE table_43511 (\n \"Season\" text,\n \"Competition\" text,\n \"Round\" text,\n \"Opponent\" text,\n \"Home\" text,\n \"Away\" text\n)","response":"SELECT \"Round\" FROM table_43511 WHERE \"Opponent\" = 'freiburg'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which round has an opponent of Freiburg? ### Input: CREATE TABLE table_43511 (\n \"Season\" text,\n \"Competition\" text,\n \"Round\" text,\n \"Opponent\" text,\n \"Home\" text,\n \"Away\" text\n) ### Response: SELECT \"Round\" FROM table_43511 WHERE \"Opponent\" = 'freiburg'"} {"instruction":"What's the Area with a Density of 263?","input":"CREATE TABLE table_11104 (\n \"Suburb\" text,\n \"Population (in 2008)\" real,\n \"Median age (in 2006)\" text,\n \"Mean household size (in 2006)\" text,\n \"Area (km\\u00b2)\" real,\n \"Density (\/km\\u00b2)\" real,\n \"Date first settled as a suburb\" real,\n \"Gazetted as a Division Name\" text\n)","response":"SELECT AVG(\"Area (km\\u00b2)\") FROM table_11104 WHERE \"Density (\/km\\u00b2)\" = '263'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the Area with a Density of 263? ### Input: CREATE TABLE table_11104 (\n \"Suburb\" text,\n \"Population (in 2008)\" real,\n \"Median age (in 2006)\" text,\n \"Mean household size (in 2006)\" text,\n \"Area (km\\u00b2)\" real,\n \"Density (\/km\\u00b2)\" real,\n \"Date first settled as a suburb\" real,\n \"Gazetted as a Division Name\" text\n) ### Response: SELECT AVG(\"Area (km\\u00b2)\") FROM table_11104 WHERE \"Density (\/km\\u00b2)\" = '263'"} {"instruction":"For the years 1992-93, what position did he play for the Houston Rockets?","input":"CREATE TABLE table_name_4 (\n position VARCHAR,\n years_for_rockets VARCHAR\n)","response":"SELECT position FROM table_name_4 WHERE years_for_rockets = \"1992-93\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the years 1992-93, what position did he play for the Houston Rockets? ### Input: CREATE TABLE table_name_4 (\n position VARCHAR,\n years_for_rockets VARCHAR\n) ### Response: SELECT position FROM table_name_4 WHERE years_for_rockets = \"1992-93\""} {"instruction":"What is the largest number of points they had?","input":"CREATE TABLE table_23308178_8 (\n points INTEGER\n)","response":"SELECT MAX(points) FROM table_23308178_8","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest number of points they had? ### Input: CREATE TABLE table_23308178_8 (\n points INTEGER\n) ### Response: SELECT MAX(points) FROM table_23308178_8"} {"instruction":"Create a bar chart showing maximal revenue across name","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a bar chart showing maximal revenue across name ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter"} {"instruction":"Tell me the total number of Bronze for futsal","input":"CREATE TABLE table_10315 (\n \"Sport\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n)","response":"SELECT COUNT(\"Bronze\") FROM table_10315 WHERE \"Sport\" = 'futsal'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the total number of Bronze for futsal ### Input: CREATE TABLE table_10315 (\n \"Sport\" text,\n \"Gold\" real,\n \"Silver\" real,\n \"Bronze\" real,\n \"Total\" real\n) ### Response: SELECT COUNT(\"Bronze\") FROM table_10315 WHERE \"Sport\" = 'futsal'"} {"instruction":"When 2005 is the year played what is the lowest year drafted?","input":"CREATE TABLE table_18373863_2 (\n year_drafted INTEGER,\n years_played VARCHAR\n)","response":"SELECT MIN(year_drafted) FROM table_18373863_2 WHERE years_played = \"2005\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When 2005 is the year played what is the lowest year drafted? ### Input: CREATE TABLE table_18373863_2 (\n year_drafted INTEGER,\n years_played VARCHAR\n) ### Response: SELECT MIN(year_drafted) FROM table_18373863_2 WHERE years_played = \"2005\""} {"instruction":"Give me the comparison about School_ID over the ACC_Road , and group by attribute ACC_Home by a bar chart, and order by the bars in desc.","input":"CREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)\n\nCREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)","response":"SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about School_ID over the ACC_Road , and group by attribute ACC_Home by a bar chart, and order by the bars in desc. ### Input: CREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)\n\nCREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n) ### Response: SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC"} {"instruction":"What's the general classification of stage 3 with David Loosli as the mountains classification?","input":"CREATE TABLE table_59025 (\n \"Stage\" text,\n \"Winner\" text,\n \"General Classification\" text,\n \"Mountains Classification\" text,\n \"Points Classification\" text,\n \"Sprints classification\" text,\n \"Team Classification\" text\n)","response":"SELECT \"General Classification\" FROM table_59025 WHERE \"Mountains Classification\" = 'david loosli' AND \"Stage\" = '3'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the general classification of stage 3 with David Loosli as the mountains classification? ### Input: CREATE TABLE table_59025 (\n \"Stage\" text,\n \"Winner\" text,\n \"General Classification\" text,\n \"Mountains Classification\" text,\n \"Points Classification\" text,\n \"Sprints classification\" text,\n \"Team Classification\" text\n) ### Response: SELECT \"General Classification\" FROM table_59025 WHERE \"Mountains Classification\" = 'david loosli' AND \"Stage\" = '3'"} {"instruction":"When was Mount Tahoma established?","input":"CREATE TABLE table_19156 (\n \"High School\" text,\n \"Type\" text,\n \"Established\" real,\n \"Enrollment\" real,\n \"Mascot\" text,\n \"WIAA Classification\" text,\n \"Notes\" text\n)","response":"SELECT MAX(\"Established\") FROM table_19156 WHERE \"High School\" = 'Mount Tahoma'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was Mount Tahoma established? ### Input: CREATE TABLE table_19156 (\n \"High School\" text,\n \"Type\" text,\n \"Established\" real,\n \"Enrollment\" real,\n \"Mascot\" text,\n \"WIAA Classification\" text,\n \"Notes\" text\n) ### Response: SELECT MAX(\"Established\") FROM table_19156 WHERE \"High School\" = 'Mount Tahoma'"} {"instruction":"Who directed episode 266 in the series?","input":"CREATE TABLE table_2221484_2 (\n directed_by VARCHAR,\n series__number VARCHAR\n)","response":"SELECT directed_by FROM table_2221484_2 WHERE series__number = 266","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed episode 266 in the series? ### Input: CREATE TABLE table_2221484_2 (\n directed_by VARCHAR,\n series__number VARCHAR\n) ### Response: SELECT directed_by FROM table_2221484_2 WHERE series__number = 266"} {"instruction":"When did the Tournament of the Tour Championship take place?","input":"CREATE TABLE table_name_10 (\n date VARCHAR,\n tournament VARCHAR\n)","response":"SELECT date FROM table_name_10 WHERE tournament = \"the tour championship\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the Tournament of the Tour Championship take place? ### Input: CREATE TABLE table_name_10 (\n date VARCHAR,\n tournament VARCHAR\n) ### Response: SELECT date FROM table_name_10 WHERE tournament = \"the tour championship\""} {"instruction":"What province has the largest city of Birjand?","input":"CREATE TABLE table_48114 (\n \"Province\" text,\n \"Largest city\" text,\n \"2nd Largest\" text,\n \"3rd Largest\" text,\n \"4th largest\" text\n)","response":"SELECT \"Province\" FROM table_48114 WHERE \"Largest city\" = 'birjand'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What province has the largest city of Birjand? ### Input: CREATE TABLE table_48114 (\n \"Province\" text,\n \"Largest city\" text,\n \"2nd Largest\" text,\n \"3rd Largest\" text,\n \"4th largest\" text\n) ### Response: SELECT \"Province\" FROM table_48114 WHERE \"Largest city\" = 'birjand'"} {"instruction":"Group and count details for the events using a pie chart.","input":"CREATE TABLE Events (\n Event_ID INTEGER,\n Service_ID INTEGER,\n Event_Details VARCHAR(255)\n)\n\nCREATE TABLE Participants_in_Events (\n Event_ID INTEGER,\n Participant_ID INTEGER\n)\n\nCREATE TABLE Participants (\n Participant_ID INTEGER,\n Participant_Type_Code CHAR(15),\n Participant_Details VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15)\n)","response":"SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Group and count details for the events using a pie chart. ### Input: CREATE TABLE Events (\n Event_ID INTEGER,\n Service_ID INTEGER,\n Event_Details VARCHAR(255)\n)\n\nCREATE TABLE Participants_in_Events (\n Event_ID INTEGER,\n Participant_ID INTEGER\n)\n\nCREATE TABLE Participants (\n Participant_ID INTEGER,\n Participant_Type_Code CHAR(15),\n Participant_Details VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15)\n) ### Response: SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details"} {"instruction":"How much Area (km 2) has a Common of collegno, and a Population smaller than 50137?","input":"CREATE TABLE table_name_60 (\n area__km_2__ VARCHAR,\n common_of VARCHAR,\n population VARCHAR\n)","response":"SELECT COUNT(area__km_2__) FROM table_name_60 WHERE common_of = \"collegno\" AND population < 50137","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Area (km 2) has a Common of collegno, and a Population smaller than 50137? ### Input: CREATE TABLE table_name_60 (\n area__km_2__ VARCHAR,\n common_of VARCHAR,\n population VARCHAR\n) ### Response: SELECT COUNT(area__km_2__) FROM table_name_60 WHERE common_of = \"collegno\" AND population < 50137"} {"instruction":"What 7:00 has a 10:00 of dirty sexy money?","input":"CREATE TABLE table_67978 (\n \"7:00\" text,\n \"7:30\" text,\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"9:30\" text,\n \"10:00\" text,\n \"10:30\" text\n)","response":"SELECT \"7:00\" FROM table_67978 WHERE \"10:00\" = 'dirty sexy money'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What 7:00 has a 10:00 of dirty sexy money? ### Input: CREATE TABLE table_67978 (\n \"7:00\" text,\n \"7:30\" text,\n \"8:00\" text,\n \"8:30\" text,\n \"9:00\" text,\n \"9:30\" text,\n \"10:00\" text,\n \"10:30\" text\n) ### Response: SELECT \"7:00\" FROM table_67978 WHERE \"10:00\" = 'dirty sexy money'"} {"instruction":"Did I mark all my questions as accepted?.","input":"CREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)","response":"SELECT Id AS \"post_link\", * FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND OwnerUserId = '##ownerid##'","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Did I mark all my questions as accepted?. ### Input: CREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n) ### Response: SELECT Id AS \"post_link\", * FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND OwnerUserId = '##ownerid##'"} {"instruction":"If the driver is Milka Duno, what is the name of the team?","input":"CREATE TABLE table_21872 (\n \"Fin. Pos\" real,\n \"Car No.\" real,\n \"Driver\" text,\n \"Team\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real,\n \"Laps Led\" real,\n \"Points\" text\n)","response":"SELECT \"Team\" FROM table_21872 WHERE \"Driver\" = 'Milka Duno'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the driver is Milka Duno, what is the name of the team? ### Input: CREATE TABLE table_21872 (\n \"Fin. Pos\" real,\n \"Car No.\" real,\n \"Driver\" text,\n \"Team\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real,\n \"Laps Led\" real,\n \"Points\" text\n) ### Response: SELECT \"Team\" FROM table_21872 WHERE \"Driver\" = 'Milka Duno'"} {"instruction":"In what place did Dave Barr score?","input":"CREATE TABLE table_8817 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n)","response":"SELECT \"Place\" FROM table_8817 WHERE \"Player\" = 'dave barr'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what place did Dave Barr score? ### Input: CREATE TABLE table_8817 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text\n) ### Response: SELECT \"Place\" FROM table_8817 WHERE \"Player\" = 'dave barr'"} {"instruction":"What is the average laps for a grid larger than 2, for a ferrari that got in an accident?","input":"CREATE TABLE table_name_87 (\n laps INTEGER,\n constructor VARCHAR,\n grid VARCHAR,\n time_retired VARCHAR\n)","response":"SELECT AVG(laps) FROM table_name_87 WHERE grid > 2 AND time_retired = \"accident\" AND constructor = \"ferrari\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average laps for a grid larger than 2, for a ferrari that got in an accident? ### Input: CREATE TABLE table_name_87 (\n laps INTEGER,\n constructor VARCHAR,\n grid VARCHAR,\n time_retired VARCHAR\n) ### Response: SELECT AVG(laps) FROM table_name_87 WHERE grid > 2 AND time_retired = \"accident\" AND constructor = \"ferrari\""} {"instruction":"how many patients are diagnosed with primary disease copd exacerbation?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"COPD EXACERBATION\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are diagnosed with primary disease copd exacerbation? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = \"COPD EXACERBATION\""} {"instruction":"What Country's Content is TV Locale?","input":"CREATE TABLE table_40678 (\n \"Television service\" text,\n \"Country\" text,\n \"Language\" text,\n \"Content\" text,\n \"HDTV\" text,\n \"Package\/Option\" text\n)","response":"SELECT \"Country\" FROM table_40678 WHERE \"Content\" = 'tv locale'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Country's Content is TV Locale? ### Input: CREATE TABLE table_40678 (\n \"Television service\" text,\n \"Country\" text,\n \"Language\" text,\n \"Content\" text,\n \"HDTV\" text,\n \"Package\/Option\" text\n) ### Response: SELECT \"Country\" FROM table_40678 WHERE \"Content\" = 'tv locale'"} {"instruction":"Who had the high rebounds when the record was 14 7?","input":"CREATE TABLE table_29843 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"High rebounds\" FROM table_29843 WHERE \"Record\" = '14\u20137'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the high rebounds when the record was 14 7? ### Input: CREATE TABLE table_29843 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"High rebounds\" FROM table_29843 WHERE \"Record\" = '14\u20137'"} {"instruction":"Name the money for p draig harrington","input":"CREATE TABLE table_68355 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( \\u00a3 )\" text\n)","response":"SELECT \"Money ( \\u00a3 )\" FROM table_68355 WHERE \"Player\" = 'p\u00e1draig harrington'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the money for p draig harrington ### Input: CREATE TABLE table_68355 (\n \"Place\" text,\n \"Player\" text,\n \"Country\" text,\n \"Score\" text,\n \"To par\" text,\n \"Money ( \\u00a3 )\" text\n) ### Response: SELECT \"Money ( \\u00a3 )\" FROM table_68355 WHERE \"Player\" = 'p\u00e1draig harrington'"} {"instruction":"Which Date has a Record of 19 16 8?","input":"CREATE TABLE table_64405 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text,\n \"Arena\" text,\n \"Points\" real\n)","response":"SELECT \"Date\" FROM table_64405 WHERE \"Record\" = '19\u201316\u20138'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Date has a Record of 19 16 8? ### Input: CREATE TABLE table_64405 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text,\n \"Arena\" text,\n \"Points\" real\n) ### Response: SELECT \"Date\" FROM table_64405 WHERE \"Record\" = '19\u201316\u20138'"} {"instruction":"Which Monday Mona\/Mani also had a Thursday Thunor\/Thor of Tongersdei?","input":"CREATE TABLE table_66876 (\n \"Sunday Sunna\/S\\u00f3l\" text,\n \"Monday Mona\/ M\\u00e1ni\" text,\n \"Tuesday Tiw\/ Tyr\" text,\n \"Wednesday Woden \/ Odin\" text,\n \"Thursday Thunor \/ Thor\" text,\n \"Friday Frige or Freya\" text,\n \"Saturday Saturn\" text\n)","response":"SELECT \"Monday Mona\/ M\\u00e1ni\" FROM table_66876 WHERE \"Thursday Thunor \/ Thor\" = 'tongersdei'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Monday Mona\/Mani also had a Thursday Thunor\/Thor of Tongersdei? ### Input: CREATE TABLE table_66876 (\n \"Sunday Sunna\/S\\u00f3l\" text,\n \"Monday Mona\/ M\\u00e1ni\" text,\n \"Tuesday Tiw\/ Tyr\" text,\n \"Wednesday Woden \/ Odin\" text,\n \"Thursday Thunor \/ Thor\" text,\n \"Friday Frige or Freya\" text,\n \"Saturday Saturn\" text\n) ### Response: SELECT \"Monday Mona\/ M\\u00e1ni\" FROM table_66876 WHERE \"Thursday Thunor \/ Thor\" = 'tongersdei'"} {"instruction":"What's the loss for September 16?","input":"CREATE TABLE table_79725 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Record\" text\n)","response":"SELECT \"Loss\" FROM table_79725 WHERE \"Date\" = 'september 16'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the loss for September 16? ### Input: CREATE TABLE table_79725 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Record\" text\n) ### Response: SELECT \"Loss\" FROM table_79725 WHERE \"Date\" = 'september 16'"} {"instruction":"Name the number of week for game site being memorial stadium for buffalo bills","input":"CREATE TABLE table_14940519_1 (\n week VARCHAR,\n game_site VARCHAR,\n opponent VARCHAR\n)","response":"SELECT COUNT(week) FROM table_14940519_1 WHERE game_site = \"Memorial Stadium\" AND opponent = \"Buffalo Bills\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of week for game site being memorial stadium for buffalo bills ### Input: CREATE TABLE table_14940519_1 (\n week VARCHAR,\n game_site VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT COUNT(week) FROM table_14940519_1 WHERE game_site = \"Memorial Stadium\" AND opponent = \"Buffalo Bills\""} {"instruction":"Where did the Vit ria de Set bal club place in the 2006-2007 season?","input":"CREATE TABLE table_51904 (\n \"Club\" text,\n \"Head Coach\" text,\n \"City\" text,\n \"Stadium\" text,\n \"2006-2007 season\" text\n)","response":"SELECT \"2006-2007 season\" FROM table_51904 WHERE \"Club\" = 'vit\u00f3ria de set\u00fabal'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the Vit ria de Set bal club place in the 2006-2007 season? ### Input: CREATE TABLE table_51904 (\n \"Club\" text,\n \"Head Coach\" text,\n \"City\" text,\n \"Stadium\" text,\n \"2006-2007 season\" text\n) ### Response: SELECT \"2006-2007 season\" FROM table_51904 WHERE \"Club\" = 'vit\u00f3ria de set\u00fabal'"} {"instruction":"How many students does each advisor have. Show scatter chart.","input":"CREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Has_Allergy (\n StuID INTEGER,\n Allergy VARCHAR(20)\n)\n\nCREATE TABLE Allergy_Type (\n Allergy VARCHAR(20),\n AllergyType VARCHAR(20)\n)","response":"SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many students does each advisor have. Show scatter chart. ### Input: CREATE TABLE Student (\n StuID INTEGER,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n)\n\nCREATE TABLE Has_Allergy (\n StuID INTEGER,\n Allergy VARCHAR(20)\n)\n\nCREATE TABLE Allergy_Type (\n Allergy VARCHAR(20),\n AllergyType VARCHAR(20)\n) ### Response: SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor"} {"instruction":"tell me the maximum hospital cost if there is a gstr\/ddnts nos w hmrhg this year?","input":"CREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)","response":"SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gstr\/ddnts nos w hmrhg')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS t1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the maximum hospital cost if there is a gstr\/ddnts nos w hmrhg this year? ### Input: CREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n) ### Response: SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gstr\/ddnts nos w hmrhg')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS t1"} {"instruction":"Name the birth of the person married 24 may 1935","input":"CREATE TABLE table_68311 (\n \"Name\" text,\n \"Birth\" text,\n \"Marriage\" text,\n \"Became Consort\" text,\n \"Ceased to be Consort\" text,\n \"Spouse\" text\n)","response":"SELECT \"Birth\" FROM table_68311 WHERE \"Marriage\" = '24 may 1935'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the birth of the person married 24 may 1935 ### Input: CREATE TABLE table_68311 (\n \"Name\" text,\n \"Birth\" text,\n \"Marriage\" text,\n \"Became Consort\" text,\n \"Ceased to be Consort\" text,\n \"Spouse\" text\n) ### Response: SELECT \"Birth\" FROM table_68311 WHERE \"Marriage\" = '24 may 1935'"} {"instruction":"How many attended during the game with a score of 80-94?","input":"CREATE TABLE table_name_52 (\n attendance INTEGER,\n score VARCHAR\n)","response":"SELECT SUM(attendance) FROM table_name_52 WHERE score = \"80-94\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many attended during the game with a score of 80-94? ### Input: CREATE TABLE table_name_52 (\n attendance INTEGER,\n score VARCHAR\n) ### Response: SELECT SUM(attendance) FROM table_name_52 WHERE score = \"80-94\""} {"instruction":"Draw a bar chart of asset make versus the number of asset make, and display in asc by the X.","input":"CREATE TABLE Asset_Parts (\n asset_id INTEGER,\n part_id INTEGER\n)\n\nCREATE TABLE Skills (\n skill_id INTEGER,\n skill_code VARCHAR(20),\n skill_description VARCHAR(255)\n)\n\nCREATE TABLE Fault_Log_Parts (\n fault_log_entry_id INTEGER,\n part_fault_id INTEGER,\n fault_status VARCHAR(10)\n)\n\nCREATE TABLE Staff (\n staff_id INTEGER,\n staff_name VARCHAR(255),\n gender VARCHAR(1),\n other_staff_details VARCHAR(255)\n)\n\nCREATE TABLE Maintenance_Engineers (\n engineer_id INTEGER,\n company_id INTEGER,\n first_name VARCHAR(50),\n last_name VARCHAR(50),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Third_Party_Companies (\n company_id INTEGER,\n company_type VARCHAR(5),\n company_name VARCHAR(255),\n company_address VARCHAR(255),\n other_company_details VARCHAR(255)\n)\n\nCREATE TABLE Fault_Log (\n fault_log_entry_id INTEGER,\n asset_id INTEGER,\n recorded_by_staff_id INTEGER,\n fault_log_entry_datetime DATETIME,\n fault_description VARCHAR(255),\n other_fault_details VARCHAR(255)\n)\n\nCREATE TABLE Parts (\n part_id INTEGER,\n part_name VARCHAR(255),\n chargeable_yn VARCHAR(1),\n chargeable_amount VARCHAR(20),\n other_part_details VARCHAR(255)\n)\n\nCREATE TABLE Part_Faults (\n part_fault_id INTEGER,\n part_id INTEGER,\n fault_short_name VARCHAR(20),\n fault_description VARCHAR(255),\n other_fault_details VARCHAR(255)\n)\n\nCREATE TABLE Engineer_Visits (\n engineer_visit_id INTEGER,\n contact_staff_id INTEGER,\n engineer_id INTEGER,\n fault_log_entry_id INTEGER,\n fault_status VARCHAR(10),\n visit_start_datetime DATETIME,\n visit_end_datetime DATETIME,\n other_visit_details VARCHAR(255)\n)\n\nCREATE TABLE Engineer_Skills (\n engineer_id INTEGER,\n skill_id INTEGER\n)\n\nCREATE TABLE Assets (\n asset_id INTEGER,\n maintenance_contract_id INTEGER,\n supplier_company_id INTEGER,\n asset_details VARCHAR(255),\n asset_make VARCHAR(20),\n asset_model VARCHAR(20),\n asset_acquired_date DATETIME,\n asset_disposed_date DATETIME,\n other_asset_details VARCHAR(255)\n)\n\nCREATE TABLE Maintenance_Contracts (\n maintenance_contract_id INTEGER,\n maintenance_contract_company_id INTEGER,\n contract_start_date DATETIME,\n contract_end_date DATETIME,\n other_contract_details VARCHAR(255)\n)\n\nCREATE TABLE Skills_Required_To_Fix (\n part_fault_id INTEGER,\n skill_id INTEGER\n)","response":"SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of asset make versus the number of asset make, and display in asc by the X. ### Input: CREATE TABLE Asset_Parts (\n asset_id INTEGER,\n part_id INTEGER\n)\n\nCREATE TABLE Skills (\n skill_id INTEGER,\n skill_code VARCHAR(20),\n skill_description VARCHAR(255)\n)\n\nCREATE TABLE Fault_Log_Parts (\n fault_log_entry_id INTEGER,\n part_fault_id INTEGER,\n fault_status VARCHAR(10)\n)\n\nCREATE TABLE Staff (\n staff_id INTEGER,\n staff_name VARCHAR(255),\n gender VARCHAR(1),\n other_staff_details VARCHAR(255)\n)\n\nCREATE TABLE Maintenance_Engineers (\n engineer_id INTEGER,\n company_id INTEGER,\n first_name VARCHAR(50),\n last_name VARCHAR(50),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Third_Party_Companies (\n company_id INTEGER,\n company_type VARCHAR(5),\n company_name VARCHAR(255),\n company_address VARCHAR(255),\n other_company_details VARCHAR(255)\n)\n\nCREATE TABLE Fault_Log (\n fault_log_entry_id INTEGER,\n asset_id INTEGER,\n recorded_by_staff_id INTEGER,\n fault_log_entry_datetime DATETIME,\n fault_description VARCHAR(255),\n other_fault_details VARCHAR(255)\n)\n\nCREATE TABLE Parts (\n part_id INTEGER,\n part_name VARCHAR(255),\n chargeable_yn VARCHAR(1),\n chargeable_amount VARCHAR(20),\n other_part_details VARCHAR(255)\n)\n\nCREATE TABLE Part_Faults (\n part_fault_id INTEGER,\n part_id INTEGER,\n fault_short_name VARCHAR(20),\n fault_description VARCHAR(255),\n other_fault_details VARCHAR(255)\n)\n\nCREATE TABLE Engineer_Visits (\n engineer_visit_id INTEGER,\n contact_staff_id INTEGER,\n engineer_id INTEGER,\n fault_log_entry_id INTEGER,\n fault_status VARCHAR(10),\n visit_start_datetime DATETIME,\n visit_end_datetime DATETIME,\n other_visit_details VARCHAR(255)\n)\n\nCREATE TABLE Engineer_Skills (\n engineer_id INTEGER,\n skill_id INTEGER\n)\n\nCREATE TABLE Assets (\n asset_id INTEGER,\n maintenance_contract_id INTEGER,\n supplier_company_id INTEGER,\n asset_details VARCHAR(255),\n asset_make VARCHAR(20),\n asset_model VARCHAR(20),\n asset_acquired_date DATETIME,\n asset_disposed_date DATETIME,\n other_asset_details VARCHAR(255)\n)\n\nCREATE TABLE Maintenance_Contracts (\n maintenance_contract_id INTEGER,\n maintenance_contract_company_id INTEGER,\n contract_start_date DATETIME,\n contract_end_date DATETIME,\n other_contract_details VARCHAR(255)\n)\n\nCREATE TABLE Skills_Required_To_Fix (\n part_fault_id INTEGER,\n skill_id INTEGER\n) ### Response: SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make"} {"instruction":"How many cop apps in the season with fewer than 12 league apps?","input":"CREATE TABLE table_32374 (\n \"Season\" text,\n \"Team\" text,\n \"League Apps\" real,\n \"League Goals\" real,\n \"Cup Apps\" real,\n \"Cup Goals\" real\n)","response":"SELECT SUM(\"Cup Apps\") FROM table_32374 WHERE \"League Apps\" < '12'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many cop apps in the season with fewer than 12 league apps? ### Input: CREATE TABLE table_32374 (\n \"Season\" text,\n \"Team\" text,\n \"League Apps\" real,\n \"League Goals\" real,\n \"Cup Apps\" real,\n \"Cup Goals\" real\n) ### Response: SELECT SUM(\"Cup Apps\") FROM table_32374 WHERE \"League Apps\" < '12'"} {"instruction":"What competition has the club villareal?","input":"CREATE TABLE table_name_89 (\n competition VARCHAR,\n club VARCHAR\n)","response":"SELECT competition FROM table_name_89 WHERE club = \"villareal\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What competition has the club villareal? ### Input: CREATE TABLE table_name_89 (\n competition VARCHAR,\n club VARCHAR\n) ### Response: SELECT competition FROM table_name_89 WHERE club = \"villareal\""} {"instruction":"when was joe clark first elected ?","input":"CREATE TABLE table_203_214 (\n id number,\n \"member\" text,\n \"party\" text,\n \"electorate\" text,\n \"state\" text,\n \"first elected\" text\n)","response":"SELECT \"first elected\" FROM table_203_214 WHERE \"member\" = 'joe clark'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was joe clark first elected ? ### Input: CREATE TABLE table_203_214 (\n id number,\n \"member\" text,\n \"party\" text,\n \"electorate\" text,\n \"state\" text,\n \"first elected\" text\n) ### Response: SELECT \"first elected\" FROM table_203_214 WHERE \"member\" = 'joe clark'"} {"instruction":"Bar graph to show how many nationality from different nationality, list in desc by the total number.","input":"CREATE TABLE mission (\n Mission_ID int,\n Ship_ID int,\n Code text,\n Launched_Year int,\n Location text,\n Speed_knots int,\n Fate text\n)\n\nCREATE TABLE ship (\n Ship_ID int,\n Name text,\n Type text,\n Nationality text,\n Tonnage int\n)","response":"SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show how many nationality from different nationality, list in desc by the total number. ### Input: CREATE TABLE mission (\n Mission_ID int,\n Ship_ID int,\n Code text,\n Launched_Year int,\n Location text,\n Speed_knots int,\n Fate text\n)\n\nCREATE TABLE ship (\n Ship_ID int,\n Name text,\n Type text,\n Nationality text,\n Tonnage int\n) ### Response: SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC"} {"instruction":"what are the top five frequent prescribed drugs that were prescribed to patients aged 20s in the same hospital encounter after they had been diagnosed with quadriplegia-partial until 2104?","input":"CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)","response":"SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'quadriplegia-partial' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.age BETWEEN 20 AND 29 AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top five frequent prescribed drugs that were prescribed to patients aged 20s in the same hospital encounter after they had been diagnosed with quadriplegia-partial until 2104? ### Input: CREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n) ### Response: SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'quadriplegia-partial' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.age BETWEEN 20 AND 29 AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5"} {"instruction":"In which venue did the competition on 11 October 2008 take place?","input":"CREATE TABLE table_14524 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n)","response":"SELECT \"Venue\" FROM table_14524 WHERE \"Date\" = '11 october 2008'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In which venue did the competition on 11 October 2008 take place? ### Input: CREATE TABLE table_14524 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n) ### Response: SELECT \"Venue\" FROM table_14524 WHERE \"Date\" = '11 october 2008'"} {"instruction":"Display a bar chart for what are the different card types, and how many cards are there of each?","input":"CREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Customers_Cards (\n card_id INTEGER,\n customer_id INTEGER,\n card_type_code VARCHAR(15),\n card_number VARCHAR(80),\n date_valid_from DATETIME,\n date_valid_to DATETIME,\n other_card_details VARCHAR(255)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n previous_transaction_id INTEGER,\n account_id INTEGER,\n card_id INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DOUBLE,\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(20),\n customer_last_name VARCHAR(20),\n customer_address VARCHAR(255),\n customer_phone VARCHAR(255),\n customer_email VARCHAR(255),\n other_customer_details VARCHAR(255)\n)","response":"SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a bar chart for what are the different card types, and how many cards are there of each? ### Input: CREATE TABLE Accounts (\n account_id INTEGER,\n customer_id INTEGER,\n account_name VARCHAR(50),\n other_account_details VARCHAR(255)\n)\n\nCREATE TABLE Customers_Cards (\n card_id INTEGER,\n customer_id INTEGER,\n card_type_code VARCHAR(15),\n card_number VARCHAR(80),\n date_valid_from DATETIME,\n date_valid_to DATETIME,\n other_card_details VARCHAR(255)\n)\n\nCREATE TABLE Financial_Transactions (\n transaction_id INTEGER,\n previous_transaction_id INTEGER,\n account_id INTEGER,\n card_id INTEGER,\n transaction_type VARCHAR(15),\n transaction_date DATETIME,\n transaction_amount DOUBLE,\n transaction_comment VARCHAR(255),\n other_transaction_details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n customer_id INTEGER,\n customer_first_name VARCHAR(20),\n customer_last_name VARCHAR(20),\n customer_address VARCHAR(255),\n customer_phone VARCHAR(255),\n customer_email VARCHAR(255),\n other_customer_details VARCHAR(255)\n) ### Response: SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code"} {"instruction":"count the number of patients whose days of hospital stay is greater than 17 and diagnoses long title is diabetes with renal manifestations, type i [juvenile type], not stated as uncontrolled?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > \"17\" AND diagnoses.long_title = \"Diabetes with renal manifestations, type I [juvenile type], not stated as uncontrolled\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose days of hospital stay is greater than 17 and diagnoses long title is diabetes with renal manifestations, type i [juvenile type], not stated as uncontrolled? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > \"17\" AND diagnoses.long_title = \"Diabetes with renal manifestations, type I [juvenile type], not stated as uncontrolled\""} {"instruction":"give me the number of patients less than 45 years who were hospitalized for more than 20 days.","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < \"45\" AND demographic.days_stay > \"20\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients less than 45 years who were hospitalized for more than 20 days. ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < \"45\" AND demographic.days_stay > \"20\""} {"instruction":"Which venue does Mardan sponsor?","input":"CREATE TABLE table_17356873_1 (\n venue VARCHAR,\n shirt_sponsor VARCHAR\n)","response":"SELECT venue FROM table_17356873_1 WHERE shirt_sponsor = \"Mardan\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue does Mardan sponsor? ### Input: CREATE TABLE table_17356873_1 (\n venue VARCHAR,\n shirt_sponsor VARCHAR\n) ### Response: SELECT venue FROM table_17356873_1 WHERE shirt_sponsor = \"Mardan\""} {"instruction":"Who was the runner-up in season five?","input":"CREATE TABLE table_16331144_1 (\n runner_up VARCHAR,\n season VARCHAR\n)","response":"SELECT runner_up FROM table_16331144_1 WHERE season = \"Five\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the runner-up in season five? ### Input: CREATE TABLE table_16331144_1 (\n runner_up VARCHAR,\n season VARCHAR\n) ### Response: SELECT runner_up FROM table_16331144_1 WHERE season = \"Five\""} {"instruction":"what's the transmission where turbo is yes (mitsubishi td04-16t )","input":"CREATE TABLE table_16484 (\n \"Trim\" text,\n \"Engine\" text,\n \"Turbo\" text,\n \"Fuel Delivery\" text,\n \"Power\" text,\n \"Torque\" text,\n \"Transmission\" text,\n \"Performance\" text\n)","response":"SELECT \"Transmission\" FROM table_16484 WHERE \"Turbo\" = 'Yes (Mitsubishi TD04-16t )'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the transmission where turbo is yes (mitsubishi td04-16t ) ### Input: CREATE TABLE table_16484 (\n \"Trim\" text,\n \"Engine\" text,\n \"Turbo\" text,\n \"Fuel Delivery\" text,\n \"Power\" text,\n \"Torque\" text,\n \"Transmission\" text,\n \"Performance\" text\n) ### Response: SELECT \"Transmission\" FROM table_16484 WHERE \"Turbo\" = 'Yes (Mitsubishi TD04-16t )'"} {"instruction":"What is the lowest round of Ed Smith, who had a pick lower than 19?","input":"CREATE TABLE table_35935 (\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Position\" text,\n \"School\/Club Team\" text\n)","response":"SELECT MIN(\"Round\") FROM table_35935 WHERE \"Player\" = 'ed smith' AND \"Pick\" > '19'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest round of Ed Smith, who had a pick lower than 19? ### Input: CREATE TABLE table_35935 (\n \"Round\" real,\n \"Pick\" real,\n \"Player\" text,\n \"Position\" text,\n \"School\/Club Team\" text\n) ### Response: SELECT MIN(\"Round\") FROM table_35935 WHERE \"Player\" = 'ed smith' AND \"Pick\" > '19'"} {"instruction":"count the number of patients whose primary disease is coronary artery disease\\coronary artery bypass graft; myomectomy\/sda and lab test fluid is urine?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = \"CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY\/SDA\" AND lab.fluid = \"Urine\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose primary disease is coronary artery disease\\coronary artery bypass graft; myomectomy\/sda and lab test fluid is urine? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = \"CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY\/SDA\" AND lab.fluid = \"Urine\""} {"instruction":"The plural abbreviation of ll. uses what plural word?","input":"CREATE TABLE table_name_94 (\n plural_word VARCHAR,\n plural_abbreviation VARCHAR\n)","response":"SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = \"ll.\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The plural abbreviation of ll. uses what plural word? ### Input: CREATE TABLE table_name_94 (\n plural_word VARCHAR,\n plural_abbreviation VARCHAR\n) ### Response: SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = \"ll.\""} {"instruction":"list flights from INDIANAPOLIS to MEMPHIS with fares on monday","input":"CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)","response":"SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND flight.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'MEMPHIS'))) AND flight.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'INDIANAPOLIS'))) AND fare.fare_basis_code IN (SELECT FARE_BASISalias0.fare_basis_code FROM fare_basis AS FARE_BASISalias0 WHERE FARE_BASISalias0.basis_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 21 AND DATE_DAYalias1.month_number = 2 AND DATE_DAYalias1.year = 1991))) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list flights from INDIANAPOLIS to MEMPHIS with fares on monday ### Input: CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n) ### Response: SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND flight.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'MEMPHIS'))) AND flight.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'INDIANAPOLIS'))) AND fare.fare_basis_code IN (SELECT FARE_BASISalias0.fare_basis_code FROM fare_basis AS FARE_BASISalias0 WHERE FARE_BASISalias0.basis_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 21 AND DATE_DAYalias1.month_number = 2 AND DATE_DAYalias1.year = 1991))) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id"} {"instruction":"What date is the 1:00 pm game at arrowhead stadium?","input":"CREATE TABLE table_name_37 (\n date VARCHAR,\n time___et__ VARCHAR,\n game_site VARCHAR\n)","response":"SELECT date FROM table_name_37 WHERE time___et__ = \"1:00 pm\" AND game_site = \"arrowhead stadium\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date is the 1:00 pm game at arrowhead stadium? ### Input: CREATE TABLE table_name_37 (\n date VARCHAR,\n time___et__ VARCHAR,\n game_site VARCHAR\n) ### Response: SELECT date FROM table_name_37 WHERE time___et__ = \"1:00 pm\" AND game_site = \"arrowhead stadium\""} {"instruction":"What is draft detail of the document with id 7?","input":"CREATE TABLE addresses (\n address_id number,\n address_details text\n)\n\nCREATE TABLE circulation_history (\n document_id number,\n draft_number number,\n copy_number number,\n employee_id number\n)\n\nCREATE TABLE ref_document_status (\n document_status_code text,\n document_status_description text\n)\n\nCREATE TABLE roles (\n role_code text,\n role_description text\n)\n\nCREATE TABLE documents_mailed (\n document_id number,\n mailed_to_address_id number,\n mailing_date time\n)\n\nCREATE TABLE document_drafts (\n document_id number,\n draft_number number,\n draft_details text\n)\n\nCREATE TABLE ref_shipping_agents (\n shipping_agent_code text,\n shipping_agent_name text,\n shipping_agent_description text\n)\n\nCREATE TABLE draft_copies (\n document_id number,\n draft_number number,\n copy_number number\n)\n\nCREATE TABLE employees (\n employee_id number,\n role_code text,\n employee_name text,\n other_details text\n)\n\nCREATE TABLE ref_document_types (\n document_type_code text,\n document_type_description text\n)\n\nCREATE TABLE documents (\n document_id number,\n document_status_code text,\n document_type_code text,\n shipping_agent_code text,\n receipt_date time,\n receipt_number text,\n other_details text\n)","response":"SELECT draft_details FROM document_drafts WHERE document_id = 7","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is draft detail of the document with id 7? ### Input: CREATE TABLE addresses (\n address_id number,\n address_details text\n)\n\nCREATE TABLE circulation_history (\n document_id number,\n draft_number number,\n copy_number number,\n employee_id number\n)\n\nCREATE TABLE ref_document_status (\n document_status_code text,\n document_status_description text\n)\n\nCREATE TABLE roles (\n role_code text,\n role_description text\n)\n\nCREATE TABLE documents_mailed (\n document_id number,\n mailed_to_address_id number,\n mailing_date time\n)\n\nCREATE TABLE document_drafts (\n document_id number,\n draft_number number,\n draft_details text\n)\n\nCREATE TABLE ref_shipping_agents (\n shipping_agent_code text,\n shipping_agent_name text,\n shipping_agent_description text\n)\n\nCREATE TABLE draft_copies (\n document_id number,\n draft_number number,\n copy_number number\n)\n\nCREATE TABLE employees (\n employee_id number,\n role_code text,\n employee_name text,\n other_details text\n)\n\nCREATE TABLE ref_document_types (\n document_type_code text,\n document_type_description text\n)\n\nCREATE TABLE documents (\n document_id number,\n document_status_code text,\n document_type_code text,\n shipping_agent_code text,\n receipt_date time,\n receipt_number text,\n other_details text\n) ### Response: SELECT draft_details FROM document_drafts WHERE document_id = 7"} {"instruction":"What is the Jump 2 of the person that has a Jump 3 of 7.77?","input":"CREATE TABLE table_32520 (\n \"Athlete Name\" text,\n \"Jump 1\" text,\n \"Jump 2\" text,\n \"Jump 3\" text,\n \"Best Jump\" text\n)","response":"SELECT \"Jump 2\" FROM table_32520 WHERE \"Jump 3\" = '7.77'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Jump 2 of the person that has a Jump 3 of 7.77? ### Input: CREATE TABLE table_32520 (\n \"Athlete Name\" text,\n \"Jump 1\" text,\n \"Jump 2\" text,\n \"Jump 3\" text,\n \"Best Jump\" text\n) ### Response: SELECT \"Jump 2\" FROM table_32520 WHERE \"Jump 3\" = '7.77'"} {"instruction":"Give me a pie to show how many directed by from different directed by.","input":"CREATE TABLE cinema (\n Cinema_ID int,\n Name text,\n Openning_year int,\n Capacity int,\n Location text\n)\n\nCREATE TABLE film (\n Film_ID int,\n Rank_in_series int,\n Number_in_season int,\n Title text,\n Directed_by text,\n Original_air_date text,\n Production_code text\n)\n\nCREATE TABLE schedule (\n Cinema_ID int,\n Film_ID int,\n Date text,\n Show_times_per_day int,\n Price float\n)","response":"SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a pie to show how many directed by from different directed by. ### Input: CREATE TABLE cinema (\n Cinema_ID int,\n Name text,\n Openning_year int,\n Capacity int,\n Location text\n)\n\nCREATE TABLE film (\n Film_ID int,\n Rank_in_series int,\n Number_in_season int,\n Title text,\n Directed_by text,\n Original_air_date text,\n Production_code text\n)\n\nCREATE TABLE schedule (\n Cinema_ID int,\n Film_ID int,\n Date text,\n Show_times_per_day int,\n Price float\n) ### Response: SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by"} {"instruction":"What is Ariel 3's COSPAR ID?","input":"CREATE TABLE table_name_3 (\n cospar_id VARCHAR,\n satellite VARCHAR\n)","response":"SELECT cospar_id FROM table_name_3 WHERE satellite = \"ariel 3\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Ariel 3's COSPAR ID? ### Input: CREATE TABLE table_name_3 (\n cospar_id VARCHAR,\n satellite VARCHAR\n) ### Response: SELECT cospar_id FROM table_name_3 WHERE satellite = \"ariel 3\""} {"instruction":"in a year before d5 1\/2ns, labetalol or insulin were prescribed for patient 10266?","input":"CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)","response":"SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1\/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in a year before d5 1\/2ns, labetalol or insulin were prescribed for patient 10266? ### Input: CREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1\/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')"} {"instruction":"Top 100 posts by view count.","input":"CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 100 posts by view count. ### Input: CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100"} {"instruction":"What Chassis has g Tyres before 1987?","input":"CREATE TABLE table_71124 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyres\" text,\n \"Points\" real\n)","response":"SELECT \"Chassis\" FROM table_71124 WHERE \"Tyres\" = 'g' AND \"Year\" < '1987'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Chassis has g Tyres before 1987? ### Input: CREATE TABLE table_71124 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Tyres\" text,\n \"Points\" real\n) ### Response: SELECT \"Chassis\" FROM table_71124 WHERE \"Tyres\" = 'g' AND \"Year\" < '1987'"} {"instruction":"Which channel comes out of Israel?","input":"CREATE TABLE table_name_83 (\n channel VARCHAR,\n country VARCHAR\n)","response":"SELECT channel FROM table_name_83 WHERE country = \"israel\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which channel comes out of Israel? ### Input: CREATE TABLE table_name_83 (\n channel VARCHAR,\n country VARCHAR\n) ### Response: SELECT channel FROM table_name_83 WHERE country = \"israel\""} {"instruction":"how many patients are diagnosed with nb obsrv suspct infect and tested under hematology category in lab?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = \"NB obsrv suspct infect\" AND lab.\"CATEGORY\" = \"Hematology\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are diagnosed with nb obsrv suspct infect and tested under hematology category in lab? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = \"NB obsrv suspct infect\" AND lab.\"CATEGORY\" = \"Hematology\""} {"instruction":"In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas?","input":"CREATE TABLE table_name_83 (\n year VARCHAR,\n team VARCHAR,\n tournament VARCHAR,\n finish VARCHAR\n)","response":"SELECT year FROM table_name_83 WHERE tournament = \"1st division el salvador\" AND finish = \"champion\" AND team = \"fas\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas? ### Input: CREATE TABLE table_name_83 (\n year VARCHAR,\n team VARCHAR,\n tournament VARCHAR,\n finish VARCHAR\n) ### Response: SELECT year FROM table_name_83 WHERE tournament = \"1st division el salvador\" AND finish = \"champion\" AND team = \"fas\""} {"instruction":"What is Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'?","input":"CREATE TABLE table_name_76 (\n accolade VARCHAR,\n rank VARCHAR,\n year VARCHAR,\n publication VARCHAR\n)","response":"SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = \"rolling stone\" AND rank = 48","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'? ### Input: CREATE TABLE table_name_76 (\n accolade VARCHAR,\n rank VARCHAR,\n year VARCHAR,\n publication VARCHAR\n) ### Response: SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = \"rolling stone\" AND rank = 48"} {"instruction":"For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time.","input":"CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)","response":"SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. ### Input: CREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n) ### Response: SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)"} {"instruction":"what are the flights and fares from BOSTON to PHILADELPHIA","input":"CREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)","response":"SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the flights and fares from BOSTON to PHILADELPHIA ### Input: CREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n) ### Response: SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"what is the last treaty morocco ratified ?","input":"CREATE TABLE table_203_109 (\n id number,\n \"treaty\" text,\n \"organization\" text,\n \"introduced\" number,\n \"signed\" number,\n \"ratified\" number\n)","response":"SELECT \"treaty\" FROM table_203_109 ORDER BY \"ratified\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the last treaty morocco ratified ? ### Input: CREATE TABLE table_203_109 (\n id number,\n \"treaty\" text,\n \"organization\" text,\n \"introduced\" number,\n \"signed\" number,\n \"ratified\" number\n) ### Response: SELECT \"treaty\" FROM table_203_109 ORDER BY \"ratified\" DESC LIMIT 1"} {"instruction":"had patient 13806 been prescribed vancomycin hcl, phenylephrine or d5w (excel bag) until 2102?","input":"CREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102'","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 13806 been prescribed vancomycin hcl, phenylephrine or d5w (excel bag) until 2102? ### Input: CREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102'"} {"instruction":"Name the 2012 for 2009 of 1r","input":"CREATE TABLE table_58551 (\n \"Tournament\" text,\n \"2009\" text,\n \"2011\" text,\n \"2012\" text,\n \"2013\" text\n)","response":"SELECT \"2012\" FROM table_58551 WHERE \"2009\" = '1r'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the 2012 for 2009 of 1r ### Input: CREATE TABLE table_58551 (\n \"Tournament\" text,\n \"2009\" text,\n \"2011\" text,\n \"2012\" text,\n \"2013\" text\n) ### Response: SELECT \"2012\" FROM table_58551 WHERE \"2009\" = '1r'"} {"instruction":"What nurses are on call with block floor 1 and block code 1? Tell me their names.","input":"CREATE TABLE on_call (\n nurse VARCHAR,\n blockfloor VARCHAR,\n blockcode VARCHAR\n)","response":"SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What nurses are on call with block floor 1 and block code 1? Tell me their names. ### Input: CREATE TABLE on_call (\n nurse VARCHAR,\n blockfloor VARCHAR,\n blockcode VARCHAR\n) ### Response: SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1"} {"instruction":"Find posts with broken MathJax (single dollar sign).","input":"CREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)","response":"SELECT Id AS \"post_link\", Body, CreationDate AS \"date\" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%'","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find posts with broken MathJax (single dollar sign). ### Input: CREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n) ### Response: SELECT Id AS \"post_link\", Body, CreationDate AS \"date\" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%'"} {"instruction":"how many patients whose admission type is urgent and primary disease is mesenteric ischemia?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = \"URGENT\" AND demographic.diagnosis = \"MESENTERIC ISCHEMIA\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is urgent and primary disease is mesenteric ischemia? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = \"URGENT\" AND demographic.diagnosis = \"MESENTERIC ISCHEMIA\""} {"instruction":"What is the Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that 12.2","input":"CREATE TABLE table_name_15 (\n right_ascension___j2000__ VARCHAR,\n object_type VARCHAR,\n apparent_magnitude VARCHAR\n)","response":"SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = \"spiral galaxy\" AND apparent_magnitude > 12.2","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that 12.2 ### Input: CREATE TABLE table_name_15 (\n right_ascension___j2000__ VARCHAR,\n object_type VARCHAR,\n apparent_magnitude VARCHAR\n) ### Response: SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = \"spiral galaxy\" AND apparent_magnitude > 12.2"} {"instruction":"Who was the young rider classification when Alessandro Petacchi won?","input":"CREATE TABLE table_30586 (\n \"Stage\" real,\n \"Winner\" text,\n \"General classification\" text,\n \"Points classification\" text,\n \"Mountains classification\" text,\n \"Young rider classification\" text\n)","response":"SELECT \"Young rider classification\" FROM table_30586 WHERE \"Winner\" = 'Alessandro Petacchi'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the young rider classification when Alessandro Petacchi won? ### Input: CREATE TABLE table_30586 (\n \"Stage\" real,\n \"Winner\" text,\n \"General classification\" text,\n \"Points classification\" text,\n \"Mountains classification\" text,\n \"Young rider classification\" text\n) ### Response: SELECT \"Young rider classification\" FROM table_30586 WHERE \"Winner\" = 'Alessandro Petacchi'"} {"instruction":"Total number of posts by months.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)","response":"SELECT COUNT(*) FROM Posts","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Total number of posts by months. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n) ### Response: SELECT COUNT(*) FROM Posts"} {"instruction":"what are the four most frequently ordered lab tests for patients who had previously received ven cath renal dialysis within the same month, in 2104?","input":"CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)","response":"SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ven cath renal dialysis') AND STRFTIME('%y', procedures_icd.charttime) = '2104') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) = '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 4)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequently ordered lab tests for patients who had previously received ven cath renal dialysis within the same month, in 2104? ### Input: CREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n) ### Response: SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ven cath renal dialysis') AND STRFTIME('%y', procedures_icd.charttime) = '2104') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) = '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 4)"} {"instruction":"What is Status, when Newspaper\/Magazine is Al-Thawra?","input":"CREATE TABLE table_name_24 (\n status VARCHAR,\n newspaper_magazine VARCHAR\n)","response":"SELECT status FROM table_name_24 WHERE newspaper_magazine = \"al-thawra\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Status, when Newspaper\/Magazine is Al-Thawra? ### Input: CREATE TABLE table_name_24 (\n status VARCHAR,\n newspaper_magazine VARCHAR\n) ### Response: SELECT status FROM table_name_24 WHERE newspaper_magazine = \"al-thawra\""} {"instruction":"Where Date is september 13, 1998 what is result?","input":"CREATE TABLE table_name_89 (\n result VARCHAR,\n date VARCHAR\n)","response":"SELECT result FROM table_name_89 WHERE date = \"september 13, 1998\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where Date is september 13, 1998 what is result? ### Input: CREATE TABLE table_name_89 (\n result VARCHAR,\n date VARCHAR\n) ### Response: SELECT result FROM table_name_89 WHERE date = \"september 13, 1998\""} {"instruction":"If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge?","input":"CREATE TABLE table_28657 (\n \"Name \/ designation\" text,\n \"Year of introduction\" text,\n \"Country of origin\" text,\n \"Primary cartridge\" text,\n \"primary user\" text\n)","response":"SELECT \"Primary cartridge\" FROM table_28657 WHERE \"Year of introduction\" = '1962' AND \"Country of origin\" = 'Denmark'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge? ### Input: CREATE TABLE table_28657 (\n \"Name \/ designation\" text,\n \"Year of introduction\" text,\n \"Country of origin\" text,\n \"Primary cartridge\" text,\n \"primary user\" text\n) ### Response: SELECT \"Primary cartridge\" FROM table_28657 WHERE \"Year of introduction\" = '1962' AND \"Country of origin\" = 'Denmark'"} {"instruction":"Which 3rd run has rank of 8?","input":"CREATE TABLE table_79697 (\n \"Rank\" real,\n \"Name\" text,\n \"1st run\" text,\n \"2nd run\" text,\n \"3rd run\" text,\n \"Total\" real\n)","response":"SELECT \"3rd run\" FROM table_79697 WHERE \"Rank\" = '8'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which 3rd run has rank of 8? ### Input: CREATE TABLE table_79697 (\n \"Rank\" real,\n \"Name\" text,\n \"1st run\" text,\n \"2nd run\" text,\n \"3rd run\" text,\n \"Total\" real\n) ### Response: SELECT \"3rd run\" FROM table_79697 WHERE \"Rank\" = '8'"} {"instruction":"For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)","response":"SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n) ### Response: SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'"} {"instruction":"What is the type of allergy Cat?","input":"CREATE TABLE allergy_type (\n allergy text,\n allergytype text\n)\n\nCREATE TABLE has_allergy (\n stuid number,\n allergy text\n)\n\nCREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n)","response":"SELECT allergytype FROM allergy_type WHERE allergy = \"Cat\"","source":"spider","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the type of allergy Cat? ### Input: CREATE TABLE allergy_type (\n allergy text,\n allergytype text\n)\n\nCREATE TABLE has_allergy (\n stuid number,\n allergy text\n)\n\nCREATE TABLE student (\n stuid number,\n lname text,\n fname text,\n age number,\n sex text,\n major number,\n advisor number,\n city_code text\n) ### Response: SELECT allergytype FROM allergy_type WHERE allergy = \"Cat\""} {"instruction":"Which venue did Luke Blackwell serve as captain?","input":"CREATE TABLE table_18796 (\n \"Season\" real,\n \"Premiers\" text,\n \"Runners Up\" text,\n \"Score\" text,\n \"Captain\" text,\n \"Coach\" text,\n \"Simpson Medal\" text,\n \"Venue\" text,\n \"Attendance\" real,\n \"Umpires\" text\n)","response":"SELECT \"Venue\" FROM table_18796 WHERE \"Captain\" = 'Luke Blackwell'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue did Luke Blackwell serve as captain? ### Input: CREATE TABLE table_18796 (\n \"Season\" real,\n \"Premiers\" text,\n \"Runners Up\" text,\n \"Score\" text,\n \"Captain\" text,\n \"Coach\" text,\n \"Simpson Medal\" text,\n \"Venue\" text,\n \"Attendance\" real,\n \"Umpires\" text\n) ### Response: SELECT \"Venue\" FROM table_18796 WHERE \"Captain\" = 'Luke Blackwell'"} {"instruction":"When the driver peter gethin has a grid less than 25, what is the average number of laps?","input":"CREATE TABLE table_55351 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT AVG(\"Laps\") FROM table_55351 WHERE \"Driver\" = 'peter gethin' AND \"Grid\" < '25'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the driver peter gethin has a grid less than 25, what is the average number of laps? ### Input: CREATE TABLE table_55351 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT AVG(\"Laps\") FROM table_55351 WHERE \"Driver\" = 'peter gethin' AND \"Grid\" < '25'"} {"instruction":"How many people attended the game when Larry Hughes(33) was the leading scorer and cleveland was visiting?","input":"CREATE TABLE table_35910 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT SUM(\"Attendance\") FROM table_35910 WHERE \"Visitor\" = 'cleveland' AND \"Leading scorer\" = 'larry hughes(33)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the game when Larry Hughes(33) was the leading scorer and cleveland was visiting? ### Input: CREATE TABLE table_35910 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT SUM(\"Attendance\") FROM table_35910 WHERE \"Visitor\" = 'cleveland' AND \"Leading scorer\" = 'larry hughes(33)'"} {"instruction":"What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06)","input":"CREATE TABLE table_489 (\n \"Celebrity\" text,\n \"Background\" text,\n \"Original Team\" text,\n \"Age\" real,\n \"Hometown\" text,\n \"Charity\" text,\n \"Result\" text,\n \"Raised\" text\n)","response":"SELECT \"Original Team\" FROM table_489 WHERE \"Result\" = '08 Fired in week 10 (2008-03-06)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06) ### Input: CREATE TABLE table_489 (\n \"Celebrity\" text,\n \"Background\" text,\n \"Original Team\" text,\n \"Age\" real,\n \"Hometown\" text,\n \"Charity\" text,\n \"Result\" text,\n \"Raised\" text\n) ### Response: SELECT \"Original Team\" FROM table_489 WHERE \"Result\" = '08 Fired in week 10 (2008-03-06)'"} {"instruction":"what is the total number of title ?","input":"CREATE TABLE table_204_265 (\n id number,\n \"no.\" number,\n \"title (latin)\" text,\n \"title (english translation)\" text,\n \"subject\" text,\n \"date\" text\n)","response":"SELECT COUNT(\"subject\") FROM table_204_265","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of title ? ### Input: CREATE TABLE table_204_265 (\n id number,\n \"no.\" number,\n \"title (latin)\" text,\n \"title (english translation)\" text,\n \"subject\" text,\n \"date\" text\n) ### Response: SELECT COUNT(\"subject\") FROM table_204_265"} {"instruction":"who won the south after esc geretsried did during the 2006-07 season ?","input":"CREATE TABLE table_204_1 (\n id number,\n \"season\" text,\n \"north\" text,\n \"south\" text,\n \"east\" text,\n \"west\" text\n)","response":"SELECT \"south\" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE \"south\" = 'esc geretsried') + 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who won the south after esc geretsried did during the 2006-07 season ? ### Input: CREATE TABLE table_204_1 (\n id number,\n \"season\" text,\n \"north\" text,\n \"south\" text,\n \"east\" text,\n \"west\" text\n) ### Response: SELECT \"south\" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE \"south\" = 'esc geretsried') + 1"} {"instruction":"Where is the home ground for the club coached by nick pantsaras and founded before 1946?","input":"CREATE TABLE table_44900 (\n \"Team\" text,\n \"Coach\" text,\n \"Home Ground\" text,\n \"Location\" text,\n \"Founded\" real\n)","response":"SELECT \"Home Ground\" FROM table_44900 WHERE \"Founded\" < '1946' AND \"Coach\" = 'nick pantsaras'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where is the home ground for the club coached by nick pantsaras and founded before 1946? ### Input: CREATE TABLE table_44900 (\n \"Team\" text,\n \"Coach\" text,\n \"Home Ground\" text,\n \"Location\" text,\n \"Founded\" real\n) ### Response: SELECT \"Home Ground\" FROM table_44900 WHERE \"Founded\" < '1946' AND \"Coach\" = 'nick pantsaras'"} {"instruction":"How many years were g Tyres and Minardi m187 used?","input":"CREATE TABLE table_name_82 (\n year INTEGER,\n tyres VARCHAR,\n chassis VARCHAR\n)","response":"SELECT AVG(year) FROM table_name_82 WHERE tyres = \"g\" AND chassis = \"minardi m187\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many years were g Tyres and Minardi m187 used? ### Input: CREATE TABLE table_name_82 (\n year INTEGER,\n tyres VARCHAR,\n chassis VARCHAR\n) ### Response: SELECT AVG(year) FROM table_name_82 WHERE tyres = \"g\" AND chassis = \"minardi m187\""} {"instruction":"What was the result of the game against the Miami Dolphins held at the Riverfront Stadium?","input":"CREATE TABLE table_78664 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Location\" text\n)","response":"SELECT \"Result\" FROM table_78664 WHERE \"Location\" = 'riverfront stadium' AND \"Opponent\" = 'miami dolphins'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game against the Miami Dolphins held at the Riverfront Stadium? ### Input: CREATE TABLE table_78664 (\n \"Week\" text,\n \"Date\" text,\n \"Opponent\" text,\n \"Result\" text,\n \"Location\" text\n) ### Response: SELECT \"Result\" FROM table_78664 WHERE \"Location\" = 'riverfront stadium' AND \"Opponent\" = 'miami dolphins'"} {"instruction":"Who directed the totle 'tjockare n vatten'?","input":"CREATE TABLE table_20709 (\n \"Number in series\" real,\n \"Broadcast Order\" text,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original airdate\" text,\n \"Production Code\" real\n)","response":"SELECT \"Directed by\" FROM table_20709 WHERE \"Title\" = 'Tjockare \u00e4n vatten'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed the totle 'tjockare n vatten'? ### Input: CREATE TABLE table_20709 (\n \"Number in series\" real,\n \"Broadcast Order\" text,\n \"Title\" text,\n \"Directed by\" text,\n \"Written by\" text,\n \"Original airdate\" text,\n \"Production Code\" real\n) ### Response: SELECT \"Directed by\" FROM table_20709 WHERE \"Title\" = 'Tjockare \u00e4n vatten'"} {"instruction":"When did the archbishop that was ordained a bishop on July 25, 1902 die?","input":"CREATE TABLE table_44491 (\n \"Archbishop\" text,\n \"Born\" text,\n \"Ordained Priest\" text,\n \"Ordained Bishop\" text,\n \"Appointed Archbishop\" text,\n \"Vacated throne\" text,\n \"Died\" text\n)","response":"SELECT \"Died\" FROM table_44491 WHERE \"Ordained Bishop\" = 'july 25, 1902'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the archbishop that was ordained a bishop on July 25, 1902 die? ### Input: CREATE TABLE table_44491 (\n \"Archbishop\" text,\n \"Born\" text,\n \"Ordained Priest\" text,\n \"Ordained Bishop\" text,\n \"Appointed Archbishop\" text,\n \"Vacated throne\" text,\n \"Died\" text\n) ### Response: SELECT \"Died\" FROM table_44491 WHERE \"Ordained Bishop\" = 'july 25, 1902'"} {"instruction":"How many rain figures are provided for sunlight hours in 1966?","input":"CREATE TABLE table_17829 (\n \"City\/Town\" text,\n \"July av. T\" text,\n \"Rain\" text,\n \"Days with rain (year\/summer)\" text,\n \"Days with frost\" real,\n \"Sunlight hours\" real\n)","response":"SELECT COUNT(\"Rain\") FROM table_17829 WHERE \"Sunlight hours\" = '1966'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many rain figures are provided for sunlight hours in 1966? ### Input: CREATE TABLE table_17829 (\n \"City\/Town\" text,\n \"July av. T\" text,\n \"Rain\" text,\n \"Days with rain (year\/summer)\" text,\n \"Days with frost\" real,\n \"Sunlight hours\" real\n) ### Response: SELECT COUNT(\"Rain\") FROM table_17829 WHERE \"Sunlight hours\" = '1966'"} {"instruction":"Show the different countries and the number of members from each with a bar chart, rank by the bar in ascending.","input":"CREATE TABLE round (\n Round_ID int,\n Member_ID int,\n Decoration_Theme text,\n Rank_in_Round int\n)\n\nCREATE TABLE member (\n Member_ID int,\n Name text,\n Country text,\n College_ID int\n)\n\nCREATE TABLE college (\n College_ID int,\n Name text,\n Leader_Name text,\n College_Location text\n)","response":"SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the different countries and the number of members from each with a bar chart, rank by the bar in ascending. ### Input: CREATE TABLE round (\n Round_ID int,\n Member_ID int,\n Decoration_Theme text,\n Rank_in_Round int\n)\n\nCREATE TABLE member (\n Member_ID int,\n Name text,\n Country text,\n College_ID int\n)\n\nCREATE TABLE college (\n College_ID int,\n Name text,\n Leader_Name text,\n College_Location text\n) ### Response: SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country"} {"instruction":"Bar chart of total number of height from each sex","input":"CREATE TABLE candidate (\n Candidate_ID int,\n People_ID int,\n Poll_Source text,\n Date text,\n Support_rate real,\n Consider_rate real,\n Oppose_rate real,\n Unsure_rate real\n)\n\nCREATE TABLE people (\n People_ID int,\n Sex text,\n Name text,\n Date_of_Birth text,\n Height real,\n Weight real\n)","response":"SELECT Sex, SUM(Height) FROM people GROUP BY Sex","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart of total number of height from each sex ### Input: CREATE TABLE candidate (\n Candidate_ID int,\n People_ID int,\n Poll_Source text,\n Date text,\n Support_rate real,\n Consider_rate real,\n Oppose_rate real,\n Unsure_rate real\n)\n\nCREATE TABLE people (\n People_ID int,\n Sex text,\n Name text,\n Date_of_Birth text,\n Height real,\n Weight real\n) ### Response: SELECT Sex, SUM(Height) FROM people GROUP BY Sex"} {"instruction":"what was the first time until 05\/2100 patient 002-52932 was prescribed a medication via a misc route?","input":"CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND medication.routeadmin = 'misc' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2100-05' ORDER BY medication.drugstarttime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first time until 05\/2100 patient 002-52932 was prescribed a medication via a misc route? ### Input: CREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND medication.routeadmin = 'misc' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2100-05' ORDER BY medication.drugstarttime LIMIT 1"} {"instruction":"how many times have there been helps by damon stoudamire (13)","input":"CREATE TABLE table_802 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n)","response":"SELECT COUNT(\"Record\") FROM table_802 WHERE \"High assists\" = 'Damon Stoudamire (13)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times have there been helps by damon stoudamire (13) ### Input: CREATE TABLE table_802 (\n \"Game\" real,\n \"Date\" text,\n \"Team\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location Attendance\" text,\n \"Record\" text\n) ### Response: SELECT COUNT(\"Record\") FROM table_802 WHERE \"High assists\" = 'Damon Stoudamire (13)'"} {"instruction":"Show all payment method codes and the number of orders for each code. Visualize by pie chart.","input":"CREATE TABLE Products (\n Product_ID VARCHAR(100),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Product_Description VARCHAR(255),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Customer_Orders (\n Order_ID INTEGER,\n Customer_ID INTEGER,\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings_Services (\n Order_ID INTEGER,\n Product_ID INTEGER\n)\n\nCREATE TABLE Addresses (\n Address_ID VARCHAR(100),\n Line_1 VARCHAR(255),\n Line_2 VARCHAR(255),\n City_Town VARCHAR(255),\n State_County VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Stores (\n Store_ID VARCHAR(100),\n Address_ID INTEGER,\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n Customer_ID VARCHAR(100),\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Drama_Workshop_Groups (\n Workshop_Group_ID INTEGER,\n Address_ID INTEGER,\n Currency_Code CHAR(15),\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers (\n Performer_ID INTEGER,\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n Order_Item_ID INTEGER,\n Order_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Marketing_Regions (\n Marketing_Region_Code CHAR(15),\n Marketing_Region_Name VARCHAR(255),\n Marketing_Region_Descriptrion VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Payment_Methods (\n payment_method_code CHAR(10),\n payment_method_description VARCHAR(80)\n)\n\nCREATE TABLE Invoices (\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n payment_method_code CHAR(15),\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255),\n Order_Item_ID INTEGER\n)\n\nCREATE TABLE Ref_Service_Types (\n Service_Type_Code CHAR(15),\n Parent_Service_Type_Code CHAR(15),\n Service_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Bookings (\n Booking_ID INTEGER,\n Customer_ID INTEGER,\n Workshop_Group_ID VARCHAR(100),\n Status_Code CHAR(15),\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Items (\n Invoice_Item_ID INTEGER,\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n Order_Item_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity INTEGER,\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15),\n Workshop_Group_ID INTEGER,\n Product_Description VARCHAR(255),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers_in_Bookings (\n Order_ID INTEGER,\n Performer_ID INTEGER\n)\n\nCREATE TABLE Clients (\n Client_ID INTEGER,\n Address_ID INTEGER,\n Customer_Email_Address VARCHAR(255),\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Other_Details VARCHAR(255)\n)","response":"SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all payment method codes and the number of orders for each code. Visualize by pie chart. ### Input: CREATE TABLE Products (\n Product_ID VARCHAR(100),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Product_Description VARCHAR(255),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Customer_Orders (\n Order_ID INTEGER,\n Customer_ID INTEGER,\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Bookings_Services (\n Order_ID INTEGER,\n Product_ID INTEGER\n)\n\nCREATE TABLE Addresses (\n Address_ID VARCHAR(100),\n Line_1 VARCHAR(255),\n Line_2 VARCHAR(255),\n City_Town VARCHAR(255),\n State_County VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Stores (\n Store_ID VARCHAR(100),\n Address_ID INTEGER,\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Customers (\n Customer_ID VARCHAR(100),\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Drama_Workshop_Groups (\n Workshop_Group_ID INTEGER,\n Address_ID INTEGER,\n Currency_Code CHAR(15),\n Marketing_Region_Code CHAR(15),\n Store_Name VARCHAR(255),\n Store_Phone VARCHAR(255),\n Store_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers (\n Performer_ID INTEGER,\n Address_ID INTEGER,\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Customer_Email_Address VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Order_Items (\n Order_Item_ID INTEGER,\n Order_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Marketing_Regions (\n Marketing_Region_Code CHAR(15),\n Marketing_Region_Name VARCHAR(255),\n Marketing_Region_Descriptrion VARCHAR(255),\n Other_Details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Payment_Methods (\n payment_method_code CHAR(10),\n payment_method_description VARCHAR(80)\n)\n\nCREATE TABLE Invoices (\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n payment_method_code CHAR(15),\n Product_ID INTEGER,\n Order_Quantity VARCHAR(288),\n Other_Item_Details VARCHAR(255),\n Order_Item_ID INTEGER\n)\n\nCREATE TABLE Ref_Service_Types (\n Service_Type_Code CHAR(15),\n Parent_Service_Type_Code CHAR(15),\n Service_Type_Description VARCHAR(255)\n)\n\nCREATE TABLE Bookings (\n Booking_ID INTEGER,\n Customer_ID INTEGER,\n Workshop_Group_ID VARCHAR(100),\n Status_Code CHAR(15),\n Store_ID INTEGER,\n Order_Date DATETIME,\n Planned_Delivery_Date DATETIME,\n Actual_Delivery_Date DATETIME,\n Other_Order_Details VARCHAR(255)\n)\n\nCREATE TABLE Invoice_Items (\n Invoice_Item_ID INTEGER,\n Invoice_ID INTEGER,\n Order_ID INTEGER,\n Order_Item_ID INTEGER,\n Product_ID INTEGER,\n Order_Quantity INTEGER,\n Other_Item_Details VARCHAR(255)\n)\n\nCREATE TABLE Services (\n Service_ID INTEGER,\n Service_Type_Code CHAR(15),\n Workshop_Group_ID INTEGER,\n Product_Description VARCHAR(255),\n Product_Name VARCHAR(255),\n Product_Price DECIMAL(20,4),\n Other_Product_Service_Details VARCHAR(255)\n)\n\nCREATE TABLE Performers_in_Bookings (\n Order_ID INTEGER,\n Performer_ID INTEGER\n)\n\nCREATE TABLE Clients (\n Client_ID INTEGER,\n Address_ID INTEGER,\n Customer_Email_Address VARCHAR(255),\n Customer_Name VARCHAR(255),\n Customer_Phone VARCHAR(255),\n Other_Details VARCHAR(255)\n) ### Response: SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code"} {"instruction":"For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and sort y axis in ascending order.","input":"CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and sort y axis in ascending order. ### Input: CREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)"} {"instruction":"When was the film directed by Pen-Ek Ratanaruang released?","input":"CREATE TABLE table_name_13 (\n date VARCHAR,\n director VARCHAR\n)","response":"SELECT date FROM table_name_13 WHERE director = \"pen-ek ratanaruang\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the film directed by Pen-Ek Ratanaruang released? ### Input: CREATE TABLE table_name_13 (\n date VARCHAR,\n director VARCHAR\n) ### Response: SELECT date FROM table_name_13 WHERE director = \"pen-ek ratanaruang\""} {"instruction":"Which rider had a speed of 104.630mph?","input":"CREATE TABLE table_52741 (\n \"Rank\" real,\n \"Rider\" text,\n \"Team\" text,\n \"Speed\" text,\n \"Time\" text\n)","response":"SELECT \"Rider\" FROM table_52741 WHERE \"Speed\" = '104.630mph'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which rider had a speed of 104.630mph? ### Input: CREATE TABLE table_52741 (\n \"Rank\" real,\n \"Rider\" text,\n \"Team\" text,\n \"Speed\" text,\n \"Time\" text\n) ### Response: SELECT \"Rider\" FROM table_52741 WHERE \"Speed\" = '104.630mph'"} {"instruction":"what is the total number of apps and goals for luther blissett ?","input":"CREATE TABLE table_204_340 (\n id number,\n \"name\" text,\n \"year inducted\" number,\n \"position\" text,\n \"apps\" number,\n \"goals\" number\n)","response":"SELECT \"apps\" + \"goals\" FROM table_204_340 WHERE \"name\" = 'luther blissett'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of apps and goals for luther blissett ? ### Input: CREATE TABLE table_204_340 (\n id number,\n \"name\" text,\n \"year inducted\" number,\n \"position\" text,\n \"apps\" number,\n \"goals\" number\n) ### Response: SELECT \"apps\" + \"goals\" FROM table_204_340 WHERE \"name\" = 'luther blissett'"} {"instruction":"Parts Plus sponsors what driver?","input":"CREATE TABLE table_name_21 (\n driver_s_ VARCHAR,\n primary_sponsor_s_ VARCHAR\n)","response":"SELECT driver_s_ FROM table_name_21 WHERE primary_sponsor_s_ = \"parts plus\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Parts Plus sponsors what driver? ### Input: CREATE TABLE table_name_21 (\n driver_s_ VARCHAR,\n primary_sponsor_s_ VARCHAR\n) ### Response: SELECT driver_s_ FROM table_name_21 WHERE primary_sponsor_s_ = \"parts plus\""} {"instruction":"What is the place when the performance is 60.73m?","input":"CREATE TABLE table_name_65 (\n place VARCHAR,\n performance VARCHAR\n)","response":"SELECT place FROM table_name_65 WHERE performance = \"60.73m\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the place when the performance is 60.73m? ### Input: CREATE TABLE table_name_65 (\n place VARCHAR,\n performance VARCHAR\n) ### Response: SELECT place FROM table_name_65 WHERE performance = \"60.73m\""} {"instruction":"What year was Sam Kazman a producer?","input":"CREATE TABLE table_name_35 (\n year VARCHAR,\n producer VARCHAR\n)","response":"SELECT year FROM table_name_35 WHERE producer = \"sam kazman\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was Sam Kazman a producer? ### Input: CREATE TABLE table_name_35 (\n year VARCHAR,\n producer VARCHAR\n) ### Response: SELECT year FROM table_name_35 WHERE producer = \"sam kazman\""} {"instruction":"which team had the largest goal difference ?","input":"CREATE TABLE table_203_254 (\n id number,\n \"position\" number,\n \"team\" text,\n \"points\" number,\n \"played\" number,\n \"won\" number,\n \"drawn\" number,\n \"lost\" number,\n \"for\" number,\n \"against\" number,\n \"difference\" number\n)","response":"SELECT \"team\" FROM table_203_254 ORDER BY ABS(\"difference\") DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which team had the largest goal difference ? ### Input: CREATE TABLE table_203_254 (\n id number,\n \"position\" number,\n \"team\" text,\n \"points\" number,\n \"played\" number,\n \"won\" number,\n \"drawn\" number,\n \"lost\" number,\n \"for\" number,\n \"against\" number,\n \"difference\" number\n) ### Response: SELECT \"team\" FROM table_203_254 ORDER BY ABS(\"difference\") DESC LIMIT 1"} {"instruction":"how many days have elapsed since the first time patient 30826 stayed in the ward 12 during this hospital encounter?","input":"CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL)) AND transfers.wardid = 12 ORDER BY transfers.intime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days have elapsed since the first time patient 30826 stayed in the ward 12 during this hospital encounter? ### Input: CREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL)) AND transfers.wardid = 12 ORDER BY transfers.intime LIMIT 1"} {"instruction":"What loan expires date has a Date of 29 december 2003?","input":"CREATE TABLE table_13239 (\n \"Position\" text,\n \"Player\" text,\n \"Loaned to\" text,\n \"Date\" text,\n \"Loan expires\" text\n)","response":"SELECT \"Loan expires\" FROM table_13239 WHERE \"Date\" = '29 december 2003'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What loan expires date has a Date of 29 december 2003? ### Input: CREATE TABLE table_13239 (\n \"Position\" text,\n \"Player\" text,\n \"Loaned to\" text,\n \"Date\" text,\n \"Loan expires\" text\n) ### Response: SELECT \"Loan expires\" FROM table_13239 WHERE \"Date\" = '29 december 2003'"} {"instruction":"Who was the partner that played against Serena Williams Venus Williams?","input":"CREATE TABLE table_9885 (\n \"Outcome\" text,\n \"Year\" real,\n \"Championship\" text,\n \"Surface\" text,\n \"Partner\" text,\n \"Opponents in the final\" text,\n \"Score in the final\" text\n)","response":"SELECT \"Partner\" FROM table_9885 WHERE \"Opponents in the final\" = 'serena williams venus williams'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the partner that played against Serena Williams Venus Williams? ### Input: CREATE TABLE table_9885 (\n \"Outcome\" text,\n \"Year\" real,\n \"Championship\" text,\n \"Surface\" text,\n \"Partner\" text,\n \"Opponents in the final\" text,\n \"Score in the final\" text\n) ### Response: SELECT \"Partner\" FROM table_9885 WHERE \"Opponents in the final\" = 'serena williams venus williams'"} {"instruction":"What is the name of party with most number of members?","input":"CREATE TABLE party (\n party_name VARCHAR,\n party_id VARCHAR\n)\n\nCREATE TABLE Member (\n party_id VARCHAR\n)","response":"SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of party with most number of members? ### Input: CREATE TABLE party (\n party_name VARCHAR,\n party_id VARCHAR\n)\n\nCREATE TABLE Member (\n party_id VARCHAR\n) ### Response: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1"} {"instruction":"What is the call sign for channel 6?","input":"CREATE TABLE table_28631 (\n \"Channel\" real,\n \"Channel name\" text,\n \"Callsign\" text,\n \"Signal power\" text,\n \"Broadcast area\" text\n)","response":"SELECT \"Callsign\" FROM table_28631 WHERE \"Channel\" = '6'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the call sign for channel 6? ### Input: CREATE TABLE table_28631 (\n \"Channel\" real,\n \"Channel name\" text,\n \"Callsign\" text,\n \"Signal power\" text,\n \"Broadcast area\" text\n) ### Response: SELECT \"Callsign\" FROM table_28631 WHERE \"Channel\" = '6'"} {"instruction":"What date has a set 4 of 25-19?","input":"CREATE TABLE table_42037 (\n \"Date\" text,\n \"Score\" text,\n \"Set 1\" text,\n \"Set 2\" text,\n \"Set 3\" text,\n \"Set 4\" text,\n \"Set 5\" text,\n \"Total\" text\n)","response":"SELECT \"Date\" FROM table_42037 WHERE \"Set 4\" = '25-19'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date has a set 4 of 25-19? ### Input: CREATE TABLE table_42037 (\n \"Date\" text,\n \"Score\" text,\n \"Set 1\" text,\n \"Set 2\" text,\n \"Set 3\" text,\n \"Set 4\" text,\n \"Set 5\" text,\n \"Total\" text\n) ### Response: SELECT \"Date\" FROM table_42037 WHERE \"Set 4\" = '25-19'"} {"instruction":"how many patients were admitted before the year 2135 under procedure icd9 code 3893?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < \"2135\" AND procedures.icd9_code = \"3893\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients were admitted before the year 2135 under procedure icd9 code 3893? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < \"2135\" AND procedures.icd9_code = \"3893\""} {"instruction":"What was the total effic for the quarterbacks?","input":"CREATE TABLE table_9027 (\n \"Name\" text,\n \"GP-GS\" text,\n \"Effic\" real,\n \"Att-Cmp-Int\" text,\n \"Avg\/G\" real\n)","response":"SELECT MIN(\"Effic\") FROM table_9027 WHERE \"Name\" = 'total'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the total effic for the quarterbacks? ### Input: CREATE TABLE table_9027 (\n \"Name\" text,\n \"GP-GS\" text,\n \"Effic\" real,\n \"Att-Cmp-Int\" text,\n \"Avg\/G\" real\n) ### Response: SELECT MIN(\"Effic\") FROM table_9027 WHERE \"Name\" = 'total'"} {"instruction":"When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties?","input":"CREATE TABLE table_name_78 (\n civil_liberties INTEGER,\n year VARCHAR,\n political_rights VARCHAR,\n president VARCHAR\n)","response":"SELECT SUM(civil_liberties) FROM table_name_78 WHERE political_rights = 6 AND president = \"yoweri museveni\" AND year = 1993","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties? ### Input: CREATE TABLE table_name_78 (\n civil_liberties INTEGER,\n year VARCHAR,\n political_rights VARCHAR,\n president VARCHAR\n) ### Response: SELECT SUM(civil_liberties) FROM table_name_78 WHERE political_rights = 6 AND president = \"yoweri museveni\" AND year = 1993"} {"instruction":"ST. PETERSBURG to DETROIT","input":"CREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETROIT' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: ST. PETERSBURG to DETROIT ### Input: CREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETROIT' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"Name the fewest tries for leicester tigers with points less than 207","input":"CREATE TABLE table_31955 (\n \"Points\" real,\n \"Name\" text,\n \"Club\" text,\n \"Tries\" real,\n \"Drop\" real\n)","response":"SELECT MIN(\"Tries\") FROM table_31955 WHERE \"Club\" = 'leicester tigers' AND \"Points\" < '207'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the fewest tries for leicester tigers with points less than 207 ### Input: CREATE TABLE table_31955 (\n \"Points\" real,\n \"Name\" text,\n \"Club\" text,\n \"Tries\" real,\n \"Drop\" real\n) ### Response: SELECT MIN(\"Tries\") FROM table_31955 WHERE \"Club\" = 'leicester tigers' AND \"Points\" < '207'"} {"instruction":"Total View Count of User's Accepted Answers.","input":"CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)","response":"SELECT 'Grand Total' AS Title, SUM(Question.ViewCount) AS ViewCount, NULL AS Score FROM Posts AS Answer INNER JOIN PostTypes ON PostTypes.Id = Answer.PostTypeId INNER JOIN Posts AS Question ON Question.Id = Answer.ParentId AND Question.AcceptedAnswerId = Answer.Id WHERE PostTypes.Name = 'Answer' AND Answer.OwnerUserId = '##UserId##' AND Answer.CommunityOwnedDate IS NULL UNION ALL SELECT Question.Title, Question.ViewCount, Question.Score FROM Posts AS Answer INNER JOIN PostTypes ON PostTypes.Id = Answer.PostTypeId INNER JOIN Posts AS Question ON Question.Id = Answer.ParentId AND Question.AcceptedAnswerId = Answer.Id WHERE PostTypes.Name = 'Answer' AND Answer.OwnerUserId = '##UserId##' AND Answer.CommunityOwnedDate IS NULL ORDER BY ViewCount DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Total View Count of User's Accepted Answers. ### Input: CREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n) ### Response: SELECT 'Grand Total' AS Title, SUM(Question.ViewCount) AS ViewCount, NULL AS Score FROM Posts AS Answer INNER JOIN PostTypes ON PostTypes.Id = Answer.PostTypeId INNER JOIN Posts AS Question ON Question.Id = Answer.ParentId AND Question.AcceptedAnswerId = Answer.Id WHERE PostTypes.Name = 'Answer' AND Answer.OwnerUserId = '##UserId##' AND Answer.CommunityOwnedDate IS NULL UNION ALL SELECT Question.Title, Question.ViewCount, Question.Score FROM Posts AS Answer INNER JOIN PostTypes ON PostTypes.Id = Answer.PostTypeId INNER JOIN Posts AS Question ON Question.Id = Answer.ParentId AND Question.AcceptedAnswerId = Answer.Id WHERE PostTypes.Name = 'Answer' AND Answer.OwnerUserId = '##UserId##' AND Answer.CommunityOwnedDate IS NULL ORDER BY ViewCount DESC"} {"instruction":"Find other_details and the sum of monthly_rental , and group by attribute other_details, and visualize them by a bar chart.","input":"CREATE TABLE Addresses (\n address_id INTEGER,\n line_1 VARCHAR(120),\n line_2 VARCHAR(120),\n line_3 VARCHAR(120),\n city VARCHAR(80),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50),\n other_address_details VARCHAR(255)\n)\n\nCREATE TABLE Students_in_Detention (\n student_id INTEGER,\n detention_id INTEGER,\n incident_id INTEGER\n)\n\nCREATE TABLE Behavior_Incident (\n incident_id INTEGER,\n incident_type_code VARCHAR(10),\n student_id INTEGER,\n date_incident_start DATETIME,\n date_incident_end DATETIME,\n incident_summary VARCHAR(255),\n recommendations VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Detention_Type (\n detention_type_code VARCHAR(10),\n detention_type_description VARCHAR(80)\n)\n\nCREATE TABLE Assessment_Notes (\n notes_id INTEGER,\n student_id INTEGER,\n teacher_id INTEGER,\n date_of_notes DATETIME,\n text_of_notes VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Address_Types (\n address_type_code VARCHAR(15),\n address_type_description VARCHAR(80)\n)\n\nCREATE TABLE Teachers (\n teacher_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(80),\n last_name VARCHAR(80),\n gender VARCHAR(1),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Student_Addresses (\n student_id INTEGER,\n address_id INTEGER,\n date_address_from DATETIME,\n date_address_to DATETIME,\n monthly_rental DECIMAL(19,4),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Detention (\n detention_id INTEGER,\n detention_type_code VARCHAR(10),\n teacher_id INTEGER,\n datetime_detention_start DATETIME,\n datetime_detention_end DATETIME,\n detention_summary VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(40),\n last_name VARCHAR(40),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n date_first_rental DATETIME,\n date_left_university DATETIME,\n other_student_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Incident_Type (\n incident_type_code VARCHAR(10),\n incident_type_description VARCHAR(80)\n)","response":"SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find other_details and the sum of monthly_rental , and group by attribute other_details, and visualize them by a bar chart. ### Input: CREATE TABLE Addresses (\n address_id INTEGER,\n line_1 VARCHAR(120),\n line_2 VARCHAR(120),\n line_3 VARCHAR(120),\n city VARCHAR(80),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50),\n other_address_details VARCHAR(255)\n)\n\nCREATE TABLE Students_in_Detention (\n student_id INTEGER,\n detention_id INTEGER,\n incident_id INTEGER\n)\n\nCREATE TABLE Behavior_Incident (\n incident_id INTEGER,\n incident_type_code VARCHAR(10),\n student_id INTEGER,\n date_incident_start DATETIME,\n date_incident_end DATETIME,\n incident_summary VARCHAR(255),\n recommendations VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Detention_Type (\n detention_type_code VARCHAR(10),\n detention_type_description VARCHAR(80)\n)\n\nCREATE TABLE Assessment_Notes (\n notes_id INTEGER,\n student_id INTEGER,\n teacher_id INTEGER,\n date_of_notes DATETIME,\n text_of_notes VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Address_Types (\n address_type_code VARCHAR(15),\n address_type_description VARCHAR(80)\n)\n\nCREATE TABLE Teachers (\n teacher_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(80),\n last_name VARCHAR(80),\n gender VARCHAR(1),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Student_Addresses (\n student_id INTEGER,\n address_id INTEGER,\n date_address_from DATETIME,\n date_address_to DATETIME,\n monthly_rental DECIMAL(19,4),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Detention (\n detention_id INTEGER,\n detention_type_code VARCHAR(10),\n teacher_id INTEGER,\n datetime_detention_start DATETIME,\n datetime_detention_end DATETIME,\n detention_summary VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(40),\n last_name VARCHAR(40),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n date_first_rental DATETIME,\n date_left_university DATETIME,\n other_student_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Incident_Type (\n incident_type_code VARCHAR(10),\n incident_type_description VARCHAR(80)\n) ### Response: SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC"} {"instruction":"In what district was the incumbent Edwin Gray?","input":"CREATE TABLE table_2668401_17 (\n district VARCHAR,\n incumbent VARCHAR\n)","response":"SELECT district FROM table_2668401_17 WHERE incumbent = \"Edwin Gray\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what district was the incumbent Edwin Gray? ### Input: CREATE TABLE table_2668401_17 (\n district VARCHAR,\n incumbent VARCHAR\n) ### Response: SELECT district FROM table_2668401_17 WHERE incumbent = \"Edwin Gray\""} {"instruction":"What year was the developer(s) Bioware?","input":"CREATE TABLE table_64172 (\n \"Year\" real,\n \"Game\" text,\n \"Genre\" text,\n \"Platform(s)\" text,\n \"Developer(s)\" text\n)","response":"SELECT AVG(\"Year\") FROM table_64172 WHERE \"Developer(s)\" = 'bioware'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the developer(s) Bioware? ### Input: CREATE TABLE table_64172 (\n \"Year\" real,\n \"Game\" text,\n \"Genre\" text,\n \"Platform(s)\" text,\n \"Developer(s)\" text\n) ### Response: SELECT AVG(\"Year\") FROM table_64172 WHERE \"Developer(s)\" = 'bioware'"} {"instruction":"was the last game a win or a loss ?","input":"CREATE TABLE table_204_795 (\n id number,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"location\" text,\n \"attendance\" number\n)","response":"SELECT \"result\" FROM table_204_795 ORDER BY \"date\" DESC LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the last game a win or a loss ? ### Input: CREATE TABLE table_204_795 (\n id number,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"location\" text,\n \"attendance\" number\n) ### Response: SELECT \"result\" FROM table_204_795 ORDER BY \"date\" DESC LIMIT 1"} {"instruction":"count the number of patients whose insurance is private and admission location is clinic referral\/premature.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = \"Private\" AND demographic.admission_location = \"CLINIC REFERRAL\/PREMATURE\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose insurance is private and admission location is clinic referral\/premature. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = \"Private\" AND demographic.admission_location = \"CLINIC REFERRAL\/PREMATURE\""} {"instruction":"in this month has the arterial bp [diastolic] of patient 18159 been normal?","input":"CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)","response":"SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN diastolic_bp_lower AND diastolic_bp_upper AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in this month has the arterial bp [diastolic] of patient 18159 been normal? ### Input: CREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n) ### Response: SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN diastolic_bp_lower AND diastolic_bp_upper AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')"} {"instruction":"What was the surface where the outcome was winner on 12 march 1989?","input":"CREATE TABLE table_54160 (\n \"Outcome\" text,\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Opponent in the final\" text,\n \"Score in the final\" text\n)","response":"SELECT \"Surface\" FROM table_54160 WHERE \"Outcome\" = 'winner' AND \"Date\" = '12 march 1989'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the surface where the outcome was winner on 12 march 1989? ### Input: CREATE TABLE table_54160 (\n \"Outcome\" text,\n \"Date\" text,\n \"Tournament\" text,\n \"Surface\" text,\n \"Opponent in the final\" text,\n \"Score in the final\" text\n) ### Response: SELECT \"Surface\" FROM table_54160 WHERE \"Outcome\" = 'winner' AND \"Date\" = '12 march 1989'"} {"instruction":"During 2003 what was open cup qualifying status?","input":"CREATE TABLE table_1570003_2 (\n open_cup VARCHAR,\n year VARCHAR\n)","response":"SELECT open_cup FROM table_1570003_2 WHERE year = 2003","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: During 2003 what was open cup qualifying status? ### Input: CREATE TABLE table_1570003_2 (\n open_cup VARCHAR,\n year VARCHAR\n) ### Response: SELECT open_cup FROM table_1570003_2 WHERE year = 2003"} {"instruction":"Which US air date had 4.4 million viewers?","input":"CREATE TABLE table_17901155_4 (\n original_us_air_date VARCHAR,\n viewers__millions_ VARCHAR\n)","response":"SELECT original_us_air_date FROM table_17901155_4 WHERE viewers__millions_ = \"4.4\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which US air date had 4.4 million viewers? ### Input: CREATE TABLE table_17901155_4 (\n original_us_air_date VARCHAR,\n viewers__millions_ VARCHAR\n) ### Response: SELECT original_us_air_date FROM table_17901155_4 WHERE viewers__millions_ = \"4.4\""} {"instruction":"What was the score for the game on June 30?","input":"CREATE TABLE table_name_65 (\n score VARCHAR,\n date VARCHAR\n)","response":"SELECT score FROM table_name_65 WHERE date = \"june 30\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score for the game on June 30? ### Input: CREATE TABLE table_name_65 (\n score VARCHAR,\n date VARCHAR\n) ### Response: SELECT score FROM table_name_65 WHERE date = \"june 30\""} {"instruction":"What is the earliest year that has a Bristol engine?","input":"CREATE TABLE table_15203 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n)","response":"SELECT MIN(\"Year\") FROM table_15203 WHERE \"Engine\" = 'bristol'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the earliest year that has a Bristol engine? ### Input: CREATE TABLE table_15203 (\n \"Year\" real,\n \"Entrant\" text,\n \"Chassis\" text,\n \"Engine\" text,\n \"Points\" real\n) ### Response: SELECT MIN(\"Year\") FROM table_15203 WHERE \"Engine\" = 'bristol'"} {"instruction":"In early 1873, Owen sound had what works number?","input":"CREATE TABLE table_41506 (\n \"Number\" real,\n \"Name\" text,\n \"Builder\" text,\n \"Type\" text,\n \"Date\" text,\n \"Works number\" text\n)","response":"SELECT \"Works number\" FROM table_41506 WHERE \"Date\" = 'early 1873' AND \"Name\" = 'owen sound'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In early 1873, Owen sound had what works number? ### Input: CREATE TABLE table_41506 (\n \"Number\" real,\n \"Name\" text,\n \"Builder\" text,\n \"Type\" text,\n \"Date\" text,\n \"Works number\" text\n) ### Response: SELECT \"Works number\" FROM table_41506 WHERE \"Date\" = 'early 1873' AND \"Name\" = 'owen sound'"} {"instruction":"when was the first time that patient 009-5001 was prescribed medication on this hospital encounter via oral route?","input":"CREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001' AND patient.hospitaldischargetime IS NULL)) AND medication.routeadmin = 'oral' ORDER BY medication.drugstarttime LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time that patient 009-5001 was prescribed medication on this hospital encounter via oral route? ### Input: CREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001' AND patient.hospitaldischargetime IS NULL)) AND medication.routeadmin = 'oral' ORDER BY medication.drugstarttime LIMIT 1"} {"instruction":"What is the 1st leg of cs sfaxien?","input":"CREATE TABLE table_name_48 (\n team_2 VARCHAR\n)","response":"SELECT 1 AS st_leg FROM table_name_48 WHERE team_2 = \"cs sfaxien\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 1st leg of cs sfaxien? ### Input: CREATE TABLE table_name_48 (\n team_2 VARCHAR\n) ### Response: SELECT 1 AS st_leg FROM table_name_48 WHERE team_2 = \"cs sfaxien\""} {"instruction":"Most upvoted questions asked in the last month.","input":"CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)","response":"SELECT TOP(30) AS CreationDate, Id AS \"post_link\", Score, ViewCount FROM Posts WHERE CreationDate >= (DATEADD(MONTH, -1, GETDATE())) AND PostTypeId = 1 ORDER BY Posts.Score DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Most upvoted questions asked in the last month. ### Input: CREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n) ### Response: SELECT TOP(30) AS CreationDate, Id AS \"post_link\", Score, ViewCount FROM Posts WHERE CreationDate >= (DATEADD(MONTH, -1, GETDATE())) AND PostTypeId = 1 ORDER BY Posts.Score DESC"} {"instruction":"Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending order.","input":"CREATE TABLE Ref_Product_Categories (\n product_category_code VARCHAR(15),\n product_category_description VARCHAR(80),\n unit_of_measure VARCHAR(20)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n color_code VARCHAR(15),\n product_category_code VARCHAR(15),\n product_name VARCHAR(80),\n typical_buying_price VARCHAR(20),\n typical_selling_price VARCHAR(20),\n product_description VARCHAR(255),\n other_product_details VARCHAR(255)\n)\n\nCREATE TABLE Product_Characteristics (\n product_id INTEGER,\n characteristic_id INTEGER,\n product_characteristic_value VARCHAR(50)\n)\n\nCREATE TABLE Ref_Characteristic_Types (\n characteristic_type_code VARCHAR(15),\n characteristic_type_description VARCHAR(80)\n)\n\nCREATE TABLE Ref_Colors (\n color_code VARCHAR(15),\n color_description VARCHAR(80)\n)\n\nCREATE TABLE Characteristics (\n characteristic_id INTEGER,\n characteristic_type_code VARCHAR(15),\n characteristic_data_type VARCHAR(10),\n characteristic_name VARCHAR(80),\n other_characteristic_details VARCHAR(255)\n)","response":"SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending order. ### Input: CREATE TABLE Ref_Product_Categories (\n product_category_code VARCHAR(15),\n product_category_description VARCHAR(80),\n unit_of_measure VARCHAR(20)\n)\n\nCREATE TABLE Products (\n product_id INTEGER,\n color_code VARCHAR(15),\n product_category_code VARCHAR(15),\n product_name VARCHAR(80),\n typical_buying_price VARCHAR(20),\n typical_selling_price VARCHAR(20),\n product_description VARCHAR(255),\n other_product_details VARCHAR(255)\n)\n\nCREATE TABLE Product_Characteristics (\n product_id INTEGER,\n characteristic_id INTEGER,\n product_characteristic_value VARCHAR(50)\n)\n\nCREATE TABLE Ref_Characteristic_Types (\n characteristic_type_code VARCHAR(15),\n characteristic_type_description VARCHAR(80)\n)\n\nCREATE TABLE Ref_Colors (\n color_code VARCHAR(15),\n color_description VARCHAR(80)\n)\n\nCREATE TABLE Characteristics (\n characteristic_id INTEGER,\n characteristic_type_code VARCHAR(15),\n characteristic_data_type VARCHAR(10),\n characteristic_name VARCHAR(80),\n other_characteristic_details VARCHAR(255)\n) ### Response: SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description"} {"instruction":"Bar graph to show meter_100 from different meter 400, and could you display by the y axis in asc?","input":"CREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n)","response":"SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show meter_100 from different meter 400, and could you display by the y axis in asc? ### Input: CREATE TABLE event (\n ID int,\n Name text,\n Stadium_ID int,\n Year text\n)\n\nCREATE TABLE swimmer (\n ID int,\n name text,\n Nationality text,\n meter_100 real,\n meter_200 text,\n meter_300 text,\n meter_400 text,\n meter_500 text,\n meter_600 text,\n meter_700 text,\n Time text\n)\n\nCREATE TABLE stadium (\n ID int,\n name text,\n Capacity int,\n City text,\n Country text,\n Opening_year int\n)\n\nCREATE TABLE record (\n ID int,\n Result text,\n Swimmer_ID int,\n Event_ID int\n) ### Response: SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100"} {"instruction":"What team is 2 when 1 is Taipower and the result is 0-1?","input":"CREATE TABLE table_name_90 (\n team_2 VARCHAR,\n team_1 VARCHAR,\n result VARCHAR\n)","response":"SELECT team_2 FROM table_name_90 WHERE team_1 = \"taipower\" AND result = \"0-1\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team is 2 when 1 is Taipower and the result is 0-1? ### Input: CREATE TABLE table_name_90 (\n team_2 VARCHAR,\n team_1 VARCHAR,\n result VARCHAR\n) ### Response: SELECT team_2 FROM table_name_90 WHERE team_1 = \"taipower\" AND result = \"0-1\""} {"instruction":"Which System's Name is Gemulator?","input":"CREATE TABLE table_name_45 (\n system VARCHAR,\n name VARCHAR\n)","response":"SELECT system FROM table_name_45 WHERE name = \"gemulator\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which System's Name is Gemulator? ### Input: CREATE TABLE table_name_45 (\n system VARCHAR,\n name VARCHAR\n) ### Response: SELECT system FROM table_name_45 WHERE name = \"gemulator\""} {"instruction":"What is the name of the head coach of 1974?","input":"CREATE TABLE table_name_96 (\n name VARCHAR,\n years VARCHAR\n)","response":"SELECT name FROM table_name_96 WHERE years = \"1974\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the head coach of 1974? ### Input: CREATE TABLE table_name_96 (\n name VARCHAR,\n years VARCHAR\n) ### Response: SELECT name FROM table_name_96 WHERE years = \"1974\""} {"instruction":"Will Prof. Alan Hunt always be setting exams for her classes ?","input":"CREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n)","response":"SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AND instructor.name LIKE '%Alan Hunt%'","source":"advising","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Will Prof. Alan Hunt always be setting exams for her classes ? ### Input: CREATE TABLE course_offering (\n offering_id int,\n course_id int,\n semester int,\n section_number int,\n start_time time,\n end_time time,\n monday varchar,\n tuesday varchar,\n wednesday varchar,\n thursday varchar,\n friday varchar,\n saturday varchar,\n sunday varchar,\n has_final_project varchar,\n has_final_exam varchar,\n textbook varchar,\n class_address varchar,\n allow_audit varchar\n)\n\nCREATE TABLE ta (\n campus_job_id int,\n student_id int,\n location varchar\n)\n\nCREATE TABLE offering_instructor (\n offering_instructor_id int,\n offering_id int,\n instructor_id int\n)\n\nCREATE TABLE course_tags_count (\n course_id int,\n clear_grading int,\n pop_quiz int,\n group_projects int,\n inspirational int,\n long_lectures int,\n extra_credit int,\n few_tests int,\n good_feedback int,\n tough_tests int,\n heavy_papers int,\n cares_for_students int,\n heavy_assignments int,\n respected int,\n participation int,\n heavy_reading int,\n tough_grader int,\n hilarious int,\n would_take_again int,\n good_lecture int,\n no_skip int\n)\n\nCREATE TABLE student (\n student_id int,\n lastname varchar,\n firstname varchar,\n program_id int,\n declare_major varchar,\n total_credit int,\n total_gpa float,\n entered_as varchar,\n admit_term int,\n predicted_graduation_semester int,\n degree varchar,\n minor varchar,\n internship varchar\n)\n\nCREATE TABLE program_requirement (\n program_id int,\n category varchar,\n min_credit int,\n additional_req varchar\n)\n\nCREATE TABLE course_prerequisite (\n pre_course_id int,\n course_id int\n)\n\nCREATE TABLE jobs (\n job_id int,\n job_title varchar,\n description varchar,\n requirement varchar,\n city varchar,\n state varchar,\n country varchar,\n zip int\n)\n\nCREATE TABLE area (\n course_id int,\n area varchar\n)\n\nCREATE TABLE semester (\n semester_id int,\n semester varchar,\n year int\n)\n\nCREATE TABLE program (\n program_id int,\n name varchar,\n college varchar,\n introduction varchar\n)\n\nCREATE TABLE instructor (\n instructor_id int,\n name varchar,\n uniqname varchar\n)\n\nCREATE TABLE student_record (\n student_id int,\n course_id int,\n semester int,\n grade varchar,\n how varchar,\n transfer_source varchar,\n earn_credit varchar,\n repeat_term varchar,\n test_id varchar\n)\n\nCREATE TABLE gsi (\n course_offering_id int,\n student_id int\n)\n\nCREATE TABLE requirement (\n requirement_id int,\n requirement varchar,\n college varchar\n)\n\nCREATE TABLE program_course (\n program_id int,\n course_id int,\n workload int,\n category varchar\n)\n\nCREATE TABLE course (\n course_id int,\n name varchar,\n department varchar,\n number varchar,\n credits varchar,\n advisory_requirement varchar,\n enforced_requirement varchar,\n description varchar,\n num_semesters int,\n num_enrolled int,\n has_discussion varchar,\n has_lab varchar,\n has_projects varchar,\n has_exams varchar,\n num_reviews int,\n clarity_score int,\n easiness_score int,\n helpfulness_score int\n)\n\nCREATE TABLE comment_instructor (\n instructor_id int,\n student_id int,\n score int,\n comment_text varchar\n) ### Response: SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AND instructor.name LIKE '%Alan Hunt%'"} {"instruction":"provide the number of patients whose ethnicity is american indian\/alaska native and drug code is benz1i?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = \"AMERICAN INDIAN\/ALASKA NATIVE\" AND prescriptions.formulary_drug_cd = \"BENZ1I\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose ethnicity is american indian\/alaska native and drug code is benz1i? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = \"AMERICAN INDIAN\/ALASKA NATIVE\" AND prescriptions.formulary_drug_cd = \"BENZ1I\""} {"instruction":"according to the chart , which team is listed to have the first dodge ram ?","input":"CREATE TABLE table_204_89 (\n id number,\n \"team\" text,\n \"truck(s)\" text,\n \"#\" number,\n \"driver(s)\" text,\n \"primary sponsor(s)\" text,\n \"listed owner(s)\" text,\n \"crew chief\" text\n)","response":"SELECT \"team\" FROM table_204_89 WHERE \"truck(s)\" = 'dodge ram' ORDER BY id LIMIT 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: according to the chart , which team is listed to have the first dodge ram ? ### Input: CREATE TABLE table_204_89 (\n id number,\n \"team\" text,\n \"truck(s)\" text,\n \"#\" number,\n \"driver(s)\" text,\n \"primary sponsor(s)\" text,\n \"listed owner(s)\" text,\n \"crew chief\" text\n) ### Response: SELECT \"team\" FROM table_204_89 WHERE \"truck(s)\" = 'dodge ram' ORDER BY id LIMIT 1"} {"instruction":"give the number of patients whose admission type is elective and lab test category is blood gas.","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND lab.\"CATEGORY\" = \"Blood Gas\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients whose admission type is elective and lab test category is blood gas. ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND lab.\"CATEGORY\" = \"Blood Gas\""} {"instruction":"I want the plaid cymru for Polling organisation\/client of yougov\/itv wales for 4 may 2011","input":"CREATE TABLE table_name_77 (\n plaid_cymru VARCHAR,\n polling_organisation_client VARCHAR,\n date_s__conducted VARCHAR\n)","response":"SELECT plaid_cymru FROM table_name_77 WHERE polling_organisation_client = \"yougov\/itv wales\" AND date_s__conducted = \"4 may 2011\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want the plaid cymru for Polling organisation\/client of yougov\/itv wales for 4 may 2011 ### Input: CREATE TABLE table_name_77 (\n plaid_cymru VARCHAR,\n polling_organisation_client VARCHAR,\n date_s__conducted VARCHAR\n) ### Response: SELECT plaid_cymru FROM table_name_77 WHERE polling_organisation_client = \"yougov\/itv wales\" AND date_s__conducted = \"4 may 2011\""} {"instruction":"List the name of the county with the largest population.","input":"CREATE TABLE county_public_safety (\n Name VARCHAR,\n Population VARCHAR\n)","response":"SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the name of the county with the largest population. ### Input: CREATE TABLE county_public_safety (\n Name VARCHAR,\n Population VARCHAR\n) ### Response: SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1"} {"instruction":"What is the 2nd leg of team 1 Zamalek SC?","input":"CREATE TABLE table_name_31 (\n team_1 VARCHAR\n)","response":"SELECT 2 AS nd_leg FROM table_name_31 WHERE team_1 = \"zamalek sc\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2nd leg of team 1 Zamalek SC? ### Input: CREATE TABLE table_name_31 (\n team_1 VARCHAR\n) ### Response: SELECT 2 AS nd_leg FROM table_name_31 WHERE team_1 = \"zamalek sc\""} {"instruction":"What is the week 3, prior to the when the week 4 was Laura Nicole?","input":"CREATE TABLE table_name_26 (\n week_4 VARCHAR,\n week_3 VARCHAR\n)","response":"SELECT week_4 FROM table_name_26 WHERE week_3 = \"laura nicole\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the week 3, prior to the when the week 4 was Laura Nicole? ### Input: CREATE TABLE table_name_26 (\n week_4 VARCHAR,\n week_3 VARCHAR\n) ### Response: SELECT week_4 FROM table_name_26 WHERE week_3 = \"laura nicole\""} {"instruction":"Find the number of routes with destination airports in Italy.","input":"CREATE TABLE routes (\n dst_apid VARCHAR\n)\n\nCREATE TABLE airports (\n apid VARCHAR,\n country VARCHAR\n)","response":"SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of routes with destination airports in Italy. ### Input: CREATE TABLE routes (\n dst_apid VARCHAR\n)\n\nCREATE TABLE airports (\n apid VARCHAR,\n country VARCHAR\n) ### Response: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'"} {"instruction":"who is the first driver listed ?","input":"CREATE TABLE table_204_853 (\n id number,\n \"pos\" number,\n \"grid\" number,\n \"no.\" number,\n \"driver\" text,\n \"team\" text,\n \"manufacturer\" text,\n \"laps\" number,\n \"points\" number\n)","response":"SELECT \"driver\" FROM table_204_853 WHERE id = 1","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the first driver listed ? ### Input: CREATE TABLE table_204_853 (\n id number,\n \"pos\" number,\n \"grid\" number,\n \"no.\" number,\n \"driver\" text,\n \"team\" text,\n \"manufacturer\" text,\n \"laps\" number,\n \"points\" number\n) ### Response: SELECT \"driver\" FROM table_204_853 WHERE id = 1"} {"instruction":"What is the l3 cache when the sspec number is sr0r2(l1)sr0t6(l1)?","input":"CREATE TABLE table_13514 (\n \"Model number\" text,\n \"sSpec number\" text,\n \"Cores\" text,\n \"Frequency\" text,\n \"Turbo\" text,\n \"L2 cache\" text,\n \"L3 cache\" text,\n \"GPU model\" text,\n \"GPU frequency\" text,\n \"Socket\" text,\n \"I\/O bus\" text,\n \"Release date\" text,\n \"Part number(s)\" text,\n \"Release price ( USD )\" text\n)","response":"SELECT \"L3 cache\" FROM table_13514 WHERE \"sSpec number\" = 'sr0r2(l1)sr0t6(l1)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the l3 cache when the sspec number is sr0r2(l1)sr0t6(l1)? ### Input: CREATE TABLE table_13514 (\n \"Model number\" text,\n \"sSpec number\" text,\n \"Cores\" text,\n \"Frequency\" text,\n \"Turbo\" text,\n \"L2 cache\" text,\n \"L3 cache\" text,\n \"GPU model\" text,\n \"GPU frequency\" text,\n \"Socket\" text,\n \"I\/O bus\" text,\n \"Release date\" text,\n \"Part number(s)\" text,\n \"Release price ( USD )\" text\n) ### Response: SELECT \"L3 cache\" FROM table_13514 WHERE \"sSpec number\" = 'sr0r2(l1)sr0t6(l1)'"} {"instruction":"calculate the minimum age of home health care discharged patients who had overdose primary disease.","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)","response":"SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = \"HOME HEALTH CARE\" AND demographic.diagnosis = \"OVERDOSE\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the minimum age of home health care discharged patients who had overdose primary disease. ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = \"HOME HEALTH CARE\" AND demographic.diagnosis = \"OVERDOSE\""} {"instruction":"new semantic parsing papers","input":"CREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n)","response":"SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC","source":"scholar","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: new semantic parsing papers ### Input: CREATE TABLE paperfield (\n fieldid int,\n paperid int\n)\n\nCREATE TABLE field (\n fieldid int\n)\n\nCREATE TABLE venue (\n venueid int,\n venuename varchar\n)\n\nCREATE TABLE writes (\n paperid int,\n authorid int\n)\n\nCREATE TABLE cite (\n citingpaperid int,\n citedpaperid int\n)\n\nCREATE TABLE paper (\n paperid int,\n title varchar,\n venueid int,\n year int,\n numciting int,\n numcitedby int,\n journalid int\n)\n\nCREATE TABLE keyphrase (\n keyphraseid int,\n keyphrasename varchar\n)\n\nCREATE TABLE paperkeyphrase (\n paperid int,\n keyphraseid int\n)\n\nCREATE TABLE author (\n authorid int,\n authorname varchar\n)\n\nCREATE TABLE paperdataset (\n paperid int,\n datasetid int\n)\n\nCREATE TABLE dataset (\n datasetid int,\n datasetname varchar\n)\n\nCREATE TABLE journal (\n journalid int,\n journalname varchar\n) ### Response: SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC"} {"instruction":"Which event had 4th place and took place in the year 2007?","input":"CREATE TABLE table_name_76 (\n event VARCHAR,\n position VARCHAR,\n year VARCHAR\n)","response":"SELECT event FROM table_name_76 WHERE position = \"4th\" AND year = 2007","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which event had 4th place and took place in the year 2007? ### Input: CREATE TABLE table_name_76 (\n event VARCHAR,\n position VARCHAR,\n year VARCHAR\n) ### Response: SELECT event FROM table_name_76 WHERE position = \"4th\" AND year = 2007"} {"instruction":"Which Tankers have a Hazmat of , and Platforms of , and a Staffing of volunteer?","input":"CREATE TABLE table_name_9 (\n tankers VARCHAR,\n staffing VARCHAR,\n hazmat VARCHAR,\n platforms VARCHAR\n)","response":"SELECT tankers FROM table_name_9 WHERE hazmat = \"\u2013\" AND platforms = \"\u2013\" AND staffing = \"volunteer\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Tankers have a Hazmat of , and Platforms of , and a Staffing of volunteer? ### Input: CREATE TABLE table_name_9 (\n tankers VARCHAR,\n staffing VARCHAR,\n hazmat VARCHAR,\n platforms VARCHAR\n) ### Response: SELECT tankers FROM table_name_9 WHERE hazmat = \"\u2013\" AND platforms = \"\u2013\" AND staffing = \"volunteer\""} {"instruction":"what is the AP\/57 restriction","input":"CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)","response":"SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP\/57'","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the AP\/57 restriction ### Input: CREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n) ### Response: SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP\/57'"} {"instruction":"let me know the number of patients taking drug via sl route suffering from pneumonia primary disease.","input":"CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = \"PNEUMONIA\" AND prescriptions.route = \"SL\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: let me know the number of patients taking drug via sl route suffering from pneumonia primary disease. ### Input: CREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = \"PNEUMONIA\" AND prescriptions.route = \"SL\""} {"instruction":"The EPT German open was won by which listed winner?","input":"CREATE TABLE table_70219 (\n \"Date\" text,\n \"City\" text,\n \"Event\" text,\n \"Winner\" text,\n \"Prize\" text\n)","response":"SELECT \"Winner\" FROM table_70219 WHERE \"Event\" = 'ept german open'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The EPT German open was won by which listed winner? ### Input: CREATE TABLE table_70219 (\n \"Date\" text,\n \"City\" text,\n \"Event\" text,\n \"Winner\" text,\n \"Prize\" text\n) ### Response: SELECT \"Winner\" FROM table_70219 WHERE \"Event\" = 'ept german open'"} {"instruction":"how many different ranks exist for karate belts ?","input":"CREATE TABLE table_203_392 (\n id number,\n \"rank\" text,\n \"belt alternate 1\" text,\n \"belt alternate 2\" text,\n \"belt alternate 3\" text,\n \"belt alternate 4\" text\n)","response":"SELECT COUNT(DISTINCT \"rank\") FROM table_203_392","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many different ranks exist for karate belts ? ### Input: CREATE TABLE table_203_392 (\n id number,\n \"rank\" text,\n \"belt alternate 1\" text,\n \"belt alternate 2\" text,\n \"belt alternate 3\" text,\n \"belt alternate 4\" text\n) ### Response: SELECT COUNT(DISTINCT \"rank\") FROM table_203_392"} {"instruction":"Name the record for attendance location of palace of auburn hills 15,210","input":"CREATE TABLE table_21310 (\n \"Game\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location\/Attendance\" text,\n \"Record\" text\n)","response":"SELECT \"Record\" FROM table_21310 WHERE \"Location\/Attendance\" = 'Palace of Auburn Hills 15,210'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the record for attendance location of palace of auburn hills 15,210 ### Input: CREATE TABLE table_21310 (\n \"Game\" real,\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"High points\" text,\n \"High rebounds\" text,\n \"High assists\" text,\n \"Location\/Attendance\" text,\n \"Record\" text\n) ### Response: SELECT \"Record\" FROM table_21310 WHERE \"Location\/Attendance\" = 'Palace of Auburn Hills 15,210'"} {"instruction":"how long did it take the fifth place finisher to run the race ?","input":"CREATE TABLE table_204_937 (\n id number,\n \"rank\" number,\n \"lane\" number,\n \"athlete\" text,\n \"time\" number\n)","response":"SELECT \"time\" FROM table_204_937 WHERE \"rank\" = 5","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how long did it take the fifth place finisher to run the race ? ### Input: CREATE TABLE table_204_937 (\n id number,\n \"rank\" number,\n \"lane\" number,\n \"athlete\" text,\n \"time\" number\n) ### Response: SELECT \"time\" FROM table_204_937 WHERE \"rank\" = 5"} {"instruction":"What did the home team score when playing at Western Oval?","input":"CREATE TABLE table_32339 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT \"Home team score\" FROM table_32339 WHERE \"Venue\" = 'western oval'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What did the home team score when playing at Western Oval? ### Input: CREATE TABLE table_32339 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT \"Home team score\" FROM table_32339 WHERE \"Venue\" = 'western oval'"} {"instruction":"Which Opponents have a Partner of irina-camelia begu, and a Surface of hard?","input":"CREATE TABLE table_36349 (\n \"Outcome\" text,\n \"Date\" text,\n \"Surface\" text,\n \"Partner\" text,\n \"Opponents\" text,\n \"Score\" text\n)","response":"SELECT \"Opponents\" FROM table_36349 WHERE \"Partner\" = 'irina-camelia begu' AND \"Surface\" = 'hard'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Opponents have a Partner of irina-camelia begu, and a Surface of hard? ### Input: CREATE TABLE table_36349 (\n \"Outcome\" text,\n \"Date\" text,\n \"Surface\" text,\n \"Partner\" text,\n \"Opponents\" text,\n \"Score\" text\n) ### Response: SELECT \"Opponents\" FROM table_36349 WHERE \"Partner\" = 'irina-camelia begu' AND \"Surface\" = 'hard'"} {"instruction":"presence of chronic kidney disease ( gfr < 45 ml \/ min )","input":"CREATE TABLE table_train_159 (\n \"id\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"kidney_disease\" bool,\n \"serum_triglyceride\" int,\n \"body_mass_index_bmi\" float,\n \"age\" float,\n \"NOUSE\" float\n)","response":"SELECT * FROM table_train_159 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 45","source":"criteria2sql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: presence of chronic kidney disease ( gfr < 45 ml \/ min ) ### Input: CREATE TABLE table_train_159 (\n \"id\" int,\n \"hemoglobin_a1c_hba1c\" float,\n \"estimated_glomerular_filtration_rate_egfr\" int,\n \"kidney_disease\" bool,\n \"serum_triglyceride\" int,\n \"body_mass_index_bmi\" float,\n \"age\" float,\n \"NOUSE\" float\n) ### Response: SELECT * FROM table_train_159 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 45"} {"instruction":"how many patients whose diagnoses long title is perforation of intestine and lab test category is blood gas?","input":"CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = \"Perforation of intestine\" AND lab.\"CATEGORY\" = \"Blood Gas\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose diagnoses long title is perforation of intestine and lab test category is blood gas? ### Input: CREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = \"Perforation of intestine\" AND lab.\"CATEGORY\" = \"Blood Gas\""} {"instruction":"What is the type when McCormack is the name?","input":"CREATE TABLE table_name_21 (\n type VARCHAR,\n name VARCHAR\n)","response":"SELECT type FROM table_name_21 WHERE name = \"mccormack\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the type when McCormack is the name? ### Input: CREATE TABLE table_name_21 (\n type VARCHAR,\n name VARCHAR\n) ### Response: SELECT type FROM table_name_21 WHERE name = \"mccormack\""} {"instruction":"How many numbers were recorded on the fields goals of the Left End player?","input":"CREATE TABLE table_28033 (\n \"Player\" text,\n \"Position\" text,\n \"Starter\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n)","response":"SELECT COUNT(\"Field goals\") FROM table_28033 WHERE \"Position\" = 'Left end'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many numbers were recorded on the fields goals of the Left End player? ### Input: CREATE TABLE table_28033 (\n \"Player\" text,\n \"Position\" text,\n \"Starter\" text,\n \"Touchdowns\" real,\n \"Extra points\" real,\n \"Field goals\" real,\n \"Points\" real\n) ### Response: SELECT COUNT(\"Field goals\") FROM table_28033 WHERE \"Position\" = 'Left end'"} {"instruction":"Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, could you show in desc by the y-axis please?","input":"CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n)","response":"SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, could you show in desc by the y-axis please? ### Input: CREATE TABLE basketball_match (\n Team_ID int,\n School_ID int,\n Team_Name text,\n ACC_Regular_Season text,\n ACC_Percent text,\n ACC_Home text,\n ACC_Road text,\n All_Games text,\n All_Games_Percent int,\n All_Home text,\n All_Road text,\n All_Neutral text\n)\n\nCREATE TABLE university (\n School_ID int,\n School text,\n Location text,\n Founded real,\n Affiliation text,\n Enrollment real,\n Nickname text,\n Primary_conference text\n) ### Response: SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC"} {"instruction":"Name the standard yarn weight system for 7 wpi","input":"CREATE TABLE table_20297668_1 (\n standard_yarn_weight_system VARCHAR,\n wraps_per_inch__wpi_ VARCHAR\n)","response":"SELECT standard_yarn_weight_system FROM table_20297668_1 WHERE wraps_per_inch__wpi_ = \"7 wpi\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the standard yarn weight system for 7 wpi ### Input: CREATE TABLE table_20297668_1 (\n standard_yarn_weight_system VARCHAR,\n wraps_per_inch__wpi_ VARCHAR\n) ### Response: SELECT standard_yarn_weight_system FROM table_20297668_1 WHERE wraps_per_inch__wpi_ = \"7 wpi\""} {"instruction":"Nametheh school team for norman gonzales","input":"CREATE TABLE table_1262 (\n \"Name\" text,\n \"Position\" text,\n \"Number\" real,\n \"School\/Club Team\" text,\n \"Season\" text,\n \"Acquisition via\" text\n)","response":"SELECT \"School\/Club Team\" FROM table_1262 WHERE \"Name\" = 'Norman Gonzales'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Nametheh school team for norman gonzales ### Input: CREATE TABLE table_1262 (\n \"Name\" text,\n \"Position\" text,\n \"Number\" real,\n \"School\/Club Team\" text,\n \"Season\" text,\n \"Acquisition via\" text\n) ### Response: SELECT \"School\/Club Team\" FROM table_1262 WHERE \"Name\" = 'Norman Gonzales'"} {"instruction":"For the club that had tries of 50 and drawn of 0, what were the points?","input":"CREATE TABLE table_name_51 (\n points_against VARCHAR,\n drawn VARCHAR,\n tries_for VARCHAR\n)","response":"SELECT points_against FROM table_name_51 WHERE drawn = \"0\" AND tries_for = \"50\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the club that had tries of 50 and drawn of 0, what were the points? ### Input: CREATE TABLE table_name_51 (\n points_against VARCHAR,\n drawn VARCHAR,\n tries_for VARCHAR\n) ### Response: SELECT points_against FROM table_name_51 WHERE drawn = \"0\" AND tries_for = \"50\""} {"instruction":"last time until 20 months ago when did patient 028-23341 get a prescription?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)","response":"SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-23341')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-20 month') ORDER BY medication.drugstarttime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: last time until 20 months ago when did patient 028-23341 get a prescription? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-23341')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-20 month') ORDER BY medication.drugstarttime DESC LIMIT 1"} {"instruction":"Find me the admission type and short title of procedure for the patient with patient id 2110.","input":"CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"2110\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find me the admission type and short title of procedure for the patient with patient id 2110. ### Input: CREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"2110\""} {"instruction":"Name the lowest yards for 34 long and avg less than 12.6","input":"CREATE TABLE table_name_3 (\n yards INTEGER,\n long VARCHAR,\n avg VARCHAR\n)","response":"SELECT MIN(yards) FROM table_name_3 WHERE long = 34 AND avg < 12.6","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the lowest yards for 34 long and avg less than 12.6 ### Input: CREATE TABLE table_name_3 (\n yards INTEGER,\n long VARCHAR,\n avg VARCHAR\n) ### Response: SELECT MIN(yards) FROM table_name_3 WHERE long = 34 AND avg < 12.6"} {"instruction":"Who did they lose to on may 9?","input":"CREATE TABLE table_56314 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT \"Loss\" FROM table_56314 WHERE \"Date\" = 'may 9'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who did they lose to on may 9? ### Input: CREATE TABLE table_56314 (\n \"Date\" text,\n \"Opponent\" text,\n \"Score\" text,\n \"Loss\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT \"Loss\" FROM table_56314 WHERE \"Date\" = 'may 9'"} {"instruction":"For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, list x-axis in asc order please.","input":"CREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n)","response":"SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, list x-axis in asc order please. ### Input: CREATE TABLE departments (\n DEPARTMENT_ID decimal(4,0),\n DEPARTMENT_NAME varchar(30),\n MANAGER_ID decimal(6,0),\n LOCATION_ID decimal(4,0)\n)\n\nCREATE TABLE locations (\n LOCATION_ID decimal(4,0),\n STREET_ADDRESS varchar(40),\n POSTAL_CODE varchar(12),\n CITY varchar(30),\n STATE_PROVINCE varchar(25),\n COUNTRY_ID varchar(2)\n)\n\nCREATE TABLE countries (\n COUNTRY_ID varchar(2),\n COUNTRY_NAME varchar(40),\n REGION_ID decimal(10,0)\n)\n\nCREATE TABLE regions (\n REGION_ID decimal(5,0),\n REGION_NAME varchar(25)\n)\n\nCREATE TABLE jobs (\n JOB_ID varchar(10),\n JOB_TITLE varchar(35),\n MIN_SALARY decimal(6,0),\n MAX_SALARY decimal(6,0)\n)\n\nCREATE TABLE employees (\n EMPLOYEE_ID decimal(6,0),\n FIRST_NAME varchar(20),\n LAST_NAME varchar(25),\n EMAIL varchar(25),\n PHONE_NUMBER varchar(20),\n HIRE_DATE date,\n JOB_ID varchar(10),\n SALARY decimal(8,2),\n COMMISSION_PCT decimal(2,2),\n MANAGER_ID decimal(6,0),\n DEPARTMENT_ID decimal(4,0)\n)\n\nCREATE TABLE job_history (\n EMPLOYEE_ID decimal(6,0),\n START_DATE date,\n END_DATE date,\n JOB_ID varchar(10),\n DEPARTMENT_ID decimal(4,0)\n) ### Response: SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID"} {"instruction":"How many different matchup\/results appear in San Diego, California?","input":"CREATE TABLE table_23718905_6 (\n matchup_results VARCHAR,\n city VARCHAR\n)","response":"SELECT COUNT(matchup_results) FROM table_23718905_6 WHERE city = \"San Diego, California\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different matchup\/results appear in San Diego, California? ### Input: CREATE TABLE table_23718905_6 (\n matchup_results VARCHAR,\n city VARCHAR\n) ### Response: SELECT COUNT(matchup_results) FROM table_23718905_6 WHERE city = \"San Diego, California\""} {"instruction":"What years did Marienhof run, which featured Leonore Capell and lasted 10 years?","input":"CREATE TABLE table_name_88 (\n years VARCHAR,\n actor VARCHAR,\n soap_opera VARCHAR,\n duration VARCHAR\n)","response":"SELECT years FROM table_name_88 WHERE soap_opera = \"marienhof\" AND duration = \"10 years\" AND actor = \"leonore capell\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years did Marienhof run, which featured Leonore Capell and lasted 10 years? ### Input: CREATE TABLE table_name_88 (\n years VARCHAR,\n actor VARCHAR,\n soap_opera VARCHAR,\n duration VARCHAR\n) ### Response: SELECT years FROM table_name_88 WHERE soap_opera = \"marienhof\" AND duration = \"10 years\" AND actor = \"leonore capell\""} {"instruction":"Q1-1 What is the most number of comments on a single post?.","input":"CREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)","response":"SELECT CommentCount, Id, COUNT(*) FROM Posts GROUP BY Id, CommentCount HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Q1-1 What is the most number of comments on a single post?. ### Input: CREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n) ### Response: SELECT CommentCount, Id, COUNT(*) FROM Posts GROUP BY Id, CommentCount HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC"} {"instruction":"how many hours has it been since patient 57050 stayed for the first time on the current hospital visit in ward 14?","input":"CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)","response":"SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL)) AND transfers.wardid = 14 ORDER BY transfers.intime LIMIT 1","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours has it been since patient 57050 stayed for the first time on the current hospital visit in ward 14? ### Input: CREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL)) AND transfers.wardid = 14 ORDER BY transfers.intime LIMIT 1"} {"instruction":"give me flights from ATLANTA to BALTIMORE","input":"CREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)","response":"SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me flights from ATLANTA to BALTIMORE ### Input: CREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code"} {"instruction":"Return a scatter chart about the correlation between Body_Builder_ID and Clean_Jerk .","input":"CREATE TABLE body_builder (\n Body_Builder_ID int,\n People_ID int,\n Snatch real,\n Clean_Jerk real,\n Total real\n)\n\nCREATE TABLE people (\n People_ID int,\n Name text,\n Height real,\n Weight real,\n Birth_Date text,\n Birth_Place text\n)","response":"SELECT Body_Builder_ID, Clean_Jerk FROM body_builder","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a scatter chart about the correlation between Body_Builder_ID and Clean_Jerk . ### Input: CREATE TABLE body_builder (\n Body_Builder_ID int,\n People_ID int,\n Snatch real,\n Clean_Jerk real,\n Total real\n)\n\nCREATE TABLE people (\n People_ID int,\n Name text,\n Height real,\n Weight real,\n Birth_Date text,\n Birth_Place text\n) ### Response: SELECT Body_Builder_ID, Clean_Jerk FROM body_builder"} {"instruction":"How many playerd Mrs. Darling in the 1999 Broadway?","input":"CREATE TABLE table_10312547_1 (\n character VARCHAR\n)","response":"SELECT COUNT(1999 AS _broadway) FROM table_10312547_1 WHERE character = \"Mrs. Darling\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many playerd Mrs. Darling in the 1999 Broadway? ### Input: CREATE TABLE table_10312547_1 (\n character VARCHAR\n) ### Response: SELECT COUNT(1999 AS _broadway) FROM table_10312547_1 WHERE character = \"Mrs. Darling\""} {"instruction":"what is the maximum age of patients whose death status is 0 and diagnosed with primary disease coronary artery disease\\coronary artery bypass graft with mvr; ? maze?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = \"0\" AND demographic.diagnosis = \"CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the maximum age of patients whose death status is 0 and diagnosed with primary disease coronary artery disease\\coronary artery bypass graft with mvr; ? maze? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = \"0\" AND demographic.diagnosis = \"CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE\""} {"instruction":"What is the value for Lost when Drawn is 0, and Tries against is 41?","input":"CREATE TABLE table_name_33 (\n lost VARCHAR,\n drawn VARCHAR,\n tries_against VARCHAR\n)","response":"SELECT lost FROM table_name_33 WHERE drawn = \"0\" AND tries_against = \"41\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the value for Lost when Drawn is 0, and Tries against is 41? ### Input: CREATE TABLE table_name_33 (\n lost VARCHAR,\n drawn VARCHAR,\n tries_against VARCHAR\n) ### Response: SELECT lost FROM table_name_33 WHERE drawn = \"0\" AND tries_against = \"41\""} {"instruction":"Create a bar chart showing maximal revenue across name, and I want to rank X in descending order please.","input":"CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n)","response":"SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Name DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a bar chart showing maximal revenue across name, and I want to rank X in descending order please. ### Input: CREATE TABLE Products (\n Code INTEGER,\n Name VARCHAR(255),\n Price DECIMAL,\n Manufacturer INTEGER\n)\n\nCREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255),\n Headquarter VARCHAR(255),\n Founder VARCHAR(255),\n Revenue REAL\n) ### Response: SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Name DESC"} {"instruction":"Where does South Melbourne play?","input":"CREATE TABLE table_name_52 (\n venue VARCHAR,\n away_team VARCHAR\n)","response":"SELECT venue FROM table_name_52 WHERE away_team = \"south melbourne\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where does South Melbourne play? ### Input: CREATE TABLE table_name_52 (\n venue VARCHAR,\n away_team VARCHAR\n) ### Response: SELECT venue FROM table_name_52 WHERE away_team = \"south melbourne\""} {"instruction":"what are the procedures that are the top five most commonly received in 2100?","input":"CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)","response":"SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 5)","source":"mimic_iii","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the procedures that are the top five most commonly received in 2100? ### Input: CREATE TABLE labevents (\n row_id number,\n subject_id number,\n hadm_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE d_items (\n row_id number,\n itemid number,\n label text,\n linksto text\n)\n\nCREATE TABLE procedures_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE admissions (\n row_id number,\n subject_id number,\n hadm_id number,\n admittime time,\n dischtime time,\n admission_type text,\n admission_location text,\n discharge_location text,\n insurance text,\n language text,\n marital_status text,\n ethnicity text,\n age number\n)\n\nCREATE TABLE diagnoses_icd (\n row_id number,\n subject_id number,\n hadm_id number,\n icd9_code text,\n charttime time\n)\n\nCREATE TABLE icustays (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n first_careunit text,\n last_careunit text,\n first_wardid number,\n last_wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE inputevents_cv (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n amount number\n)\n\nCREATE TABLE chartevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n itemid number,\n charttime time,\n valuenum number,\n valueuom text\n)\n\nCREATE TABLE prescriptions (\n row_id number,\n subject_id number,\n hadm_id number,\n startdate time,\n enddate time,\n drug text,\n dose_val_rx text,\n dose_unit_rx text,\n route text\n)\n\nCREATE TABLE cost (\n row_id number,\n subject_id number,\n hadm_id number,\n event_type text,\n event_id number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE microbiologyevents (\n row_id number,\n subject_id number,\n hadm_id number,\n charttime time,\n spec_type_desc text,\n org_name text\n)\n\nCREATE TABLE outputevents (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n charttime time,\n itemid number,\n value number\n)\n\nCREATE TABLE transfers (\n row_id number,\n subject_id number,\n hadm_id number,\n icustay_id number,\n eventtype text,\n careunit text,\n wardid number,\n intime time,\n outtime time\n)\n\nCREATE TABLE d_icd_procedures (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE patients (\n row_id number,\n subject_id number,\n gender text,\n dob time,\n dod time\n)\n\nCREATE TABLE d_labitems (\n row_id number,\n itemid number,\n label text\n)\n\nCREATE TABLE d_icd_diagnoses (\n row_id number,\n icd9_code text,\n short_title text,\n long_title text\n) ### Response: SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 5)"} {"instruction":"Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday by a bar chart.","input":"CREATE TABLE Ref_Address_Types (\n address_type_code VARCHAR(15),\n address_type_description VARCHAR(80)\n)\n\nCREATE TABLE Teachers (\n teacher_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(80),\n last_name VARCHAR(80),\n gender VARCHAR(1),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Detention_Type (\n detention_type_code VARCHAR(10),\n detention_type_description VARCHAR(80)\n)\n\nCREATE TABLE Ref_Incident_Type (\n incident_type_code VARCHAR(10),\n incident_type_description VARCHAR(80)\n)\n\nCREATE TABLE Addresses (\n address_id INTEGER,\n line_1 VARCHAR(120),\n line_2 VARCHAR(120),\n line_3 VARCHAR(120),\n city VARCHAR(80),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50),\n other_address_details VARCHAR(255)\n)\n\nCREATE TABLE Students_in_Detention (\n student_id INTEGER,\n detention_id INTEGER,\n incident_id INTEGER\n)\n\nCREATE TABLE Assessment_Notes (\n notes_id INTEGER,\n student_id INTEGER,\n teacher_id INTEGER,\n date_of_notes DATETIME,\n text_of_notes VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Detention (\n detention_id INTEGER,\n detention_type_code VARCHAR(10),\n teacher_id INTEGER,\n datetime_detention_start DATETIME,\n datetime_detention_end DATETIME,\n detention_summary VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(40),\n last_name VARCHAR(40),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n date_first_rental DATETIME,\n date_left_university DATETIME,\n other_student_details VARCHAR(255)\n)\n\nCREATE TABLE Student_Addresses (\n student_id INTEGER,\n address_id INTEGER,\n date_address_from DATETIME,\n date_address_to DATETIME,\n monthly_rental DECIMAL(19,4),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Behavior_Incident (\n incident_id INTEGER,\n incident_type_code VARCHAR(10),\n student_id INTEGER,\n date_incident_start DATETIME,\n date_incident_end DATETIME,\n incident_summary VARCHAR(255),\n recommendations VARCHAR(255),\n other_details VARCHAR(255)\n)","response":"SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday by a bar chart. ### Input: CREATE TABLE Ref_Address_Types (\n address_type_code VARCHAR(15),\n address_type_description VARCHAR(80)\n)\n\nCREATE TABLE Teachers (\n teacher_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(80),\n last_name VARCHAR(80),\n gender VARCHAR(1),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Ref_Detention_Type (\n detention_type_code VARCHAR(10),\n detention_type_description VARCHAR(80)\n)\n\nCREATE TABLE Ref_Incident_Type (\n incident_type_code VARCHAR(10),\n incident_type_description VARCHAR(80)\n)\n\nCREATE TABLE Addresses (\n address_id INTEGER,\n line_1 VARCHAR(120),\n line_2 VARCHAR(120),\n line_3 VARCHAR(120),\n city VARCHAR(80),\n zip_postcode VARCHAR(20),\n state_province_county VARCHAR(50),\n country VARCHAR(50),\n other_address_details VARCHAR(255)\n)\n\nCREATE TABLE Students_in_Detention (\n student_id INTEGER,\n detention_id INTEGER,\n incident_id INTEGER\n)\n\nCREATE TABLE Assessment_Notes (\n notes_id INTEGER,\n student_id INTEGER,\n teacher_id INTEGER,\n date_of_notes DATETIME,\n text_of_notes VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Detention (\n detention_id INTEGER,\n detention_type_code VARCHAR(10),\n teacher_id INTEGER,\n datetime_detention_start DATETIME,\n datetime_detention_end DATETIME,\n detention_summary VARCHAR(255),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Students (\n student_id INTEGER,\n address_id INTEGER,\n first_name VARCHAR(80),\n middle_name VARCHAR(40),\n last_name VARCHAR(40),\n cell_mobile_number VARCHAR(40),\n email_address VARCHAR(40),\n date_first_rental DATETIME,\n date_left_university DATETIME,\n other_student_details VARCHAR(255)\n)\n\nCREATE TABLE Student_Addresses (\n student_id INTEGER,\n address_id INTEGER,\n date_address_from DATETIME,\n date_address_to DATETIME,\n monthly_rental DECIMAL(19,4),\n other_details VARCHAR(255)\n)\n\nCREATE TABLE Behavior_Incident (\n incident_id INTEGER,\n incident_type_code VARCHAR(10),\n student_id INTEGER,\n date_incident_start DATETIME,\n date_incident_end DATETIME,\n incident_summary VARCHAR(255),\n recommendations VARCHAR(255),\n other_details VARCHAR(255)\n) ### Response: SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC"} {"instruction":"what was the name of the laboratory test that patient 021-141335 received last in a month before?","input":"CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)","response":"SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY lab.labresulttime DESC LIMIT 1","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the laboratory test that patient 021-141335 received last in a month before? ### Input: CREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n) ### Response: SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY lab.labresulttime DESC LIMIT 1"} {"instruction":"Which date has a score of 2-1?","input":"CREATE TABLE table_68490 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n)","response":"SELECT \"Date\" FROM table_68490 WHERE \"Score\" = '2-1'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which date has a score of 2-1? ### Input: CREATE TABLE table_68490 (\n \"Date\" text,\n \"Venue\" text,\n \"Score\" text,\n \"Result\" text,\n \"Competition\" text\n) ### Response: SELECT \"Date\" FROM table_68490 WHERE \"Score\" = '2-1'"} {"instruction":"What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels?","input":"CREATE TABLE table_71745 (\n \"Year\" real,\n \"Opponent\" text,\n \"Competition\" text,\n \"Score\" text,\n \"Venue\" text,\n \"Attendance\" text\n)","response":"SELECT COUNT(\"Year\") FROM table_71745 WHERE \"Venue\" = 'sydney cricket ground' AND \"Opponent\" = 'parramatta eels'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels? ### Input: CREATE TABLE table_71745 (\n \"Year\" real,\n \"Opponent\" text,\n \"Competition\" text,\n \"Score\" text,\n \"Venue\" text,\n \"Attendance\" text\n) ### Response: SELECT COUNT(\"Year\") FROM table_71745 WHERE \"Venue\" = 'sydney cricket ground' AND \"Opponent\" = 'parramatta eels'"} {"instruction":"what 's the earliest arriving flight between BOSTON and WASHINGTON DC","input":"CREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n)","response":"SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'BOSTON')) AND to_airport IN (SELECT AIRPORT_SERVICEalias3.airport_code FROM airport_service AS AIRPORT_SERVICEalias3 WHERE AIRPORT_SERVICEalias3.city_code IN (SELECT CITYalias3.city_code FROM city AS CITYalias3 WHERE (CITYalias3.city_name = 'WASHINGTON' AND CITYalias3.state_code = 'DC')))) AND arrival_time = (SELECT MIN(FLIGHTalias1.arrival_time) FROM flight AS FLIGHTalias1 WHERE (FLIGHTalias1.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'BOSTON')) AND FLIGHTalias1.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE (CITYalias1.city_name = 'WASHINGTON' AND CITYalias1.state_code = 'DC'))))))","source":"atis","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what 's the earliest arriving flight between BOSTON and WASHINGTON DC ### Input: CREATE TABLE month (\n month_number int,\n month_name text\n)\n\nCREATE TABLE state (\n state_code text,\n state_name text,\n country_name text\n)\n\nCREATE TABLE airport_service (\n city_code varchar,\n airport_code varchar,\n miles_distant int,\n direction varchar,\n minutes_distant int\n)\n\nCREATE TABLE compartment_class (\n compartment varchar,\n class_type varchar\n)\n\nCREATE TABLE fare (\n fare_id int,\n from_airport varchar,\n to_airport varchar,\n fare_basis_code text,\n fare_airline text,\n restriction_code text,\n one_direction_cost int,\n round_trip_cost int,\n round_trip_required varchar\n)\n\nCREATE TABLE dual_carrier (\n main_airline varchar,\n low_flight_number int,\n high_flight_number int,\n dual_airline varchar,\n service_name text\n)\n\nCREATE TABLE equipment_sequence (\n aircraft_code_sequence varchar,\n aircraft_code varchar\n)\n\nCREATE TABLE aircraft (\n aircraft_code varchar,\n aircraft_description varchar,\n manufacturer varchar,\n basic_type varchar,\n engines int,\n propulsion varchar,\n wide_body varchar,\n wing_span int,\n length int,\n weight int,\n capacity int,\n pay_load int,\n cruising_speed int,\n range_miles int,\n pressurized varchar\n)\n\nCREATE TABLE code_description (\n code varchar,\n description text\n)\n\nCREATE TABLE time_interval (\n period text,\n begin_time int,\n end_time int\n)\n\nCREATE TABLE time_zone (\n time_zone_code text,\n time_zone_name text,\n hours_from_gmt int\n)\n\nCREATE TABLE flight_fare (\n flight_id int,\n fare_id int\n)\n\nCREATE TABLE class_of_service (\n booking_class varchar,\n rank int,\n class_description text\n)\n\nCREATE TABLE flight_stop (\n flight_id int,\n stop_number int,\n stop_days text,\n stop_airport text,\n arrival_time int,\n arrival_airline text,\n arrival_flight_number int,\n departure_time int,\n departure_airline text,\n departure_flight_number int,\n stop_time int\n)\n\nCREATE TABLE date_day (\n month_number int,\n day_number int,\n year int,\n day_name varchar\n)\n\nCREATE TABLE flight (\n aircraft_code_sequence text,\n airline_code varchar,\n airline_flight text,\n arrival_time int,\n connections int,\n departure_time int,\n dual_carrier text,\n flight_days text,\n flight_id int,\n flight_number int,\n from_airport varchar,\n meal_code text,\n stops int,\n time_elapsed int,\n to_airport varchar\n)\n\nCREATE TABLE flight_leg (\n flight_id int,\n leg_number int,\n leg_flight int\n)\n\nCREATE TABLE restriction (\n restriction_code text,\n advance_purchase int,\n stopovers text,\n saturday_stay_required text,\n minimum_stay int,\n maximum_stay int,\n application text,\n no_discounts text\n)\n\nCREATE TABLE fare_basis (\n fare_basis_code text,\n booking_class text,\n class_type text,\n premium text,\n economy text,\n discounted text,\n night text,\n season text,\n basis_days text\n)\n\nCREATE TABLE food_service (\n meal_code text,\n meal_number int,\n compartment text,\n meal_description varchar\n)\n\nCREATE TABLE days (\n days_code varchar,\n day_name varchar\n)\n\nCREATE TABLE airline (\n airline_code varchar,\n airline_name text,\n note text\n)\n\nCREATE TABLE city (\n city_code varchar,\n city_name varchar,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar\n)\n\nCREATE TABLE ground_service (\n city_code text,\n airport_code text,\n transport_type text,\n ground_fare int\n)\n\nCREATE TABLE airport (\n airport_code varchar,\n airport_name text,\n airport_location text,\n state_code varchar,\n country_name varchar,\n time_zone_code varchar,\n minimum_connect_time int\n) ### Response: SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'BOSTON')) AND to_airport IN (SELECT AIRPORT_SERVICEalias3.airport_code FROM airport_service AS AIRPORT_SERVICEalias3 WHERE AIRPORT_SERVICEalias3.city_code IN (SELECT CITYalias3.city_code FROM city AS CITYalias3 WHERE (CITYalias3.city_name = 'WASHINGTON' AND CITYalias3.state_code = 'DC')))) AND arrival_time = (SELECT MIN(FLIGHTalias1.arrival_time) FROM flight AS FLIGHTalias1 WHERE (FLIGHTalias1.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'BOSTON')) AND FLIGHTalias1.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE (CITYalias1.city_name = 'WASHINGTON' AND CITYalias1.state_code = 'DC'))))))"} {"instruction":"Tell me the Stem Meaning of ical","input":"CREATE TABLE table_31998 (\n \"Stem Meaning\" text,\n \"2nd person sg\" text,\n \"2nd person sg honorific\" text,\n \"3rd person sg\" text,\n \"3rd person sg honorific\" text\n)","response":"SELECT \"Stem Meaning\" FROM table_31998 WHERE \"3rd person sg\" = 'ical'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the Stem Meaning of ical ### Input: CREATE TABLE table_31998 (\n \"Stem Meaning\" text,\n \"2nd person sg\" text,\n \"2nd person sg honorific\" text,\n \"3rd person sg\" text,\n \"3rd person sg honorific\" text\n) ### Response: SELECT \"Stem Meaning\" FROM table_31998 WHERE \"3rd person sg\" = 'ical'"} {"instruction":"How many wins happened when there were fewer than 2 draws?","input":"CREATE TABLE table_8680 (\n \"Position\" real,\n \"Club\" text,\n \"Played\" real,\n \"Points\" real,\n \"Wins\" real,\n \"Draws\" real,\n \"Losses\" real,\n \"Goals for\" real,\n \"Goals against\" real,\n \"Goal Difference\" real\n)","response":"SELECT SUM(\"Wins\") FROM table_8680 WHERE \"Draws\" < '2'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many wins happened when there were fewer than 2 draws? ### Input: CREATE TABLE table_8680 (\n \"Position\" real,\n \"Club\" text,\n \"Played\" real,\n \"Points\" real,\n \"Wins\" real,\n \"Draws\" real,\n \"Losses\" real,\n \"Goals for\" real,\n \"Goals against\" real,\n \"Goal Difference\" real\n) ### Response: SELECT SUM(\"Wins\") FROM table_8680 WHERE \"Draws\" < '2'"} {"instruction":"What episode aired on 18 April 2007?","input":"CREATE TABLE table_10749367_3 (\n _number INTEGER,\n air_date VARCHAR\n)","response":"SELECT MIN(_number) FROM table_10749367_3 WHERE air_date = \"18 April 2007\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What episode aired on 18 April 2007? ### Input: CREATE TABLE table_10749367_3 (\n _number INTEGER,\n air_date VARCHAR\n) ### Response: SELECT MIN(_number) FROM table_10749367_3 WHERE air_date = \"18 April 2007\""} {"instruction":"Who was runner-up in the 2006 Pacific Life Open?","input":"CREATE TABLE table_name_62 (\n runner_up VARCHAR,\n name VARCHAR,\n year VARCHAR\n)","response":"SELECT runner_up FROM table_name_62 WHERE name = \"pacific life open\" AND year = \"2006\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was runner-up in the 2006 Pacific Life Open? ### Input: CREATE TABLE table_name_62 (\n runner_up VARCHAR,\n name VARCHAR,\n year VARCHAR\n) ### Response: SELECT runner_up FROM table_name_62 WHERE name = \"pacific life open\" AND year = \"2006\""} {"instruction":"what is age and procedure short title of subject id 2560?","input":"CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)","response":"SELECT demographic.age, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"2560\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is age and procedure short title of subject id 2560? ### Input: CREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n) ### Response: SELECT demographic.age, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = \"2560\""} {"instruction":"What is the highest Points when the record was 12 2, and the Points Against are larger than 6?","input":"CREATE TABLE table_name_25 (\n points_for INTEGER,\n record VARCHAR,\n points_against VARCHAR\n)","response":"SELECT MAX(points_for) FROM table_name_25 WHERE record = \"12\u20132\" AND points_against > 6","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Points when the record was 12 2, and the Points Against are larger than 6? ### Input: CREATE TABLE table_name_25 (\n points_for INTEGER,\n record VARCHAR,\n points_against VARCHAR\n) ### Response: SELECT MAX(points_for) FROM table_name_25 WHERE record = \"12\u20132\" AND points_against > 6"} {"instruction":"Top Voted Questions By Tag.","input":"CREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n)","response":"WITH ScoreByTag AS (SELECT pt.TagId, p.Score, ROW_NUMBER() OVER (PARTITION BY pt.TagId ORDER BY p.Score DESC) AS \"rank\" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id) SELECT RANK() OVER (ORDER BY st.Score DESC) AS \"rank\", t.TagName, st.Score FROM ScoreByTag AS st INNER JOIN Tags AS t ON st.TagId = t.Id WHERE st.Rank = 1 ORDER BY st.Score DESC","source":"sede","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top Voted Questions By Tag. ### Input: CREATE TABLE ReviewTasks (\n Id number,\n ReviewTaskTypeId number,\n CreationDate time,\n DeletionDate time,\n ReviewTaskStateId number,\n PostId number,\n SuggestedEditId number,\n CompletedByReviewTaskId number\n)\n\nCREATE TABLE SuggestedEditVotes (\n Id number,\n SuggestedEditId number,\n UserId number,\n VoteTypeId number,\n CreationDate time,\n TargetUserId number,\n TargetRepChange number\n)\n\nCREATE TABLE ReviewTaskTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE TagSynonyms (\n Id number,\n SourceTagName text,\n TargetTagName text,\n CreationDate time,\n OwnerUserId number,\n AutoRenameCount number,\n LastAutoRename time,\n Score number,\n ApprovedByUserId number,\n ApprovalDate time\n)\n\nCREATE TABLE PostTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostsWithDeleted (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE ReviewRejectionReasons (\n Id number,\n Name text,\n Description text,\n PostTypeId number\n)\n\nCREATE TABLE VoteTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE PostFeedback (\n Id number,\n PostId number,\n IsAnonymous boolean,\n VoteTypeId number,\n CreationDate time\n)\n\nCREATE TABLE PostHistory (\n Id number,\n PostHistoryTypeId number,\n PostId number,\n RevisionGUID other,\n CreationDate time,\n UserId number,\n UserDisplayName text,\n Comment text,\n Text text,\n ContentLicense text\n)\n\nCREATE TABLE Tags (\n Id number,\n TagName text,\n Count number,\n ExcerptPostId number,\n WikiPostId number\n)\n\nCREATE TABLE ReviewTaskResults (\n Id number,\n ReviewTaskId number,\n ReviewTaskResultTypeId number,\n CreationDate time,\n RejectionReasonId number,\n Comment text\n)\n\nCREATE TABLE Posts (\n Id number,\n PostTypeId number,\n AcceptedAnswerId number,\n ParentId number,\n CreationDate time,\n DeletionDate time,\n Score number,\n ViewCount number,\n Body text,\n OwnerUserId number,\n OwnerDisplayName text,\n LastEditorUserId number,\n LastEditorDisplayName text,\n LastEditDate time,\n LastActivityDate time,\n Title text,\n Tags text,\n AnswerCount number,\n CommentCount number,\n FavoriteCount number,\n ClosedDate time,\n CommunityOwnedDate time,\n ContentLicense text\n)\n\nCREATE TABLE CloseAsOffTopicReasonTypes (\n Id number,\n IsUniversal boolean,\n InputTitle text,\n MarkdownInputGuidance text,\n MarkdownPostOwnerGuidance text,\n MarkdownPrivilegedUserGuidance text,\n MarkdownConcensusDescription text,\n CreationDate time,\n CreationModeratorId number,\n ApprovalDate time,\n ApprovalModeratorId number,\n DeactivationDate time,\n DeactivationModeratorId number\n)\n\nCREATE TABLE PostTags (\n PostId number,\n TagId number\n)\n\nCREATE TABLE PostHistoryTypes (\n Id number,\n Name text\n)\n\nCREATE TABLE SuggestedEdits (\n Id number,\n PostId number,\n CreationDate time,\n ApprovalDate time,\n RejectionDate time,\n OwnerUserId number,\n Comment text,\n Text text,\n Title text,\n Tags text,\n RevisionGUID other\n)\n\nCREATE TABLE Votes (\n Id number,\n PostId number,\n VoteTypeId number,\n UserId number,\n CreationDate time,\n BountyAmount number\n)\n\nCREATE TABLE Comments (\n Id number,\n PostId number,\n Score number,\n Text text,\n CreationDate time,\n UserDisplayName text,\n UserId number,\n ContentLicense text\n)\n\nCREATE TABLE PostNoticeTypes (\n Id number,\n ClassId number,\n Name text,\n Body text,\n IsHidden boolean,\n Predefined boolean,\n PostNoticeDurationId number\n)\n\nCREATE TABLE Badges (\n Id number,\n UserId number,\n Name text,\n Date time,\n Class number,\n TagBased boolean\n)\n\nCREATE TABLE FlagTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE ReviewTaskResultTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE Users (\n Id number,\n Reputation number,\n CreationDate time,\n DisplayName text,\n LastAccessDate time,\n WebsiteUrl text,\n Location text,\n AboutMe text,\n Views number,\n UpVotes number,\n DownVotes number,\n ProfileImageUrl text,\n EmailHash text,\n AccountId number\n)\n\nCREATE TABLE ReviewTaskStates (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostLinks (\n Id number,\n CreationDate time,\n PostId number,\n RelatedPostId number,\n LinkTypeId number\n)\n\nCREATE TABLE CloseReasonTypes (\n Id number,\n Name text,\n Description text\n)\n\nCREATE TABLE PostNotices (\n Id number,\n PostId number,\n PostNoticeTypeId number,\n CreationDate time,\n DeletionDate time,\n ExpiryDate time,\n Body text,\n OwnerUserId number,\n DeletionUserId number\n)\n\nCREATE TABLE PendingFlags (\n Id number,\n FlagTypeId number,\n PostId number,\n CreationDate time,\n CloseReasonTypeId number,\n CloseAsOffTopicReasonTypeId number,\n DuplicateOfQuestionId number,\n BelongsOnBaseHostAddress text\n) ### Response: WITH ScoreByTag AS (SELECT pt.TagId, p.Score, ROW_NUMBER() OVER (PARTITION BY pt.TagId ORDER BY p.Score DESC) AS \"rank\" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id) SELECT RANK() OVER (ORDER BY st.Score DESC) AS \"rank\", t.TagName, st.Score FROM ScoreByTag AS st INNER JOIN Tags AS t ON st.TagId = t.Id WHERE st.Rank = 1 ORDER BY st.Score DESC"} {"instruction":"Show me mean rating by languages in a histogram, sort X from high to low order.","input":"CREATE TABLE genre (\n g_name varchar2(20),\n rating varchar2(10),\n most_popular_in varchar2(50)\n)\n\nCREATE TABLE artist (\n artist_name varchar2(50),\n country varchar2(20),\n gender varchar2(20),\n preferred_genre varchar2(50)\n)\n\nCREATE TABLE song (\n song_name varchar2(50),\n artist_name varchar2(50),\n country varchar2(20),\n f_id number(10),\n genre_is varchar2(20),\n rating number(10),\n languages varchar2(20),\n releasedate Date,\n resolution number(10)\n)\n\nCREATE TABLE files (\n f_id number(10),\n artist_name varchar2(50),\n file_size varchar2(20),\n duration varchar2(20),\n formats varchar2(20)\n)","response":"SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me mean rating by languages in a histogram, sort X from high to low order. ### Input: CREATE TABLE genre (\n g_name varchar2(20),\n rating varchar2(10),\n most_popular_in varchar2(50)\n)\n\nCREATE TABLE artist (\n artist_name varchar2(50),\n country varchar2(20),\n gender varchar2(20),\n preferred_genre varchar2(50)\n)\n\nCREATE TABLE song (\n song_name varchar2(50),\n artist_name varchar2(50),\n country varchar2(20),\n f_id number(10),\n genre_is varchar2(20),\n rating number(10),\n languages varchar2(20),\n releasedate Date,\n resolution number(10)\n)\n\nCREATE TABLE files (\n f_id number(10),\n artist_name varchar2(50),\n file_size varchar2(20),\n duration varchar2(20),\n formats varchar2(20)\n) ### Response: SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC"} {"instruction":"what's the score where record is 35 33","input":"CREATE TABLE table_17347 (\n \"#\" real,\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" text,\n \"Record\" text,\n \"Streak\" text\n)","response":"SELECT \"Score\" FROM table_17347 WHERE \"Record\" = '35\u201333'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the score where record is 35 33 ### Input: CREATE TABLE table_17347 (\n \"#\" real,\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Leading scorer\" text,\n \"Attendance\" text,\n \"Record\" text,\n \"Streak\" text\n) ### Response: SELECT \"Score\" FROM table_17347 WHERE \"Record\" = '35\u201333'"} {"instruction":"What was the score of the game that put the team at 27-32?","input":"CREATE TABLE table_name_51 (\n loss VARCHAR,\n record VARCHAR\n)","response":"SELECT loss FROM table_name_51 WHERE record = \"27-32\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the game that put the team at 27-32? ### Input: CREATE TABLE table_name_51 (\n loss VARCHAR,\n record VARCHAR\n) ### Response: SELECT loss FROM table_name_51 WHERE record = \"27-32\""} {"instruction":"What was the To par for bill britton when he placed t7?","input":"CREATE TABLE table_name_37 (\n to_par VARCHAR,\n place VARCHAR,\n player VARCHAR\n)","response":"SELECT to_par FROM table_name_37 WHERE place = \"t7\" AND player = \"bill britton\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the To par for bill britton when he placed t7? ### Input: CREATE TABLE table_name_37 (\n to_par VARCHAR,\n place VARCHAR,\n player VARCHAR\n) ### Response: SELECT to_par FROM table_name_37 WHERE place = \"t7\" AND player = \"bill britton\""} {"instruction":"what is the number of patients whose admission type is elective and procedure long title is laparoscopic lysis of peritoneal adhesions?","input":"CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n)","response":"SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND procedures.long_title = \"Laparoscopic lysis of peritoneal adhesions\"","source":"mimicsql_data","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is elective and procedure long title is laparoscopic lysis of peritoneal adhesions? ### Input: CREATE TABLE lab (\n subject_id text,\n hadm_id text,\n itemid text,\n charttime text,\n flag text,\n value_unit text,\n label text,\n fluid text\n)\n\nCREATE TABLE diagnoses (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE demographic (\n subject_id text,\n hadm_id text,\n name text,\n marital_status text,\n age text,\n dob text,\n gender text,\n language text,\n religion text,\n admission_type text,\n days_stay text,\n insurance text,\n ethnicity text,\n expire_flag text,\n admission_location text,\n discharge_location text,\n diagnosis text,\n dod text,\n dob_year text,\n dod_year text,\n admittime text,\n dischtime text,\n admityear text\n)\n\nCREATE TABLE procedures (\n subject_id text,\n hadm_id text,\n icd9_code text,\n short_title text,\n long_title text\n)\n\nCREATE TABLE prescriptions (\n subject_id text,\n hadm_id text,\n icustay_id text,\n drug_type text,\n drug text,\n formulary_drug_cd text,\n route text,\n drug_dose text\n) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = \"ELECTIVE\" AND procedures.long_title = \"Laparoscopic lysis of peritoneal adhesions\""} {"instruction":"What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00?","input":"CREATE TABLE table_name_64 (\n record VARCHAR,\n time VARCHAR,\n opponent VARCHAR\n)","response":"SELECT record FROM table_name_64 WHERE time = \"4:00\" AND opponent = \"krzysztof soszynski\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00? ### Input: CREATE TABLE table_name_64 (\n record VARCHAR,\n time VARCHAR,\n opponent VARCHAR\n) ### Response: SELECT record FROM table_name_64 WHERE time = \"4:00\" AND opponent = \"krzysztof soszynski\""} {"instruction":"What's the status on 16\/12\/1995?","input":"CREATE TABLE table_name_35 (\n status VARCHAR,\n date VARCHAR\n)","response":"SELECT status FROM table_name_35 WHERE date = \"16\/12\/1995\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the status on 16\/12\/1995? ### Input: CREATE TABLE table_name_35 (\n status VARCHAR,\n date VARCHAR\n) ### Response: SELECT status FROM table_name_35 WHERE date = \"16\/12\/1995\""} {"instruction":"What was the crowd size when the visiting team scored 23.18 (156)?","input":"CREATE TABLE table_56036 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n)","response":"SELECT COUNT(\"Crowd\") FROM table_56036 WHERE \"Away team score\" = '23.18 (156)'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the crowd size when the visiting team scored 23.18 (156)? ### Input: CREATE TABLE table_56036 (\n \"Home team\" text,\n \"Home team score\" text,\n \"Away team\" text,\n \"Away team score\" text,\n \"Venue\" text,\n \"Crowd\" real,\n \"Date\" text\n) ### Response: SELECT COUNT(\"Crowd\") FROM table_56036 WHERE \"Away team score\" = '23.18 (156)'"} {"instruction":"what is the highest frequency mhz with the call sign w292cu?","input":"CREATE TABLE table_name_77 (\n frequency_mhz INTEGER,\n call_sign VARCHAR\n)","response":"SELECT MAX(frequency_mhz) FROM table_name_77 WHERE call_sign = \"w292cu\"","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the highest frequency mhz with the call sign w292cu? ### Input: CREATE TABLE table_name_77 (\n frequency_mhz INTEGER,\n call_sign VARCHAR\n) ### Response: SELECT MAX(frequency_mhz) FROM table_name_77 WHERE call_sign = \"w292cu\""} {"instruction":"how many patients were prescribed 2 ml : metoclopramide hcl 5 mg\/ml inj soln within 2 months since 2103 after being diagnosed with copd - no limitations?","input":"CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n)","response":"SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - no limitations' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '2 ml : metoclopramide hcl 5 mg\/ml inj soln' AND STRFTIME('%y', medication.drugstarttime) >= '2103') AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')","source":"eicu","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients were prescribed 2 ml : metoclopramide hcl 5 mg\/ml inj soln within 2 months since 2103 after being diagnosed with copd - no limitations? ### Input: CREATE TABLE vitalperiodic (\n vitalperiodicid number,\n patientunitstayid number,\n temperature number,\n sao2 number,\n heartrate number,\n respiration number,\n systemicsystolic number,\n systemicdiastolic number,\n systemicmean number,\n observationtime time\n)\n\nCREATE TABLE lab (\n labid number,\n patientunitstayid number,\n labname text,\n labresult number,\n labresulttime time\n)\n\nCREATE TABLE medication (\n medicationid number,\n patientunitstayid number,\n drugname text,\n dosage text,\n routeadmin text,\n drugstarttime time,\n drugstoptime time\n)\n\nCREATE TABLE patient (\n uniquepid text,\n patienthealthsystemstayid number,\n patientunitstayid number,\n gender text,\n age text,\n ethnicity text,\n hospitalid number,\n wardid number,\n admissionheight number,\n admissionweight number,\n dischargeweight number,\n hospitaladmittime time,\n hospitaladmitsource text,\n unitadmittime time,\n unitdischargetime time,\n hospitaldischargetime time,\n hospitaldischargestatus text\n)\n\nCREATE TABLE diagnosis (\n diagnosisid number,\n patientunitstayid number,\n diagnosisname text,\n diagnosistime time,\n icd9code text\n)\n\nCREATE TABLE treatment (\n treatmentid number,\n patientunitstayid number,\n treatmentname text,\n treatmenttime time\n)\n\nCREATE TABLE cost (\n costid number,\n uniquepid text,\n patienthealthsystemstayid number,\n eventtype text,\n eventid number,\n chargetime time,\n cost number\n)\n\nCREATE TABLE allergy (\n allergyid number,\n patientunitstayid number,\n drugname text,\n allergyname text,\n allergytime time\n)\n\nCREATE TABLE microlab (\n microlabid number,\n patientunitstayid number,\n culturesite text,\n organism text,\n culturetakentime time\n)\n\nCREATE TABLE intakeoutput (\n intakeoutputid number,\n patientunitstayid number,\n cellpath text,\n celllabel text,\n cellvaluenumeric number,\n intakeoutputtime time\n) ### Response: SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - no limitations' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '2 ml : metoclopramide hcl 5 mg\/ml inj soln' AND STRFTIME('%y', medication.drugstarttime) >= '2103') AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')"} {"instruction":"What is the average high temperature for each day of week Plot them as bar chart, rank Y-axis in desc order.","input":"CREATE TABLE station (\n id int,\n network_name text,\n services text,\n local_authority text\n)\n\nCREATE TABLE route (\n train_id int,\n station_id int\n)\n\nCREATE TABLE weekly_weather (\n station_id int,\n day_of_week text,\n high_temperature int,\n low_temperature int,\n precipitation real,\n wind_speed_mph int\n)\n\nCREATE TABLE train (\n id int,\n train_number int,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n)","response":"SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC","source":"nvbench","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average high temperature for each day of week Plot them as bar chart, rank Y-axis in desc order. ### Input: CREATE TABLE station (\n id int,\n network_name text,\n services text,\n local_authority text\n)\n\nCREATE TABLE route (\n train_id int,\n station_id int\n)\n\nCREATE TABLE weekly_weather (\n station_id int,\n day_of_week text,\n high_temperature int,\n low_temperature int,\n precipitation real,\n wind_speed_mph int\n)\n\nCREATE TABLE train (\n id int,\n train_number int,\n name text,\n origin text,\n destination text,\n time text,\n interval text\n) ### Response: SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC"} {"instruction":"What was the lowest production code value in series #10?","input":"CREATE TABLE table_name_14 (\n production_code INTEGER,\n series__number VARCHAR\n)","response":"SELECT MIN(production_code) FROM table_name_14 WHERE series__number = 10","source":"sql_create_context","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the lowest production code value in series #10? ### Input: CREATE TABLE table_name_14 (\n production_code INTEGER,\n series__number VARCHAR\n) ### Response: SELECT MIN(production_code) FROM table_name_14 WHERE series__number = 10"} {"instruction":"What is the total of attendance with a Record of 5-9-0?","input":"CREATE TABLE table_56683 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Decision\" text,\n \"Attendance\" real,\n \"Record\" text\n)","response":"SELECT SUM(\"Attendance\") FROM table_56683 WHERE \"Record\" = '5-9-0'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total of attendance with a Record of 5-9-0? ### Input: CREATE TABLE table_56683 (\n \"Date\" text,\n \"Visitor\" text,\n \"Score\" text,\n \"Home\" text,\n \"Decision\" text,\n \"Attendance\" real,\n \"Record\" text\n) ### Response: SELECT SUM(\"Attendance\") FROM table_56683 WHERE \"Record\" = '5-9-0'"} {"instruction":"What is the low lap total for a grid larger than 16 and has a Time\/Retired of + 3:27.3?","input":"CREATE TABLE table_78184 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n)","response":"SELECT MIN(\"Laps\") FROM table_78184 WHERE \"Time\/Retired\" = '+ 3:27.3' AND \"Grid\" > '16'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the low lap total for a grid larger than 16 and has a Time\/Retired of + 3:27.3? ### Input: CREATE TABLE table_78184 (\n \"Driver\" text,\n \"Constructor\" text,\n \"Laps\" real,\n \"Time\/Retired\" text,\n \"Grid\" real\n) ### Response: SELECT MIN(\"Laps\") FROM table_78184 WHERE \"Time\/Retired\" = '+ 3:27.3' AND \"Grid\" > '16'"} {"instruction":"which reps were only appointed by franklin pierce ?","input":"CREATE TABLE table_203_778 (\n id number,\n \"representative\" text,\n \"title\" text,\n \"presentation\\nof credentials\" text,\n \"termination\\nof mission\" text,\n \"appointed by\" text\n)","response":"SELECT \"representative\" FROM table_203_778 WHERE \"appointed by\" = 'franklin pierce'","source":"squall","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which reps were only appointed by franklin pierce ? ### Input: CREATE TABLE table_203_778 (\n id number,\n \"representative\" text,\n \"title\" text,\n \"presentation\\nof credentials\" text,\n \"termination\\nof mission\" text,\n \"appointed by\" text\n) ### Response: SELECT \"representative\" FROM table_203_778 WHERE \"appointed by\" = 'franklin pierce'"} {"instruction":"Which Champion has a Coeff of 1.000?","input":"CREATE TABLE table_52977 (\n \"Season\" text,\n \"UEFA Season\" text,\n \"Coeff\" text,\n \"Ranking\" real,\n \"Champions\" text,\n \"Runner-up\" text,\n \"3rd place\" text,\n \"Cup winner\" text,\n \"Cup runner-up\" text\n)","response":"SELECT \"Champions\" FROM table_52977 WHERE \"Coeff\" = '1.000'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Champion has a Coeff of 1.000? ### Input: CREATE TABLE table_52977 (\n \"Season\" text,\n \"UEFA Season\" text,\n \"Coeff\" text,\n \"Ranking\" real,\n \"Champions\" text,\n \"Runner-up\" text,\n \"3rd place\" text,\n \"Cup winner\" text,\n \"Cup runner-up\" text\n) ### Response: SELECT \"Champions\" FROM table_52977 WHERE \"Coeff\" = '1.000'"} {"instruction":"What is the 2nd leg in match with team 2 of Teram?","input":"CREATE TABLE table_62868 (\n \"Team 1\" text,\n \"Agg.\" text,\n \"Team 2\" text,\n \"1st leg\" text,\n \"2nd leg\" text\n)","response":"SELECT \"2nd leg\" FROM table_62868 WHERE \"Team 2\" = 'teram'","source":"wikisql","text":"Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2nd leg in match with team 2 of Teram? ### Input: CREATE TABLE table_62868 (\n \"Team 1\" text,\n \"Agg.\" text,\n \"Team 2\" text,\n \"1st leg\" text,\n \"2nd leg\" text\n) ### Response: SELECT \"2nd leg\" FROM table_62868 WHERE \"Team 2\" = 'teram'"}