instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Where was the game played when the away team scored 14.15 (99)?
CREATE TABLE table_56616 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_56616 WHERE "Away team score" = '14.15 (99)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the game played when the away team scored 14.15 (99)? ### Input: CREATE TABLE table_56616 ( "Home team" text, ...
How many swimsuits have an Evening Gown larger than 9, and an Interview larger than 8.405?
CREATE TABLE table_name_32 ( swimsuit VARCHAR, evening_gown VARCHAR, interview VARCHAR )
SELECT COUNT(swimsuit) FROM table_name_32 WHERE evening_gown > 9 AND interview > 8.405
Below are sql tables 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 swimsuits have an Evening Gown larger than 9, and an Interview larger than 8.405? ### Input: CREATE TABLE table_nam...
Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home.
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_Road, School_ID FROM basketball_match GROUP BY ACC_Home, 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: Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home. ### Input: CREATE ...
Tell me the constructor that has 35 Laps with a grid more than 5
CREATE TABLE table_name_61 ( constructor VARCHAR, laps VARCHAR, grid VARCHAR )
SELECT constructor FROM table_name_61 WHERE laps = 35 AND grid > 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: Tell me the constructor that has 35 Laps with a grid more than 5 ### Input: CREATE TABLE table_name_61 ( constructor VAR...
have since 36 months ago patient 13329 been prescribed hydromorphone p.f., iso-osmotic dextrose or clindamycin?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13329) AND prescriptions.drug IN ('hydromorphone p.f.', 'iso-osmotic dextrose', 'clindamycin') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-36 month')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: have since 36 months ago patient 13329 been prescribed hydromorphone p.f., iso-osmotic dextrose or clindamycin? ### Input: C...
in 2105, what were the top four most frequent procedures that patients received during the same month after receiving a packed cell transfusion?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
Below are sql tables 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 2105, what were the top four most frequent procedures that patients received during the same month after receiving a pack...
what is the difference of heartrate in patient 015-96048 measured at 2105-08-15 09:57:00 compared to the value measured at 2105-08-15 09:52:00?
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, ...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND NOT vitalperiodic.heartrate IS 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 is the difference of heartrate in patient 015-96048 measured at 2105-08-15 09:57:00 compared to the value measured at 2...
in 06/last year, how much did patient 017-55081 weigh for the first time?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-55081') AND NOT patient.admissionweight 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: in 06/last year, how much did patient 017-55081 weigh for the first time? ### Input: CREATE TABLE intakeoutput ( intakeo...
Who is every player with a height of 6-5?
CREATE TABLE table_22824297_1 ( player VARCHAR, height VARCHAR )
SELECT player FROM table_22824297_1 WHERE height = "6-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: Who is every player with a height of 6-5? ### Input: CREATE TABLE table_22824297_1 ( player VARCHAR, height VARCHAR ...
what is the two year survival rate of nb obsrv suspct infect patients?
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 cost ( row_i...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the two year survival rate of nb obsrv suspct infect patients? ### Input: CREATE TABLE d_icd_procedures ( row_id...
What is the smallest rank with less than 2 wings, more than 26 events, and less than $1,831,211?
CREATE TABLE table_54369 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
SELECT MIN("Rank") FROM table_54369 WHERE "Wins" < '2' AND "Earnings ( $ )" < '1,831,211' AND "Events" > '26'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest rank with less than 2 wings, more than 26 events, and less than $1,831,211? ### Input: CREATE TABLE tab...
when was the last time patient 65569 was prescribed a drug through iv route in 05/this year?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65569) AND prescriptions.route = 'iv' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%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: when was the last time patient 65569 was prescribed a drug through iv route in 05/this year? ### Input: CREATE TABLE outpute...
What is the average of all Heats of competitors with a Time of 59.11 and a lane higher than 3?
CREATE TABLE table_14927 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
SELECT AVG("Heat") FROM table_14927 WHERE "Time" = '59.11' AND "Lane" > '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: What is the average of all Heats of competitors with a Time of 59.11 and a lane higher than 3? ### Input: CREATE TABLE table...
What is the highest rank of the medal total less than 15, more than 2 bronzes, 0 gold and 1 silver?
CREATE TABLE table_75730 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MAX("Rank") FROM table_75730 WHERE "Total" < '15' AND "Bronze" > '2' AND "Gold" = '0' AND "Silver" = '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: What is the highest rank of the medal total less than 15, more than 2 bronzes, 0 gold and 1 silver? ### Input: CREATE TABLE ...
Stack bar chart of school_id vs All_Home based on acc road, and display in descending by the X.
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_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road 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: Stack bar chart of school_id vs All_Home based on acc road, and display in descending by the X. ### Input: CREATE TABLE univ...
Who won the Modena circuit?
CREATE TABLE table_16771 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
SELECT "Winning driver" FROM table_16771 WHERE "Circuit" = 'Modena'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who won the Modena circuit? ### Input: CREATE TABLE table_16771 ( "Race Name" text, "Circuit" text, "Date" text,...
what was the maximum value for arterial bp mean for patient 9294 on this month/09?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT MAX(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 = 9294)) 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 was the maximum value for arterial bp mean for patient 9294 on this month/09? ### Input: CREATE TABLE diagnoses_icd ( ...
i would like to travel from WASHINGTON to PITTSBURGH on 8 20
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 flight_fare ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 20 AND date_day.month_number = 8 AN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i would like to travel from WASHINGTON to PITTSBURGH on 8 20 ### Input: CREATE TABLE flight_stop ( flight_id int, st...
what is the apparent magnitude of NGC number 6027d?
CREATE TABLE table_54276 ( "NGC number" text, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real )
SELECT "Apparent magnitude" FROM table_54276 WHERE "NGC number" = '6027d'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the apparent magnitude of NGC number 6027d? ### Input: CREATE TABLE table_54276 ( "NGC number" text, "Object...
Which country has a score of 70-71-72=213?
CREATE TABLE table_51118 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Country" FROM table_51118 WHERE "Score" = '70-71-72=213'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which country has a score of 70-71-72=213? ### Input: CREATE TABLE table_51118 ( "Place" text, "Player" text, "C...
What is the away team at lake oval?
CREATE TABLE table_12020 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_12020 WHERE "Venue" = 'lake 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 is the away team at lake oval? ### Input: CREATE TABLE table_12020 ( "Home team" text, "Home team score" text, ...
give me the number of patients whose discharge location is home health care and lab test name is phosphate?
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 ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND lab.label = "Phosphate"
Below are sql tables 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 discharge location is home health care and lab test name is phosphate? ### Input: CREAT...
Please show different software platforms and the corresponding number of devices using each.
CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT software_platform, COUNT(*) FROM device GROUP BY software_platform
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please show different software platforms and the corresponding number of devices using each. ### Input: CREATE TABLE device ...
Tell me the total for silver more than 0 for italy with gold less than 29
CREATE TABLE table_53725 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Total") FROM table_53725 WHERE "Silver" > '0' AND "Nation" = 'italy' AND "Gold" < '29'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the total for silver more than 0 for italy with gold less than 29 ### Input: CREATE TABLE table_53725 ( "Rank" r...
Which Losses has a Wins of 6, and an Against smaller than 1741?
CREATE TABLE table_name_56 ( losses INTEGER, wins VARCHAR, against VARCHAR )
SELECT MIN(losses) FROM table_name_56 WHERE wins = 6 AND against < 1741
Below are sql tables 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 Losses has a Wins of 6, and an Against smaller than 1741? ### Input: CREATE TABLE table_name_56 ( losses INTEGER, ...
What was the college for the player with the cfl team of Edmonton Eskimos (via calgary)?
CREATE TABLE table_10812938_3 ( college VARCHAR, cfl_team VARCHAR )
SELECT college FROM table_10812938_3 WHERE cfl_team = "Edmonton Eskimos (via Calgary)"
Below are sql tables schemas 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 college for the player with the cfl team of Edmonton Eskimos (via calgary)? ### Input: CREATE TABLE table_10812...
find the number of hispanic/latino-puerto rican ethnic background patients who were born before 2071.
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2071"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of hispanic/latino-puerto rican ethnic background patients who were born before 2071. ### Input: CREATE TABL...
give me the number of patients whose religion is protestant quaker and item id is 51447?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND lab.itemid = "51447"
Below are sql tables 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 religion is protestant quaker and item id is 51447? ### Input: CREATE TABLE diagnoses (...
A bar graph listing the services and how many services provided by all stations, list in desc by the x axis.
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, win...
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services 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 graph listing the services and how many services provided by all stations, list in desc by the x axis. ### Input: CREA...
What venue features hawthorn as the away team?
CREATE TABLE table_name_64 ( venue VARCHAR, away_team VARCHAR )
SELECT venue FROM table_name_64 WHERE away_team = "hawthorn"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What venue features hawthorn as the away team? ### Input: CREATE TABLE table_name_64 ( venue VARCHAR, away_team VARC...
calculate the total number of patients who had radical neck dissection, unilateral
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the total number of patients who had radical neck dissection, unilateral ### Input: CREATE TABLE lab ( subject...
nonstop flights from NEW YORK to LAS VEGAS on sunday
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...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: nonstop flights from NEW YORK to LAS VEGAS on sunday ### Input: CREATE TABLE airport ( airport_code varchar, airport...
What was the lowest pick number for Marc Pilon?
CREATE TABLE table_43930 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
SELECT MIN("Pick #") FROM table_43930 WHERE "Player" = 'marc pilon'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the lowest pick number for Marc Pilon? ### Input: CREATE TABLE table_43930 ( "Pick #" real, "CFL Team" text...
What is the total number of games played against the Buffalo Sabres?
CREATE TABLE table_37994 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
SELECT COUNT("Game") FROM table_37994 WHERE "Opponent" = 'buffalo sabres'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of games played against the Buffalo Sabres? ### Input: CREATE TABLE table_37994 ( "Game" real, ...
what is the date when the competition is 1996 tiger cup and the result is drew?
CREATE TABLE table_name_60 ( date VARCHAR, competition VARCHAR, result VARCHAR )
SELECT date FROM table_name_60 WHERE competition = "1996 tiger cup" AND result = "drew"
Below are sql tables schemas paired with 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 when the competition is 1996 tiger cup and the result is drew? ### Input: CREATE TABLE table_name_60 ( ...
Can you list the courses that are worth 12 credits ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS'
Below are sql tables 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 list the courses that are worth 12 credits ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, ...
What is the highest total number of medals associated with 1 gold, more than 0 silver, and 2 bronze?
CREATE TABLE table_name_33 ( total INTEGER, silver VARCHAR, bronze VARCHAR, gold VARCHAR )
SELECT MAX(total) FROM table_name_33 WHERE bronze = 2 AND gold = 1 AND silver > 0
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest total number of medals associated with 1 gold, more than 0 silver, and 2 bronze? ### Input: CREATE TABLE...
count the number of patients whose religion is romanian east. orth.
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "ROMANIAN EAST. ORTH"
Below are sql tables 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 religion is romanian east. orth. ### Input: CREATE TABLE diagnoses ( subject_id text,...
What is the date when the opponent in the final is gast n etlis mart n rodr guez?
CREATE TABLE table_name_22 ( date VARCHAR, opponents_in_the_final VARCHAR )
SELECT date FROM table_name_22 WHERE opponents_in_the_final = "gastón etlis martín rodríguez"
Below are sql tables schemas paired with 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 when the opponent in the final is gast n etlis mart n rodr guez? ### Input: CREATE TABLE table_name_22 ( ...
how many patients died in or before year 2174 with the drug code ibup600?
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2174.0" AND prescriptions.formulary_drug_cd = "IBUP600"
Below are sql tables 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 died in or before year 2174 with the drug code ibup600? ### Input: CREATE TABLE procedures ( subject_i...
What is Date, when Away Team is 'Ipswich Town'?
CREATE TABLE table_name_20 ( date VARCHAR, away_team VARCHAR )
SELECT date FROM table_name_20 WHERE away_team = "ipswich town"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Date, when Away Team is 'Ipswich Town'? ### Input: CREATE TABLE table_name_20 ( date VARCHAR, away_team VARC...
when was the last time that heart rate was measured for patient 28443 on 12/25/2105?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
Below are sql tables 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 that heart rate was measured for patient 28443 on 12/25/2105? ### Input: CREATE TABLE inputevents_cv ...
List the number of items by the details of the organization that owns it using a bar chart, order total number in descending order.
CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_i...
SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details ORDER BY COUNT(organization_details) 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: List the number of items by the details of the organization that owns it using a bar chart, order total number in descending...
Name the cyrillic name for 518
CREATE TABLE table_27869 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
SELECT "Cyrillic Name Other Names" FROM table_27869 WHERE "Population (2011)" = '518'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the cyrillic name for 518 ### Input: CREATE TABLE table_27869 ( "Settlement" text, "Cyrillic Name Other Names" ...
Which opponent has a record of 3 1?
CREATE TABLE table_12308 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
SELECT "Opponent" FROM table_12308 WHERE "Record" = '3–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 opponent has a record of 3 1? ### Input: CREATE TABLE table_12308 ( "Res." text, "Record" text, "Opponent"...
What is the lowest tie with less than 100 points and 277 goals?
CREATE TABLE table_56721 ( "Season" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Goals for" real, "Goals against" real, "Standing" text )
SELECT MIN("Tied") FROM table_56721 WHERE "Points" < '100' AND "Goals for" = '277'
Below are sql tables schemas paired with 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 tie with less than 100 points and 277 goals? ### Input: CREATE TABLE table_56721 ( "Season" text, ...
Show how many delegates in each party with a bar chart.
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
Below are sql tables 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 how many delegates in each party with a bar chart. ### Input: CREATE TABLE county ( County_Id int, County_name ...
how many patients whose death status is 0 and year of birth is less than 2167?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2167"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose death status is 0 and year of birth is less than 2167? ### Input: CREATE TABLE procedures ( subj...
Who is the Constructor for driver Piercarlo Ghinzani and a Ford cosworth dfv 3.0 v8 engine?
CREATE TABLE table_name_42 ( constructor VARCHAR, driver VARCHAR, engine VARCHAR )
SELECT constructor FROM table_name_42 WHERE driver = "piercarlo ghinzani" AND engine = "ford cosworth dfv 3.0 v8"
Below are sql tables 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 for driver Piercarlo Ghinzani and a Ford cosworth dfv 3.0 v8 engine? ### Input: CREATE TABLE table_na...
What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE campuses ( id number, ...
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county? ### Input: CREAT...
Which college/junior/club team did the player play on that played for the Buffalo Sabres in NHL?
CREATE TABLE table_19545 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
SELECT "College/junior/club team" FROM table_19545 WHERE "NHL team" = 'Buffalo Sabres'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which college/junior/club team did the player play on that played for the Buffalo Sabres in NHL? ### Input: CREATE TABLE tab...
Which directors had a movie in either 1999 or 2000, and count them by a bar chart, I want to order Y from low to high order.
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREAT...
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY COUNT(Director)
Below are sql tables 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 directors had a movie in either 1999 or 2000, and count them by a bar chart, I want to order Y from low to high order....
what is diagnoses short title and diagnoses long title of diagnoses icd9 code 42823?
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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "42823"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is diagnoses short title and diagnoses long title of diagnoses icd9 code 42823? ### Input: CREATE TABLE lab ( subje...
have there been any microbiological test history for patient 10539 until 2103?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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, ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10539) AND STRFTIME('%y', microbiologyevents.charttime) <= '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: have there been any microbiological test history for patient 10539 until 2103? ### Input: CREATE TABLE d_icd_procedures ( ...
how many students are advised by each rank of faculty? List the rank and the number of students, and rank by the Y in ascending.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Ag...
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many students are advised by each rank of faculty? List the rank and the number of students, and rank by the Y in ascend...
Name the sum of grid with laps more than 97
CREATE TABLE table_38668 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
SELECT SUM("Grid") FROM table_38668 WHERE "Laps" > '97'
Below are sql tables 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 sum of grid with laps more than 97 ### Input: CREATE TABLE table_38668 ( "Driver" text, "Team" text, "L...
show me flights going from BOSTON to DENVER arriving on wednesday morning
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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartmen...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.da...
Below are sql tables 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 flights going from BOSTON to DENVER arriving on wednesday morning ### Input: CREATE TABLE fare_basis ( fare_basi...
How many alive patients were administered oxazolidinone via injection?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Injection oxazolidinone"
Below are sql tables 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 alive patients were administered oxazolidinone via injection? ### Input: CREATE TABLE lab ( subject_id text, ...
what are the five most frequent specimen tests that patients took within 2 months after being diagnosed with asphyxiation/strangulat the last year?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_c...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequent specimen tests that patients took within 2 months after being diagnosed with asphyxiation/st...
yes or no for the melbourne that has no for adelaide, no for gold coast?
CREATE TABLE table_67838 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
SELECT "Melbourne" FROM table_67838 WHERE "Adelaide" = 'yes' AND "Gold Coast" = 'no'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: yes or no for the melbourne that has no for adelaide, no for gold coast? ### Input: CREATE TABLE table_67838 ( "Sydney" ...
Who was the class AAAA when class AAAAA was Weslaco in 1994-95
CREATE TABLE table_19562 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
SELECT "Class AAAA" FROM table_19562 WHERE "Class AAAAA" = 'Weslaco' AND "School Year" = '1994-95'
Below are sql tables 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 class AAAA when class AAAAA was Weslaco in 1994-95 ### Input: CREATE TABLE table_19562 ( "School Year" text,...
What event has a $248,004 prize?
CREATE TABLE table_name_24 ( event VARCHAR, prize VARCHAR )
SELECT event FROM table_name_24 WHERE prize = "$248,004"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What event has a $248,004 prize? ### Input: CREATE TABLE table_name_24 ( event VARCHAR, prize VARCHAR ) ### Response...
calculate the total amount of jackson pratt #1 output for patient 1902 on 12/30/this year.
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number,...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'jack...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the total amount of jackson pratt #1 output for patient 1902 on 12/30/this year. ### Input: CREATE TABLE d_icd_pro...
Top 100 StackOverflow users from Nigeria.
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Id, DisplayName AS "display_name", Reputation, WebsiteUrl AS Website, Location FROM Users WHERE Location LIKE '%Nigeria%' ORDER BY Reputation DESC LIMIT 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: Top 100 StackOverflow users from Nigeria. ### Input: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
Show the proportion of faculty for each rank.
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank
Below are sql tables 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 proportion of faculty for each rank. ### Input: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), ...
For how many upper level classes are there labs ?
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 offering_instructor ( offering_instructor_id int, offering_id int, ins...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For how many upper level classes are there labs ? ### Input: CREATE TABLE student_record ( student_id int, course_id...
what is diagnoses short title and procedure short title of subject name lue white?
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 diagnoses.short_title, procedures.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Lue White"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is diagnoses short title and procedure short title of subject name lue white? ### Input: CREATE TABLE prescriptions ( ...
what number of patients admitted before the 2200 had the diagnoses titled pseudomonas infection in conditions classified elsewhere and of unspecified site?
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2200" AND diagnoses.long_title = "Pseudomonas infection in conditions classified elsewhere and of unspecified site"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients admitted before the 2200 had the diagnoses titled pseudomonas infection in conditions classified els...
how much is the difference in hemoglobin of patient 71192 last measured on the first hospital visit compared to the second to last value measured on the first hospital visit?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much is the difference in hemoglobin of patient 71192 last measured on the first hospital visit compared to the second t...
What is the Attendance on august 15?
CREATE TABLE table_name_99 ( attendance VARCHAR, date VARCHAR )
SELECT attendance FROM table_name_99 WHERE date = "august 15"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Attendance on august 15? ### Input: CREATE TABLE table_name_99 ( attendance VARCHAR, date VARCHAR ) ### ...
had patient 5520 excreted urine out foley since 05/2101?
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5520)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley...
Below are sql tables 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 5520 excreted urine out foley since 05/2101? ### Input: CREATE TABLE prescriptions ( row_id number, subj...
Find the distinct last names of all the students who have president votes and whose advisor is 8741.
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = president_vote INTERSECT SELECT DISTINCT lname FROM student WHERE advisor = "8741"
Below are sql tables 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 distinct last names of all the students who have president votes and whose advisor is 8741. ### Input: CREATE TABLE...
was there an organism found in the first urine, voided specimen microbiology test of patient 025-19271 since 4 years ago?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, voided specimen' AND DATETIME(...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was there an organism found in the first urine, voided specimen microbiology test of patient 025-19271 since 4 years ago? ##...
how many days have it been since the first time during the current hospital encounter that patient 22648 was diagnosed with meth res pneu d/t staph?
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'meth res pneu d/t staph') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days have it been since the first time during the current hospital encounter that patient 22648 was diagnosed with ...
Name the class aa for 1998-99
CREATE TABLE table_19419 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
SELECT "Class AA" FROM table_19419 WHERE "School Year" = '1998-99'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the class aa for 1998-99 ### Input: CREATE TABLE table_19419 ( "School Year" text, "Class A" text, "Class A...
how did patient 8814 enter the hospital until 1 year ago first?
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8814 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime 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: how did patient 8814 enter the hospital until 1 year ago first? ### Input: CREATE TABLE prescriptions ( row_id number, ...
Where the home team score is 15.19 (109), what did the away team Footscray score?
CREATE TABLE table_11033 ( "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_11033 WHERE "Home team score" = '15.19 (109)' AND "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: Where the home team score is 15.19 (109), what did the away team Footscray score? ### Input: CREATE TABLE table_11033 ( ...
list the top five most frequent lab tests?
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 d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 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: list the top five most frequent lab tests? ### Input: CREATE TABLE diagnoses_icd ( row_id number, subject_id number,...
Which venue has 2:04.22 notes?
CREATE TABLE table_name_19 ( venue VARCHAR, notes VARCHAR )
SELECT venue FROM table_name_19 WHERE notes = "2:04.22"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue has 2:04.22 notes? ### Input: CREATE TABLE table_name_19 ( venue VARCHAR, notes VARCHAR ) ### Response: ...
count the number of hospital visits that patient 48709 had since 2105.
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_procedures ( row_id number, icd9_code text, s...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 48709 AND STRFTIME('%y', admissions.admittime) >= '2105'
Below are sql tables 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 hospital visits that patient 48709 had since 2105. ### Input: CREATE TABLE icustays ( row_id number,...
what were the top three most frequent diagnoses that patients received within the same month after receiving oth cardiac mon output until 2101?
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...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top three most frequent diagnoses that patients received within the same month after receiving oth cardiac mon...
What is the average latitude and longitude in San Jose?
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
SELECT AVG(lat), AVG(long) FROM station WHERE city = "San Jose"
Below are sql tables schemas paired with 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 latitude and longitude in San Jose? ### Input: CREATE TABLE weather ( date text, max_temperature...
Which competition has a Goal of deacon 8/8 and a Score of 32-14?
CREATE TABLE table_58218 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Goals" text )
SELECT "Competition" FROM table_58218 WHERE "Goals" = 'deacon 8/8' AND "Score" = '32-14'
Below are sql tables 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 competition has a Goal of deacon 8/8 and a Score of 32-14? ### Input: CREATE TABLE table_58218 ( "Date" text, ...
how many patients who had cd34 lab test stayed in hospital for more than 30 days?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "30" AND lab.label = "CD34"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients who had cd34 lab test stayed in hospital for more than 30 days? ### Input: CREATE TABLE procedures ( s...
how many of the patients aged below 56 had other specified conditions originating in the perinatal period?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "56" AND diagnoses.long_title = "Other specified conditions originating in the perinatal period"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the patients aged below 56 had other specified conditions originating in the perinatal period? ### Input: CREATE...
What is the number of climbers for each mountain? Show me a bar chart.
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.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: What is the number of climbers for each mountain? Show me a bar chart. ### Input: CREATE TABLE mountain ( Mountain_ID in...
AngularJS popular questions with few answers.
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, LastEditorDispl...
SELECT p.Id AS "post_link", p.Score, p.AnswerCount, p.ViewCount FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON pt.TagId = t.Id WHERE p.Score > 0 AND p.AnswerCount <= 2 AND p.ViewCount > 20000 AND p.ClosedDate IS NULL ORDER BY p.Score DESC, p.AnswerCount
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: AngularJS popular questions with few answers. ### Input: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId numbe...
when was the first time patient 013-38992 was having less than 93.0 sao2 on the current icu visit?
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 intakeoutput ( i...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992') AND patient.unitdischargetime IS NULL) ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time patient 013-38992 was having less than 93.0 sao2 on the current icu visit? ### Input: CREATE TABLE m...
Give me the comparison about the sum 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, SUM(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 sum of Weight over the Sex , and group by attribute Sex by a bar chart. ### Input: CREATE T...
Who is the away side, when the home side scores 13.22 (100)?
CREATE TABLE table_33223 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_33223 WHERE "Home team score" = '13.22 (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: Who is the away side, when the home side scores 13.22 (100)? ### Input: CREATE TABLE table_33223 ( "Home team" text, ...
What was the event for round 1 against Lance Wipf?
CREATE TABLE table_name_9 ( event VARCHAR, round VARCHAR, opponent VARCHAR )
SELECT event FROM table_name_9 WHERE round = "1" AND opponent = "lance wipf"
Below are sql tables schemas 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 event for round 1 against Lance Wipf? ### Input: CREATE TABLE table_name_9 ( event VARCHAR, round VARCH...
Please show me how many employees working on different countries using a bar chart, could you list in asc by the the number of country name?
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 varc...
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_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: Please show me how many employees working on different countries using a bar chart, could you list in asc by the the number ...
Which type of policy is most frequently used? Give me the policy type code.
CREATE TABLE policies ( policy_type_code VARCHAR )
SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) 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: Which type of policy is most frequently used? Give me the policy type code. ### Input: CREATE TABLE policies ( policy_ty...
how many persons got the third position whan sanyo electric tokushima got the fourth position?
CREATE TABLE table_24514 ( "Regional" text, "Champions" text, "Runners-up" text, "Third place" text, "Fourth place" text )
SELECT COUNT("Third place") FROM table_24514 WHERE "Fourth place" = 'Sanyo Electric Tokushima'
Below are sql tables 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 persons got the third position whan sanyo electric tokushima got the fourth position? ### Input: CREATE TABLE table...
Who placed t5 and had a score of 70-72=142?
CREATE TABLE table_78952 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Player" FROM table_78952 WHERE "Place" = 't5' AND "Score" = '70-72=142'
Below are sql tables 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 placed t5 and had a score of 70-72=142? ### Input: CREATE TABLE table_78952 ( "Place" text, "Player" text, "...
Plot the total number by grouped by booking status code as a bar graph, sort in ascending by the Y.
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) 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_dat...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot the total number by grouped by booking status code as a bar graph, sort in ascending by the Y. ### Input: CREATE TABLE ...
SELECT * FROM users where REPUTATION > 2000.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT * FROM Users WHERE Reputation > 2000
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: SELECT * FROM users where REPUTATION > 2000. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Des...
What are the ranks of captains that are both in the Cutter and Armed schooner classes?
CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text )
SELECT rank FROM captain WHERE class = 'Cutter' INTERSECT SELECT rank FROM captain WHERE class = 'Armed schooner'
Below are sql tables schemas 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 ranks of captains that are both in the Cutter and Armed schooner classes? ### Input: CREATE TABLE captain ( ...
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and display by the bar in ascending.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.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 records from the products and each product's manufacturer, visualize a bar chart about the distribution of name an...
Where did Footscray play as the home team?
CREATE TABLE table_name_41 ( venue VARCHAR, home_team VARCHAR )
SELECT venue FROM table_name_41 WHERE home_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: Where did Footscray play as the home team? ### Input: CREATE TABLE table_name_41 ( venue VARCHAR, home_team VARCHAR ...