instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
how many patients are staying at careunit ccu until 4 years ago? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
chartt... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-4 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 patients are staying at careunit ccu until 4 years ago? ### Input: CREATE TABLE d_items (
row_id number,
it... |
What is the title written by David Mamet? | CREATE TABLE table_10908676_7 (
title VARCHAR,
written_by VARCHAR
) | SELECT title FROM table_10908676_7 WHERE written_by = "David Mamet" | Below are sql tables 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 title written by David Mamet? ### Input: CREATE TABLE table_10908676_7 (
title VARCHAR,
written_by VARCH... |
what is the least expensive way to fly from PHILADELPHIA to SAN FRANCISCO | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | Below are sql tables 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 expensive way to fly from PHILADELPHIA to SAN FRANCISCO ### Input: CREATE TABLE month (
month_number i... |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, and order by the Y-axis from high to low. | 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 NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) 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 those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about... |
what is the price of flights from INDIANAPOLIS to MEMPHIS | 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 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 = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_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 price of flights from INDIANAPOLIS to MEMPHIS ### Input: CREATE TABLE code_description (
code varchar,
d... |
What is the class AAA of the 1993-94 school year with a class AAAAA of Duncanville? | CREATE TABLE table_38479 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | SELECT "Class AAA" FROM table_38479 WHERE "Class AAAAA" = 'duncanville' AND "School Year" = '1993-94' | Below are sql tables 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 class AAA of the 1993-94 school year with a class AAAAA of Duncanville? ### Input: CREATE TABLE table_38479 (
... |
Prior to taking ROMLANG 250 what courses do I need to take ? | CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | 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: Prior to taking ROMLANG 250 what courses do I need to take ? ### Input: CREATE TABLE area (
course_id int,
area varc... |
Where is Dynamo-2 located? | CREATE TABLE table_57031 (
"Team" text,
"Location" text,
"Venue" text,
"League and position in 1991" text,
"Coach" text
) | SELECT "Location" FROM table_57031 WHERE "Team" = 'dynamo-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: Where is Dynamo-2 located? ### Input: CREATE TABLE table_57031 (
"Team" text,
"Location" text,
"Venue" text,
... |
Which courses did Dr. Rosa Angulo-barroso teach before ? | 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 WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | Below are sql tables 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 courses did Dr. Rosa Angulo-barroso teach before ? ### Input: CREATE TABLE requirement (
requirement_id int,
r... |
What is the highest win for the team Nacional? | CREATE TABLE table_19628 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | SELECT MAX("Wins") FROM table_19628 WHERE "Team" = 'Nacional' | Below are sql tables 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 win for the team Nacional? ### Input: CREATE TABLE table_19628 (
"Position" real,
"Team" text,
... |
what did patient 91768 receive for his or her first procedure until 2103? | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admis... | 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 = 91768) 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 did patient 91768 receive for his or her first procedure until 2103? ### Input: CREATE TABLE transfers (
row_id num... |
what was patient 002-56853's respiration minimum on the first intensive care unit visit? | 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 MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-56853') AND NOT patient.unitdischargetime IS N... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 002-56853's respiration minimum on the first intensive care unit visit? ### Input: CREATE TABLE lab (
l... |
For the airline ids with the top 10 most routes operated, what are their names? | CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
... | SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10 | Below are sql tables 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 airline ids with the top 10 most routes operated, what are their names? ### Input: CREATE TABLE airports (
apid ... |
how many days have pass since patient 11826 was admitted to the hospital? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime ti... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 11826 AND admissions.dischtime 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 days have pass since patient 11826 was admitted to the hospital? ### Input: CREATE TABLE d_labitems (
row_id nu... |
how many hours have passed since patient 25733 was admitted to the hospital for? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 25733 AND admissions.dischtime 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 passed since patient 25733 was admitted to the hospital for? ### Input: CREATE TABLE procedures_icd (
... |
What were the total number of field goals when there were 0 touchdowns and 2 extra points? | CREATE TABLE table_37757 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | SELECT COUNT("Field goals") FROM table_37757 WHERE "Touchdowns" = '0' AND "Extra points" = '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 were the total number of field goals when there were 0 touchdowns and 2 extra points? ### Input: CREATE TABLE table_377... |
calculate the number of patients who had received a sedative - lorazepam procedure until 2104. | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'sedative - lorazepam' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') | Below are sql tables 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 number of patients who had received a sedative - lorazepam procedure until 2104. ### Input: CREATE TABLE vital... |
What are the nationalities and the taotal ages of journalists. Visualize by a bar chart. | 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 int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality | Below are sql tables 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 nationalities and the taotal ages of journalists. Visualize by a bar chart. ### Input: CREATE TABLE news_report... |
in how many olympic games did imma clopes compete ? | CREATE TABLE table_204_503 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | SELECT COUNT(*) FROM table_204_503 WHERE "competition" = 'olympic games' | Below are sql tables 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 how many olympic games did imma clopes compete ? ### Input: CREATE TABLE table_204_503 (
id number,
"year" number... |
City vs Tag by Rep. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE LOWER(Location) LIKE LOWER('%##cityname##%') AND t.TagName ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: City vs Tag by Rep. ### Input: CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE ... |
Return a bar chart on what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. | CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
) | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country | Below are sql tables 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 what are the countries of perpetrators? Show each country and the corresponding number of perpetrators... |
What is the departure for Peterborough East whose arrival time is 12.40? | CREATE TABLE table_22269 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
) | SELECT "Departure" FROM table_22269 WHERE "Going to" = 'Peterborough East' AND "Arrival" = '12.40' | Below are sql tables 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 departure for Peterborough East whose arrival time is 12.40? ### Input: CREATE TABLE table_22269 (
"Departur... |
What is Canada's score? | CREATE TABLE table_name_81 (
score VARCHAR,
country VARCHAR
) | SELECT score FROM table_name_81 WHERE country = "canada" | Below are sql tables 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 Canada's score? ### Input: CREATE TABLE table_name_81 (
score VARCHAR,
country VARCHAR
) ### Response: SELEC... |
What is the smallest pick number for McGill? | CREATE TABLE table_21321804_5 (
pick__number INTEGER,
college VARCHAR
) | SELECT MIN(pick__number) FROM table_21321804_5 WHERE college = "McGill" | Below are sql tables 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 pick number for McGill? ### Input: CREATE TABLE table_21321804_5 (
pick__number INTEGER,
colleg... |
indicate the daily maximum volume of pacu out pacu urine that patient 21134 has had since 512 days ago. | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE proced... | 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 = 21134)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pac... | Below are sql tables 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 maximum volume of pacu out pacu urine that patient 21134 has had since 512 days ago. ### Input: CREATE TA... |
on the current icu visit, when was the last time that patient 021-111547 had a respiration measured? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547') AND patient.unitdischargetime IS NULL)... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on the current icu visit, when was the last time that patient 021-111547 had a respiration measured? ### Input: CREATE TABLE... |
find out the number of patients with admission location as transfer from hosp/extram who were admitted before the year 2165. | 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 WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2165" | Below are sql tables 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 out the number of patients with admission location as transfer from hosp/extram who were admitted before the year 2165.... |
When is the winner olympiacos, the venue is georgios karaiskakis stadium and the runner-up is iraklis? | CREATE TABLE table_50530 (
"Year" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Venue" text
) | SELECT "Year" FROM table_50530 WHERE "Winner" = 'olympiacos' AND "Venue" = 'georgios karaiskakis stadium' AND "Runner-up" = 'iraklis' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When is the winner olympiacos, the venue is georgios karaiskakis stadium and the runner-up is iraklis? ### Input: CREATE TAB... |
give me the five most common output events during this year? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY outputevents.itemid) AS... | Below are sql tables 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 five most common output events during this year? ### Input: CREATE TABLE diagnoses_icd (
row_id number,
... |
How old is each student and how many students are each age? | CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | SELECT age, COUNT(*) FROM student GROUP BY 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: How old is each student and how many students are each age? ### Input: CREATE TABLE student (
stuid number,
lname te... |
A bar chart about what are the title and maximum price of each film?, display by the price from low to high. | CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cine... | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) | Below are sql tables 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 title and maximum price of each film?, display by the price from low to high. ### Input: CREA... |
What round had a record of 8-2? | CREATE TABLE table_43821 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | SELECT "Round" FROM table_43821 WHERE "Record" = '8-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 round had a record of 8-2? ### Input: CREATE TABLE table_43821 (
"Res." text,
"Record" text,
"Opponent" tex... |
Which title placed in rank 7? | CREATE TABLE table_47048 (
"Rank" real,
"Title" text,
"Studio" text,
"Director(s)" text,
"Worldwide Gross" text
) | SELECT "Title" FROM table_47048 WHERE "Rank" = '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: Which title placed in rank 7? ### Input: CREATE TABLE table_47048 (
"Rank" real,
"Title" text,
"Studio" text,
... |
What is the score of the game with a tie no of 6? | CREATE TABLE table_name_21 (
score VARCHAR,
tie_no VARCHAR
) | SELECT score FROM table_name_21 WHERE tie_no = "6" | Below are sql tables 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 the game with a tie no of 6? ### Input: CREATE TABLE table_name_21 (
score VARCHAR,
tie_no VARC... |
Return the average price for each product type by a pie chart. | CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(10),
product_name VARCHAR(80),
product_price DECIMAL(19,4)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_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 the average price for each product type by a pie chart. ### Input: CREATE TABLE Order_Items (
order_item_id INTEG... |
What was the method of the bout lasting 4:15? | CREATE TABLE table_name_82 (
method VARCHAR,
time VARCHAR
) | SELECT method FROM table_name_82 WHERE time = "4:15" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the method of the bout lasting 4:15? ### Input: CREATE TABLE table_name_82 (
method VARCHAR,
time VARCHAR
)... |
serum creatinine = 2 mg / dl in male and > 1.8 mg / dl in female | CREATE TABLE table_train_217 (
"id" int,
"gender" string,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"hematocrit_hct" float,
"insulin_requirement" float,
"serum_creatinine" float,
"NOUSE" float
) | SELECT * FROM table_train_217 WHERE (serum_creatinine = 2 AND gender = 'male') OR (serum_creatinine > 1.8 AND gender = 'female') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: serum creatinine = 2 mg / dl in male and > 1.8 mg / dl in female ### Input: CREATE TABLE table_train_217 (
"id" int,
... |
what's patient 74392's minimum value of bilirubin, direct? | 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 MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74392) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, direct') | Below are sql tables 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 patient 74392's minimum value of bilirubin, direct? ### Input: CREATE TABLE patients (
row_id number,
subject... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of employee_id over hire_date, display by the x axis from low to high. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) 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 do not work in departments with managers that have ids between 100 and 200, a line chart shows the c... |
What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'? | CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosom... | SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX' | Below are sql tables 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 medicine and trade names that cannot interact with the enzyme with the product 'Heme'? ### Input: CREATE TABLE ... |
how much difference does patient 9619 have in arterial bp [diastolic] 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 d_icd_procedures (
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 TABL... | 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 = 9619) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... | Below are sql tables 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 difference does patient 9619 have in arterial bp [diastolic] last measured on the first intensive care unit visit c... |
what is average age of patients whose admission type is emergency and year of birth is greater than 1821? | 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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "1821" | Below are sql tables 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 average age of patients whose admission type is emergency and year of birth is greater than 1821? ### Input: CREATE ... |
How many share values are listed for the episode with a rating/share value of 2.6/8? | CREATE TABLE table_17525955_2 (
share VARCHAR,
rating VARCHAR
) | SELECT COUNT(share) FROM table_17525955_2 WHERE rating / SHARE(18 AS –49) = 2.6 / 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 share values are listed for the episode with a rating/share value of 2.6/8? ### Input: CREATE TABLE table_17525955_... |
what is the number of patients whose age is less than 54 and diagnoses icd9 code is 7470? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "54" AND diagnoses.icd9_code = "7470" | Below are sql tables 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 age is less than 54 and diagnoses icd9 code is 7470? ### Input: CREATE TABLE lab (
... |
What are next Winter 's special topics classes ? | CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... | Below are sql tables 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 next Winter 's special topics classes ? ### Input: CREATE TABLE jobs (
job_id int,
job_title varchar,
d... |
give me patient 74523's yearly maximum pt until 4 years ago. | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime ti... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74523) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-4 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: give me patient 74523's yearly maximum pt until 4 years ago. ### Input: CREATE TABLE d_labitems (
row_id number,
ite... |
Calculate the average age of patients belonging to White-Russian ethnicity who were admitted in or after the year 2144 | 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 AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear >= "2144" | Below are sql tables 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 average age of patients belonging to White-Russian ethnicity who were admitted in or after the year 2144 ### I... |
show me the number of hispanic or latino ethnic background patients who had calculated total co2 lab test. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.label = "Calculated Total CO2" | Below are sql tables 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 number of hispanic or latino ethnic background patients who had calculated total co2 lab test. ### Input: CREATE... |
What season did Stoke City win? | CREATE TABLE table_62257 (
"Season" text,
"Date" text,
"Winner" text,
"Loser" text,
"Score" text,
"Venue" text,
"Attendance" text
) | SELECT "Season" FROM table_62257 WHERE "Winner" = 'stoke 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: What season did Stoke City win? ### Input: CREATE TABLE table_62257 (
"Season" text,
"Date" text,
"Winner" text,... |
What was the miles (km) for the race that had an average speed of 136.117 MPH? | CREATE TABLE table_24849 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | SELECT "Miles (km)" FROM table_24849 WHERE "Average Speed (mph)" = '136.117' | Below are sql tables 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 miles (km) for the race that had an average speed of 136.117 MPH? ### Input: CREATE TABLE table_24849 (
"Ye... |
give the number of patients diagnosed with ulcer of heel and midfoot and drug type is base. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ulcer of heel & midfoot" AND prescriptions.drug_type = "BASE" | Below are sql tables 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 diagnosed with ulcer of heel and midfoot and drug type is base. ### Input: CREATE TABLE lab (
... |
Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart. | CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_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: Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart. ### ... |
how many times does patient 17667 have a bicarbonate test? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667) | Below are sql tables 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 does patient 17667 have a bicarbonate test? ### Input: CREATE TABLE d_icd_procedures (
row_id number,
... |
how many patients in 2105 had an intake of neocate 24? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT 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 = 'neocate 24' AND 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: how many patients in 2105 had an intake of neocate 24? ### Input: CREATE TABLE cost (
row_id number,
subject_id numb... |
Stacked bar of class and the number of class colored by Rank, and display in asc by the x axis please. | CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Stacked bar of class and the number of class colored by Rank, and display in asc by the x axis please. ### Input: CREATE TAB... |
Count the number of urgent hospital admission patients who had the exteriorization of small intestine procedure. | 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.admission_type = "URGENT" AND procedures.short_title = "Sm bowel exteriorization" | Below are sql tables 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 urgent hospital admission patients who had the exteriorization of small intestine procedure. ### Input: ... |
What is the average value of ERP W in Beardstown, Illinois for a frequency greater than 93.5? | CREATE TABLE table_39397 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | SELECT AVG("ERP W") FROM table_39397 WHERE "City of license" = 'beardstown, illinois' AND "Frequency MHz" > '93.5' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average value of ERP W in Beardstown, Illinois for a frequency greater than 93.5? ### Input: CREATE TABLE table_... |
How many documents correspond with each project id? | CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details tex... | SELECT project_id, COUNT(*) FROM documents GROUP BY project_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: How many documents correspond with each project id? ### Input: CREATE TABLE documents (
document_id number,
document... |
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT JOB_ID, AVG(EMPLOYEE_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, a bar chart shows the distribution of job_id and the average of employe... |
What was the score on February 9? | CREATE TABLE table_name_84 (
score VARCHAR,
date VARCHAR
) | SELECT score FROM table_name_84 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: What was the score on February 9? ### Input: CREATE TABLE table_name_84 (
score VARCHAR,
date VARCHAR
) ### Response... |
count the number of patients whose ethnicity is white - russian and admission year is less than 2148? | 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 WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2148" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose ethnicity is white - russian and admission year is less than 2148? ### Input: CREATE TABL... |
how many patients are diagnosed for ulcer of heel and midfoot with drug route tp? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Ulcer of heel and midfoot" AND prescriptions.route = "TP" | Below are sql tables 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 diagnosed for ulcer of heel and midfoot with drug route tp? ### Input: CREATE TABLE diagnoses (
su... |
What is Opponent, when Attendance is 58,836? | CREATE TABLE table_49308 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | SELECT "Opponent" FROM table_49308 WHERE "Attendance" = '58,836' | Below are sql tables 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 Opponent, when Attendance is 58,836? ### Input: CREATE TABLE table_49308 (
"Week" real,
"Date" text,
"Op... |
when did patient 12181 receive the last intake on the first icu visit? | CREATE TABLE procedures_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 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 = 12181) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) ORDER BY inputeven... | Below are sql tables 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 12181 receive the last intake on the first icu visit? ### Input: CREATE TABLE procedures_icd (
row_id n... |
Visualize a bar chart for what are the total enrollments of universities of each affiliation type? | 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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation | Below are sql tables 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 are the total enrollments of universities of each affiliation type? ### Input: CREATE TABLE u... |
What is To Par, when Country is 'United States', when Place is 'T4', and when Score is '71-68=139'? | CREATE TABLE table_8832 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "To par" FROM table_8832 WHERE "Country" = 'united states' AND "Place" = 't4' AND "Score" = '71-68=139' | Below are sql tables 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 To Par, when Country is 'United States', when Place is 'T4', and when Score is '71-68=139'? ### Input: CREATE TABLE ... |
When Efrain Valdez was pitching, what was the highest home run? | CREATE TABLE table_75217 (
"Home Run" real,
"Game" real,
"Date" text,
"Inning" text,
"Location" text,
"Opposing Pitcher" text,
"Team" text
) | SELECT MAX("Home Run") FROM table_75217 WHERE "Opposing Pitcher" = 'efrain valdez' | Below are sql tables 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 Efrain Valdez was pitching, what was the highest home run? ### Input: CREATE TABLE table_75217 (
"Home Run" real,
... |
what is patient 17638's first ward on the last hospital visit? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17638 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime 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: what is patient 17638's first ward on the last hospital visit? ### Input: CREATE TABLE cost (
row_id number,
subject... |
What player(s) drafted by the hamilton tiger-cats? | CREATE TABLE table_23586 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | SELECT "Player" FROM table_23586 WHERE "CFL Team" = 'Hamilton Tiger-Cats' | Below are sql tables 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 player(s) drafted by the hamilton tiger-cats? ### Input: CREATE TABLE table_23586 (
"Pick #" real,
"CFL Team" t... |
mention the number of patients below 68 years of age have procedure icd9 code 4573. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "68" AND procedures.icd9_code = "4573" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mention the number of patients below 68 years of age have procedure icd9 code 4573. ### Input: CREATE TABLE diagnoses (
... |
For those employees who do not work in departments with managers that have ids between 100 and 200, find job_id and employee_id , and visualize them by 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_I... | SELECT JOB_ID, EMPLOYEE_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, find job_id and employee... |
Find the name of rooms booked by some customers whose first name contains ROY, and count them by a bar chart, list by the Y-axis in descending. | CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) 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 name of rooms booked by some customers whose first name contains ROY, and count them by a bar chart, list by the Y-... |
provide the number of patients admitted in hospital before the year 2133 who have lab test item id 51132. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2133" AND lab.itemid = "51132" | Below are sql tables 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 admitted in hospital before the year 2133 who have lab test item id 51132. ### Input: CREATE ... |
Show the names and ids of tourist attractions that are visited at least two times Visualize by bar chart, and I want to show in ascending by the X. | CREATE TABLE Hotels (
hotel_id INTEGER,
star_rating_code CHAR(15),
pets_allowed_yn CHAR(1),
price_range real,
other_hotel_details VARCHAR(255)
)
CREATE TABLE Tourist_Attraction_Features (
Tourist_Attraction_ID INTEGER,
Feature_ID INTEGER
)
CREATE TABLE Royal_Family (
Royal_Family_ID IN... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.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: Show the names and ids of tourist attractions that are visited at least two times Visualize by bar chart, and I want to show... |
Please list the countries and years of film market estimations. | CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | SELECT T2.country, T1.year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_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: Please list the countries and years of film market estimations. ### Input: CREATE TABLE film (
film_id number,
title... |
What was Robin's score when she was eliminated? | CREATE TABLE table_21234111_10 (
robin VARCHAR,
result VARCHAR
) | SELECT robin FROM table_21234111_10 WHERE result = "Eliminated" | Below are sql tables 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 Robin's score when she was eliminated? ### Input: CREATE TABLE table_21234111_10 (
robin VARCHAR,
result VA... |
What opponent has a record of 6-9? | CREATE TABLE table_name_27 (
opponent VARCHAR,
record VARCHAR
) | SELECT opponent FROM table_name_27 WHERE record = "6-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: What opponent has a record of 6-9? ### Input: CREATE TABLE table_name_27 (
opponent VARCHAR,
record VARCHAR
) ### Re... |
have patient 14836 had a hematocrit test in 2105? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid num... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14836) AND STRFTIME('%y', labevents.charttime) = '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: have patient 14836 had a hematocrit test in 2105? ### Input: CREATE TABLE d_items (
row_id number,
itemid number,
... |
Show the transaction types and the total amount of transactions with a bar chart. | CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Or... | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the transaction types and the total amount of transactions with a bar chart. ### Input: CREATE TABLE Financial_Transact... |
flight information from OAKLAND to DENVER | 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 TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | 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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flight information from OAKLAND to DENVER ### Input: CREATE TABLE restriction (
restriction_code text,
advance_purch... |
How many games did they play on february 5? | CREATE TABLE table_23308178_8 (
opponent VARCHAR,
date VARCHAR
) | SELECT opponent FROM table_23308178_8 WHERE date = "February 5" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games did they play on february 5? ### Input: CREATE TABLE table_23308178_8 (
opponent VARCHAR,
date VARCHA... |
what is admission type and procedure short title of subject id 18372? | 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 demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18372" | Below are sql tables 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 admission type and procedure short title of subject id 18372? ### Input: CREATE TABLE demographic (
subject_id t... |
For exams , does Prof. Firas Shalabi always set one ? | CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time... | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For exams , does Prof. Firas Shalabi always set one ? ### Input: CREATE TABLE semester (
semester_id int,
semester v... |
How many product # have episode 1? | CREATE TABLE table_25528 (
"Episode #" real,
"Prod #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text
) | SELECT MAX("Prod #") FROM table_25528 WHERE "Episode #" = '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many product # have episode 1? ### Input: CREATE TABLE table_25528 (
"Episode #" real,
"Prod #" real,
"Title... |
What date did season 12 premiere? | CREATE TABLE table_2655016_4 (
original_air_date VARCHAR,
season__number VARCHAR
) | SELECT original_air_date FROM table_2655016_4 WHERE season__number = 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 date did season 12 premiere? ### Input: CREATE TABLE table_2655016_4 (
original_air_date VARCHAR,
season__numbe... |
count the number of patients whose diagnoses short title is seroma complicting proc? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Seroma complicting proc" | Below are sql tables 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 short title is seroma complicting proc? ### Input: CREATE TABLE demographic (
... |
which country has the largest amount of total medals ? | CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | SELECT "nation" FROM table_204_775 ORDER BY "total" DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which country has the largest amount of total medals ? ### Input: CREATE TABLE table_204_775 (
id number,
"rank" num... |
Give the minimum product price for each product type in a bar chart. | CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
total_value_purchased DECIMA... | SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_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: Give the minimum product price for each product type in a bar chart. ### Input: CREATE TABLE Order_Items (
order_item_id... |
What is the latitude and longitude for Surveyor 3? | CREATE TABLE table_42976 (
"U.S. mission" text,
"Mass (kg)" real,
"Booster" text,
"Launched" text,
"Mission goal" text,
"Landing zone" text,
"Lat / Lon" text
) | SELECT "Lat / Lon" FROM table_42976 WHERE "U.S. mission" = 'surveyor 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 latitude and longitude for Surveyor 3? ### Input: CREATE TABLE table_42976 (
"U.S. mission" text,
"Mass ... |
What was the result for the nomination of Best Revival of a Musical? | CREATE TABLE table_name_90 (
result VARCHAR,
category VARCHAR
) | SELECT result FROM table_name_90 WHERE category = "best revival of a musical" | Below are sql tables 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 the nomination of Best Revival of a Musical? ### Input: CREATE TABLE table_name_90 (
result VARC... |
What is the home team of the game on April 20? | CREATE TABLE table_58267 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Series" text
) | SELECT "Home" FROM table_58267 WHERE "Date" = 'april 20' | Below are sql tables 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 home team of the game on April 20? ### Input: CREATE TABLE table_58267 (
"Date" text,
"Visitor" text,
... |
what is the number of government health insurance patients who had biopsy of tonsils and adenoids procedure? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic 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: what is the number of government health insurance patients who had biopsy of tonsils and adenoids procedure? ### Input: CREA... |
until 1 year ago what was the three most frequently given procedure for patients 40s? | 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 microbiologyevents (
row_id number,
subject_id number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | Below are sql tables 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 1 year ago what was the three most frequently given procedure for patients 40s? ### Input: CREATE TABLE icustays (
... |
What is the maximum basketball game? | CREATE TABLE table_27715173_2 (
game INTEGER
) | SELECT MAX(game) FROM table_27715173_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 maximum basketball game? ### Input: CREATE TABLE table_27715173_2 (
game INTEGER
) ### Response: SELECT MAX(... |
Which production won the drama desk award as well as the category of outstanding sound design? | CREATE TABLE table_11941 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | SELECT "Result" FROM table_11941 WHERE "Award" = 'drama desk award' AND "Category" = 'outstanding sound design' | Below are sql tables 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 production won the drama desk award as well as the category of outstanding sound design? ### Input: CREATE TABLE table... |
WHAT IS THE HOME TEAM WITH A TIE NUMBER OF 7? | CREATE TABLE table_name_52 (
home_team VARCHAR,
tie_no VARCHAR
) | SELECT home_team FROM table_name_52 WHERE tie_no = "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: WHAT IS THE HOME TEAM WITH A TIE NUMBER OF 7? ### Input: CREATE TABLE table_name_52 (
home_team VARCHAR,
tie_no VARC... |
count the number of patients whose diagnoses icd9 code is 28860 and drug route is ih? | 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.icd9_code = "28860" AND prescriptions.route = "IH" | Below are sql tables 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 28860 and drug route is ih? ### Input: CREATE TABLE demographic (
... |
how many patients whose ethnicity is american indian/alaska native and procedure short title is aortocor bypas-3 cor art? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Aortocor bypas-3 cor art" | Below are sql tables 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 ethnicity is american indian/alaska native and procedure short title is aortocor bypas-3 cor art? ##... |
What builder has lot number 30702? | CREATE TABLE table_69990 (
"Lot No." real,
"Diagram" real,
"Built" text,
"Builder" text,
"Fleet numbers" text
) | SELECT "Builder" FROM table_69990 WHERE "Lot No." = '30702' | Below are sql tables 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 builder has lot number 30702? ### Input: CREATE TABLE table_69990 (
"Lot No." real,
"Diagram" real,
"Built"... |
what is the total when bronze is 0 and the nation is hungary? | CREATE TABLE table_46553 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MAX("Total") FROM table_46553 WHERE "Bronze" = '0' AND "Nation" = 'hungary' | Below are sql tables 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 when bronze is 0 and the nation is hungary? ### Input: CREATE TABLE table_46553 (
"Rank" text,
"Na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.