instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
Show all locations and the total number of platforms for all train stations in each location in a pie chart.
CREATE TABLE train_station ( Train_ID int, Station_ID int ) 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 ...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all locations and the total number of platforms for all train stations in each location in a pie chart. ### Input: CREA...
how much was enoxaparin sodium first prescribed to patient 27362 in 06/2104?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362) AND prescriptions.drug = 'enoxaparin sodium' AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-06' ORDER BY prescriptions.startdate 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: how much was enoxaparin sodium first prescribed to patient 27362 in 06/2104? ### Input: CREATE TABLE inputevents_cv ( ro...
What was the game date when the opponent was Houston?
CREATE TABLE table_name_8 ( date VARCHAR, opponent VARCHAR )
SELECT date FROM table_name_8 WHERE opponent = "houston"
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 game date when the opponent was Houston? ### Input: CREATE TABLE table_name_8 ( date VARCHAR, opponent ...
What Film Festival had participants/recipients of Isao Tomita?
CREATE TABLE table_26282750_1 ( film_festival VARCHAR, participants_recipients VARCHAR )
SELECT film_festival FROM table_26282750_1 WHERE participants_recipients = "Isao Tomita"
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 Film Festival had participants/recipients of Isao Tomita? ### Input: CREATE TABLE table_26282750_1 ( film_festival ...
What was the surface that Laura Golarsa and her opponent played on in the final?
CREATE TABLE table_name_67 ( surface VARCHAR, opponent_in_the_final VARCHAR )
SELECT surface FROM table_name_67 WHERE opponent_in_the_final = "laura golarsa"
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 surface that Laura Golarsa and her opponent played on in the final? ### Input: CREATE TABLE table_name_67 ( ...
had patient 8888 excreted gastric gastric tube in 12/2105?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
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 = 8888)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric gastric...
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: had patient 8888 excreted gastric gastric tube in 12/2105? ### Input: CREATE TABLE microbiologyevents ( row_id number, ...
How many weeks has the opponent been san francisco 49ers?
CREATE TABLE table_name_65 ( week VARCHAR, opponent VARCHAR )
SELECT COUNT(week) FROM table_name_65 WHERE opponent = "san francisco 49ers"
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 weeks has the opponent been san francisco 49ers? ### Input: CREATE TABLE table_name_65 ( week VARCHAR, oppo...
Who 's this Spring 's CZECH 142 teacher ?
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 INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who 's this Spring 's CZECH 142 teacher ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, descript...
Languages having most negative rated questions.
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
SELECT P.Tags, SUM(P.Score) AS "Suma" FROM Posts AS P GROUP BY P.Tags ORDER BY Suma
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: Languages having most negative rated questions. ### Input: CREATE TABLE PostFeedback ( Id number, PostId number, ...
count the number of patients whose ethnicity is american indian/alaska native and primary disease is femoral artery thrombosis.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS"
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 ethnicity is american indian/alaska native and primary disease is femoral artery thrombos...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, order by the y-axis from low to high.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_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 all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id an...
How many patients were admitted with transfer from hosp/extram and diagnosed with the primary disease hyperglcemia hyponatremia?
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA"
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 were admitted with transfer from hosp/extram and diagnosed with the primary disease hyperglcemia hyponatre...
When was roshan mahanama born?
CREATE TABLE table_77940 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text )
SELECT "Date of Birth" FROM table_77940 WHERE "Player" = 'roshan mahanama'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was roshan mahanama born? ### Input: CREATE TABLE table_77940 ( "Player" text, "Date of Birth" text, "Batti...
Avg Q & A' AVERAGE SCORES YEARLY comparison.
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
SELECT YEAR(CreationDate) AS "postyear", CAST(SUM(CASE WHEN PostTypeId = 1 THEN Score ELSE 0 END) AS FLOAT) / SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS "q", CAST(SUM(CASE WHEN PostTypeId = 2 THEN Score ELSE 0 END) AS FLOAT) / SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS "a", CAST(SUM(Score) AS FLOAT) / S...
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: Avg Q & A' AVERAGE SCORES YEARLY comparison. ### Input: CREATE TABLE Badges ( Id number, UserId number, Name tex...
Name the position of glenn goldup
CREATE TABLE table_2088 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
SELECT "Position" FROM table_2088 WHERE "Player" = 'Glenn Goldup'
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 position of glenn goldup ### Input: CREATE TABLE table_2088 ( "Pick #" real, "Player" text, "Position" ...
What is listed for the Hand that has a 1 credit of 1?
CREATE TABLE table_35140 ( "Hand" text, "1 credit" text, "2 credits" text, "3 credits" text, "4 credits" text, "5 credits" text )
SELECT "Hand" FROM table_35140 WHERE "1 credit" = '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 listed for the Hand that has a 1 credit of 1? ### Input: CREATE TABLE table_35140 ( "Hand" text, "1 credit" ...
Find the altitude (or elevation) of the airports in the city of New York with a bar chart, and I want to rank in descending by the bar.
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation bigint, iata character varc...
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY name DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the altitude (or elevation) of the airports in the city of New York with a bar chart, and I want to rank in descending ...
how many patients whose admission location is transfer from hosp/extram and days of hospital stay is greater than 34?
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "34"
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 whose admission location is transfer from hosp/extram and days of hospital stay is greater than 34? ### In...
What is the points for a team with more than 9 wins and more than 40 goals?
CREATE TABLE table_52780 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real )
SELECT SUM("Points (Pts.)") FROM table_52780 WHERE "Won (PG)" > '9' AND "Goals Scored (GF)" > '40'
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 points for a team with more than 9 wins and more than 40 goals? ### Input: CREATE TABLE table_52780 ( "Place...
What date is the visitor Ottawa?
CREATE TABLE table_37378 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
SELECT "Date" FROM table_37378 WHERE "Visitor" = 'ottawa'
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 date is the visitor Ottawa? ### Input: CREATE TABLE table_37378 ( "Date" text, "Visitor" text, "Score" text...
Who had the lowest field goals if they had 12 touchdowns and more than 72 points?
CREATE TABLE table_name_40 ( field_goals INTEGER, touchdowns VARCHAR, points VARCHAR )
SELECT MIN(field_goals) FROM table_name_40 WHERE touchdowns = 12 AND points > 72
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 had the lowest field goals if they had 12 touchdowns and more than 72 points? ### Input: CREATE TABLE table_name_40 ( ...
count the number of patients whose age is less than 81 and drug route is ivpca?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.route = "IVPCA"
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 age is less than 81 and drug route is ivpca? ### Input: CREATE TABLE lab ( subject_id...
what is minimum age of patients whose marital status is divorced and admission type is elective?
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "ELECTIVE"
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 minimum age of patients whose marital status is divorced and admission type is elective? ### Input: CREATE TABLE pro...
how many different meanings does Wednesday have?
CREATE TABLE table_2624098_1 ( english_day_name_meaning VARCHAR, modern_english_day_name VARCHAR )
SELECT COUNT(english_day_name_meaning) FROM table_2624098_1 WHERE modern_english_day_name = "Wednesday"
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 different meanings does Wednesday have? ### Input: CREATE TABLE table_2624098_1 ( english_day_name_meaning VARC...
provide the number of patients whose drug code is rosi8?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ROSI8"
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 drug code is rosi8? ### Input: CREATE TABLE prescriptions ( subject_id text, ha...
For what competition was the game played on 28 March 2009?
CREATE TABLE table_name_28 ( competition VARCHAR, date VARCHAR )
SELECT competition FROM table_name_28 WHERE date = "28 march 2009"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For what competition was the game played on 28 March 2009? ### Input: CREATE TABLE table_name_28 ( competition VARCHAR, ...
What is the Region of Catalog 885 973-4?
CREATE TABLE table_34056 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
SELECT "Region" FROM table_34056 WHERE "Catalog" = '885 973-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 Region of Catalog 885 973-4? ### Input: CREATE TABLE table_34056 ( "Date" text, "Label" text, "Regio...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and rank in asc by the Y.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE)
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, draw a bar chart about the distribution of hire_date and the amount of ...
how many patients were prescribed with 2 ml : ondansetron hcl 4 mg/2ml iv soln in the same hospital encounter until 4 years ago after the procedure of analgesics - oral analgesics?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'analgesics - oral analgesics' AND DATETIME(treatment.treatmenttime) <= DA...
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 were prescribed with 2 ml : ondansetron hcl 4 mg/2ml iv soln in the same hospital encounter until 4 years ...
What date did the team play on week 8?
CREATE TABLE table_26723 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
SELECT "Date" FROM table_26723 WHERE "Week" = '8'
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 date did the team play on week 8? ### Input: CREATE TABLE table_26723 ( "Week" real, "Date" text, "Kickoff"...
What is the total number of ties a team with less than 3 losses have?
CREATE TABLE table_name_98 ( ties VARCHAR, losses INTEGER )
SELECT COUNT(ties) FROM table_name_98 WHERE losses < 3
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of ties a team with less than 3 losses have? ### Input: CREATE TABLE table_name_98 ( ties VARCH...
Report all advisors that advise more than 2 students.
CREATE TABLE STUDENT ( Advisor VARCHAR )
SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 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: Report all advisors that advise more than 2 students. ### Input: CREATE TABLE STUDENT ( Advisor VARCHAR ) ### Response: ...
What episode number has 2j5352 as a production code?
CREATE TABLE table_24625467_1 ( no VARCHAR, production_code VARCHAR )
SELECT no FROM table_24625467_1 WHERE production_code = "2J5352"
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 episode number has 2j5352 as a production code? ### Input: CREATE TABLE table_24625467_1 ( no VARCHAR, producti...
when is the first procedure patient 29971 received until 2103?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29971) AND STRFTIME('%y', procedures_icd.charttime) <= '2103' ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when is the first procedure patient 29971 received until 2103? ### Input: CREATE TABLE outputevents ( row_id number, ...
who is the only player who is not a fly half ?
CREATE TABLE table_203_871 ( id number, "#" number, "player" text, "pos" text, "pts" number, "tries" number, "conv" number, "pens" number, "drop" number, "opposition" text, "venue" text, "date" text )
SELECT "player" FROM table_203_871 WHERE "pos" <> 'fly-half'
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the only player who is not a fly half ? ### Input: CREATE TABLE table_203_871 ( id number, "#" number, "p...
what airline is US
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, a...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'US'
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what airline is US ### Input: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flig...
Who scored 74-70-67=211 and placed t5?
CREATE TABLE table_name_6 ( player VARCHAR, place VARCHAR, score VARCHAR )
SELECT player FROM table_name_6 WHERE place = "t5" AND score = 74 - 70 - 67 = 211
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 scored 74-70-67=211 and placed t5? ### Input: CREATE TABLE table_name_6 ( player VARCHAR, place VARCHAR, sco...
how much is the daily minimum weight of patient 006-71495 until 02/2104?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-71495') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2104-02' GROUP BY STRFTIME('%y-%m-%d', patien...
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 much is the daily minimum weight of patient 006-71495 until 02/2104? ### Input: CREATE TABLE vitalperiodic ( vitalpe...
What is the lowest Postion, when Bike No is greater than 10, when Driver / Passenger is Nicky Pulinx / Ondrej Cermak, and when Points is greater than 244?
CREATE TABLE table_48573 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real )
SELECT MIN("Position") FROM table_48573 WHERE "Bike No" > '10' AND "Driver / Passenger" = 'nicky pulinx / ondrej cermak' AND "Points" > '244'
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 Postion, when Bike No is greater than 10, when Driver / Passenger is Nicky Pulinx / Ondrej Cermak, and wh...
What is the PA when the PF is 73?
CREATE TABLE table_29565601_2 ( pa INTEGER, pf VARCHAR )
SELECT MIN(pa) FROM table_29565601_2 WHERE pf = 73
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 PA when the PF is 73? ### Input: CREATE TABLE table_29565601_2 ( pa INTEGER, pf VARCHAR ) ### Response: ...
how many patients with medicaid insurance underwent the lab test for prostate specific antigen?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicaid" AND lab.label = "Prostate Specific Antigen"
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 with medicaid insurance underwent the lab test for prostate specific antigen? ### Input: CREATE TABLE diag...
when did patient 031-4987 first receive a nasopharynx microbiological test since 91 months ago?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND microlab.culturesite = 'nasopharynx' AND DATETIME...
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 031-4987 first receive a nasopharynx microbiological test since 91 months ago? ### Input: CREATE TABLE vita...
Is the only Gender and Social Science professor Prof. Joyce ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Gender and Social Science%' AND NOT instructor.name LIKE '%Joyce%' AND offering_instructor.instructor_id ...
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: Is the only Gender and Social Science professor Prof. Joyce ? ### Input: CREATE TABLE semester ( semester_id int, se...
What season has a regionalliga s d league, a 1-0 home, and an away of 2-3?
CREATE TABLE table_78844 ( "Season" text, "League" text, "Teams" text, "Home" text, "Away" text )
SELECT "Season" FROM table_78844 WHERE "League" = 'regionalliga süd' AND "Home" = '1-0' AND "Away" = '2-3'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What season has a regionalliga s d league, a 1-0 home, and an away of 2-3? ### Input: CREATE TABLE table_78844 ( "Season...
How many laps did Jo Bonnier driver when the grid number was smaller than 11?
CREATE TABLE table_51480 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT SUM("Laps") FROM table_51480 WHERE "Driver" = 'jo bonnier' AND "Grid" < '11'
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 laps did Jo Bonnier driver when the grid number was smaller than 11? ### Input: CREATE TABLE table_51480 ( "Dri...
Show the id and details for the investors who have the top 3 number of transactions by a bar chart.
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Lots ( lo...
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the id and details for the investors who have the top 3 number of transactions by a bar chart. ### Input: CREATE TABLE ...
Which Segment C has a Segment B of fish food?
CREATE TABLE table_name_54 ( segment_c VARCHAR, segment_b VARCHAR )
SELECT segment_c FROM table_name_54 WHERE segment_b = "fish food"
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 Segment C has a Segment B of fish food? ### Input: CREATE TABLE table_name_54 ( segment_c VARCHAR, segment_b V...
count the number of patients whose insurance is private and procedure short title is hemodialysis?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Hemodialysis"
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 insurance is private and procedure short title is hemodialysis? ### Input: CREATE TABLE d...
What country speaks Vietnamese?
CREATE TABLE table_54970 ( "Country/Region" text, "Languages" text, "Premiere" text, "Seasons" text, "Status" text )
SELECT "Country/Region" FROM table_54970 WHERE "Languages" = 'vietnamese'
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 country speaks Vietnamese? ### Input: CREATE TABLE table_54970 ( "Country/Region" text, "Languages" text, "...
What is the score if the Tie no is 32?
CREATE TABLE table_59162 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Score" FROM table_59162 WHERE "Tie no" = '32'
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 if the Tie no is 32? ### Input: CREATE TABLE table_59162 ( "Tie no" text, "Home team" text, "S...
Name the general classification of stage 15
CREATE TABLE table_17566 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text, "Trofeo Fast Team" text )
SELECT COUNT("General classification") FROM table_17566 WHERE "Stage" = '15'
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 general classification of stage 15 ### Input: CREATE TABLE table_17566 ( "Stage" text, "Winner" text, "...
RCIDIV 302 has been in the course listings for how long ?
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'RCIDIV' AND course.number = 302 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
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: RCIDIV 302 has been in the course listings for how long ? ### Input: CREATE TABLE offering_instructor ( offering_instruc...
Stacked bar chart of how many nationality for with each Type in each nationality
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, 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: Stacked bar chart of how many nationality for with each Type in each nationality ### Input: CREATE TABLE mission ( Missi...
What year were the first/second year reps Katie Pautler and Devery North?
CREATE TABLE table_24985 ( "Year" text, "Chairman" text, "Artistic Director" text, "Performance Liaison" text, "Secretary" text, "Business manager" text, "Production Stagemanager" text, "Dramaturge" text, "Public Relations" text, "First/Second Year Rep." text, "Male Rep." tex...
SELECT "Year" FROM table_24985 WHERE "First/Second Year Rep." = 'Katie Pautler and Devery North'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year were the first/second year reps Katie Pautler and Devery North? ### Input: CREATE TABLE table_24985 ( "Year" t...
What percentage of users were using Firefox during the period in which *0.77% were using Netscape?
CREATE TABLE table_name_8 ( firefox VARCHAR, netscape VARCHAR )
SELECT firefox FROM table_name_8 WHERE netscape = "*0.77%"
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 percentage of users were using Firefox during the period in which *0.77% were using Netscape? ### Input: CREATE TABLE t...
count the number of patients who have had a social work consult procedure within 2 months after having been diagnosed until 1 year ago with depression.
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'depression' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT...
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have had a social work consult procedure within 2 months after having been diagnosed until ...
Which sign had a yellow background and a triangular shape?
CREATE TABLE table_57201 ( "Type of sign" text, "Shape" text, "Border" text, "Background colour" text, "Text/Symbol" text )
SELECT "Border" FROM table_57201 WHERE "Background colour" = 'yellow' AND "Shape" = 'triangular'
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 sign had a yellow background and a triangular shape? ### Input: CREATE TABLE table_57201 ( "Type of sign" text, ...
How many platinum points were awarded for 5th place?
CREATE TABLE table_11254821_2 ( points_awarded__platinum_ INTEGER, finishing_position VARCHAR )
SELECT MAX(points_awarded__platinum_) FROM table_11254821_2 WHERE finishing_position = "5th"
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 platinum points were awarded for 5th place? ### Input: CREATE TABLE table_11254821_2 ( points_awarded__platinum...
how many patients whose gender is m and drug code is clin1000i?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "CLIN1000I"
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 whose gender is m and drug code is clin1000i? ### Input: CREATE TABLE lab ( subject_id text, hadm_...
What is the nominal GDP per capita when the population is 63.056 million?
CREATE TABLE table_20566 ( "Year" real, "GDP Nominal ($ billions)" text, "GDP Adjusted ($ billions)" text, "Population (millions)" text, "GDP per capita Nominal ($)" real, "GDP per capita Adjusted ($)" real )
SELECT MIN("GDP per capita Nominal ($)") FROM table_20566 WHERE "Population (millions)" = '63.056'
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 nominal GDP per capita when the population is 63.056 million? ### Input: CREATE TABLE table_20566 ( "Year" r...
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of code , and group by attribute name, display from low to high by the x-axis.
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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
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 records from the products and each product's manufacturer, a bar chart shows the distribution of name and the aver...
What is the average weight of the player with a height of 180 cm and plays the d position?
CREATE TABLE table_41587 ( "Position" text, "Jersey number" real, "Name v t e" text, "Height (cm)" real, "Weight (kg)" real, "Birthplace" text, "2008-09 team" text, "NHL rights, if any" text )
SELECT AVG("Weight (kg)") FROM table_41587 WHERE "Height (cm)" = '180' AND "Position" = 'd'
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 average weight of the player with a height of 180 cm and plays the d position? ### Input: CREATE TABLE table_415...
what was patient 004-64091's last output since 12/29/2105?
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 intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND intakeoutput.cellpath LIKE '%output%' AND S...
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 patient 004-64091's last output since 12/29/2105? ### Input: CREATE TABLE microlab ( microlabid number, pat...
what is the combined wins of the clubs in the top 3 positions ?
CREATE TABLE table_204_256 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
SELECT SUM("wins") FROM table_204_256 WHERE "position" <= 3
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 combined wins of the clubs in the top 3 positions ? ### Input: CREATE TABLE table_204_256 ( id number, "...
How many years of nasl years did the accolades read 'captained england to victory at the 1966 world cup'?
CREATE TABLE table_2931 ( "Player" text, "Position" text, "NASL years" text, "NASL club(s)" text, "Accolades (Pre-NASL)" text )
SELECT COUNT("NASL years") FROM table_2931 WHERE "Accolades (Pre-NASL)" = 'Captained England to victory at the 1966 World Cup'
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 years of nasl years did the accolades read 'captained england to victory at the 1966 world cup'? ### Input: CREATE ...
Ever Protected Questions, simple search.
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT ph.PostId AS "post_link", ph.CreationDate AS "protected_date", CASE ph.UserId WHEN NULL THEN ph.UserDisplayName ELSE ph.UserId END AS "user_link" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 19 ORDER BY ph.PostId, ph.CreationDate
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: Ever Protected Questions, simple search. ### Input: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number,...
What chassis did Gordon Johncock use with his cosworth engine?
CREATE TABLE table_4606 ( "Team" text, "Chassis" text, "Engine" text, "Tires" text, "Drivers" text )
SELECT "Chassis" FROM table_4606 WHERE "Engine" = 'cosworth' AND "Drivers" = 'gordon johncock'
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 chassis did Gordon Johncock use with his cosworth engine? ### Input: CREATE TABLE table_4606 ( "Team" text, "Ch...
In 2004 Spring , EEB 801 will have how many professors teaching it ?
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, countr...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 801 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offeri...
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: In 2004 Spring , EEB 801 will have how many professors teaching it ? ### Input: CREATE TABLE ta ( campus_job_id int, ...
which patients have metl25 drug code?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METL25"
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: which patients have metl25 drug code? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_co...
tell me the maximum sao2 in patient 4368 on 05/24/this year?
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 prescriptions ( row_id number, subject_id number, h...
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 = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'...
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: tell me the maximum sao2 in patient 4368 on 05/24/this year? ### Input: CREATE TABLE icustays ( row_id number, subje...
Show the number of documents created in each day and bin document date by year interval with a line chart, display in desc by the Document_Date please.
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of documents created in each day and bin document date by year interval with a line chart, display in desc b...
Let me know the number of patients with diagnoses icd9 code 49320 who had a urine 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "49320" AND lab.fluid = "Urine"
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: Let me know the number of patients with diagnoses icd9 code 49320 who had a urine test. ### Input: CREATE TABLE prescription...
How many Gold medals did Great Britain with a Total of more than 2 medals receive?
CREATE TABLE table_43387 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Gold") FROM table_43387 WHERE "Nation" = 'great britain' AND "Total" > '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: How many Gold medals did Great Britain with a Total of more than 2 medals receive? ### Input: CREATE TABLE table_43387 ( ...
Name the pinyin for 657 date
CREATE TABLE table_20574 ( "Date (CE)" text, "Text" text, "Simplified characters" text, "Traditional characters" text, "Pinyin" text, "Wade-Giles" text, "Literal meaning" text )
SELECT "Pinyin" FROM table_20574 WHERE "Date (CE)" = '657'
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 pinyin for 657 date ### Input: CREATE TABLE table_20574 ( "Date (CE)" text, "Text" text, "Simplified ch...
How many wins has a podiums greater than 1 and 9 as the races with a season after 1984?
CREATE TABLE table_70169 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Podiums" real )
SELECT COUNT("Wins") FROM table_70169 WHERE "Podiums" > '1' AND "Races" = '9' AND "Season" > '1984'
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 wins has a podiums greater than 1 and 9 as the races with a season after 1984? ### Input: CREATE TABLE table_70169 ...
Show the amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descending by the Date_Payment_Made please.
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descendi...
What was the finish for the golfer with a total of 285?
CREATE TABLE table_50675 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
SELECT "Finish" FROM table_50675 WHERE "Total" = '285'
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 finish for the golfer with a total of 285? ### Input: CREATE TABLE table_50675 ( "Player" text, "Countr...
For the Tie number of 14 who was the away team?
CREATE TABLE table_name_46 ( away_team VARCHAR, tie_no VARCHAR )
SELECT away_team FROM table_name_46 WHERE tie_no = "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: For the Tie number of 14 who was the away team? ### Input: CREATE TABLE table_name_46 ( away_team VARCHAR, tie_no VA...
What 2009 has statistics by surface in 2012?
CREATE TABLE table_9537 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2009" FROM table_9537 WHERE "2012" = 'statistics by surface'
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 2009 has statistics by surface in 2012? ### Input: CREATE TABLE table_9537 ( "Tournament" text, "2006" text, ...
For those employees who did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, give me the comparison about the average of department_id over the...
What is the sexual abuse rate where the conflict is the Burundi Civil War?
CREATE TABLE table_72689 ( "Conflict" text, "United Nations Mission" text, "Sexual abuse 1" real, "Murder 2" real, "Extortion/Theft 3" text )
SELECT MAX("Sexual abuse 1") FROM table_72689 WHERE "Conflict" = 'Burundi Civil War'
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 sexual abuse rate where the conflict is the Burundi Civil War? ### Input: CREATE TABLE table_72689 ( "Confli...
What is the highest number of viewers for a rating greater than 9.4?
CREATE TABLE table_51415 ( "Air Date" text, "Timeslot (EST)" text, "Season" text, "Rating" real, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" real, "Weekly Rank (#)" text )
SELECT MAX("Viewers (m)") FROM table_51415 WHERE "Rating" > '9.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 highest number of viewers for a rating greater than 9.4? ### Input: CREATE TABLE table_51415 ( "Air Date" te...
What was the score when the home team was Stockport County?
CREATE TABLE table_47602 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Score" FROM table_47602 WHERE "Home team" = 'stockport county'
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 when the home team was Stockport County? ### Input: CREATE TABLE table_47602 ( "Tie no" text, "Ho...
What is the average round of the match in the Hero's 9 event with a time of 5:00?
CREATE TABLE table_15518 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
SELECT AVG("Round") FROM table_15518 WHERE "Time" = '5:00' AND "Event" = 'hero''s 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 is the average round of the match in the Hero's 9 event with a time of 5:00? ### Input: CREATE TABLE table_15518 ( ...
Who won that game on 24 July 2010?
CREATE TABLE table_51453 ( "Opponent" text, "Result" text, "Score" text, "Date" text, "Venue" text )
SELECT "Result" FROM table_51453 WHERE "Date" = '24 july 2010'
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 won that game on 24 July 2010? ### Input: CREATE TABLE table_51453 ( "Opponent" text, "Result" text, "Score"...
What is the total number of ends when the transfer fee was dkk 14m?
CREATE TABLE table_name_80 ( ends VARCHAR, transfer_fee VARCHAR )
SELECT COUNT(ends) FROM table_name_80 WHERE transfer_fee = "dkk 14m"
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 total number of ends when the transfer fee was dkk 14m? ### Input: CREATE TABLE table_name_80 ( ends VARCHAR...
Which Event has the Opponent, Jason Yee?
CREATE TABLE table_10881 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
SELECT "Event" FROM table_10881 WHERE "Opponent" = 'jason yee'
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 Event has the Opponent, Jason Yee? ### Input: CREATE TABLE table_10881 ( "Result" text, "Record" text, "Op...
What did South Melbourne score when they were the Away team?
CREATE TABLE table_name_21 ( away_team VARCHAR )
SELECT away_team AS score FROM table_name_21 WHERE away_team = "south 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 did South Melbourne score when they were the Away team? ### Input: CREATE TABLE table_name_21 ( away_team VARCHAR )...
What is the 2007 value with NMS in 2011?
CREATE TABLE table_11462 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2007" FROM table_11462 WHERE "2011" = 'nms'
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 2007 value with NMS in 2011? ### Input: CREATE TABLE table_11462 ( "Tournament" text, "2006" text, "...
How many kinds of roles are there for the staff?
CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE staff_roles ( role_code text, role_description text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE organisati...
SELECT COUNT(DISTINCT role_code) FROM project_staff
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: How many kinds of roles are there for the staff? ### Input: CREATE TABLE projects ( project_id number, organisation_...
when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0?
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 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 = '007-849') AND NOT patient.unitdischargetime 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: when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0? ### Inp...
show me the flights from SAN FRANCISCO to DALLAS
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
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: show me the flights from SAN FRANCISCO to DALLAS ### Input: CREATE TABLE flight_leg ( flight_id int, leg_number int,...
how many novelists are listed ?
CREATE TABLE table_203_449 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text )
SELECT COUNT(*) FROM table_203_449 WHERE "notable as" = 'novelist'
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 novelists are listed ? ### Input: CREATE TABLE table_203_449 ( id number, "name" text, "lifetime" text,...
What is every score at the location of Verizon Center and points of 68?
CREATE TABLE table_23486853_8 ( score VARCHAR, location VARCHAR, points VARCHAR )
SELECT score FROM table_23486853_8 WHERE location = "Verizon Center" AND points = 68
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 every score at the location of Verizon Center and points of 68? ### Input: CREATE TABLE table_23486853_8 ( score...
What is the average wickets that have overs greater than 44, danish kaneria as the player, with an average greater than 13.8?
CREATE TABLE table_59626 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Runs" real, "Wickets" real, "Best" text, "Econ" real, "S/Rate" real, "4/inns" real, "5+/inns" real, "Average" real )
SELECT AVG("Wickets") FROM table_59626 WHERE "Overs" > '44' AND "Player" = 'danish kaneria' AND "Average" > '13.8'
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 average wickets that have overs greater than 44, danish kaneria as the player, with an average greater than 13.8...
how many patients are admitted before the year 2170 and used the drug clobetasol propionate 0.05% oinment?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment"
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 are admitted before the year 2170 and used the drug clobetasol propionate 0.05% oinment? ### Input: CREATE...
What is High Points, when Game is less than 10, and when High Assists is 'Chauncey Billups (8)'?
CREATE TABLE table_76273 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "High points" FROM table_76273 WHERE "Game" < '10' AND "High assists" = 'chauncey billups (8)'
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 High Points, when Game is less than 10, and when High Assists is 'Chauncey Billups (8)'? ### Input: CREATE TABLE tab...
What was Carlton's score when they were the away team?
CREATE TABLE table_33047 ( "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_33047 WHERE "Away team" = 'carlton'
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 Carlton's score when they were the away team? ### Input: CREATE TABLE table_33047 ( "Home team" text, "Home...
How many centerfold models were there when the cover model was Torrie Wilson?
CREATE TABLE table_1566852_4 ( centerfold_model VARCHAR, cover_model VARCHAR )
SELECT COUNT(centerfold_model) FROM table_1566852_4 WHERE cover_model = "Torrie Wilson"
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 centerfold models were there when the cover model was Torrie Wilson? ### Input: CREATE TABLE table_1566852_4 ( ...
Who took the loss on May 25?
CREATE TABLE table_71210 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Loss" FROM table_71210 WHERE "Date" = 'may 25'
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 took the loss on May 25? ### Input: CREATE TABLE table_71210 ( "Date" text, "Opponent" text, "Score" text, ...