instruction
stringlengths 20
309
| input
stringlengths 45
7.14k
| response
stringlengths 24
2.22k
| source
stringclasses 15
values | text
stringlengths 337
7.52k
|
---|---|---|---|---|
What is the size of the windfarm in wexford that has more than 19 turbines and a vendor of Enercon? | CREATE TABLE table_39540 (
"Wind Farm" text,
"Capacity (MW)" real,
"Turbines" real,
"Turbine Vendor" text,
"Size (MW)" text,
"County" text
) | SELECT "Size (MW)" FROM table_39540 WHERE "Turbines" > '19' AND "Turbine Vendor" = 'enercon' AND "County" = 'wexford' | wikisql | Below are sql tables schemas paired with 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 (
"Wind Farm" text,
"Capacity (MW)" real,
"Turbines" real,
"Turbine Vendor" text,
"Size (MW)" text,
"County" text
) ### Response: SELECT "Size (MW)" FROM table_39540 WHERE "Turbines" > '19' AND "Turbine Vendor" = 'enercon' AND "County" = 'wexford' |
What is the maximum 2006 census population of LGA name Opobo/Nkoro? | CREATE TABLE table_23155 (
"LGA Name" text,
"Area (km 2 )" real,
"Census 2006 population" real,
"Administrative capital" text,
"Postal Code" real
) | SELECT MAX("Census 2006 population") FROM table_23155 WHERE "LGA Name" = 'Opobo/Nkoro' | wikisql | Below are sql tables schemas paired with 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 (
"LGA Name" text,
"Area (km 2 )" real,
"Census 2006 population" real,
"Administrative capital" text,
"Postal Code" real
) ### Response: SELECT MAX("Census 2006 population") FROM table_23155 WHERE "LGA Name" = 'Opobo/Nkoro' |
Which Jushin Liger has a Gran Hamada of kendo kashin? | CREATE TABLE table_name_60 (
jushin_liger VARCHAR,
gran_hamada VARCHAR
) | SELECT jushin_liger FROM table_name_60 WHERE gran_hamada = "kendo kashin" | sql_create_context | Below are sql tables 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 (
jushin_liger VARCHAR,
gran_hamada VARCHAR
) ### Response: SELECT jushin_liger FROM table_name_60 WHERE gran_hamada = "kendo kashin" |
What engine has an output of ps (kw; hp) @4700 rpm? | CREATE TABLE table_60251 (
"Name" text,
"Volume" text,
"Engine" text,
"Fuel" text,
"Output" text,
"Torque" text,
"Engine ID code(s)" text,
"0\u2013100km/h,s" real,
"Top speed" text,
"Years" text
) | SELECT "Engine" FROM table_60251 WHERE "Output" = 'ps (kw; hp) @4700 rpm' | wikisql | Below are sql tables schemas 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 (
"Name" text,
"Volume" text,
"Engine" text,
"Fuel" text,
"Output" text,
"Torque" text,
"Engine ID code(s)" text,
"0\u2013100km/h,s" real,
"Top speed" text,
"Years" text
) ### Response: SELECT "Engine" FROM table_60251 WHERE "Output" = 'ps (kw; hp) @4700 rpm' |
Who was the HP winning team when the EP winning team was Hans Zereis and the GM winning team was Charles Gibson? | CREATE TABLE table_31014 (
"Rnd" text,
"Circuit" text,
"AP Winning Team" text,
"BP Winning Team" text,
"CM Winning Team" text,
"CP Winning Team" text,
"DM Winning Team" text,
"DP Winning Team" text,
"EM Winning Team" text,
"EP Winning Team" text,
"FM Winning Team" text,
"FP Winning Team" text,
"GM Winning Team" text,
"GP Winning Team" text,
"HM Winning Team" text,
"HP Winning Team" text,
"Results" text
) | SELECT "HP Winning Team" FROM table_31014 WHERE "EP Winning Team" = 'Hans Zereis' AND "GM Winning Team" = 'Charles Gibson' | wikisql | Below are sql tables 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 (
"Rnd" text,
"Circuit" text,
"AP Winning Team" text,
"BP Winning Team" text,
"CM Winning Team" text,
"CP Winning Team" text,
"DM Winning Team" text,
"DP Winning Team" text,
"EM Winning Team" text,
"EP Winning Team" text,
"FM Winning Team" text,
"FP Winning Team" text,
"GM Winning Team" text,
"GP Winning Team" text,
"HM Winning Team" text,
"HP Winning Team" text,
"Results" text
) ### Response: SELECT "HP Winning Team" FROM table_31014 WHERE "EP Winning Team" = 'Hans Zereis' AND "GM Winning Team" = 'Charles Gibson' |
What mean number of extra points was there when James Lawrence was a player and the touchdown number was less than 1? | CREATE TABLE table_name_7 (
extra_points INTEGER,
player VARCHAR,
touchdowns VARCHAR
) | SELECT AVG(extra_points) FROM table_name_7 WHERE player = "james lawrence" AND touchdowns < 1 | sql_create_context | Below are sql tables schemas 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 (
extra_points INTEGER,
player VARCHAR,
touchdowns VARCHAR
) ### Response: SELECT AVG(extra_points) FROM table_name_7 WHERE player = "james lawrence" AND touchdowns < 1 |
who is the only player to have denmark listed as their nationality ? | CREATE TABLE table_203_305 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) | SELECT "player" FROM table_203_305 WHERE "nationality" = 'denmark' | squall | Below are sql tables 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 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) ### Response: SELECT "player" FROM table_203_305 WHERE "nationality" = 'denmark' |
count the number of dead patients who were diagnosed with noninf gastroenterit nec. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
) | 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" | mimicsql_data | Below are sql tables 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
) ### 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" |
What year and where was the tournament when fan ying won the womens singles? | CREATE TABLE table_28138035_26 (
year_location VARCHAR,
womens_singles VARCHAR
) | SELECT year_location FROM table_28138035_26 WHERE womens_singles = "Fan Ying" | sql_create_context | Below are sql tables schemas 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 (
year_location VARCHAR,
womens_singles VARCHAR
) ### Response: SELECT year_location FROM table_28138035_26 WHERE womens_singles = "Fan Ying" |
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. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
) | 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 | nvbench | Below are sql tables 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 (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
) ### 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 |
What label shows an Album of cover version v? | CREATE TABLE table_name_24 (
label VARCHAR,
album VARCHAR
) | SELECT label FROM table_name_24 WHERE album = "cover version v" | sql_create_context | Below are sql tables schemas 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 (
label VARCHAR,
album VARCHAR
) ### Response: SELECT label FROM table_name_24 WHERE album = "cover version v" |
What genre was Music in the Air? | CREATE TABLE table_name_7 (
genre VARCHAR,
title VARCHAR
) | SELECT genre FROM table_name_7 WHERE title = "music in the air" | sql_create_context | Below are sql tables schemas 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 (
genre VARCHAR,
title VARCHAR
) ### Response: SELECT genre FROM table_name_7 WHERE title = "music in the air" |
In how many counties di McCain win 41.62% of the vote? | CREATE TABLE table_23740 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
) | SELECT COUNT("County") FROM table_23740 WHERE "McCain%" = '41.62%' | wikisql | Below are sql tables 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 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
) ### Response: SELECT COUNT("County") FROM table_23740 WHERE "McCain%" = '41.62%' |
What is the date of appointment for outgoing manager Campbell Money | CREATE TABLE table_11206916_2 (
date_of_appointment VARCHAR,
outgoing_manager VARCHAR
) | SELECT date_of_appointment FROM table_11206916_2 WHERE outgoing_manager = "Campbell Money" | sql_create_context | Below are sql tables schemas paired with 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 (
date_of_appointment VARCHAR,
outgoing_manager VARCHAR
) ### Response: SELECT date_of_appointment FROM table_11206916_2 WHERE outgoing_manager = "Campbell Money" |
What year was the winners vote 55.99%? | CREATE TABLE table_1808 (
"Year" real,
"Lok Sabha" text,
"Members of Parliament" text,
"Party Won" text,
"Winners % votes" text,
"Trailing Party" text,
"Trailing Party % votes" text
) | SELECT MIN("Year") FROM table_1808 WHERE "Winners % votes" = '55.99%' | wikisql | Below are sql tables schemas 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 (
"Year" real,
"Lok Sabha" text,
"Members of Parliament" text,
"Party Won" text,
"Winners % votes" text,
"Trailing Party" text,
"Trailing Party % votes" text
) ### Response: SELECT MIN("Year") FROM table_1808 WHERE "Winners % votes" = '55.99%' |
What is the lowest number of points of the team with 2 losses and a lower than 1 position? | CREATE TABLE table_name_73 (
points INTEGER,
losses VARCHAR,
position VARCHAR
) | SELECT MIN(points) FROM table_name_73 WHERE losses = 2 AND position > 1 | sql_create_context | Below are sql tables schemas paired with 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 (
points INTEGER,
losses VARCHAR,
position VARCHAR
) ### Response: SELECT MIN(points) FROM table_name_73 WHERE losses = 2 AND position > 1 |
What is the away team's score when the Home team score is 14.18 (102)? | CREATE TABLE table_57966 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_57966 WHERE "Home team score" = '14.18 (102)' | wikisql | Below are sql tables schemas paired with 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 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Away team score" FROM table_57966 WHERE "Home team score" = '14.18 (102)' |
what label was italy on ? | CREATE TABLE table_204_966 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
) | SELECT "label" FROM table_204_966 WHERE "region" = 'italy' | squall | Below are sql tables schemas 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 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
) ### Response: SELECT "label" FROM table_204_966 WHERE "region" = 'italy' |
What national has 4.45 for o and 4.55 for xo? | CREATE TABLE table_65762 (
"Name" text,
"Nationality" text,
"4.30" text,
"4.45" text,
"4.55" text,
"Result" real
) | SELECT "Nationality" FROM table_65762 WHERE "4.45" = 'o' AND "4.55" = 'xo' | wikisql | Below are sql tables schemas 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 (
"Name" text,
"Nationality" text,
"4.30" text,
"4.45" text,
"4.55" text,
"Result" real
) ### Response: SELECT "Nationality" FROM table_65762 WHERE "4.45" = 'o' AND "4.55" = 'xo' |
Return the average money requested across all entrepreneurs. | CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | SELECT AVG(money_requested) FROM entrepreneur | spider | Below are sql tables 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 (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) ### Response: SELECT AVG(money_requested) FROM entrepreneur |
What core clocks ( mhz ) have a 21.3 memory bandwidth ( gb/s )? | CREATE TABLE table_28157 (
"Graphics" text,
"Launch" real,
"Market" text,
"CPU" text,
"Code name" text,
"Device ID" real,
"Core clock ( MHz )" text,
"Execution units" real,
"Shader model" text,
"DirectX" text,
"OpenGL" text,
"OpenCL" text,
"Memory bandwidth ( GB/s )" text,
"DVMT ( MB )" real,
"CVT HD" text,
"QSV" text
) | SELECT "Core clock ( MHz )" FROM table_28157 WHERE "Memory bandwidth ( GB/s )" = '21.3' | wikisql | Below are sql tables schemas 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 (
"Graphics" text,
"Launch" real,
"Market" text,
"CPU" text,
"Code name" text,
"Device ID" real,
"Core clock ( MHz )" text,
"Execution units" real,
"Shader model" text,
"DirectX" text,
"OpenGL" text,
"OpenCL" text,
"Memory bandwidth ( GB/s )" text,
"DVMT ( MB )" real,
"CVT HD" text,
"QSV" text
) ### Response: SELECT "Core clock ( MHz )" FROM table_28157 WHERE "Memory bandwidth ( GB/s )" = '21.3' |
Who the GM winning team when the EP winning team was #37 Porsche? | CREATE TABLE table_31012 (
"Rnd" text,
"Circuit" text,
"AP Winning Team" text,
"BP Winning Team" text,
"CM Winning Team" text,
"CP Winning Team" text,
"DM Winning Team" text,
"DP Winning Team" text,
"EM Winning Team" text,
"EP Winning Team" text,
"FM Winning Team" text,
"FP Winning Team" text,
"GM Winning Team" text,
"GP Winning Team" text,
"HM Winning Team" text,
"HP Winning Team" text,
"Results" text
) | SELECT "GM Winning Team" FROM table_31012 WHERE "EP Winning Team" = '#37 Porsche' | wikisql | Below are sql tables 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 (
"Rnd" text,
"Circuit" text,
"AP Winning Team" text,
"BP Winning Team" text,
"CM Winning Team" text,
"CP Winning Team" text,
"DM Winning Team" text,
"DP Winning Team" text,
"EM Winning Team" text,
"EP Winning Team" text,
"FM Winning Team" text,
"FP Winning Team" text,
"GM Winning Team" text,
"GP Winning Team" text,
"HM Winning Team" text,
"HP Winning Team" text,
"Results" text
) ### Response: SELECT "GM Winning Team" FROM table_31012 WHERE "EP Winning Team" = '#37 Porsche' |
What is their position when the b score is more than 8.975 for Ekaterina Kramarenko ( rus )? | CREATE TABLE table_name_57 (
position VARCHAR,
b_score VARCHAR,
gymnast VARCHAR
) | SELECT position FROM table_name_57 WHERE b_score > 8.975 AND gymnast = "ekaterina kramarenko ( rus )" | sql_create_context | Below are sql tables schemas paired 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 (
position VARCHAR,
b_score VARCHAR,
gymnast VARCHAR
) ### Response: SELECT position FROM table_name_57 WHERE b_score > 8.975 AND gymnast = "ekaterina kramarenko ( rus )" |
known renal disease with a baseline serum creatinine > 1.5 mg / dl | CREATE TABLE table_train_157 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"platelets" int,
"renal_disease" bool,
"c_reactive_protein" float,
"creatinine_clearance_cl" float,
"urine_protein" int,
"serum_creatinine" float,
"proteinuria" int,
"NOUSE" float
) | SELECT * FROM table_train_157 WHERE renal_disease = 1 AND serum_creatinine > 1.5 | criteria2sql | Below are sql tables 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 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"platelets" int,
"renal_disease" bool,
"c_reactive_protein" float,
"creatinine_clearance_cl" float,
"urine_protein" int,
"serum_creatinine" float,
"proteinuria" int,
"NOUSE" float
) ### Response: SELECT * FROM table_train_157 WHERE renal_disease = 1 AND serum_creatinine > 1.5 |
List the dates and vote percents of elections. | CREATE TABLE election (
Date VARCHAR,
Vote_Percent VARCHAR
) | SELECT Date, Vote_Percent FROM election | sql_create_context | Below are sql tables 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 (
Date VARCHAR,
Vote_Percent VARCHAR
) ### Response: SELECT Date, Vote_Percent FROM election |
which date had the least attendance ? | CREATE TABLE table_204_123 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) | SELECT "date" FROM table_204_123 ORDER BY "attendance" LIMIT 1 | squall | Below are sql tables 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 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) ### Response: SELECT "date" FROM table_204_123 ORDER BY "attendance" LIMIT 1 |
What enrollement would you expect if you were attending the university in St. Louis? | CREATE TABLE table_2319 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment" real,
"Founded" real
) | SELECT "Enrollment" FROM table_2319 WHERE "Location(s)" = 'St. Louis' | wikisql | Below are sql tables schemas 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 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment" real,
"Founded" real
) ### Response: SELECT "Enrollment" FROM table_2319 WHERE "Location(s)" = 'St. Louis' |
what is the total number of painters who scored 12 in composition ? | CREATE TABLE table_203_186 (
id number,
"painter" text,
"composition" number,
"drawing" number,
"color" number,
"expression" number
) | SELECT COUNT("painter") FROM table_203_186 WHERE "composition" = 12 | squall | Below are sql tables schemas paired with 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 (
id number,
"painter" text,
"composition" number,
"drawing" number,
"color" number,
"expression" number
) ### Response: SELECT COUNT("painter") FROM table_203_186 WHERE "composition" = 12 |
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? | CREATE TABLE table_29728596_2 (
away_team VARCHAR,
competition VARCHAR,
home_team VARCHAR
) | SELECT away_team FROM table_29728596_2 WHERE competition = "1st ``Republic of Srpska Football Day``" AND home_team = "U 14 Republic of Srpska" | sql_create_context | Below are sql tables 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 (
away_team VARCHAR,
competition VARCHAR,
home_team VARCHAR
) ### Response: SELECT away_team FROM table_29728596_2 WHERE competition = "1st ``Republic of Srpska Football Day``" AND home_team = "U 14 Republic of Srpska" |
Which chassis did fondmetal f1 spa use after 1990? | CREATE TABLE table_name_32 (
chassis VARCHAR,
year VARCHAR,
entrant VARCHAR
) | SELECT chassis FROM table_name_32 WHERE year > 1990 AND entrant = "fondmetal f1 spa" | sql_create_context | Below are sql tables 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 (
chassis VARCHAR,
year VARCHAR,
entrant VARCHAR
) ### Response: SELECT chassis FROM table_name_32 WHERE year > 1990 AND entrant = "fondmetal f1 spa" |
what is the number of patients who are in ward 650 until 2104? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
) | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 650 AND STRFTIME('%y', patient.unitadmittime) <= '2104' | eicu | Below are sql tables schemas paired with 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 (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
) ### Response: SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 650 AND STRFTIME('%y', patient.unitadmittime) <= '2104' |
How far is the olbia to sassari route? | CREATE TABLE table_10194 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | SELECT "Distance" FROM table_10194 WHERE "Course" = 'olbia to sassari' | wikisql | Below are sql tables 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 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) ### Response: SELECT "Distance" FROM table_10194 WHERE "Course" = 'olbia to sassari' |
What competition was held 1 March 1909? | CREATE TABLE table_4377 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | SELECT "Competition" FROM table_4377 WHERE "Date" = '1 march 1909' | wikisql | Below are sql tables schemas 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 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) ### Response: SELECT "Competition" FROM table_4377 WHERE "Date" = '1 march 1909' |
can you find the top entered service ? | CREATE TABLE table_204_882 (
id number,
"number" number,
"builder" text,
"entered service" text,
"withdrawn" text,
"notes" text
) | SELECT "entered service" FROM table_204_882 WHERE id = 1 | squall | Below are sql tables 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 (
id number,
"number" number,
"builder" text,
"entered service" text,
"withdrawn" text,
"notes" text
) ### Response: SELECT "entered service" FROM table_204_882 WHERE id = 1 |
provide the number of patients whose ethnicity is black/cape verdean and age is less than 68? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "68" | mimicsql_data | Below are sql tables 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 (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "68" |
Name the 2011 when 2010 is 2r | CREATE TABLE table_80361 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | SELECT "2011" FROM table_80361 WHERE "2010" = '2r' | wikisql | Below are sql tables 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 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) ### Response: SELECT "2011" FROM table_80361 WHERE "2010" = '2r' |
What was the title of series number 56? | CREATE TABLE table_2468961_4 (
title VARCHAR,
no_in_series VARCHAR
) | SELECT title FROM table_2468961_4 WHERE no_in_series = 56 | sql_create_context | Below are sql tables schemas 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 (
title VARCHAR,
no_in_series VARCHAR
) ### Response: SELECT title FROM table_2468961_4 WHERE no_in_series = 56 |
What was the championship during the match with the opponent of richard fromberg? | CREATE TABLE table_9055 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | SELECT "Championship" FROM table_9055 WHERE "Opponent" = 'richard fromberg' | wikisql | Below are sql tables schemas 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 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) ### Response: SELECT "Championship" FROM table_9055 WHERE "Opponent" = 'richard fromberg' |
Name the most revenue for operating income more than 27 for hamburg and debt as % of value less than 0 | CREATE TABLE table_68346 (
"Rank" real,
"Team" text,
"Country" text,
"Value ($M)" real,
"Debt as % of value" real,
"% change on year" text,
"Revenue ($M)" real,
"Operating income ($m)" real
) | SELECT MAX("Revenue ($M)") FROM table_68346 WHERE "Operating income ($m)" > '27' AND "Team" = 'hamburg' AND "Debt as % of value" < '0' | wikisql | Below are sql tables 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 (
"Rank" real,
"Team" text,
"Country" text,
"Value ($M)" real,
"Debt as % of value" real,
"% change on year" text,
"Revenue ($M)" real,
"Operating income ($m)" real
) ### Response: SELECT MAX("Revenue ($M)") FROM table_68346 WHERE "Operating income ($m)" > '27' AND "Team" = 'hamburg' AND "Debt as % of value" < '0' |
What is the result for game 5? | CREATE TABLE table_9742 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | SELECT "Result" FROM table_9742 WHERE "Game" = 'game 5' | wikisql | Below are sql tables schemas paired with 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 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) ### Response: SELECT "Result" FROM table_9742 WHERE "Game" = 'game 5' |
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. | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
) | 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')) | mimic_iii | Below are sql tables 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 (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
) ### 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')) |
What school has the Lancers as their mascot? | CREATE TABLE table_65693 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | SELECT "Location" FROM table_65693 WHERE "Mascot" = 'lancers' | wikisql | Below are sql tables schemas 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 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) ### Response: SELECT "Location" FROM table_65693 WHERE "Mascot" = 'lancers' |
What was the tie number for the game with an away team of Hartlepool United? | CREATE TABLE table_60420 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | SELECT "Tie no" FROM table_60420 WHERE "Away team" = 'hartlepool united' | wikisql | Below are sql tables schemas 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 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) ### Response: SELECT "Tie no" FROM table_60420 WHERE "Away team" = 'hartlepool united' |
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. | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) | 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') | eicu | Below are sql tables 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 (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) ### 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') |
What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt? | CREATE TABLE table_name_92 (
round VARCHAR,
race VARCHAR
) | SELECT round FROM table_name_92 WHERE race = "int. adac-preis der tourenwagen von sachsen-anhalt" | sql_create_context | Below are sql tables schemas paired with 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 (
round VARCHAR,
race VARCHAR
) ### Response: SELECT round FROM table_name_92 WHERE race = "int. adac-preis der tourenwagen von sachsen-anhalt" |
total number of venues that hosted first and second round games . | CREATE TABLE table_203_606 (
id number,
"region" text,
"rnd" number,
"host" text,
"venue" text,
"city" text,
"state" text
) | SELECT COUNT("venue") FROM table_203_606 WHERE "rnd" = 1 OR "rnd" = 2 | squall | Below are sql tables 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 (
id number,
"region" text,
"rnd" number,
"host" text,
"venue" text,
"city" text,
"state" text
) ### Response: SELECT COUNT("venue") FROM table_203_606 WHERE "rnd" = 1 OR "rnd" = 2 |
Which constructor has laps less than 100 and a time/retired +10 laps? | CREATE TABLE table_54219 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT "Constructor" FROM table_54219 WHERE "Laps" < '100' AND "Time/Retired" = '+10 laps' | wikisql | Below are sql tables 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 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) ### Response: SELECT "Constructor" FROM table_54219 WHERE "Laps" < '100' AND "Time/Retired" = '+10 laps' |
what was the first time that patient 003-83 had an intake since 995 days ago? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) | 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 | eicu | Below are sql tables schemas 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 (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) ### 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 |
What was the winning team where Tim Macrow won the fastest lap on Queensland Raceway circuit? | CREATE TABLE table_22083044_2 (
winning_team VARCHAR,
circuit VARCHAR,
fastest_lap VARCHAR
) | SELECT winning_team FROM table_22083044_2 WHERE circuit = "Queensland Raceway" AND fastest_lap = "Tim Macrow" | sql_create_context | Below are sql tables schemas 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 (
winning_team VARCHAR,
circuit VARCHAR,
fastest_lap VARCHAR
) ### Response: SELECT winning_team FROM table_22083044_2 WHERE circuit = "Queensland Raceway" AND fastest_lap = "Tim Macrow" |
since 3 years ago, count the number of drugs that patient 19428 had been prescribed. | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
) | 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') | mimic_iii | Below are sql tables 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 (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
) ### 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') |
Tell me the cast for b. reeves eason and joseph kane | CREATE TABLE table_57614 (
"Serial Title" text,
"Year" text,
"Chapters" text,
"Director" text,
"Cast" text
) | SELECT "Cast" FROM table_57614 WHERE "Director" = 'b. reeves eason and joseph kane' | wikisql | Below are sql tables 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 (
"Serial Title" text,
"Year" text,
"Chapters" text,
"Director" text,
"Cast" text
) ### Response: SELECT "Cast" FROM table_57614 WHERE "Director" = 'b. reeves eason and joseph kane' |
Which Captain 2 has a Result of final? | CREATE TABLE table_76555 (
"Date" text,
"Captain 1" text,
"Team 2" text,
"Captain 2" text,
"Venue" text,
"Result" text
) | SELECT "Captain 2" FROM table_76555 WHERE "Result" = 'final' | wikisql | Below are sql tables 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 (
"Date" text,
"Captain 1" text,
"Team 2" text,
"Captain 2" text,
"Venue" text,
"Result" text
) ### Response: SELECT "Captain 2" FROM table_76555 WHERE "Result" = 'final' |
when was the last time patient 85895 was prescribed a drug the previous month? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) | 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 | mimic_iii | Below are sql tables 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 (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) ### 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 |
What was the record on April 1? | CREATE TABLE table_33986 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | SELECT "Record" FROM table_33986 WHERE "Date" = 'april 1' | wikisql | Below are sql tables schemas 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 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) ### Response: SELECT "Record" FROM table_33986 WHERE "Date" = 'april 1' |
What is the entered service date for serial number 85-1222? | CREATE TABLE table_name_29 (
entered_service VARCHAR,
serial_no VARCHAR
) | SELECT entered_service FROM table_name_29 WHERE serial_no = "85-1222" | sql_create_context | Below are sql tables schemas paired with 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 (
entered_service VARCHAR,
serial_no VARCHAR
) ### Response: SELECT entered_service FROM table_name_29 WHERE serial_no = "85-1222" |
How many points does Swedish America's Cup Challenge have for rr1? | CREATE TABLE table_21515673_2 (
rr1_pts VARCHAR,
team_name VARCHAR
) | SELECT COUNT(rr1_pts) FROM table_21515673_2 WHERE team_name = "Swedish America's Cup Challenge" | sql_create_context | Below are sql tables 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 (
rr1_pts VARCHAR,
team_name VARCHAR
) ### Response: SELECT COUNT(rr1_pts) FROM table_21515673_2 WHERE team_name = "Swedish America's Cup Challenge" |
Who is teaching PreMajor classes in the Winter term ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
) | 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 | advising | Below are sql tables 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 (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
) ### 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 |
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. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) | 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 | nvbench | Below are sql tables 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 (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) ### 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 |
What is the lowest attendance for a stadium that has an average smaller than 307? | CREATE TABLE table_name_24 (
lowest INTEGER,
average INTEGER
) | SELECT AVG(lowest) FROM table_name_24 WHERE average < 307 | sql_create_context | Below are sql tables schemas paired with 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 (
lowest INTEGER,
average INTEGER
) ### Response: SELECT AVG(lowest) FROM table_name_24 WHERE average < 307 |
How many people are under 40 for each gender Plot them as bar chart, list x axis in asc order. | CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender | nvbench | Below are sql tables 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 (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) ### Response: SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender |
When 0-1 is the series who has the highest amount of assists? | CREATE TABLE table_22883210_11 (
high_assists VARCHAR,
series VARCHAR
) | SELECT high_assists FROM table_22883210_11 WHERE series = "0-1" | sql_create_context | Below are sql tables 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 (
high_assists VARCHAR,
series VARCHAR
) ### Response: SELECT high_assists FROM table_22883210_11 WHERE series = "0-1" |
What are the first names of all students taking accoutning and Computer Information Systems classes? | CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
) | 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' | spider | Below are sql tables schemas 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 (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
) ### 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' |
how many months had more than 55 favor votes ? | CREATE TABLE table_203_43 (
id number,
"polling firm" text,
"month" text,
"link" text,
"favor" number,
"oppose" number
) | SELECT COUNT("month") FROM table_203_43 WHERE "favor" > 55 | squall | Below are sql tables 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 (
id number,
"polling firm" text,
"month" text,
"link" text,
"favor" number,
"oppose" number
) ### Response: SELECT COUNT("month") FROM table_203_43 WHERE "favor" > 55 |
What was the score for south melbourne at home? | CREATE TABLE table_78401 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team score" FROM table_78401 WHERE "Home team" = 'south melbourne' | wikisql | Below are sql tables schemas 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 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Home team score" FROM table_78401 WHERE "Home team" = 'south melbourne' |
Tell me the time of admission and primary disease for the patient with patient id 53707. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
) | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "53707" | mimicsql_data | Below are sql tables 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
) ### Response: SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "53707" |
previous gastrointestinal bleeding within 6 months, bleeding diathesis, platelet count < 100000 / mm3 or hemoglobin < 10 g / dl | CREATE TABLE table_test_24 (
"id" int,
"history_of_bleeding_diathesis" bool,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"blood_draw" bool,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"allergy_to_clopidogrel" bool,
"cardiogenic_shock" bool,
"allergy_to_prasugrel" bool,
"platelet_count" float,
"diastolic_blood_pressure_dbp" int,
"symptomatic_hypotension" bool,
"serum_total_cholesterol" int,
"gastrointestinal_disease" bool,
"serum_creatinine" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) | SELECT * FROM table_test_24 WHERE gastrointestinal_disease = 1 OR bleeding = 1 OR platelet_count < 100000 OR hemoglobin_a1c_hba1c < 10 | criteria2sql | Below are sql tables 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 (
"id" int,
"history_of_bleeding_diathesis" bool,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"blood_draw" bool,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"allergy_to_clopidogrel" bool,
"cardiogenic_shock" bool,
"allergy_to_prasugrel" bool,
"platelet_count" float,
"diastolic_blood_pressure_dbp" int,
"symptomatic_hypotension" bool,
"serum_total_cholesterol" int,
"gastrointestinal_disease" bool,
"serum_creatinine" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) ### Response: SELECT * FROM table_test_24 WHERE gastrointestinal_disease = 1 OR bleeding = 1 OR platelet_count < 100000 OR hemoglobin_a1c_hba1c < 10 |
how many games were attended by at least 8,000 people ? | CREATE TABLE table_204_971 (
id number,
"m" number,
"date" text,
"tournament" text,
"round" text,
"ground" text,
"opponent" text,
"score" text,
"attendance" number,
"dinamo scorers" text,
"report" text
) | SELECT COUNT(*) FROM table_204_971 WHERE "attendance" >= 8000 | squall | Below are sql tables 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 (
id number,
"m" number,
"date" text,
"tournament" text,
"round" text,
"ground" text,
"opponent" text,
"score" text,
"attendance" number,
"dinamo scorers" text,
"report" text
) ### Response: SELECT COUNT(*) FROM table_204_971 WHERE "attendance" >= 8000 |
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. | CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
) | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active | nvbench | Below are sql tables 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 (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
) ### Response: SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active |
Name the most time for katrin mei ner and rank less than 5 | CREATE TABLE table_68512 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | SELECT MAX("Time") FROM table_68512 WHERE "Name" = 'katrin meißner' AND "Rank" < '5' | wikisql | Below are sql tables 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 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) ### Response: SELECT MAX("Time") FROM table_68512 WHERE "Name" = 'katrin meißner' AND "Rank" < '5' |
In the year 2009 who was the under-13? | CREATE TABLE table_26368963_1 (
under_13 VARCHAR,
year VARCHAR
) | SELECT under_13 FROM table_26368963_1 WHERE year = 2009 | sql_create_context | Below are sql tables 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 (
under_13 VARCHAR,
year VARCHAR
) ### Response: SELECT under_13 FROM table_26368963_1 WHERE year = 2009 |
Name the highest Horizontal Bar which is in france and Rings smaller than 58.975? | CREATE TABLE table_name_4 (
horizontal_bar INTEGER,
country VARCHAR,
rings VARCHAR
) | SELECT MAX(horizontal_bar) FROM table_name_4 WHERE country = "france" AND rings < 58.975 | sql_create_context | Below are sql tables 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 (
horizontal_bar INTEGER,
country VARCHAR,
rings VARCHAR
) ### Response: SELECT MAX(horizontal_bar) FROM table_name_4 WHERE country = "france" AND rings < 58.975 |
what is the county when the latitude is more than 48.581299, ansi code is more than 1037103 and the geo id is 3801985060? | CREATE TABLE table_name_74 (
county VARCHAR,
geo_id VARCHAR,
latitude VARCHAR,
ansi_code VARCHAR
) | SELECT county FROM table_name_74 WHERE latitude > 48.581299 AND ansi_code > 1037103 AND geo_id = 3801985060 | sql_create_context | Below are sql tables schemas paired with 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 (
county VARCHAR,
geo_id VARCHAR,
latitude VARCHAR,
ansi_code VARCHAR
) ### Response: SELECT county FROM table_name_74 WHERE latitude > 48.581299 AND ansi_code > 1037103 AND geo_id = 3801985060 |
Recent bounties with a given tag. | CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
) | 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 | sede | Below are sql tables 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 (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
) ### 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 |
Show the names of climbers and the heights of mountains they climb Show bar chart, and display in desc by the bars please. | CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
) | 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 | nvbench | Below are sql tables 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 (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
) ### 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 |
How many strokes for arnold palmer with a to par of greater than 9? | CREATE TABLE table_name_69 (
total INTEGER,
to_par VARCHAR,
player VARCHAR
) | SELECT AVG(total) FROM table_name_69 WHERE to_par > 9 AND player = "arnold palmer" | sql_create_context | Below are sql tables 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 (
total INTEGER,
to_par VARCHAR,
player VARCHAR
) ### Response: SELECT AVG(total) FROM table_name_69 WHERE to_par > 9 AND player = "arnold palmer" |
what is a flight that goes from BALTIMORE to SAN FRANCISCO and arrives at SAN FRANCISCO at 2000 on a FRIDAY | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
) | 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 | atis | Below are sql tables schemas paired 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 (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
) ### 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 |
What were the starts when the points dropped 18? | CREATE TABLE table_73703 (
"Name" text,
"Nation" text,
"Seasons" text,
"Championship titles" text,
"Races (Starts)" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Fastest Laps" real,
"Points (Dropped points)" text
) | SELECT "Races (Starts)" FROM table_73703 WHERE "Points (Dropped points)" = '18' | wikisql | Below are sql tables schemas 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 (
"Name" text,
"Nation" text,
"Seasons" text,
"Championship titles" text,
"Races (Starts)" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Fastest Laps" real,
"Points (Dropped points)" text
) ### Response: SELECT "Races (Starts)" FROM table_73703 WHERE "Points (Dropped points)" = '18' |
Who was Henry Hyde's opponent in the race? | CREATE TABLE table_1341568_14 (
opponent VARCHAR,
incumbent VARCHAR
) | SELECT opponent FROM table_1341568_14 WHERE incumbent = "Henry Hyde" | sql_create_context | Below are sql tables 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 (
opponent VARCHAR,
incumbent VARCHAR
) ### Response: SELECT opponent FROM table_1341568_14 WHERE incumbent = "Henry Hyde" |
Draw a bar chart about the distribution of All_Road and School_ID , order by the Y-axis from low to high please. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
) | SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID | nvbench | Below are sql tables 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 (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
) ### Response: SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID |
which papers used NELL ? | CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE writes (
paperid int,
authorid int
) | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid | scholar | Below are sql tables 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 (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE writes (
paperid int,
authorid int
) ### Response: SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid |
Which tournament has a Runner(s)-up of Gary McCord? | CREATE TABLE table_name_47 (
tournament VARCHAR,
runner_s__up VARCHAR
) | SELECT tournament FROM table_name_47 WHERE runner_s__up = "gary mccord" | sql_create_context | Below are sql tables 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 (
tournament VARCHAR,
runner_s__up VARCHAR
) ### Response: SELECT tournament FROM table_name_47 WHERE runner_s__up = "gary mccord" |
when did patient 021-221706 come to the hospital for the last time until 4 years ago via an floor? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) | 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 | eicu | Below are sql tables 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 (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) ### 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 |
What's the overall record of the team with 4-3 road record? | CREATE TABLE table_22993636_2 (
overall_record VARCHAR,
road_record VARCHAR
) | SELECT overall_record FROM table_22993636_2 WHERE road_record = "4-3" | sql_create_context | Below are sql tables schemas 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 (
overall_record VARCHAR,
road_record VARCHAR
) ### Response: SELECT overall_record FROM table_22993636_2 WHERE road_record = "4-3" |
Which person teaches the easiest course in regards to ULCS ? | CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
) | 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%') | advising | Below are sql tables 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 (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
) ### 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%') |
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? | CREATE TABLE table_54042 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text
) | SELECT "Constructor" FROM table_54042 WHERE "Tyre" = 'd' AND "Engine" = 'talbot 23cv 4.5 l6' AND "Chassis" = 'talbot-lago t26c' AND "Entrant" = 'ecurie belge' | wikisql | Below are sql tables 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 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text
) ### 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' |
What is Place, when To Par is '5', and when Score is '72-73=145'? | CREATE TABLE table_47828 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | SELECT "Place" FROM table_47828 WHERE "To par" = '5' AND "Score" = '72-73=145' | wikisql | Below are sql tables schemas paired 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 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) ### Response: SELECT "Place" FROM table_47828 WHERE "To par" = '5' AND "Score" = '72-73=145' |
When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party? | CREATE TABLE table_67462 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
) | SELECT "Term end" FROM table_67462 WHERE "Party" = 'national religious party' AND "Minister" = 'shlomo-yisrael ben-meir' | wikisql | Below are sql tables 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 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
) ### Response: SELECT "Term end" FROM table_67462 WHERE "Party" = 'national religious party' AND "Minister" = 'shlomo-yisrael ben-meir' |
List the names of editors in ascending order of age. | CREATE TABLE editor (
Name VARCHAR,
Age VARCHAR
) | SELECT Name FROM editor ORDER BY Age | sql_create_context | Below are sql tables 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 (
Name VARCHAR,
Age VARCHAR
) ### Response: SELECT Name FROM editor ORDER BY Age |
what was the last time that patient 009-13409 was prescribed for a drug until 48 months ago? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
) | 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 | eicu | Below are sql tables schemas 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 (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
) ### 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 |
what's the minimum cost of a hospital that includes a cortisol lab test until 4 years ago? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
) | 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 | eicu | Below are sql tables schemas 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 (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
) ### 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 |
What are the different budget type codes, and how many documents are there for each. Show a pie chart. | CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
) | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code | nvbench | Below are sql tables schemas 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 (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
) ### Response: SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code |
In heat rank 7, what is the sum of lanes? | CREATE TABLE table_31969 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
) | SELECT SUM("Lane") FROM table_31969 WHERE "Heat Rank" = '7' | wikisql | Below are sql tables 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 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
) ### Response: SELECT SUM("Lane") FROM table_31969 WHERE "Heat Rank" = '7' |
What is the city/state of the circuit where Russell Ingall Larry Perkins was the winner? | CREATE TABLE table_51037 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | SELECT "City / State" FROM table_51037 WHERE "Winner" = 'russell ingall larry perkins' | wikisql | Below are sql tables schemas paired with 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 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) ### Response: SELECT "City / State" FROM table_51037 WHERE "Winner" = 'russell ingall larry perkins' |
When did construction start on the Power station with a net MWE of 1190 | CREATE TABLE table_143352_1 (
construction_started INTEGER,
net_mwe VARCHAR
) | SELECT MIN(construction_started) FROM table_143352_1 WHERE net_mwe = 1190 | sql_create_context | Below are sql tables 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 (
construction_started INTEGER,
net_mwe VARCHAR
) ### Response: SELECT MIN(construction_started) FROM table_143352_1 WHERE net_mwe = 1190 |
Who are the directors of the episode in series # 54? | CREATE TABLE table_26866233_1 (
director VARCHAR,
series__number VARCHAR
) | SELECT director FROM table_26866233_1 WHERE series__number = 54 | sql_create_context | Below are sql tables 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 (
director VARCHAR,
series__number VARCHAR
) ### Response: SELECT director FROM table_26866233_1 WHERE series__number = 54 |
What is the Location, when the Score is 38-29? | CREATE TABLE table_71546 (
"Date" text,
"Winner" text,
"Score" text,
"Location" text,
"Series" text
) | SELECT "Location" FROM table_71546 WHERE "Score" = '38-29' | wikisql | Below are sql tables schemas paired with 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 (
"Date" text,
"Winner" text,
"Score" text,
"Location" text,
"Series" text
) ### Response: SELECT "Location" FROM table_71546 WHERE "Score" = '38-29' |
Which week did the Baltimore Ravens play at home ? | CREATE TABLE table_name_79 (
week VARCHAR,
host_team VARCHAR
) | SELECT week FROM table_name_79 WHERE host_team = "baltimore ravens" | sql_create_context | Below are sql tables 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 (
week VARCHAR,
host_team VARCHAR
) ### Response: SELECT week FROM table_name_79 WHERE host_team = "baltimore ravens" |
please show me all airlines with SUNDAY flights from PHILADELPHIA to DENVER | CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
) | 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 | atis | Below are sql tables 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 (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
) ### 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 |
count of unique roles | CREATE TABLE table_203_756 (
id number,
"year" number,
"title" text,
"role" text,
"network" text,
"notes" text
) | SELECT COUNT("role") FROM table_203_756 | squall | Below are sql tables 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 (
id number,
"year" number,
"title" text,
"role" text,
"network" text,
"notes" text
) ### Response: SELECT COUNT("role") FROM table_203_756 |
what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and procedure icd9 code is 8856? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) | 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" | mimicsql_data | Below are sql tables schemas paired with 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) ### 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" |