instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Show names of musicals and the number of actors who have appeared in the musicals. | CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_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: Show names of musicals and the number of actors who have appeared in the musicals. ### Input: CREATE TABLE musical (
Mus... |
Find the major that is studied by the largest number of students. | CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
... | SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the major that is studied by the largest number of students. ### Input: CREATE TABLE voting_record (
stuid number,
... |
How many players are injured in each day? Show a bar chart, list by the Y-axis in ascending. | CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
... | SELECT Date, COUNT(Date) FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id GROUP BY Date ORDER BY COUNT(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: How many players are injured in each day? Show a bar chart, list by the Y-axis in ascending. ### Input: CREATE TABLE stadium... |
count the number of patients whose diagnoses icd9 code is 3079 and lab test fluid is cerebrospinal fluid (csf)? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "3079" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses icd9 code is 3079 and lab test fluid is cerebrospinal fluid (csf)? ### Input: C... |
how many current patients are of age 20s? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 20 AND 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: how many current patients are of age 20s? ### Input: CREATE TABLE medication (
medicationid number,
patientunitstayi... |
What is the place of player john cook? | CREATE TABLE table_name_73 (
place VARCHAR,
player VARCHAR
) | SELECT place FROM table_name_73 WHERE player = "john cook" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the place of player john cook? ### Input: CREATE TABLE table_name_73 (
place VARCHAR,
player VARCHAR
) ### R... |
what procedure did patient 64873 undergo for the first time since 3 years ago? | CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64873) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TI... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what procedure did patient 64873 undergo for the first time since 3 years ago? ### Input: CREATE TABLE admissions (
row_... |
Which Runner(s)-up has a Winning score of 9 (71-68-72-68=279)? | CREATE TABLE table_34070 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | SELECT "Runner(s)-up" FROM table_34070 WHERE "Winning score" = '–9 (71-68-72-68=279)' | Below are sql tables 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 Runner(s)-up has a Winning score of 9 (71-68-72-68=279)? ### Input: CREATE TABLE table_34070 (
"Date" text,
"T... |
what procedure did patient 23550 receive the first time since 2103. | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23550) AND STRFTIME('%y', procedures_icd.charttime) >= '2103' ORDER ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what procedure did patient 23550 receive the first time since 2103. ### Input: CREATE TABLE diagnoses_icd (
row_id numbe... |
how much is patient 027-76730's difference in systemicmean last measured on the first intensive care unit visit compared to the second to last value measured on the first intensive care unit visit? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-76730') AND NOT patient.unitdischargetime ... | Below are sql tables 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 patient 027-76730's difference in systemicmean last measured on the first intensive care unit visit compared to ... |
What is the repeat date of the episode that aired 22/12/1968? | CREATE TABLE table_18089 (
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Originalairdate" text,
"Repeatairdate(s)" text,
"Prod.Code" text
) | SELECT "Repeatairdate(s)" FROM table_18089 WHERE "Originalairdate" = '22/12/1968' | Below are sql tables 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 repeat date of the episode that aired 22/12/1968? ### Input: CREATE TABLE table_18089 (
"#" real,
"Title... |
What was the result for week 14? | CREATE TABLE table_33413 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT "Result" FROM table_33413 WHERE "Week" = '14' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result for week 14? ### Input: CREATE TABLE table_33413 (
"Week" real,
"Date" text,
"Opponent" text... |
AA from DENVER to MILWAUKEE | CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varcha... | 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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: AA from DENVER to MILWAUKEE ### Input: CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE groun... |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, display in descending by the Y please. | 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, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date an... |
what is the total number of districts of lima ? | CREATE TABLE table_204_739 (
id number,
"districts" text,
"ubigeo" number,
"area\n(km2)" number,
"population" number,
"population density\n(/km2)" number,
"created" text,
"postal\ncode" number
) | SELECT COUNT("districts") FROM table_204_739 | Below are sql tables 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 districts of lima ? ### Input: CREATE TABLE table_204_739 (
id number,
"districts" text,... |
now i need flight information leaving ATLANTA and arriving in BALTIMORE in the afternoon | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport va... | 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 = 'BALTI... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: now i need flight information leaving ATLANTA and arriving in BALTIMORE in the afternoon ### Input: CREATE TABLE date_day (
... |
For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, and order by the x-axis from low to high please. | CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 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: For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, and order by the x-a... |
In the tournament with more than 6 top-25's and less than 13 cuts made, how many wins were there? | CREATE TABLE table_6076 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT COUNT("Wins") FROM table_6076 WHERE "Top-25" > '6' AND "Cuts made" < '13' | Below are sql tables 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 tournament with more than 6 top-25's and less than 13 cuts made, how many wins were there? ### Input: CREATE TABLE ta... |
number of victories | CREATE TABLE table_203_746 (
id number,
"date" text,
"opponent" text,
"score" text,
"leading scorer" text,
"attendance" number,
"record" text
) | SELECT COUNT(*) FROM table_203_746 WHERE "score" > "score" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: number of victories ### Input: CREATE TABLE table_203_746 (
id number,
"date" text,
"opponent" text,
"score"... |
specify admission time and gender of patient id 4589 | 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 demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "4589" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify admission time and gender of patient id 4589 ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_i... |
Find the max and min grade point for all letter grade. | CREATE TABLE GRADECONVERSION (
gradepoint INTEGER
) | SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION | Below are sql tables 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 max and min grade point for all letter grade. ### Input: CREATE TABLE GRADECONVERSION (
gradepoint INTEGER
) ##... |
What is the amount of oil terminal in 2004? | CREATE TABLE table_56391 (
"Product" text,
"2004" text,
"2003" text,
"2002" text,
"2001" text
) | SELECT "2004" FROM table_56391 WHERE "Product" = 'oil terminal' | Below are sql tables 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 amount of oil terminal in 2004? ### Input: CREATE TABLE table_56391 (
"Product" text,
"2004" text,
"... |
What was the score on April 22? | CREATE TABLE table_56716 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Score" FROM table_56716 WHERE "Date" = 'april 22' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score on April 22? ### Input: CREATE TABLE table_56716 (
"Date" text,
"Opponent" text,
"Score" text... |
what is the distance between PITTSBURGH airport and downtown PITTSBURGH | CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fligh... | 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: what is the distance between PITTSBURGH airport and downtown PITTSBURGH ### Input: CREATE TABLE airline (
airline_code v... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the trend of department_id over hire_date . | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the t... |
how many days has elapsed since patient 5828 was last diagnosed during this hospital encounter with hypotension nos? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT 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 = 'hypotension nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions W... | Below are sql tables 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 has elapsed since patient 5828 was last diagnosed during this hospital encounter with hypotension nos? ### Inp... |
What is the average number of League Goals for palyers with 0 FA Cup Goals? | CREATE TABLE table_64067 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | SELECT AVG("League Goals") FROM table_64067 WHERE "FA Cup Goals" < '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 average number of League Goals for palyers with 0 FA Cup Goals? ### Input: CREATE TABLE table_64067 (
"Name"... |
Name the title for number in season 9 | CREATE TABLE table_16951593_1 (
title VARCHAR,
no_in_season VARCHAR
) | SELECT title FROM table_16951593_1 WHERE no_in_season = "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: Name the title for number in season 9 ### Input: CREATE TABLE table_16951593_1 (
title VARCHAR,
no_in_season VARCHAR... |
Are there any courses I must take before taking CHE 414 ? | CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | Below are sql tables 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 any courses I must take before taking CHE 414 ? ### Input: CREATE TABLE student_record (
student_id int,
c... |
What is the score on may 16? | CREATE TABLE table_11697 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Score" FROM table_11697 WHERE "Date" = 'may 16' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score on may 16? ### Input: CREATE TABLE table_11697 (
"Date" text,
"Opponent" text,
"Score" text,
... |
What is the 2004 value for the 2009 Grand slam tournaments? | CREATE TABLE table_50259 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | SELECT "2004" FROM table_50259 WHERE "2009" = 'grand slam tournaments' | Below are sql tables 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 2004 value for the 2009 Grand slam tournaments? ### Input: CREATE TABLE table_50259 (
"Tournament" text,
... |
give me the number of patients whose death status is 1 and diagnoses icd9 code is 56962? | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "56962" | Below are sql tables 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 death status is 1 and diagnoses icd9 code is 56962? ### Input: CREATE TABLE diagnoses (... |
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home | Below are sql tables 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_Home , and group by attribute ACC_Home by a bar chart. ### Input: CREATE T... |
Which Name has a Years Played of 2004 2008, and a Date and Opponent of 2/17/07 vs. purdue? | CREATE TABLE table_name_34 (
name VARCHAR,
years_played VARCHAR,
date_and_opponent VARCHAR
) | SELECT name FROM table_name_34 WHERE years_played = "2004–2008" AND date_and_opponent = "2/17/07 vs. purdue" | Below are sql tables 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 Name has a Years Played of 2004 2008, and a Date and Opponent of 2/17/07 vs. purdue? ### Input: CREATE TABLE table_nam... |
Show school id vs acc_percent as scatter plot use a different color for each All_Home | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Home | Below are sql tables 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 school id vs acc_percent as scatter plot use a different color for each All_Home ### Input: CREATE TABLE university (
... |
What place did the player from South Africa finish? | CREATE TABLE table_44363 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Place" FROM table_44363 WHERE "Country" = 'south africa' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What place did the player from South Africa finish? ### Input: CREATE TABLE table_44363 (
"Place" text,
"Player" tex... |
How many episodes were viewed by 1.29 million people? | CREATE TABLE table_23918997_1 (
no VARCHAR,
us_viewers__million_ VARCHAR
) | SELECT COUNT(no) FROM table_23918997_1 WHERE us_viewers__million_ = "1.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: How many episodes were viewed by 1.29 million people? ### Input: CREATE TABLE table_23918997_1 (
no VARCHAR,
us_view... |
what is the maximum hospital cost when it involves acute copd exacerbation since 4 years ago? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute copd exacerbation')) AND DATETIME(cost... | Below are sql tables 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 maximum hospital cost when it involves acute copd exacerbation since 4 years ago? ### Input: CREATE TABLE lab (
... |
when was the last time the systemicmean of patient 027-165214 was less than 112.0, the previous day? | 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 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 = '027-165214')) AND vitalperiodic.systemicmean < 112.... | Below are sql tables 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 the systemicmean of patient 027-165214 was less than 112.0, the previous day? ### Input: CREATE TABLE... |
Are there any courses that I 'm required to take before taking IOE 641 ? | CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | Below are sql tables 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 any courses that I 'm required to take before taking IOE 641 ? ### Input: CREATE TABLE course_tags_count (
cou... |
what is the number of patients whose gender is f and diagnoses short title is ulcer of heel & midfoot? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Ulcer of heel & midfoot" | Below are sql tables 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 gender is f and diagnoses short title is ulcer of heel & midfoot? ### Input: CREATE TAB... |
What is the total bronze with a Gold larger than 1, a Rank of 2, and a Silver smaller than 12? | CREATE TABLE table_71810 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT COUNT("Bronze") FROM table_71810 WHERE "Gold" > '1' AND "Rank" = '2' AND "Silver" < '12' | Below are sql tables 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 bronze with a Gold larger than 1, a Rank of 2, and a Silver smaller than 12? ### Input: CREATE TABLE table... |
Bin the installation date into the day of week interval, and then you can draw a bar chart to tell me how many stations each year, sort from low to high by the y axis please. | CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
d... | SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_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: Bin the installation date into the day of week interval, and then you can draw a bar chart to tell me how many stations each... |
show me the flight that leaves PHILADELPHIA in the afternoon and arrives in the evening in DENVER | CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_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 (((flight.arrival_time <= 2200 AND flight.arrival_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_... | Below are sql tables 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 flight that leaves PHILADELPHIA in the afternoon and arrives in the evening in DENVER ### Input: CREATE TABLE co... |
when did patient 97314 have the maximum amount of potassium in 03/this year for the first time? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE... | Below are sql tables 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 97314 have the maximum amount of potassium in 03/this year for the first time? ### Input: CREATE TABLE labe... |
what is the cheapest fare from BALTIMORE to DALLAS in any class | CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length in... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | Below are sql tables 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 cheapest fare from BALTIMORE to DALLAS in any class ### Input: CREATE TABLE airline (
airline_code varchar,
... |
What Goals has a Team of zamora, and Average larger than 0.89? | CREATE TABLE table_61695 (
"Goalkeeper" text,
"Goals" real,
"Matches" real,
"Average" real,
"Team" text
) | SELECT AVG("Goals") FROM table_61695 WHERE "Team" = 'zamora' AND "Average" > '0.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 Goals has a Team of zamora, and Average larger than 0.89? ### Input: CREATE TABLE table_61695 (
"Goalkeeper" text,
... |
Who had the fastest lap at the brazilian grand prix? | CREATE TABLE table_1137695_3 (
fastest_lap VARCHAR,
grand_prix VARCHAR
) | SELECT fastest_lap FROM table_1137695_3 WHERE grand_prix = "Brazilian grand_prix" | Below are sql tables 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 fastest lap at the brazilian grand prix? ### Input: CREATE TABLE table_1137695_3 (
fastest_lap VARCHAR,
... |
Give me a pie about the proportion of each location's total number of passengers. | CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location | Below are sql tables 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 a pie about the proportion of each location's total number of passengers. ### Input: CREATE TABLE station (
Stat... |
In what round was a left wing drafted? | CREATE TABLE table_61460 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
) | SELECT "Round" FROM table_61460 WHERE "Position" = 'left wing' | Below are sql tables 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 round was a left wing drafted? ### Input: CREATE TABLE table_61460 (
"Round" real,
"Player" text,
"Posit... |
When Rocco Mediate of the United States has a To par of +2, what was his score? | CREATE TABLE table_name_43 (
score VARCHAR,
player VARCHAR,
to_par VARCHAR,
country VARCHAR
) | SELECT score FROM table_name_43 WHERE to_par = "+2" AND country = "united states" AND player = "rocco mediate" | Below are sql tables 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 Rocco Mediate of the United States has a To par of +2, what was his score? ### Input: CREATE TABLE table_name_43 (
... |
list all the flights from ATLANTA to PHILADELPHIA on 8 the 1 | 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 flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE aircraft (
aircraft_code varc... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 1 AND date_day.month_number = 8 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: list all the flights from ATLANTA to PHILADELPHIA on 8 the 1 ### Input: CREATE TABLE airport (
airport_code varchar,
... |
provide the number of patients whose gender is f and drug code is thor25? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "THOR25" | Below are sql tables 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 gender is f and drug code is thor25? ### Input: CREATE TABLE prescriptions (
subjec... |
What is the average total for teams with over 3 bronzes and over 8 golds? | CREATE TABLE table_name_33 (
total INTEGER,
bronze VARCHAR,
gold VARCHAR
) | SELECT AVG(total) FROM table_name_33 WHERE bronze > 3 AND gold > 8 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average total for teams with over 3 bronzes and over 8 golds? ### Input: CREATE TABLE table_name_33 (
total ... |
provide the number of patients who are on ed route of drug administration and have diagnoses icd9 code 6929. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "6929" 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: provide the number of patients who are on ed route of drug administration and have diagnoses icd9 code 6929. ### Input: CREA... |
What is the cyrillic and other name of rabe? | CREATE TABLE table_73820 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT "Cyrillic Name Other Names" FROM table_73820 WHERE "Settlement" = 'Rabe' | Below are sql tables 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 cyrillic and other name of rabe? ### Input: CREATE TABLE table_73820 (
"Settlement" text,
"Cyrillic Name... |
provide the number of patients whose discharge location is home health care and procedure short title is hemodialysis? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Hemodialysis" | Below are sql tables 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 discharge location is home health care and procedure short title is hemodialysis? ### I... |
What is the top attendance for weeks past 2 on october 29, 1961? | CREATE TABLE table_77761 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT MAX("Attendance") FROM table_77761 WHERE "Week" > '2' AND "Date" = 'october 29, 1961' | Below are sql tables 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 top attendance for weeks past 2 on october 29, 1961? ### Input: CREATE TABLE table_77761 (
"Week" real,
... |
What Airport's ICAO is ENTO? | CREATE TABLE table_78939 (
"City" text,
"Country" text,
"Airport" text,
"IATA" text,
"ICAO" text
) | SELECT "Airport" FROM table_78939 WHERE "ICAO" = 'ento' | Below are sql tables 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 Airport's ICAO is ENTO? ### Input: CREATE TABLE table_78939 (
"City" text,
"Country" text,
"Airport" text,
... |
Give the number of patients whose ethnicity is black/cape verdean that had a lab test named potassium ,urine. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "Potassium, Urine" | Below are sql tables 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 ethnicity is black/cape verdean that had a lab test named potassium ,urine. ### Input: CRE... |
how many patients with drug code cefx1f were born before 2041? | 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.dob_year < "2041" AND prescriptions.formulary_drug_cd = "CEFX1F" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients with drug code cefx1f were born before 2041? ### Input: CREATE TABLE demographic (
subject_id text,
... |
when was patient 5395's heart rate first measured less than 63.0 on 09/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 outputevents (
row_id number,
subject_id number,
ha... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | Below are sql tables 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 patient 5395's heart rate first measured less than 63.0 on 09/24/this year? ### Input: CREATE TABLE icustays (
... |
Show me a bar chart for how many faculty members does each building have? List the result with the name of the building, list Y from high to low order please. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) 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: Show me a bar chart for how many faculty members does each building have? List the result with the name of the building, lis... |
What's the record of game 67? | CREATE TABLE table_49348 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | SELECT "Record" FROM table_49348 WHERE "Game" = '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: What's the record of game 67? ### Input: CREATE TABLE table_49348 (
"Game" real,
"March" real,
"Opponent" text,
... |
what is discharge location and icu stay id of subject id 42820? | 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 demographic.discharge_location, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "42820" | Below are sql tables 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 discharge location and icu stay id of subject id 42820? ### Input: CREATE TABLE diagnoses (
subject_id text,
... |
Who got high assists for team @ Indiana? | CREATE TABLE table_27700375_8 (
high_assists VARCHAR,
team VARCHAR
) | SELECT high_assists FROM table_27700375_8 WHERE team = "@ Indiana" | Below are sql tables 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 got high assists for team @ Indiana? ### Input: CREATE TABLE table_27700375_8 (
high_assists VARCHAR,
team VARCH... |
Show different carriers of phones together with the number of phones with each carrier by a bar chart. | CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier | Below are sql tables 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 different carriers of phones together with the number of phones with each carrier by a bar chart. ### Input: CREATE TAB... |
When did the staff member named Janessa Sawayn join the company? | CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE staff (
staff_id numbe... | SELECT date_joined_staff FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn" | Below are sql tables 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 the staff member named Janessa Sawayn join the company? ### Input: CREATE TABLE vehicles (
vehicle_id number,
... |
A bar chart shows the distribution of All_Games and Team_ID , list by the Y-axis in descending. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Games, Team_ID FROM basketball_match ORDER BY Team_ID DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of All_Games and Team_ID , list by the Y-axis in descending. ### Input: CREATE TABLE bask... |
provide the number of patients whose ethnicity is hispanic or latino and drug name is sarna lotion? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug = "Sarna Lotion" | Below are sql tables 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 ethnicity is hispanic or latino and drug name is sarna lotion? ### Input: CREATE TABLE ... |
Which Venue has an Away team of st kilda? | CREATE TABLE table_56830 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_56830 WHERE "Away team" = 'st kilda' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Venue has an Away team of st kilda? ### Input: CREATE TABLE table_56830 (
"Home team" text,
"Home team score" ... |
Score of 2 3 has what attendance? | CREATE TABLE table_67698 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | SELECT "Attendance" FROM table_67698 WHERE "Score" = '2 – 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: Score of 2 3 has what attendance? ### Input: CREATE TABLE table_67698 (
"Date" text,
"Visitor" text,
"Score" tex... |
What is the result of the game with 68,436 attending? | CREATE TABLE table_54859 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff Time" text,
"Attendance" text
) | SELECT "Result" FROM table_54859 WHERE "Attendance" = '68,436' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result of the game with 68,436 attending? ### Input: CREATE TABLE table_54859 (
"Week" real,
"Date" text... |
show me the flights from BOSTON to BALTIMORE | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hi... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... | Below are sql tables 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 BOSTON to BALTIMORE ### Input: CREATE TABLE city (
city_code varchar,
city_name varchar,
... |
What is the largest ethnic group in the settlement with a 2011 population of 5082? | CREATE TABLE table_27880 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT COUNT("Largest ethnic group (2002)") FROM table_27880 WHERE "Population (2011)" = '5082' | Below are sql tables 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 largest ethnic group in the settlement with a 2011 population of 5082? ### Input: CREATE TABLE table_27880 (
... |
What's the home team's score at lake oval? | CREATE TABLE table_name_89 (
home_team VARCHAR,
venue VARCHAR
) | SELECT home_team AS score FROM table_name_89 WHERE venue = "lake oval" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the home team's score at lake oval? ### Input: CREATE TABLE table_name_89 (
home_team VARCHAR,
venue VARCHAR
... |
count the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and lab test category is hematology. | 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.long_title = "Unspecified hereditary and idiopathic peripheral neuropathy" AND lab."CATEGORY" = "Hematology" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and l... |
i would like to travel from DENVER to PITTSBURGH | 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 flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE aircraft (
aircraft_code varc... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i would like to travel from DENVER to PITTSBURGH ### Input: CREATE TABLE airport (
airport_code varchar,
airport_nam... |
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, return a line chart about the change of department_id over hire_date , order by the HIRE_DATE in ascending. | 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
mmse score > or equal to 21 | CREATE TABLE table_train_80 (
"id" int,
"mini_mental_state_examination_mmse" int,
"uncontrolled_diabetes" bool,
"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,
"cornell_scale_for_depression_in_dementia_csdd" int,
"clinical_dementia_rating_cdr" float,
"age" float,
"NOUSE" float
) | SELECT * FROM table_train_80 WHERE mini_mental_state_examination_mmse >= 21 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mmse score > or equal to 21 ### Input: CREATE TABLE table_train_80 (
"id" int,
"mini_mental_state_examination_mmse" ... |
what is the four most frequent drugs that were prescribed in the same hospital encounter to the patients of age 30s since 5 years ago after having been diagnosed with s/p exploratory laparotomy. | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeou... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p exploratory... | Below are sql tables 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 four most frequent drugs that were prescribed in the same hospital encounter to the patients of age 30s since 5 ... |
what ground transportation is available at DENVER airport | CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_cod... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND ground_service.airport_code = airport.airport_code | Below are sql tables 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 ground transportation is available at DENVER airport ### Input: CREATE TABLE airline (
airline_code varchar,
ai... |
When the away team scored 9.8 (62) what was the crowd turnout? | CREATE TABLE table_53147 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Crowd" FROM table_53147 WHERE "Away team score" = '9.8 (62)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the away team scored 9.8 (62) what was the crowd turnout? ### Input: CREATE TABLE table_53147 (
"Home team" text,
... |
what is the number of patients whose marital status is married and admission year is less than 2198? | 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.marital_status = "MARRIED" AND demographic.admityear < "2198" | Below are sql tables 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 married and admission year is less than 2198? ### Input: CREATE TABLE... |
specify the gender and language of patient id 9271 | 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 demographic.gender, demographic.language FROM demographic WHERE demographic.subject_id = "9271" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the gender and language of patient id 9271 ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
... |
How many of the patients admitted before the year 2152 were divorsed? | 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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2152" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many of the patients admitted before the year 2152 were divorsed? ### Input: CREATE TABLE procedures (
subject_id te... |
How many documents are created in each day? Bin the document date by weekday and group by document type description with a stacked bar chart. | 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_Description VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEG... | 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 GROUP BY Document_Type_Description | Below are sql tables 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 documents are created in each day? Bin the document date by weekday and group by document type description with a s... |
In which lane did the swimmer with a time of 1:58.44 swim? | CREATE TABLE table_name_67 (
lane VARCHAR,
time VARCHAR
) | SELECT COUNT(lane) FROM table_name_67 WHERE time = "1:58.44" | Below are sql tables 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 which lane did the swimmer with a time of 1:58.44 swim? ### Input: CREATE TABLE table_name_67 (
lane VARCHAR,
tim... |
What are all Tamil months when the season in English is monsoon? | CREATE TABLE table_21668 (
"Season in Tamil" text,
"English Transliteration" text,
"English Translation" text,
"Season in Sanskrit" text,
"Season in English" text,
"Tamil Months" text,
"Gregorian Months" text
) | SELECT "Tamil Months" FROM table_21668 WHERE "Season in English" = 'Monsoon' | Below are sql tables 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 all Tamil months when the season in English is monsoon? ### Input: CREATE TABLE table_21668 (
"Season in Tamil"... |
How many bookings for each apartment number? Plot a bar chart, display y axis in asc order. | CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE View_Unit_Status ... | SELECT apt_number, COUNT(apt_number) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id GROUP BY apt_number ORDER BY COUNT(apt_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: How many bookings for each apartment number? Plot a bar chart, display y axis in asc order. ### Input: CREATE TABLE Apartmen... |
Which Rank has a Total larger than 30, and a Bronze of 14? | CREATE TABLE table_9297 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT AVG("Rank") FROM table_9297 WHERE "Total" > '30' AND "Bronze" = '14' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Rank has a Total larger than 30, and a Bronze of 14? ### Input: CREATE TABLE table_9297 (
"Rank" real,
"Nation... |
Which Record has a Score of 4 4, and Points of 17? | CREATE TABLE table_36671 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | SELECT "Record" FROM table_36671 WHERE "Score" = '4–4' AND "Points" = '17' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Record has a Score of 4 4, and Points of 17? ### Input: CREATE TABLE table_36671 (
"Date" text,
"Visitor" text... |
Return a bar chart on how many customers use each payment method?, and I want to rank x-axis from low to high order. | CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
supplier_phone VARCHAR(80)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Addresses (
address_id INTEGER,
address_deta... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY payment_method_code | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on how many customers use each payment method?, and I want to rank x-axis from low to high order. ### Inp... |
how many patients are admitted as newborn and are born before the year 2071? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2071" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are admitted as newborn and are born before the year 2071? ### Input: CREATE TABLE diagnoses (
subject... |
How many different results were there for the number of votes fro Obama in the county where he got 27.8% of the votes? | CREATE TABLE table_23676 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real,
"Total" real
) | SELECT COUNT("Obama#") FROM table_23676 WHERE "Obama%" = '27.8%' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different results were there for the number of votes fro Obama in the county where he got 27.8% of the votes? ### I... |
until 10/2104 when did patient 8005 last get a microbiology test? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-10' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 10/2104 when did patient 8005 last get a microbiology test? ### Input: CREATE TABLE microbiologyevents (
row_id nu... |
Please provide me with a list of classes being taught by Dr. Celia Cunningham next semester . | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE cour... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Celia Cunningham%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please provide me with a list of classes being taught by Dr. Celia Cunningham next semester . ### Input: CREATE TABLE requir... |
Find the number of classes in each department Visualize by bar chart, and list bars in descending order. | CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP... | SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of classes in each department Visualize by bar chart, and list bars in descending order. ### Input: CREATE T... |
tell me the length of stay of patient 012-18025's first stay at the icu. | 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 lab (
labid numbe... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-18025') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime 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: tell me the length of stay of patient 012-18025's first stay at the icu. ### Input: CREATE TABLE vitalperiodic (
vitalpe... |
In what year was Terry Johnson nominated for a Tony award? | CREATE TABLE table_name_63 (
year VARCHAR,
award VARCHAR,
nominee VARCHAR
) | SELECT COUNT(year) FROM table_name_63 WHERE award = "tony award" AND nominee = "terry johnson" | Below are sql tables 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 year was Terry Johnson nominated for a Tony award? ### Input: CREATE TABLE table_name_63 (
year VARCHAR,
awa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.