instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Who was the GT2 Winning Team if Greg Mansell Leo Mansell was the LMP1 Winning Team?
CREATE TABLE table_27150 ( "Rnd." real, "Circuit" text, "LMP1 Winning Team" text, "LMP2 Winning Team" text, "FLM Winning Team" text, "GT1 Winning Team" text, "GT2 Winning Team" text, "Results" text )
SELECT "GT2 Winning Team" FROM table_27150 WHERE "LMP1 Winning Team" = 'Greg Mansell Leo Mansell'
Below are sql tables 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 GT2 Winning Team if Greg Mansell Leo Mansell was the LMP1 Winning Team? ### Input: CREATE TABLE table_27150 ( ...
what is the total blood loss output for patient 022-142620 on 04/30/2104?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-142620')) AND intakeoutput.celllabel = 'bloo...
Below are sql tables schemas paired with 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 blood loss output for patient 022-142620 on 04/30/2104? ### Input: CREATE TABLE medication ( medicatio...
Which crowd has an Away team score of 10.10 (70)?
CREATE TABLE table_11382 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Crowd" FROM table_11382 WHERE "Away team score" = '10.10 (70)'
Below are sql tables 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 crowd has an Away team score of 10.10 (70)? ### Input: CREATE TABLE table_11382 ( "Home team" text, "Home team...
Please give me a pie chart to show the proportion of the home city of all drivers
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type...
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please give me a pie chart to show the proportion of the home city of all drivers ### Input: CREATE TABLE driver ( Drive...
count the number of patients having cerebral aneurysm/sda and also having drug route ih.
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" AND prescriptions.route = "IH"
Below are sql tables 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 having cerebral aneurysm/sda and also having drug route ih. ### Input: CREATE TABLE lab ( s...
What is the minimum, average, and maximum distance of all aircrafts.
CREATE TABLE Aircraft ( distance INTEGER )
SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the minimum, average, and maximum distance of all aircrafts. ### Input: CREATE TABLE Aircraft ( distance INTEGER...
A bar chart showing the number of accelerators for each browser in the descending order of compatible year.
CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connection text ) CREATE TABLE browser ( id int, name text, market_share real ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_ye...
SELECT T2.name, COUNT(T2.name) FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN Web_client_accelerator AS T3 ON T1.accelerator_id = T3.id GROUP BY T2.name ORDER BY T1.compatible_since_year DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart showing the number of accelerators for each browser in the descending order of compatible year. ### Input: CREAT...
what are the three most frequently ordered microbiology tests for patients who have had destruct chest wall les before in the same month last year?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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, ...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
Below are sql tables schemas 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 three most frequently ordered microbiology tests for patients who have had destruct chest wall les before in th...
For each manufacturer's name, what are the prices of their most expensive product?, and list by the total number in descending.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each manufacturer's name, what are the prices of their most expensive product?, and list by the total number in descendi...
how many patients with drug type as base had pressure ulcer, lower back?
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Pressure ulcer, lower back" AND prescriptions.drug_type = "BASE"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients with drug type as base had pressure ulcer, lower back? ### Input: CREATE TABLE lab ( subject_id text, ...
what was the first dose of prismasate (b32 k2) in 11/last year, prescribed to patient 92063?
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 d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92063) AND prescriptions.drug = 'prismasate (b32 k2)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ...
Below are sql tables schemas 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 dose of prismasate (b32 k2) in 11/last year, prescribed to patient 92063? ### Input: CREATE TABLE icustay...
With the given loss of 4, what was the number of tries?
CREATE TABLE table_17675675_2 ( tries_for VARCHAR, lost VARCHAR )
SELECT COUNT(tries_for) FROM table_17675675_2 WHERE lost = "4"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With the given loss of 4, what was the number of tries? ### Input: CREATE TABLE table_17675675_2 ( tries_for VARCHAR, ...
what are the numbers of patients who had po pe28 intake?
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, insuranc...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'po pe28' AND d_item...
Below are sql tables schemas 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 numbers of patients who had po pe28 intake? ### Input: CREATE TABLE d_items ( row_id number, itemid num...
What was the Attendance in Week 17?
CREATE TABLE table_78474 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
SELECT "Attendance" FROM table_78474 WHERE "Week" = '17'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Attendance in Week 17? ### Input: CREATE TABLE table_78474 ( "Week" real, "Date" text, "Opponent" t...
List the genre name and genre id using a bar chart.
CREATE TABLE store ( store_id TINYINT UNSIGNED, manager_staff_id TINYINT UNSIGNED, address_id SMALLINT UNSIGNED, last_update TIMESTAMP ) CREATE TABLE staff ( staff_id TINYINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), address_id SMALLINT UNSIGNED, picture BLOB, ema...
SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id
Below are sql tables 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 genre name and genre id using a bar chart. ### Input: CREATE TABLE store ( store_id TINYINT UNSIGNED, manag...
What is the average number of bronze medals associated with 0 silver, 1 total, and ranks over 16?
CREATE TABLE table_name_58 ( bronze INTEGER, rank VARCHAR, total VARCHAR, silver VARCHAR )
SELECT AVG(bronze) FROM table_name_58 WHERE total = 1 AND silver = 0 AND rank > 16
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of bronze medals associated with 0 silver, 1 total, and ranks over 16? ### Input: CREATE TABLE ta...
Name the division for detroit diesel series 50egr allison wb-400r
CREATE TABLE table_24193494_3 ( division VARCHAR, powertrain__engine_transmission_ VARCHAR )
SELECT division FROM table_24193494_3 WHERE powertrain__engine_transmission_ = "Detroit Diesel Series 50EGR Allison WB-400R"
Below are sql tables 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 division for detroit diesel series 50egr allison wb-400r ### Input: CREATE TABLE table_24193494_3 ( division VA...
when was the first time that the arterial bp [systolic] of patient 21079 was measured / taken?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21079)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time that the arterial bp [systolic] of patient 21079 was measured / taken? ### Input: CREATE TABLE micro...
what is CVG
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 ( ...
SELECT DISTINCT airport_code FROM airport WHERE airport_code = 'CVG'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is CVG ### Input: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airpo...
how many patients aged less than 72 years have collagenase ointment prescription?
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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.drug = "Collagenase Ointment"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients aged less than 72 years have collagenase ointment prescription? ### Input: CREATE TABLE lab ( subject_...
when was the first game played .
CREATE TABLE table_204_318 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
SELECT "date" FROM table_204_318 ORDER BY "date" LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first game played . ### Input: CREATE TABLE table_204_318 ( id number, "date" text, "opponent" text...
When was the show first aired that was viewed by 3.57 million U.S. viewers?
CREATE TABLE table_11694832_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR )
SELECT original_air_date FROM table_11694832_1 WHERE us_viewers__millions_ = "3.57"
Below are sql tables 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 show first aired that was viewed by 3.57 million U.S. viewers? ### Input: CREATE TABLE table_11694832_1 ( o...
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart.
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart. ### Input: CREA...
In the game against home team Fitzroy, what did the away team score?
CREATE TABLE table_11034 ( "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_11034 WHERE "Home team" = 'fitzroy'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game against home team Fitzroy, what did the away team score? ### Input: CREATE TABLE table_11034 ( "Home team" t...
What Chinese Title Ranking #7 has an Average of 32 and Peak less than 38?
CREATE TABLE table_57309 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text )
SELECT "Chinese title" FROM table_57309 WHERE "Average" = '32' AND "Peak" < '38' AND "Rank" = '7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Chinese Title Ranking #7 has an Average of 32 and Peak less than 38? ### Input: CREATE TABLE table_57309 ( "Rank" r...
What is the Date of the Tournament with a Score of 3 6, 7 6(6), 5 7?
CREATE TABLE table_49188 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Date" FROM table_49188 WHERE "Score" = '3–6, 7–6(6), 5–7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date of the Tournament with a Score of 3 6, 7 6(6), 5 7? ### Input: CREATE TABLE table_49188 ( "Date" text, ...
how many teams won by at least three points ?
CREATE TABLE table_204_487 ( id number, "home team" text, "score" text, "visiting team" text, "location" text, "venue" text, "door" text, "surface" text )
SELECT COUNT(*) FROM table_204_487 WHERE ABS("score" - "score") >= 3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many teams won by at least three points ? ### Input: CREATE TABLE table_204_487 ( id number, "home team" text, ...
What Game site has an Opponent of Miami Dolphins?
CREATE TABLE table_name_90 ( game_site VARCHAR, opponent VARCHAR )
SELECT game_site FROM table_name_90 WHERE opponent = "miami dolphins"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Game site has an Opponent of Miami Dolphins? ### Input: CREATE TABLE table_name_90 ( game_site VARCHAR, opponen...
What is the score for set 2 when the time is 18:00 and the score of set 1 is 18 25?
CREATE TABLE table_name_48 ( set_2 VARCHAR, time VARCHAR, set_1 VARCHAR )
SELECT set_2 FROM table_name_48 WHERE time = "18:00" AND set_1 = "18–25"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for set 2 when the time is 18:00 and the score of set 1 is 18 25? ### Input: CREATE TABLE table_name_48 ( ...
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 last_name and commission_pct , and I want to show names from low to high order.
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME
Below are sql tables 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...
rosen _ modified hachinski ischemia score >= 4
CREATE TABLE table_train_106 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "mini_mental_state_examination_mmse" int, "uncontrolled_diabetes" bool, "blood_glucose" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "age" float, "NOUSE" f...
SELECT * FROM table_train_106 WHERE rosen_modified_hachinski_ischemic_score >= 4
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: rosen _ modified hachinski ischemia score >= 4 ### Input: CREATE TABLE table_train_106 ( "id" int, "gender" string, ...
Which player is on the BC Lions?
CREATE TABLE table_73186 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
SELECT "Player" FROM table_73186 WHERE "CFL Team" = 'BC Lions'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player is on the BC Lions? ### Input: CREATE TABLE table_73186 ( "Pick #" real, "CFL Team" text, "Player" ...
What was the score of the away team at the the glenferrie oval?
CREATE TABLE table_58148 ( "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_58148 WHERE "Venue" = 'glenferrie oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the away team at the the glenferrie oval? ### Input: CREATE TABLE table_58148 ( "Home team" text, ...
count the number of patients who have received an mediastinoscopy procedure in the same month after getting a thoracentesis procedure.
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE i...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracentes...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have received an mediastinoscopy procedure in the same month after getting a thoracentesis ...
Name the number of weeks for 50073 attendance
CREATE TABLE table_19760 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
SELECT COUNT("Week") FROM table_19760 WHERE "Attendance" = '50073'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of weeks for 50073 attendance ### Input: CREATE TABLE table_19760 ( "Week" real, "Date" text, "O...
subject has a body mass index ( bmi ) > 25 kg / m^2 and < 50 kg / m^2.
CREATE TABLE table_train_273 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "hba1c" float, "insulin_requirement" float, "body_mass_index_bmi" float, "NOUSE" float )
SELECT * FROM table_train_273 WHERE body_mass_index_bmi > 25 AND body_mass_index_bmi < 50
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: subject has a body mass index ( bmi ) > 25 kg / m^2 and < 50 kg / m^2. ### Input: CREATE TABLE table_train_273 ( "id" in...
what airlines go from ATLANTA to BALTIMORE
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varch...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what airlines go from ATLANTA to BALTIMORE ### Input: CREATE TABLE compartment_class ( compartment varchar, class_ty...
how many patients have been prescribed the drug with code pred1?
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "PRED1"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have been prescribed the drug with code pred1? ### Input: CREATE TABLE prescriptions ( subject_id text...
, I want to list by the bars from low to high please.
CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int ) CREATE TABLE nomination ( Artwork_ID int, Festival_ID int, Result text ) CREATE TABLE artwork ( Artwork_ID int, Type text, Name text )
SELECT Type, COUNT(*) FROM artwork GROUP BY Type ORDER BY Type
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: , I want to list by the bars from low to high please. ### Input: CREATE TABLE festival_detail ( Festival_ID int, Fes...
How many patients were admitted as transfer from hosp/extram before the year 2163?
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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2163"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients were admitted as transfer from hosp/extram before the year 2163? ### Input: CREATE TABLE diagnoses ( s...
Which Surface has a Score of 6 4, 6 2?
CREATE TABLE table_36764 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Surface" FROM table_36764 WHERE "Score" = '6–4, 6–2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Surface has a Score of 6 4, 6 2? ### Input: CREATE TABLE table_36764 ( "Outcome" text, "Date" text, "Tourn...
had patient 030-53416 ever had some output y (ml)-chest tube y - a #2 mid b #3 mid's since 118 months ago?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 030-53416 ever had some output y (ml)-chest tube y - a #2 mid b #3 mid's since 118 months ago? ### Input: CREATE...
What was the winning score at bellerive country club?
CREATE TABLE table_29579 ( "Year" real, "Player" text, "Country" text, "Score" text, "To par" text, "Margin of victory" text, "Course" text, "Location" text, "Purse ( $ )" real, "Winners share ($)" real )
SELECT "Score" FROM table_29579 WHERE "Course" = 'Bellerive Country Club'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the winning score at bellerive country club? ### Input: CREATE TABLE table_29579 ( "Year" real, "Player" te...
What date did the episode that had 8.84 million u.s. viewers originally air?
CREATE TABLE table_30751 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
SELECT "Original air date" FROM table_30751 WHERE "U.S. viewers (million)" = '8.84'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did the episode that had 8.84 million u.s. viewers originally air? ### Input: CREATE TABLE table_30751 ( "No. ...
Visualize a bar chart showing the average age of captains in each class, I want to rank in asc by the x axis.
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart showing the average age of captains in each class, I want to rank in asc by the x axis. ### Input: CRE...
calculate the minimum age of divorced patients who had emergency room hospital admit.
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 t...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the minimum age of divorced patients who had emergency room hospital admit. ### Input: CREATE TABLE demographic ( ...
Find the altitude (or elevation) of the airports in the city of New York with a bar chart, order in ascending by the elevation.
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline va...
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY elevation
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the altitude (or elevation) of the airports in the city of New York with a bar chart, order in ascending by the elevati...
What is the score of the match on July 22, 2008?
CREATE TABLE table_51424 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT "Score" FROM table_51424 WHERE "Date" = 'july 22, 2008'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of the match on July 22, 2008? ### Input: CREATE TABLE table_51424 ( "Date" text, "Venue" text, ...
What is the home team score for St Kilda?
CREATE TABLE table_name_52 ( home_team VARCHAR )
SELECT home_team AS score FROM table_name_52 WHERE home_team = "st kilda"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the home team score for St Kilda? ### Input: CREATE TABLE table_name_52 ( home_team VARCHAR ) ### Response: SELE...
when patient 15821 received a microbiology test for the last time?
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, insuranc...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15821) ORDER BY microbiologyevents.charttime DESC LIMIT 1
Below are sql tables 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 patient 15821 received a microbiology test for the last time? ### Input: CREATE TABLE d_items ( row_id number, ...
what is age and primary disease of subject id 2560?
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 ) ...
SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is age and primary disease of subject id 2560? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id te...
What is the total number of Week(s), when Attendance is 61,603?
CREATE TABLE table_name_23 ( week VARCHAR, attendance VARCHAR )
SELECT COUNT(week) FROM table_name_23 WHERE attendance = "61,603"
Below are sql tables schemas paired with 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 Week(s), when Attendance is 61,603? ### Input: CREATE TABLE table_name_23 ( week VARCHAR, ...
What genre is Led Zeppelin?
CREATE TABLE table_name_85 ( genre VARCHAR, artist VARCHAR )
SELECT genre FROM table_name_85 WHERE artist = "led zeppelin"
Below are sql tables schemas 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 is Led Zeppelin? ### Input: CREATE TABLE table_name_85 ( genre VARCHAR, artist VARCHAR ) ### Response: SE...
Which Melbourne had a gold coast and sydney which were yes, but an adelaide that was no?
CREATE TABLE table_68329 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
SELECT "Melbourne" FROM table_68329 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'no' AND "Sydney" = 'yes'
Below are sql tables 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 Melbourne had a gold coast and sydney which were yes, but an adelaide that was no? ### Input: CREATE TABLE table_68329...
how many times since 3 years ago does patient 22753 visit the hospital?
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 ...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 22753 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times since 3 years ago does patient 22753 visit the hospital? ### Input: CREATE TABLE admissions ( row_id numb...
What tournament was at the 2007 Olympic Games?
CREATE TABLE table_15227 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "Tournament" FROM table_15227 WHERE "2007" = 'olympic games'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What tournament was at the 2007 Olympic Games? ### Input: CREATE TABLE table_15227 ( "Tournament" text, "2007" text,...
how much does the weight of patient 28443's body change last measured on the current hospital visit compared to the value second to last measured on the current hospital visit?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 n...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much does the weight of patient 28443's body change last measured on the current hospital visit compared to the value se...
could you tell me about ground transportation arrangements from the DFW airport to downtown DALLAS
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 flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: could you tell me about ground transportation arrangements from the DFW airport to downtown DALLAS ### Input: CREATE TABLE r...
what is the number of patients whose death status is 1 and days of hospital stay is greater than 11?
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "11"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose death status is 1 and days of hospital stay is greater than 11? ### Input: CREATE TABLE...
list flights from INDIANAPOLIS to MEMPHIS with fares on monday
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 food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DAT...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list flights from INDIANAPOLIS to MEMPHIS with fares on monday ### Input: CREATE TABLE fare ( fare_id int, from_airp...
Which Scores by each individual judge has a Date performed of august 7, and a Main contestant of karanvir bohra?
CREATE TABLE table_58966 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text )
SELECT "Scores by each individual judge" FROM table_58966 WHERE "Date performed" = 'august 7' AND "Main contestant" = 'karanvir bohra'
Below are sql tables 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 Scores by each individual judge has a Date performed of august 7, and a Main contestant of karanvir bohra? ### Input: ...
what is procedure long title of subject name paul edwards?
CREATE TABLE diagnoses ( 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 demographic (...
SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Paul Edwards"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is procedure long title of subject name paul edwards? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm...
What is the sum of grid values of driver Michael Schumacher with lap counts larger than 66?
CREATE TABLE table_58303 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT SUM("Grid") FROM table_58303 WHERE "Laps" > '66' AND "Driver" = 'michael schumacher'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of grid values of driver Michael Schumacher with lap counts larger than 66? ### Input: CREATE TABLE table_58...
Bar chart x axis product type code y axis the number of product type code, and show names from high to low order.
CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Assets ( Asset_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID INTEGER, addr...
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY Product_Type_Code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis product type code y axis the number of product type code, and show names from high to low order. ### Input:...
what were the differences in arterial bp [systolic] of patient 28443 last measured on the current intensive care unit visit compared to the value second to last measured on the current intensive care unit visit?
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 ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
Below are sql tables schemas 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 differences in arterial bp [systolic] of patient 28443 last measured on the current intensive care unit visit ...
what's the total output that patient 009-1746 has had until 12/28/2105?
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 t...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-1746')) AND intakeoutput.cellpath LIKE '%out...
Below are sql tables schemas 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 total output that patient 009-1746 has had until 12/28/2105? ### Input: CREATE TABLE allergy ( allergyid numb...
did patient 23930 go through any procedure?
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 chart...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23930)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 23930 go through any procedure? ### Input: CREATE TABLE transfers ( row_id number, subject_id number, ...
what procedure did patient 016-25367 undergo for the last time since 2103?
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...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-25367')) AND STRFTIME('%y', treatment.treatmenttime) >= '2103...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what procedure did patient 016-25367 undergo for the last time since 2103? ### Input: CREATE TABLE microlab ( microlabid...
What is the location for the game on October 20 with it's corresponding attendance?
CREATE TABLE table_28768469_2 ( location_attendance VARCHAR, date VARCHAR )
SELECT location_attendance FROM table_28768469_2 WHERE date = "October 20"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the location for the game on October 20 with it's corresponding attendance? ### Input: CREATE TABLE table_28768469_2...
what is the daily minimum of arterial bp [systolic] for patient 9983 until 08/12/2103?
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 labevents ( row_id number, subject_id number, hadm_...
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9983)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the daily minimum of arterial bp [systolic] for patient 9983 until 08/12/2103? ### Input: CREATE TABLE icustays ( ...
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of manufacturer , and group by attribute founder in a bar chart, display by the total number of manufacturer in asc.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum o...
Return a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute Team_Name.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute Team_Name. #...
Who was the visiting team at the matchup at the RCA Dome?
CREATE TABLE table_68802 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
SELECT "Visiting Team" FROM table_68802 WHERE "Stadium" = 'rca dome'
Below are sql tables 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 visiting team at the matchup at the RCA Dome? ### Input: CREATE TABLE table_68802 ( "Date" text, "Visiti...
Give me the comparison about School_ID over the ACC_Road , and group by attribute ACC_Home by a bar chart, sort by the X in ascending.
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 ( Scho...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about School_ID over the ACC_Road , and group by attribute ACC_Home by a bar chart, sort by the X in ...
count the number of patients whose diagnoses icd9 code is 29690 and lab test abnormal status is abnormal?
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 te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "29690" AND lab.flag = "abnormal"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses icd9 code is 29690 and lab test abnormal status is abnormal? ### Input: CREATE ...
What is the lowest number of laps with a time/retired of +38.426?
CREATE TABLE table_5147 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT MIN("Laps") FROM table_5147 WHERE "Time/Retired" = '+38.426'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of laps with a time/retired of +38.426? ### Input: CREATE TABLE table_5147 ( "Rider" text, ...
What was the total attendance of the New York Giants?
CREATE TABLE table_74338 ( "Team" text, "Stadium" text, "Home Games" real, "Average Attendance" real, "Total Attendance" real, "Capacity Percentage" text )
SELECT MIN("Total Attendance") FROM table_74338 WHERE "Team" = 'New York Giants'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the total attendance of the New York Giants? ### Input: CREATE TABLE table_74338 ( "Team" text, "Stadium" t...
That is the value for Try bonus when the value for Points is 418?
CREATE TABLE table_name_82 ( try_bonus VARCHAR, points_for VARCHAR )
SELECT try_bonus FROM table_name_82 WHERE points_for = "418"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: That is the value for Try bonus when the value for Points is 418? ### Input: CREATE TABLE table_name_82 ( try_bonus VARC...
For those employees who was hired before 2002-06-21, visualize the relationship between commission_pct and manager_id .
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 regions ( REGION_ID...
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, visualize the relationship between commission_pct and manager_id . ### ...
Next Winter , who will be the Biomechanics for Engineering Students instructor ?
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_proje...
SELECT DISTINCT instructor.name 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 semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Next Winter , who will be the Biomechanics for Engineering Students instructor ? ### Input: CREATE TABLE course_offering ( ...
When is the winner panathinaikos, the runner-up olympiacos and the venue nikos goumas stadium?
CREATE TABLE table_50529 ( "Year" text, "Winner" text, "Runner-up" text, "Score" text, "Venue" text )
SELECT "Year" FROM table_50529 WHERE "Winner" = 'panathinaikos' AND "Runner-up" = 'olympiacos' AND "Venue" = 'nikos goumas stadium'
Below are sql tables 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 winner panathinaikos, the runner-up olympiacos and the venue nikos goumas stadium? ### Input: CREATE TABLE table...
what is average age of patients whose marital status is divorced and gender is m?
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "M"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is average age of patients whose marital status is divorced and gender is m? ### Input: CREATE TABLE prescriptions ( ...
had patient 002-3736 ever had a respiration of greater than 24.0 last month?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-3736')) AND vitalperiodic.respiration > 24.0 AND NOT vitalperiod...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 002-3736 ever had a respiration of greater than 24.0 last month? ### Input: CREATE TABLE treatment ( treatme...
What place is South Africa?
CREATE TABLE table_44277 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
SELECT "Place" FROM table_44277 WHERE "Country" = 'south africa'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What place is South Africa? ### Input: CREATE TABLE table_44277 ( "Place" text, "Player" text, "Country" text, ...
What is the average attendance of stadiums with capacity percentage higher than 100%?
CREATE TABLE stadium ( average_attendance VARCHAR, capacity_percentage INTEGER )
SELECT average_attendance FROM stadium WHERE capacity_percentage > 100
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average attendance of stadiums with capacity percentage higher than 100%? ### Input: CREATE TABLE stadium ( ...
in how many games did this team have more than 80 points ?
CREATE TABLE table_204_627 ( id number, "date" text, "opponent" text, "score" text, "top scorer (total points)" text, "venue (location)" text )
SELECT COUNT(*) FROM table_204_627 WHERE "score" > 80
Below are sql tables 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 games did this team have more than 80 points ? ### Input: CREATE TABLE table_204_627 ( id number, "date"...
what is the grid when the time/retired is +9 laps and the laps is larger than 91?
CREATE TABLE table_54331 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT COUNT("Grid") FROM table_54331 WHERE "Time/Retired" = '+9 laps' AND "Laps" > '91'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the grid when the time/retired is +9 laps and the laps is larger than 91? ### Input: CREATE TABLE table_54331 ( ...
serum creatinine level >= 2.5 mg / dl.
CREATE TABLE table_test_19 ( "id" int, "gender" string, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "acute_infectious" bool, "hypertensive_retinopathy" bool, "leukocyte_count" int, "severe_uncontrolled_hypertension" bool, "chronic_infectious" boo...
SELECT * FROM table_test_19 WHERE serum_creatinine >= 2.5
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: serum creatinine level >= 2.5 mg / dl. ### Input: CREATE TABLE table_test_19 ( "id" int, "gender" string, "left_...
How many golds have denmark as the nation, with a total less than 1?
CREATE TABLE table_64830 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Gold") FROM table_64830 WHERE "Nation" = 'denmark' AND "Total" < '1'
Below are sql tables 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 golds have denmark as the nation, with a total less than 1? ### Input: CREATE TABLE table_64830 ( "Rank" text, ...
what the first height of patient 004-86136 in 08/this year.
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 medication ( medicationid n...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what the first height of patient 004-86136 in 08/this year. ### Input: CREATE TABLE treatment ( treatmentid number, ...
Give the proportion of what are the different product names? What is the average product price for each of them?
CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID I...
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give the proportion of what are the different product names? What is the average product price for each of them? ### Input: ...
Show me about the distribution of Sex and the average of Height , and group by attribute Sex in a bar chart.
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, AVG(Height) FROM people GROUP BY Sex
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of Sex and the average of Height , and group by attribute Sex in a bar chart. ### Input: CREA...
Return the booking end dates for the apartments that have type code 'Duplex' and bin the year into weekday interval with a bar chart, order by the the number of booking start date in desc.
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CH...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date) DESC
Below are sql tables 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 booking end dates for the apartments that have type code 'Duplex' and bin the year into weekday interval with a b...
What is the least amount of silver for Italy with a total less than 5?
CREATE TABLE table_name_83 ( silver INTEGER, nation VARCHAR, total VARCHAR )
SELECT MIN(silver) FROM table_name_83 WHERE nation = "italy" AND total < 5
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least amount of silver for Italy with a total less than 5? ### Input: CREATE TABLE table_name_83 ( silver IN...
What is the Tie no when the away team was Burnley?
CREATE TABLE table_42786 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
SELECT "Tie no" FROM table_42786 WHERE "Away team" = 'burnley'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Tie no when the away team was Burnley? ### Input: CREATE TABLE table_42786 ( "Tie no" text, "Home team" ...
give me the number of patients whose ethnicity is white and days of hospital stay is greater than 8?
CREATE TABLE diagnoses ( 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay > "8"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose ethnicity is white and days of hospital stay is greater than 8? ### Input: CREATE TABLE...
What is the total number of episodes where alexa wyatt is the writer?
CREATE TABLE table_16175064_3 ( series__number VARCHAR, writer_s_ VARCHAR )
SELECT COUNT(series__number) FROM table_16175064_3 WHERE writer_s_ = "Alexa Wyatt"
Below are sql tables schemas paired with 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 episodes where alexa wyatt is the writer? ### Input: CREATE TABLE table_16175064_3 ( series_...
Which venue had the result 7-1?
CREATE TABLE table_32230 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT "Venue" FROM table_32230 WHERE "Result" = '7-1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue had the result 7-1? ### Input: CREATE TABLE table_32230 ( "Date" text, "Venue" text, "Score" text, ...
The hardest class would be what ?
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_proje...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The hardest class would be what ? ### Input: CREATE TABLE course_offering ( offering_id int, course_id int, seme...
On which date did Footscray play an away game?
CREATE TABLE table_11892 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_11892 WHERE "Away team" = 'footscray'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On which date did Footscray play an away game? ### Input: CREATE TABLE table_11892 ( "Home team" text, "Home team sc...