instruction stringlengths 0 1.06k | input stringlengths 33 7.14k | response stringlengths 2 4.44k | source stringclasses 25
values | text stringlengths 302 8.5k |
|---|---|---|---|---|
Do you know who the teacher of STATS 550 is ? | 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 instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'STATS' AND course.number = 550 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.... | advising | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Do you know who the teacher of STATS 550 is ? ### Input: CREATE TABLE jobs (
job_id int,
job_title varchar,
desc... |
How many vuts made for a player with 2 wins and under 7 top 5s? | CREATE TABLE table_74859 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT AVG("Cuts made") FROM table_74859 WHERE "Wins" = '2' AND "Top-5" < '7' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many vuts made for a player with 2 wins and under 7 top 5s? ### Input: CREATE TABLE table_74859 (
"Tournament" text,... |
What season were the runs 310/9? | CREATE TABLE table_name_25 (
season VARCHAR,
runs VARCHAR
) | SELECT season FROM table_name_25 WHERE runs = "310/9" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What season were the runs 310/9? ### Input: CREATE TABLE table_name_25 (
season VARCHAR,
runs VARCHAR
) ### Response... |
What was the decision on November 26? | CREATE TABLE table_37641 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | SELECT "Decision" FROM table_37641 WHERE "Date" = 'november 26' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the decision on November 26? ### Input: CREATE TABLE table_37641 (
"Date" text,
"Visitor" text,
"Score"... |
What is the crowd size of the match featuring North Melbourne as the away team? | CREATE TABLE table_name_40 (
crowd INTEGER,
away_team VARCHAR
) | SELECT MIN(crowd) FROM table_name_40 WHERE away_team = "north melbourne" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the crowd size of the match featuring North Melbourne as the away team? ### Input: CREATE TABLE table_name_40 (
... |
i'd like to find a flight from MIAMI FLORIDA to LAS VEGAS NEVADA that would arrive before 1600 on sunday | 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 dual_carrier (
main_airline varchar,
low_flight_... | 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, state AS STATE_0, state AS STATE_1 WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time)... | atis | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i'd like to find a flight from MIAMI FLORIDA to LAS VEGAS NEVADA that would arrive before 1600 on sunday ### Input: CREATE T... |
provide the number of patients whose diagnosis long title is unspecified obesity and the drug route is pr. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | 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 = "Obesity, unspecified" AND prescriptions.route = "PR" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose diagnosis long title is unspecified obesity and the drug route is pr. ### Input: CREATE... |
Which Team has a Recopa Sudamericana 1992 of runner-up? | CREATE TABLE table_name_28 (
team VARCHAR,
recopa_sudamericana_1992 VARCHAR
) | SELECT team FROM table_name_28 WHERE recopa_sudamericana_1992 = "runner-up" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Team has a Recopa Sudamericana 1992 of runner-up? ### Input: CREATE TABLE table_name_28 (
team VARCHAR,
recopa... |
Name the hand for 1 credit 200 | CREATE TABLE table_19613 (
"Hand" text,
"1 credit" real,
"2 credits" real,
"3 credits" real,
"4 credits" real,
"5 credits" real
) | SELECT "Hand" FROM table_19613 WHERE "1 credit" = '200' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the hand for 1 credit 200 ### Input: CREATE TABLE table_19613 (
"Hand" text,
"1 credit" real,
"2 credits" r... |
When was chuck morris, back, drafted? | CREATE TABLE table_name_51 (
pick INTEGER,
position VARCHAR,
player VARCHAR
) | SELECT MIN(pick) FROM table_name_51 WHERE position = "back" AND player = "chuck morris" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was chuck morris, back, drafted? ### Input: CREATE TABLE table_name_51 (
pick INTEGER,
position VARCHAR,
pl... |
What is the record where aaron brooks (6) is high assists? | CREATE TABLE table_23281862_9 (
record VARCHAR,
high_assists VARCHAR
) | SELECT record FROM table_23281862_9 WHERE high_assists = "Aaron Brooks (6)" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the record where aaron brooks (6) is high assists? ### Input: CREATE TABLE table_23281862_9 (
record VARCHAR,
... |
What is the score for the away team at Essendon? | CREATE TABLE table_10104 (
"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_10104 WHERE "Away team" = 'essendon' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for the away team at Essendon? ### Input: CREATE TABLE table_10104 (
"Home team" text,
"Home team ... |
Who is the winner in the week listed as 26 June 2 weeks, when the runner-up is Arantxa S nchez Vicario? | CREATE TABLE table_name_71 (
winner VARCHAR,
week_of VARCHAR,
runner_up VARCHAR
) | SELECT winner FROM table_name_71 WHERE week_of = "26 june 2 weeks" AND runner_up = "arantxa sánchez vicario" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the winner in the week listed as 26 June 2 weeks, when the runner-up is Arantxa S nchez Vicario? ### Input: CREATE TA... |
Which client had no GNU/Linux? | CREATE TABLE table_11857 (
"Client" text,
"Windows" text,
"GNU/Linux" text,
"Mac OS X" text,
"Haiku" text
) | SELECT "Client" FROM table_11857 WHERE "GNU/Linux" = 'no' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which client had no GNU/Linux? ### Input: CREATE TABLE table_11857 (
"Client" text,
"Windows" text,
"GNU/Linux" ... |
What was the passenger fare for Grand Rapids, when the passenger fare for Detroit was $378.55? | CREATE TABLE table_name_89 (
grand_rapids__grr_ VARCHAR,
detroit__dtw_ VARCHAR
) | SELECT grand_rapids__grr_ FROM table_name_89 WHERE detroit__dtw_ = "$378.55" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the passenger fare for Grand Rapids, when the passenger fare for Detroit was $378.55? ### Input: CREATE TABLE table... |
What is the density (hab/km ) with a population censo 2007(hab) of 336.293*? | CREATE TABLE table_name_4 (
density__hab__km²__ VARCHAR,
population_censo_2007_hab_ VARCHAR
) | SELECT density__hab__km²__ FROM table_name_4 WHERE population_censo_2007_hab_ = "336.293*" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the density (hab/km ) with a population censo 2007(hab) of 336.293*? ### Input: CREATE TABLE table_name_4 (
dens... |
which candidate of the citizens committee has the most votes ? | CREATE TABLE table_204_736 (
id number,
"party" text,
"candidate" text,
"votes" number
) | SELECT "candidate" FROM table_204_736 WHERE "party" = "citizens' committee" ORDER BY "votes" DESC LIMIT 1 | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which candidate of the citizens committee has the most votes ? ### Input: CREATE TABLE table_204_736 (
id number,
"p... |
What is the number of platforms for each location? Show the comparison with a bar chart, I want to order by the Y in asc. | CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of platforms for each location? Show the comparison with a bar chart, I want to order by the Y in asc. ##... |
What is the total number of Year that has an Album of Remixes? | CREATE TABLE table_4993 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
) | SELECT SUM("Year") FROM table_4993 WHERE "Album" = 'remixes' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Year that has an Album of Remixes? ### Input: CREATE TABLE table_4993 (
"Version" text,
... |
What is the most number of rounds that the Team from RBR Enterprises and having a Chevrolet Silverado ran? | CREATE TABLE table_70621 (
"Team" text,
"Truck(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text,
"Rounds" real
) | SELECT MAX("Rounds") FROM table_70621 WHERE "Truck(s)" = 'chevrolet silverado' AND "Team" = 'rbr enterprises' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the most number of rounds that the Team from RBR Enterprises and having a Chevrolet Silverado ran? ### Input: CREATE... |
Average answer score by reputation (mid-tier rep). A graph the average score of answers, grouped by the reputation of the users who posted them. ('Zoomed in' to exclude high-rep users.)
Full dataset: https://data.stackexchange.com/stackoverflow/query/544952/
Lower-rep users: https://data.stackexchange.com/stackover... | CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id num... | SELECT AVG(CAST(ROUND(Reputation, -FLOOR(LOG(10, Reputation))) AS INT)) AS UserReputation, AVG(CAST(Posts.Score AS FLOAT)) AS AverageAnswerScore FROM Posts INNER JOIN Users ON (Users.Id = Posts.OwnerUserId) WHERE PostTypeId = 2 AND Reputation < 10000 GROUP BY ROUND(Reputation, -FLOOR(LOG(10, Reputation))) ORDER BY User... | sede | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Average answer score by reputation (mid-tier rep). A graph the average score of answers, grouped by the reputation of the us... |
what average grid has laps larger than 52 and contains the driver of andrea de adamich? | CREATE TABLE table_56593 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT AVG("Grid") FROM table_56593 WHERE "Laps" > '52' AND "Driver" = 'andrea de adamich' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what average grid has laps larger than 52 and contains the driver of andrea de adamich? ### Input: CREATE TABLE table_56593 ... |
What round was the debut of defender Stephen Laybutt? | CREATE TABLE table_name_11 (
debut VARCHAR,
position VARCHAR,
name VARCHAR
) | SELECT debut FROM table_name_11 WHERE position = "defender" AND name = "stephen laybutt" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What round was the debut of defender Stephen Laybutt? ### Input: CREATE TABLE table_name_11 (
debut VARCHAR,
positio... |
what is writtenand directed by shannon flynn? | CREATE TABLE table_26493 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | SELECT "Written by" FROM table_26493 WHERE "Directed by" = 'Shannon Flynn' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is writtenand directed by shannon flynn? ### Input: CREATE TABLE table_26493 (
"No. in series" real,
"No. in se... |
what is the only single from 2009 ? | CREATE TABLE table_203_491 (
id number,
"year" number,
"title" text,
"us hot 100" number,
"us modern rock" number,
"us mainstream rock" number,
"album" text
) | SELECT "title" FROM table_203_491 WHERE "year" = 2009 | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the only single from 2009 ? ### Input: CREATE TABLE table_203_491 (
id number,
"year" number,
"title" te... |
What is Arkansas State's total pick number with an overal lower than 242? | CREATE TABLE table_33952 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | SELECT COUNT("Pick #") FROM table_33952 WHERE "College" = 'arkansas state' AND "Overall" < '242' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Arkansas State's total pick number with an overal lower than 242? ### Input: CREATE TABLE table_33952 (
"Round" ... |
count the number of patients whose marital status is married and primary disease is coronary artery disease\coronary artery bypass graft with mvr; ? maze? | 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 WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose marital status is married and primary disease is coronary artery disease\coronary artery ... |
what was the name of the first of the outputs that patient 60219 had since 04/25/2103? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 60219)) AND STRFTIME('%y-%m-%d', outputeve... | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the first of the outputs that patient 60219 had since 04/25/2103? ### Input: CREATE TABLE d_labitems (
... |
What are the slovenian names of the villages that had 65.9% of slovenes in 1951? | CREATE TABLE table_16306 (
"Village (German)" text,
"Village (Slovenian)" text,
"Number of people 1991" real,
"Percent of Slovenes 1991" text,
"Percent of Slovenes 1951" text
) | SELECT "Village (Slovenian)" FROM table_16306 WHERE "Percent of Slovenes 1951" = '65.9%' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the slovenian names of the villages that had 65.9% of slovenes in 1951? ### Input: CREATE TABLE table_16306 (
"... |
What's the latest year with a hometown of san carlos, pangasinan? | CREATE TABLE table_12960 (
"Year" real,
"Delegate" text,
"Hometown" text,
"Placement in Miss World" text,
"Other awards" text
) | SELECT MAX("Year") FROM table_12960 WHERE "Hometown" = 'san carlos, pangasinan' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the latest year with a hometown of san carlos, pangasinan? ### Input: CREATE TABLE table_12960 (
"Year" real,
... |
what was the last respiration value for patient 025-60951 on 10/07/this year? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-60951')) AND NOT vitalperiodic.respiration IS NULL ... | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last respiration value for patient 025-60951 on 10/07/this year? ### Input: CREATE TABLE treatment (
treatm... |
Which College has a Name of hardy brown? | CREATE TABLE table_name_93 (
college VARCHAR,
name VARCHAR
) | SELECT college FROM table_name_93 WHERE name = "hardy brown" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which College has a Name of hardy brown? ### Input: CREATE TABLE table_name_93 (
college VARCHAR,
name VARCHAR
) ###... |
What is the 1USD= that has the Uruguayan Peso (uyu) and 1 Euro is greater than 25.3797? | CREATE TABLE table_71333 (
"Country" text,
"Currency" text,
"1 Euro =" real,
"1 USD =" real,
"Central bank" text
) | SELECT SUM("1 USD =") FROM table_71333 WHERE "Currency" = 'uruguayan peso (uyu)' AND "1 Euro =" > '25.3797' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 1USD= that has the Uruguayan Peso (uyu) and 1 Euro is greater than 25.3797? ### Input: CREATE TABLE table_71333 ... |
how many days since first time patient 55360 was diagnosed with hepatic encephalopathy during this hospital encounter? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
... | 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 = 'hepatic encephalopathy') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admis... | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days since first time patient 55360 was diagnosed with hepatic encephalopathy during this hospital encounter? ### I... |
What is Score, when Country is 'United States', and when Player is 'Raymond Floyd'? | CREATE TABLE table_name_98 (
score VARCHAR,
country VARCHAR,
player VARCHAR
) | SELECT score FROM table_name_98 WHERE country = "united states" AND player = "raymond floyd" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Score, when Country is 'United States', and when Player is 'Raymond Floyd'? ### Input: CREATE TABLE table_name_98 (
... |
What is the lowest Goals For, when Draws is less than 4, and when Points is less than 27? | CREATE TABLE table_12551 (
"Position" real,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | SELECT MIN("Goals for") FROM table_12551 WHERE "Draws" < '4' AND "Points" < '27' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest Goals For, when Draws is less than 4, and when Points is less than 27? ### Input: CREATE TABLE table_1255... |
Bar graph to show the number of took office from different took office, I want to sort in desc by the Y please. | CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
P... | SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office) DESC | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show the number of took office from different took office, I want to sort in desc by the Y please. ### Input: C... |
Who built the train in 1966 with over 40 produced? | CREATE TABLE table_55505 (
"PRR Class" text,
"Builder\u2019s Model" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Service" text,
"Power output" text
) | SELECT "Builder\u2019s Model" FROM table_55505 WHERE "Total produced" > '40' AND "Build date" = '1966' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who built the train in 1966 with over 40 produced? ### Input: CREATE TABLE table_55505 (
"PRR Class" text,
"Builder\... |
Find the first name of students in the descending order of age. | CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE department (
dno number,
division text,
dname text,
room text,
building text,
dphone number
)
CREATE TABLE faculty (
... | SELECT fname FROM student ORDER BY age DESC | spider | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the first name of students in the descending order of age. ### Input: CREATE TABLE student (
stuid number,
lnam... |
How many patients diagnosed with poisoning by other opiates and related narcotics had a psychiatric facility-partial hospitalization discharge? | 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.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.long_title = "Poisoning by other opiates and related narcotics" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients diagnosed with poisoning by other opiates and related narcotics had a psychiatric facility-partial hospita... |
what percentile is 66.0 calculated total co2 in a patient of the same age as patient 26469 on their first hospital visit? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE adm... | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what percentile is 66.0 calculated total co2 in a patient of the same age as patient 26469 on their first hospital visit? ##... |
how many patients until 2104 were prescribed with nacl 0.9% mbp within 2 months after the mechanical ventilation procedure? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE i... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.un... | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients until 2104 were prescribed with nacl 0.9% mbp within 2 months after the mechanical ventilation procedure? ... |
Round of 1, and a Record of 10 2 had what method? | CREATE TABLE table_name_88 (
method VARCHAR,
round VARCHAR,
record VARCHAR
) | SELECT method FROM table_name_88 WHERE round = "1" AND record = "10–2" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Round of 1, and a Record of 10 2 had what method? ### Input: CREATE TABLE table_name_88 (
method VARCHAR,
round VARC... |
What was the score June 22? | CREATE TABLE table_53568 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | SELECT "Loss" FROM table_53568 WHERE "Date" = 'june 22' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score June 22? ### Input: CREATE TABLE table_53568 (
"Date" text,
"Opponent" text,
"Score" text,
... |
how long was w.b. kingsmill club president ? | CREATE TABLE table_203_639 (
id number,
"year" text,
"number" text,
"name" text
) | SELECT "year" - "year" FROM table_203_639 WHERE "name" = 'w.b. kingsmill' | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how long was w.b. kingsmill club president ? ### Input: CREATE TABLE table_203_639 (
id number,
"year" text,
"nu... |
How many successors were seated in the New York 20th district? | CREATE TABLE table_1199219_2 (
successor VARCHAR,
district VARCHAR
) | SELECT COUNT(successor) FROM table_1199219_2 WHERE district = "New York 20th" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many successors were seated in the New York 20th district? ### Input: CREATE TABLE table_1199219_2 (
successor VARCH... |
What shows for 1997 when 1987 is 2r? | CREATE TABLE table_7336 (
"Tournament" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"Career SR" text,
"Career Win-Loss" text
) | SELECT "1997" FROM table_7336 WHERE "1987" = '2r' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shows for 1997 when 1987 is 2r? ### Input: CREATE TABLE table_7336 (
"Tournament" text,
"1986" text,
"1987"... |
Draw a bar chart about the distribution of Nationality and the average of meter_100 , and group by attribute Nationality. | CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of Nationality and the average of meter_100 , and group by attribute Nationality. ##... |
How tall is the player from Chicago, IL? | CREATE TABLE table_name_48 (
height VARCHAR,
hometown VARCHAR
) | SELECT height FROM table_name_48 WHERE hometown = "chicago, il" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How tall is the player from Chicago, IL? ### Input: CREATE TABLE table_name_48 (
height VARCHAR,
hometown VARCHAR
) ... |
how many are current patients of the age 20s? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 ti... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 20 AND 29 | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many are current patients of the age 20s? ### Input: CREATE TABLE d_labitems (
row_id number,
itemid number,
... |
Who is the home side when the away side score is 11.14 (80)? | CREATE TABLE table_32428 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team" FROM table_32428 WHERE "Away team score" = '11.14 (80)' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the home side when the away side score is 11.14 (80)? ### Input: CREATE TABLE table_32428 (
"Home team" text,
... |
What's the built date when the CR number is more than 940 and the LMS number is 14760? | CREATE TABLE table_65162 (
"HR no." text,
"HR name" text,
"CR no." real,
"LMS no." real,
"Built" text,
"Works" text,
"Withdrawn" text
) | SELECT "Built" FROM table_65162 WHERE "CR no." > '940' AND "LMS no." = '14760' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the built date when the CR number is more than 940 and the LMS number is 14760? ### Input: CREATE TABLE table_65162 (... |
For those employees who was hired before 2002-06-21, find hire_date and the sum of department_id bin hire_date by weekday, and visualize them by a bar chart, and list sum department id in ascending order. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, find hire_date and the sum of department_id bin hire_date by weekday, a... |
Which European Cup is in the 1990-91 season? | CREATE TABLE table_name_78 (
european_cup VARCHAR,
season VARCHAR
) | SELECT european_cup FROM table_name_78 WHERE season = "1990-91" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which European Cup is in the 1990-91 season? ### Input: CREATE TABLE table_name_78 (
european_cup VARCHAR,
season VA... |
What is the Attendance for Opponent Boston Patriots and Week is greater than 14? | CREATE TABLE table_name_1 (
attendance VARCHAR,
opponent VARCHAR,
week VARCHAR
) | SELECT COUNT(attendance) FROM table_name_1 WHERE opponent = "boston patriots" AND week > 14 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Attendance for Opponent Boston Patriots and Week is greater than 14? ### Input: CREATE TABLE table_name_1 (
... |
Which city has the least number of customers whose type code is 'Good Credit Rating'? | CREATE TABLE customers (
town_city VARCHAR,
customer_type_code VARCHAR
) | SELECT town_city FROM customers WHERE customer_type_code = "Good Credit Rating" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which city has the least number of customers whose type code is 'Good Credit Rating'? ### Input: CREATE TABLE customers (
... |
What is the current income inequality for the country of Seychelles? | CREATE TABLE table_name_15 (
income_inequality_1994_2011__latest_available_ VARCHAR,
country VARCHAR
) | SELECT income_inequality_1994_2011__latest_available_ FROM table_name_15 WHERE country = "seychelles" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the current income inequality for the country of Seychelles? ### Input: CREATE TABLE table_name_15 (
income_ineq... |
Name the total number of opponent of record 9-2 | CREATE TABLE table_72852 (
"Game" real,
"Date" text,
"Opponent" text,
"Score/Time" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Arena/Attendance" text,
"Record" text
) | SELECT COUNT("Opponent") FROM table_72852 WHERE "Record" = '9-2' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of opponent of record 9-2 ### Input: CREATE TABLE table_72852 (
"Game" real,
"Date" text,
... |
how many patients admitted before 2111 were ordered to get ascitic fluid lab test? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Ascites" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients admitted before 2111 were ordered to get ascitic fluid lab test? ### Input: CREATE TABLE prescriptions (
... |
Can you tell me what is FCC info for harmony township, new jersey? | CREATE TABLE table_67339 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | SELECT "FCC info" FROM table_67339 WHERE "City of license" = 'harmony township, new jersey' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me what is FCC info for harmony township, new jersey? ### Input: CREATE TABLE table_67339 (
"Call sign" tex... |
What was the match number for Start Gniezno? | CREATE TABLE table_name_13 (
match VARCHAR,
team VARCHAR
) | SELECT match FROM table_name_13 WHERE team = "start gniezno" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the match number for Start Gniezno? ### Input: CREATE TABLE table_name_13 (
match VARCHAR,
team VARCHAR
) #... |
Return a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by weekday. | CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id... | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute othe... |
Name of clem hill, and Inns larger than 126 has the lowest runs? | CREATE TABLE table_name_83 (
runs INTEGER,
name VARCHAR,
inns VARCHAR
) | SELECT MIN(runs) FROM table_name_83 WHERE name = "clem hill" AND inns > 126 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name of clem hill, and Inns larger than 126 has the lowest runs? ### Input: CREATE TABLE table_name_83 (
runs INTEGER,
... |
What was Riccardo Patrese's time/retired? | CREATE TABLE table_name_44 (
time_retired VARCHAR,
driver VARCHAR
) | SELECT time_retired FROM table_name_44 WHERE driver = "riccardo patrese" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Riccardo Patrese's time/retired? ### Input: CREATE TABLE table_name_44 (
time_retired VARCHAR,
driver VARCH... |
What language is the moviein that is on UMP movies network through Sky service? | CREATE TABLE table_32225 (
"Network" text,
"Origin of Programming" text,
"Language" text,
"Genre" text,
"Service" text
) | SELECT "Language" FROM table_32225 WHERE "Genre" = 'movies' AND "Service" = 'sky' AND "Network" = 'ump movies' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What language is the moviein that is on UMP movies network through Sky service? ### Input: CREATE TABLE table_32225 (
"N... |
What is the lowest top-5 of the tournament with less than 1 top-10 and less than 1 top-25? | CREATE TABLE table_7105 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT MIN("Top-5") FROM table_7105 WHERE "Top-10" < '1' AND "Top-25" < '1' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest top-5 of the tournament with less than 1 top-10 and less than 1 top-25? ### Input: CREATE TABLE table_710... |
Who was the Centerfold model on 5-88? | CREATE TABLE table_41913 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
) | SELECT "Centerfold model" FROM table_41913 WHERE "Date" = '5-88' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the Centerfold model on 5-88? ### Input: CREATE TABLE table_41913 (
"Date" text,
"Cover model" text,
"Ce... |
What was the location and attendance when the record was 19-17? | CREATE TABLE table_name_69 (
location_attendance VARCHAR,
record VARCHAR
) | SELECT location_attendance FROM table_name_69 WHERE record = "19-17" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the location and attendance when the record was 19-17? ### Input: CREATE TABLE table_name_69 (
location_attenda... |
Show the players and years played for players from team 'Columbus Crew'. | CREATE TABLE player (
Player VARCHAR,
Years_Played VARCHAR,
Team VARCHAR
)
CREATE TABLE team (
Team_id VARCHAR,
Name VARCHAR
) | SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the players and years played for players from team 'Columbus Crew'. ### Input: CREATE TABLE player (
Player VARCHAR... |
What 1997 has grand slams for the 1999? | CREATE TABLE table_34160 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text
) | SELECT "1997" FROM table_34160 WHERE "1999" = 'grand slams' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What 1997 has grand slams for the 1999? ### Input: CREATE TABLE table_34160 (
"Tournament" text,
"1990" text,
"1... |
How much Conceded has Wins smaller than 3, and Points larger than 11? | CREATE TABLE table_name_77 (
conceded VARCHAR,
wins VARCHAR,
points VARCHAR
) | SELECT COUNT(conceded) FROM table_name_77 WHERE wins < 3 AND points > 11 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Conceded has Wins smaller than 3, and Points larger than 11? ### Input: CREATE TABLE table_name_77 (
conceded V... |
On what date did congressman joseph tydings enter take his seat? | CREATE TABLE table_26820 (
"Rank" real,
"Senator" text,
"Date of birth" text,
"Entered Senate" text,
"Left Senate" text,
"State served" text,
"Party" text,
"Time since entry" text
) | SELECT "Entered Senate" FROM table_26820 WHERE "Senator" = 'Joseph Tydings' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did congressman joseph tydings enter take his seat? ### Input: CREATE TABLE table_26820 (
"Rank" real,
... |
until 4 years ago what are the three most common medications prescribed during the same hospital visit to the patients aged 50s after being diagnosed with dmii wo cmp nt st uncntr? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 4 years ago what are the three most common medications prescribed during the same hospital visit to the patients aged ... |
calculate the total number of patients with percutaneous aspiration of liver who were discharged for home health care. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.long_title = "Percutaneous aspiration of liver" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the total number of patients with percutaneous aspiration of liver who were discharged for home health care. ### I... |
How many answers by reputable users are accepted, and their accepted percentage?. | CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId INNER JOIN Posts AS q ON a.Paren... | sede | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many answers by reputable users are accepted, and their accepted percentage?. ### Input: CREATE TABLE PostTypes (
Id... |
out of total number of patients treated with gentamicin sulfate, how many of them have a confirmed death status? | 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 demographic.expire_flag = "1" AND prescriptions.drug = "Gentamicin Sulfate" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: out of total number of patients treated with gentamicin sulfate, how many of them have a confirmed death status? ### Input: ... |
Name the date for 2011 and position larger than 2.0 | CREATE TABLE table_30073089_2 (
date VARCHAR,
season VARCHAR,
position VARCHAR
) | SELECT date FROM table_30073089_2 WHERE season = 2011 AND position > 2.0 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the date for 2011 and position larger than 2.0 ### Input: CREATE TABLE table_30073089_2 (
date VARCHAR,
season ... |
Name the segment c with episode less than 179 and segment b of s sticker | CREATE TABLE table_37387 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | SELECT "Segment C" FROM table_37387 WHERE "Episode" < '179' AND "Segment B" = 's sticker' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the segment c with episode less than 179 and segment b of s sticker ### Input: CREATE TABLE table_37387 (
"Series E... |
Get the number of male patients who had a heparin lmw lab test done. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Heparin, LMW" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Get the number of male patients who had a heparin lmw lab test done. ### Input: CREATE TABLE procedures (
subject_id tex... |
what is maximum age of patients whose marital status is married and admission year is greater than or equal to 2194? | 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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2194" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose marital status is married and admission year is greater than or equal to 2194? ### Inp... |
When the lead margin was 35, what were the Democrat: Vivian Davis Figures? | CREATE TABLE table_16751596_12 (
democrat VARCHAR,
lead_margin VARCHAR
) | SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE lead_margin = 35 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the lead margin was 35, what were the Democrat: Vivian Davis Figures? ### Input: CREATE TABLE table_16751596_12 (
d... |
how many times did they participate in the olympic games ? | CREATE TABLE table_203_28 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | SELECT COUNT(*) FROM table_203_28 WHERE "competition" = 'olympic games' | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did they participate in the olympic games ? ### Input: CREATE TABLE table_203_28 (
id number,
"year" ... |
What is the type of station for ESPN International Sports? | CREATE TABLE table_name_74 (
type VARCHAR,
name VARCHAR
) | SELECT type FROM table_name_74 WHERE name = "espn international sports" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the type of station for ESPN International Sports? ### Input: CREATE TABLE table_name_74 (
type VARCHAR,
nam... |
what is the number of patients whose admission type is elective and insurance is private? | 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_type = "ELECTIVE" AND demographic.insurance = "Private" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is elective and insurance is private? ### Input: CREATE TABLE diagnoses ... |
What is the Place of the Song by Artist Rosie Hunter with a Draw of 1 or larger? | CREATE TABLE table_13888 (
"Draw" real,
"Song" text,
"Artist" text,
"Points" real,
"Place" real
) | SELECT COUNT("Place") FROM table_13888 WHERE "Artist" = 'rosie hunter' AND "Draw" > '1' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Place of the Song by Artist Rosie Hunter with a Draw of 1 or larger? ### Input: CREATE TABLE table_13888 (
"... |
What is the average number of draws for teams with more than 10 matches? | CREATE TABLE table_name_47 (
draw INTEGER,
match INTEGER
) | SELECT AVG(draw) FROM table_name_47 WHERE match > 10 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of draws for teams with more than 10 matches? ### Input: CREATE TABLE table_name_47 (
draw IN... |
what's the winner with tournament value of kroger senior classic | CREATE TABLE table_11621915_1 (
winner VARCHAR,
tournament VARCHAR
) | SELECT winner FROM table_11621915_1 WHERE tournament = "Kroger Senior Classic" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the winner with tournament value of kroger senior classic ### Input: CREATE TABLE table_11621915_1 (
winner VARCH... |
Draw a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, order from low to high by the x-axis please. | 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 All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, order fr... |
What was the result on week 1? | CREATE TABLE table_name_27 (
result VARCHAR,
week VARCHAR
) | SELECT result FROM table_name_27 WHERE week = 1 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result on week 1? ### Input: CREATE TABLE table_name_27 (
result VARCHAR,
week VARCHAR
) ### Response: ... |
Where did Trinidad and Tobago play? | CREATE TABLE table_12325 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Place" FROM table_12325 WHERE "Country" = 'trinidad and tobago' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did Trinidad and Tobago play? ### Input: CREATE TABLE table_12325 (
"Place" text,
"Player" text,
"Country"... |
what is the time/retired when the laps is less than 4? | CREATE TABLE table_55467 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT "Time/Retired" FROM table_55467 WHERE "Laps" < '4' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the time/retired when the laps is less than 4? ### Input: CREATE TABLE table_55467 (
"Driver" text,
"Constru... |
Tell me the laps for 3 grids | CREATE TABLE table_name_67 (
laps VARCHAR,
grid VARCHAR
) | SELECT laps FROM table_name_67 WHERE grid = 3 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the laps for 3 grids ### Input: CREATE TABLE table_name_67 (
laps VARCHAR,
grid VARCHAR
) ### Response: SELE... |
Name the colorado when alaska is connecticut | CREATE TABLE table_17425749_1 (
colorado VARCHAR,
alaska VARCHAR
) | SELECT colorado FROM table_17425749_1 WHERE alaska = "Connecticut" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the colorado when alaska is connecticut ### Input: CREATE TABLE table_17425749_1 (
colorado VARCHAR,
alaska VAR... |
What is the result of the ajc craven plate (wfa) race? | CREATE TABLE table_49377 (
"Result" text,
"Race" text,
"Distance" text,
"Weight" real,
"Winner or 2nd" text,
"Pos'n" text
) | SELECT "Result" FROM table_49377 WHERE "Race" = 'ajc craven plate (wfa)' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result of the ajc craven plate (wfa) race? ### Input: CREATE TABLE table_49377 (
"Result" text,
"Race" t... |
What was the result of the match in Penrith that featured a score of 48-12? | CREATE TABLE table_name_81 (
result VARCHAR,
score VARCHAR,
city VARCHAR
) | SELECT result FROM table_name_81 WHERE score = "48-12" AND city = "penrith" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the match in Penrith that featured a score of 48-12? ### Input: CREATE TABLE table_name_81 (
resu... |
What is the namesake of the ship that was commissioned or completed(*) 16 april 1864? | CREATE TABLE table_12592074_1 (
namesake VARCHAR,
commissioned_or_completed_ VARCHAR,
_ VARCHAR
) | SELECT namesake FROM table_12592074_1 WHERE commissioned_or_completed_ * _ = "16 April 1864" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the namesake of the ship that was commissioned or completed(*) 16 april 1864? ### Input: CREATE TABLE table_12592074... |
show me the top four procedures that were the most common until 2 years ago? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY procedur... | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the top four procedures that were the most common until 2 years ago? ### Input: CREATE TABLE labevents (
row_id ... |
What is the lowest earnings of Lee Trevino who has 28 wins? | CREATE TABLE table_name_49 (
earnings___ INTEGER,
wins VARCHAR,
player VARCHAR
) | SELECT MIN(earnings___) AS $__ FROM table_name_49 WHERE wins = 28 AND player = "lee trevino" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest earnings of Lee Trevino who has 28 wins? ### Input: CREATE TABLE table_name_49 (
earnings___ INTEGER,... |
on their last hospital encounter what is patient 96728's age? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 96728 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on their last hospital encounter what is patient 96728's age? ### Input: CREATE TABLE diagnoses_icd (
row_id number,
... |
who is the owner of fm 94.5? | CREATE TABLE table_name_69 (
owner VARCHAR,
frequency VARCHAR
) | SELECT owner FROM table_name_69 WHERE frequency = "fm 94.5" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the owner of fm 94.5? ### Input: CREATE TABLE table_name_69 (
owner VARCHAR,
frequency VARCHAR
) ### Response... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.