instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Return a scatter on how many students does one classroom have? | CREATE TABLE teachers (
LastName TEXT,
FirstName TEXT,
Classroom INTEGER
)
CREATE TABLE list (
LastName TEXT,
FirstName TEXT,
Grade INTEGER,
Classroom INTEGER
) | SELECT COUNT(*), Classroom FROM list GROUP BY Classroom | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a scatter on how many students does one classroom have? ### Input: CREATE TABLE teachers (
LastName TEXT,
Fir... |
is there any flight leaving WASHINGTON around 3 o'clock for DENVER | CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | 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 ((flight.departure_time <= 1530 AND flight.departure_time >= 1430) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.... | Below are sql tables 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 there any flight leaving WASHINGTON around 3 o'clock for DENVER ### Input: CREATE TABLE airport (
airport_code varcha... |
how far is downtown from the airport in 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 AIRPORT_SERVICE_0.miles_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_SE... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how far is downtown from the airport in DALLAS ### Input: CREATE TABLE flight_leg (
flight_id int,
leg_number int,
... |
Who was the home team at the game where the crowd was larger than 10,000 and the home team scored 7.13 (55)? | CREATE TABLE table_53740 (
"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_53740 WHERE "Crowd" > '10,000' AND "Home team score" = '7.13 (55)' | Below are sql tables 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 home team at the game where the crowd was larger than 10,000 and the home team scored 7.13 (55)? ### Input: CREA... |
When 1.67 is the height how many contestants are there? | CREATE TABLE table_22507 (
"Province, Community" text,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Geographical Regions" text
) | SELECT COUNT("Contestant") FROM table_22507 WHERE "Height" = '1.67' | Below are sql tables 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 1.67 is the height how many contestants are there? ### Input: CREATE TABLE table_22507 (
"Province, Community" text... |
provide the number of patients on pb route of drug administration who are diagnosed with neonatal jaundice associated with preterm delivery. | 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 demographic (
subject_id text,
hadm_id t... | 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 = "Neonatal jaundice associated with preterm delivery" AND prescriptions.route = "PB" | Below are sql tables 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 on pb route of drug administration who are diagnosed with neonatal jaundice associated with p... |
indicate the monthly maximum volume of drain out #3 penrose that patient 97330 has had since 81 months ago. | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title te... | SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the monthly maximum volume of drain out #3 penrose that patient 97330 has had since 81 months ago. ### Input: CREAT... |
who won the most silver medals ? | CREATE TABLE table_204_725 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | SELECT "nation" FROM table_204_725 ORDER BY "silver" DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who won the most silver medals ? ### Input: CREATE TABLE table_204_725 (
id number,
"rank" number,
"nation" text... |
What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163? | CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE jobs (
job_id text,
job_title text,
... | SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163) | Below are sql tables 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 full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 16... |
when was the last time patient 15794 took tpn, on the current intensive care unit visit? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
ro... | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FRO... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time patient 15794 took tpn, on the current intensive care unit visit? ### Input: CREATE TABLE d_icd_diagn... |
give me flights that arrive in BALTIMORE from ATLANTA | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me flights that arrive in BALTIMORE from ATLANTA ### Input: CREATE TABLE month (
month_number int,
month_name t... |
Give the proportion of how many movie reviews does each director get? | CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give the proportion of how many movie reviews does each director get? ### Input: CREATE TABLE Rating (
rID int,
mID ... |
How many students are from each city, and which cities have more than one cities Plot them as bar chart, and I want to list y axis in asc order. | CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_ca... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many students are from each city, and which cities have more than one cities Plot them as bar chart, and I want to list ... |
For those employees who was hired before 2002-06-21, show me the trend about commission_pct over hire_date with a line chart, and could you display x-axis in ascending order? | 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, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE | Below are sql tables 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, show me the trend about commission_pct over hire_date with a line chart... |
What Date is listed for the Region of France and Catalog of 82876-70291-2? | CREATE TABLE table_68974 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | SELECT "Date" FROM table_68974 WHERE "Region" = 'france' AND "Catalog" = '82876-70291-2' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Date is listed for the Region of France and Catalog of 82876-70291-2? ### Input: CREATE TABLE table_68974 (
"Region... |
If the home team was footscray which venue did they play it? | CREATE TABLE table_name_53 (
venue VARCHAR,
home_team VARCHAR
) | SELECT venue FROM table_name_53 WHERE home_team = "footscray" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the home team was footscray which venue did they play it? ### Input: CREATE TABLE table_name_53 (
venue VARCHAR,
... |
Compare the total number of each fate with a bar chart, and display Y-axis from low to high order. | CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Compare the total number of each fate with a bar chart, and display Y-axis from low to high order. ### Input: CREATE TABLE s... |
Scatter plot to show body builder id on x axis and snatch on y axis. | CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
) | SELECT Body_Builder_ID, Snatch FROM body_builder | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Scatter plot to show body builder id on x axis and snatch on y axis. ### Input: CREATE TABLE people (
People_ID int,
... |
Draw a bar chart of nationality versus the average of age, I want to order total number from high to low order. | CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY AVG(Age) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of nationality versus the average of age, I want to order total number from high to low order. ### Input: C... |
A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, could you order by the X in ascending? | CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id in... | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, could you order by... |
what was patient 11362 first height in 11/this year? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CR... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | Below are sql tables 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 11362 first height in 11/this year? ### Input: CREATE TABLE patients (
row_id number,
subject_id nu... |
What is Player, when Total is 292? | CREATE TABLE table_76439 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | SELECT "Player" FROM table_76439 WHERE "Total" = '292' | Below are sql tables 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 Player, when Total is 292? ### Input: CREATE TABLE table_76439 (
"Player" text,
"Country" text,
"Year(s)... |
count the number of patients whose admission location is phys referral/normal deli and procedure short title is radiotherapeut proc nec? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.short_title = "Radiotherapeut proc NEC" | Below are sql tables 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 admission location is phys referral/normal deli and procedure short title is radiotherape... |
What type of engine does the BF Racing Marron Excavations have that also has Monaco as chassis and Lee Filliponi as the driver? | CREATE TABLE table_name_94 (
engine VARCHAR,
driver VARCHAR,
team VARCHAR,
chassis VARCHAR
) | SELECT engine FROM table_name_94 WHERE team = "bf racing marron excavations" AND chassis = "monaco" AND driver = "lee filliponi" | Below are sql tables 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 type of engine does the BF Racing Marron Excavations have that also has Monaco as chassis and Lee Filliponi as the driv... |
heart rate for patient 25733 last measured on the current icu visit is greater than the value second to last measured on the current icu visit? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
s... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: heart rate for patient 25733 last measured on the current icu visit is greater than the value second to last measured on the... |
What was the production code for episode #1? | CREATE TABLE table_20726262_2 (
production_code VARCHAR,
no_in_series VARCHAR
) | SELECT production_code FROM table_20726262_2 WHERE no_in_series = 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the production code for episode #1? ### Input: CREATE TABLE table_20726262_2 (
production_code VARCHAR,
no_... |
I want to see trend of the average of budget in billions by creation, and order in ascending by the x axis. | CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | SELECT Creation, AVG(Budget_in_Billions) FROM department ORDER BY Creation | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to see trend of the average of budget in billions by creation, and order in ascending by the x axis. ### Input: CREAT... |
List the snatch score and clean jerk score of body builders in ascending order of snatch score. | CREATE TABLE body_builder (
Snatch VARCHAR,
Clean_Jerk VARCHAR
) | SELECT Snatch, Clean_Jerk FROM body_builder ORDER BY Snatch | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the snatch score and clean jerk score of body builders in ascending order of snatch score. ### Input: CREATE TABLE body... |
Name the venue for 23 january 2009 | CREATE TABLE table_name_88 (
venue VARCHAR,
date VARCHAR
) | SELECT venue FROM table_name_88 WHERE date = "23 january 2009" | Below are sql tables 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 venue for 23 january 2009 ### Input: CREATE TABLE table_name_88 (
venue VARCHAR,
date VARCHAR
) ### Respons... |
What is the prom with Hewitt class and a Height (m) of 715? | CREATE TABLE table_11676 (
"Peak" text,
"Height (m)" real,
"Prom. (m)" real,
"Class" text,
"Parent" text
) | SELECT "Prom. (m)" FROM table_11676 WHERE "Class" = 'hewitt' AND "Height (m)" = '715' | Below are sql tables 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 prom with Hewitt class and a Height (m) of 715? ### Input: CREATE TABLE table_11676 (
"Peak" text,
"Heig... |
give the number of patients whose diagnosis short title is choledocholithiasis nos and lab test abnormal status is delta. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Choledocholithiasis NOS" AND lab.flag = "delta" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients whose diagnosis short title is choledocholithiasis nos and lab test abnormal status is delta. ##... |
What is the best top 10 when there are fewer than 0 wins? | CREATE TABLE table_61719 (
"Year" text,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( $ )" text,
"Money list rank" text,
"Scoring average" text,
"Scoring rank" text
) | SELECT MAX("Top 10s") FROM table_61719 WHERE "Wins" < '0' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the best top 10 when there are fewer than 0 wins? ### Input: CREATE TABLE table_61719 (
"Year" text,
"Tourna... |
What is the score of away team, North Melbourne? | CREATE TABLE table_10165 (
"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_10165 WHERE "Away team" = 'north melbourne' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of away team, North Melbourne? ### Input: CREATE TABLE table_10165 (
"Home team" text,
"Home team ... |
What is Date, when Away Team is 'Barnet'? | CREATE TABLE table_61639 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | SELECT "Date" FROM table_61639 WHERE "Away team" = 'barnet' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Date, when Away Team is 'Barnet'? ### Input: CREATE TABLE table_61639 (
"Tie no" text,
"Home team" text,
... |
in the last hospital encounter when patient 031-23724 last got a microbiology test? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | 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-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in the last hospital encounter when patient 031-23724 last got a microbiology test? ### Input: CREATE TABLE cost (
costi... |
calculate the difference between the total input and output amount of patient 015-52724 today. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724')) AND intakeoutput.cellpath L... | Below are sql tables 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 difference between the total input and output amount of patient 015-52724 today. ### Input: CREATE TABLE cost ... |
what is drug name of subject id 2560? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.subject_id = "2560" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is drug name of subject id 2560? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_co... |
What is the average region that has an Area (km 2 ) of 451.79, and a Population under 496,257? | CREATE TABLE table_10688 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
) | SELECT AVG("Region") FROM table_10688 WHERE "Area (km 2 )" = '451.79' AND "Population" < '496,257' | Below are sql tables 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 region that has an Area (km 2 ) of 451.79, and a Population under 496,257? ### Input: CREATE TABLE table... |
Who is the home team when melbourne is the away team? | CREATE TABLE table_74771 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team score" FROM table_74771 WHERE "Away team" = 'melbourne' | Below are sql tables 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 team when melbourne is the away team? ### Input: CREATE TABLE table_74771 (
"Home team" text,
"Home ... |
What was Olazabal's winning score in the German Masters? | CREATE TABLE table_36806 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | SELECT "Winning score" FROM table_36806 WHERE "Tournament" = 'german masters' | Below are sql tables 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 Olazabal's winning score in the German Masters? ### Input: CREATE TABLE table_36806 (
"Date" text,
"Tournam... |
Bar chart x axis other details y axis resident_id, could you list Y in ascending order? | CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
prope... | SELECT other_details, resident_id FROM Residents ORDER BY resident_id | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis other details y axis resident_id, could you list Y in ascending order? ### Input: CREATE TABLE Residents_Se... |
what are the three most commonly ordered lab tests for patients that had previously received intracranial/cerebral perfusion pressure monitoring - ventriculostomy within 2 months during the last year? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
tre... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'intracranial/cerebral perfusion pressure monitoring ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the three most commonly ordered lab tests for patients that had previously received intracranial/cerebral perfusion... |
What are the names of players whose training hours is between 500 and 1500? | CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | SELECT pname FROM player WHERE hs BETWEEN 500 AND 1500 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of players whose training hours is between 500 and 1500? ### Input: CREATE TABLE college (
cname text... |
Find the number of courses for each subject in a pie chart. | CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test... | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of courses for each subject in a pie chart. ### Input: CREATE TABLE Subjects (
subject_id INTEGER,
s... |
how many hours have elapsed since patient 011-55642 was admitted to the hospital? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours have elapsed since patient 011-55642 was admitted to the hospital? ### Input: CREATE TABLE treatment (
tr... |
indicate the daily average amount of heartrate for patient 012-29497 during their first hospital visit. | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT AVG(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-29497' AND NOT patient.hospitaldischargetime IS ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the daily average amount of heartrate for patient 012-29497 during their first hospital visit. ### Input: CREATE TA... |
What are the names of the different bank branches, and what are their total loan amounts Show bar chart, and I want to sort by the Y-axis from low to high. | CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY SUM(amount) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of the different bank branches, and what are their total loan amounts Show bar chart, and I want to sort ... |
what was the number of patients admitted to hospital since 2105? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) >= '2105' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the number of patients admitted to hospital since 2105? ### Input: CREATE TABLE treatment (
treatmentid number,... |
When 5th, south western district 2 is the mens 2nd xi what is the season? | CREATE TABLE table_21576644_2 (
season VARCHAR,
mens_2nd_xi VARCHAR
) | SELECT season FROM table_21576644_2 WHERE mens_2nd_xi = "5th, South Western District 2" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When 5th, south western district 2 is the mens 2nd xi what is the season? ### Input: CREATE TABLE table_21576644_2 (
sea... |
What is the latest year for the Tyrrell 018 Chassis that has less than 3 points? | CREATE TABLE table_name_43 (
year INTEGER,
chassis VARCHAR,
points VARCHAR
) | SELECT MAX(year) FROM table_name_43 WHERE chassis = "tyrrell 018" AND points < 3 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the latest year for the Tyrrell 018 Chassis that has less than 3 points? ### Input: CREATE TABLE table_name_43 (
... |
how many times is the team oklahoma city? | CREATE TABLE table_27715173_8 (
high_points VARCHAR,
team VARCHAR
) | SELECT COUNT(high_points) FROM table_27715173_8 WHERE team = "Oklahoma City" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times is the team oklahoma city? ### Input: CREATE TABLE table_27715173_8 (
high_points VARCHAR,
team VARCH... |
A bar chart for returning the number of the categories of music festivals that have the result 'Awarded', could you show in ascending by the Y? | CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for returning the number of the categories of music festivals that have the result 'Awarded', could you show in ... |
What is the highest number of bronzes for countries ranking over 5 with 0 golds? | CREATE TABLE table_name_74 (
bronze INTEGER,
rank VARCHAR,
gold VARCHAR
) | SELECT MAX(bronze) FROM table_name_74 WHERE rank > 5 AND gold < 0 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest number of bronzes for countries ranking over 5 with 0 golds? ### Input: CREATE TABLE table_name_74 (
... |
What is Points For, when Points Against is 571? | CREATE TABLE table_46319 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
) | SELECT "Points for" FROM table_46319 WHERE "Points against" = '571' | Below are sql tables 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 Points For, when Points Against is 571? ### Input: CREATE TABLE table_46319 (
"Club" text,
"Played" text,
... |
how many days since the last chr blood loss anemia diagnosis of patient 93078 in their current hospital visit? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | 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 = 'chr blood loss anemia') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admiss... | Below are sql tables 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 the last chr blood loss anemia diagnosis of patient 93078 in their current hospital visit? ### Input: CR... |
renal failure | CREATE TABLE table_train_258 (
"id" int,
"gender" string,
"autoimmune_disease" bool,
"renal_disease" bool,
"hepatic_disease" bool,
"immune_deficiency_disorder" bool,
"active_hepatitis" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | SELECT * FROM table_train_258 WHERE renal_disease = 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: renal failure ### Input: CREATE TABLE table_train_258 (
"id" int,
"gender" string,
"autoimmune_disease" bool,
... |
count the number of patients whose diagnosis short title is dmi neuro nt st uncntrld with a main drug type. | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "DMI neuro nt st uncntrld" AND prescriptions.drug_type = "MAIN" | Below are sql tables 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 diagnosis short title is dmi neuro nt st uncntrld with a main drug type. ### Input: CREAT... |
What is the lowest number of blocks for players with height of 206 and more than 356 spikes? | CREATE TABLE table_name_69 (
block INTEGER,
height VARCHAR,
spike VARCHAR
) | SELECT MIN(block) FROM table_name_69 WHERE height = 206 AND spike > 356 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of blocks for players with height of 206 and more than 356 spikes? ### Input: CREATE TABLE table_n... |
Who was the leading scorer on February 9? | CREATE TABLE table_56467 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | SELECT "Leading scorer" FROM table_56467 WHERE "Date" = 'february 9' | Below are sql tables 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 leading scorer on February 9? ### Input: CREATE TABLE table_56467 (
"Date" text,
"Visitor" text,
"Sc... |
What is the smallest number of silver medals for a nation with fewer than 1 bronze? | CREATE TABLE table_12420 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Silver") FROM table_12420 WHERE "Bronze" < '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest number of silver medals for a nation with fewer than 1 bronze? ### Input: CREATE TABLE table_12420 (
... |
count the number of patients who have been on cariporide cc/hr intake until 3 years ago. | 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 COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cariporide cc/hr' A... | Below are sql tables 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 been on cariporide cc/hr intake until 3 years ago. ### Input: CREATE TABLE inputevents... |
Are there morning classes for STDABRD 255 ? | CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description v... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'STDABRD' AND course.number = 255 AND semester.semester = 'WN' AND semester.semester_id = course_... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there morning classes for STDABRD 255 ? ### Input: CREATE TABLE program_course (
program_id int,
course_id int,
... |
in 2105 was there any microbiological test history of patient 031-17834? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND STRFTIME('%y', microlab.culturetakentime) = '2105' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in 2105 was there any microbiological test history of patient 031-17834? ### Input: CREATE TABLE vitalperiodic (
vitalpe... |
Bar graph to show sum card number from different card type code, show in ascending by the y-axis please. | CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) | Below are sql tables 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 sum card number from different card type code, show in ascending by the y-axis please. ### Input: CREATE T... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart, I want to show in asc by the Y-axis please. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) | Below are sql tables 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
provide the number of patients whose insurance is government and procedure long title is biopsy of tonsils and adenoids? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Biopsy of tonsils and adenoids" | Below are sql tables 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 insurance is government and procedure long title is biopsy of tonsils and adenoids? ###... |
How many league apps did the player with 11 team goals have? | CREATE TABLE table_29349 (
"Position" text,
"Nationality" text,
"Name" text,
"League apps" real,
"League goals" real,
"FA Cup apps" real,
"FA Cup goals" real,
"Total apps" real,
"Total goals" real
) | SELECT "League apps" FROM table_29349 WHERE "Total goals" = '11' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many league apps did the player with 11 team goals have? ### Input: CREATE TABLE table_29349 (
"Position" text,
... |
renal failure | CREATE TABLE table_train_192 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"diabetic" string,
"fasting_plasma_glucose" int,
"NOUSE" float
) | SELECT * FROM table_train_192 WHERE renal_disease = 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: renal failure ### Input: CREATE TABLE table_train_192 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" ... |
tell me the number of patients with coronary artery primary disease. | 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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" | Below are sql tables 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 number of patients with coronary artery primary disease. ### Input: CREATE TABLE demographic (
subject_id te... |
What is the last year on this list someone was first elected? | CREATE TABLE table_789 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | SELECT MAX("First elected") FROM table_789 | Below are sql tables 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 last year on this list someone was first elected? ### Input: CREATE TABLE table_789 (
"District" text,
"... |
For the Enernoc Australia Pty Ltd, what's the country with an unknown date? | CREATE TABLE table_71615 (
"Date" text,
"Company" text,
"Business" text,
"Country" text,
"Value ( USD )" text
) | SELECT "Country" FROM table_71615 WHERE "Date" = 'unknown' AND "Company" = 'enernoc australia pty ltd' | Below are sql tables 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 Enernoc Australia Pty Ltd, what's the country with an unknown date? ### Input: CREATE TABLE table_71615 (
"Date"... |
Top 1000 users of india and pakistan. | CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserD... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, LOWER(Location) AS CNTRY FROM Users WHERE LOWER(Location) IN ('india', 'pakistan') ORDER BY Reputation DESC LIMIT 10000 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 1000 users of india and pakistan. ### Input: CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number... |
For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart. | CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the amount of job_id , and... |
Visualize a bar chart for what is average age for different job title?, I want to show from low to high by the the average of age. | CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart for what is average age for different job title?, I want to show from low to high by the the average o... |
Give me the comparison about Team_ID over the All_Road by a bar chart, rank by the y-axis in ascending. | 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_Road, Team_ID FROM basketball_match ORDER BY Team_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about Team_ID over the All_Road by a bar chart, rank by the y-axis in ascending. ### Input: CREATE TA... |
Create a bar chart showing all_games_percent across acc regular season, sort in descending by the Y. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a bar chart showing all_games_percent across acc regular season, sort in descending by the Y. ### Input: CREATE TABLE... |
On what Date was the match with a Score of 6-2, 6-4? | CREATE TABLE table_name_64 (
date VARCHAR,
score VARCHAR
) | SELECT date FROM table_name_64 WHERE score = "6-2, 6-4" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what Date was the match with a Score of 6-2, 6-4? ### Input: CREATE TABLE table_name_64 (
date VARCHAR,
score VAR... |
how many patients with death status 1 and have been prescribed glucagon drug? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Glucagon" | Below are sql tables 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 death status 1 and have been prescribed glucagon drug? ### Input: CREATE TABLE lab (
subject_id t... |
how many times do patient 3745 go to the hospital until 1 year ago. | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 3745 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times do patient 3745 go to the hospital until 1 year ago. ### Input: CREATE TABLE d_icd_diagnoses (
row_id num... |
what is icu stay id of subject id 22377? | 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 prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "22377" | Below are sql tables 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 icu stay id of subject id 22377? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd... |
What is the Record with a Leading scorer with andrew bogut (29)? | CREATE TABLE table_57894 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | SELECT "Record" FROM table_57894 WHERE "Leading scorer" = 'andrew bogut (29)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Record with a Leading scorer with andrew bogut (29)? ### Input: CREATE TABLE table_57894 (
"Date" text,
... |
Draw a scatter chart for what are the low and high estimates of film markets? | CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Stud... | SELECT Low_Estimate, High_Estimate FROM film_market_estimation | Below are sql tables 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 scatter chart for what are the low and high estimates of film markets? ### Input: CREATE TABLE market (
Market_ID... |
Return a histogram on what is the average high temperature for each day of week?, display in asc by the total number. | CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) | Below are sql tables 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 histogram on what is the average high temperature for each day of week?, display in asc by the total number. ### In... |
give me the number of patients whose days of hospital stay is greater than 1 and drug code is meth40? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.formulary_drug_cd = "METH40" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose days of hospital stay is greater than 1 and drug code is meth40? ### Input: CREATE TABL... |
how many patients whose admission type is emergency and drug route is ed? | 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.admission_type = "EMERGENCY" AND prescriptions.route = "ED" | Below are sql tables 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 type is emergency and drug route is ed? ### Input: CREATE TABLE demographic (
subject_... |
Return a histogram on how many actors have appeared in each musical?, could you display in asc by the total number? | CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on how many actors have appeared in each musical?, could you display in asc by the total number? ### Inpu... |
For the game where the opponent is listed as @ Indiana Pacers, what was the end record? | CREATE TABLE table_name_31 (
record VARCHAR,
opponent VARCHAR
) | SELECT record FROM table_name_31 WHERE opponent = "@ indiana pacers" | Below are sql tables 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 game where the opponent is listed as @ Indiana Pacers, what was the end record? ### Input: CREATE TABLE table_name_3... |
What are the types of competition and number of competitions for that type Show bar chart, and rank Y in ascending order. | CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the types of competition and number of competitions for that type Show bar chart, and rank Y in ascending order. ##... |
What was the position of Frank Tripp? | CREATE TABLE table_name_28 (
position VARCHAR,
character VARCHAR
) | SELECT position FROM table_name_28 WHERE character = "frank tripp" | Below are sql tables 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 position of Frank Tripp? ### Input: CREATE TABLE table_name_28 (
position VARCHAR,
character VARCHAR
) ... |
What is the least number of extra points? | CREATE TABLE table_25730326_2 (
extra_points INTEGER
) | SELECT MIN(extra_points) FROM table_25730326_2 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least number of extra points? ### Input: CREATE TABLE table_25730326_2 (
extra_points INTEGER
) ### Response... |
has any microbiology test been performed on patient 96774 since 148 months ago? | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96774) AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-148 month') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has any microbiology test been performed on patient 96774 since 148 months ago? ### Input: CREATE TABLE transfers (
row_... |
Name the least year for start of 17th | CREATE TABLE table_68875 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text
) | SELECT MIN("Year") FROM table_68875 WHERE "Start" = '17th' | Below are sql tables 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 least year for start of 17th ### Input: CREATE TABLE table_68875 (
"Year" real,
"Chassis" text,
"Engine... |
In what place is the player with a score of 72-66-75=213? | CREATE TABLE table_name_13 (
place VARCHAR,
score VARCHAR
) | SELECT place FROM table_name_13 WHERE score = 72 - 66 - 75 = 213 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what place is the player with a score of 72-66-75=213? ### Input: CREATE TABLE table_name_13 (
place VARCHAR,
sco... |
On what date was a game played, which left the team with a record of 5-7? | CREATE TABLE table_42168 (
"Date" text,
"Opponent" text,
"Score" text,
"Site/Stadium" text,
"Record" text
) | SELECT "Date" FROM table_42168 WHERE "Record" = '5-7' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date was a game played, which left the team with a record of 5-7? ### Input: CREATE TABLE table_42168 (
"Date" t... |
How many Crowd that has a Date on saturday, 29 january and an Away team of collingwood? | CREATE TABLE table_48420 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | SELECT AVG("Crowd") FROM table_48420 WHERE "Date" = 'saturday, 29 january' AND "Away team" = 'collingwood' | Below are sql tables 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 Crowd that has a Date on saturday, 29 january and an Away team of collingwood? ### Input: CREATE TABLE table_48420 ... |
what is the number of patients whose admission type is elective and procedure long title is coronary arteriography using two catheters? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Coronary arteriography using two catheters" | Below are sql tables 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 procedure long title is coronary arteriography using two... |
what is the number of patients whose marital status is widowed and age is less than 89? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age < "89" | Below are sql tables 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 marital status is widowed and age is less than 89? ### Input: CREATE TABLE diagnoses (
... |
list all flights going from BOSTON to ATLANTA before 500 o'clock am on thursday | CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all flights going from BOSTON to ATLANTA before 500 o'clock am on thursday ### Input: CREATE TABLE fare_basis (
far... |
How many papers has Jeffrey Heer ? | CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid int,
a... | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'Jeffrey Heer' AND writes.authorid = author.authorid | Below are sql tables 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 papers has Jeffrey Heer ? ### Input: CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE pap... |
how many patients whose admission year is less than 2138 and procedure icd9 code is 5781? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.icd9_code = "5781" | Below are sql tables 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 year is less than 2138 and procedure icd9 code is 5781? ### Input: CREATE TABLE prescripti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.