instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What is the score for the game played on January 25? | CREATE TABLE table_21454 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "Score" FROM table_21454 WHERE "Date" = 'January 25' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for the game played on January 25? ### Input: CREATE TABLE table_21454 (
"Game" real,
"Date" text,... |
What is the name of the Home team that played Fitzroy as the Away team? | CREATE TABLE table_name_53 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team FROM table_name_53 WHERE away_team = "fitzroy" | Below are sql tables 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 name of the Home team that played Fitzroy as the Away team? ### Input: CREATE TABLE table_name_53 (
home_tea... |
What is the home team score when the away team was fitzroy? | CREATE TABLE table_name_93 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team AS score FROM table_name_93 WHERE away_team = "fitzroy" | Below are sql tables 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 score when the away team was fitzroy? ### Input: CREATE TABLE table_name_93 (
home_team VARCHAR,
... |
Who was the GT2 Winning Team if Greg Mansell Leo Mansell was the LMP1 Winning Team? | CREATE TABLE table_24865763_2 (
gt2_winning_team VARCHAR,
lmp1_winning_team VARCHAR
) | SELECT gt2_winning_team FROM table_24865763_2 WHERE lmp1_winning_team = "Greg Mansell Leo Mansell" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the GT2 Winning Team if Greg Mansell Leo Mansell was the LMP1 Winning Team? ### Input: CREATE TABLE table_24865763_2... |
count the number of drugs a month before patient 012-63986 was prescribed. | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63986')) AND DATETIME(medication.drugstarttime, 'start of month') = DATETI... | Below are sql tables 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 drugs a month before patient 012-63986 was prescribed. ### Input: CREATE TABLE treatment (
treatment... |
TOP Haskell users in Oregon. | CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAc... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.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: TOP Haskell users in Oregon. ### Input: CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStat... |
On what date was the score 6 4, 7 5? | CREATE TABLE table_name_69 (
date VARCHAR,
score VARCHAR
) | SELECT date FROM table_name_69 WHERE score = "6–4, 7–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: On what date was the score 6 4, 7 5? ### Input: CREATE TABLE table_name_69 (
date VARCHAR,
score VARCHAR
) ### Respo... |
Show the smallest enrollment of each state using a bar chart, order in ascending by the X-axis. | CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
) | SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY state | Below are sql tables 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 smallest enrollment of each state using a bar chart, order in ascending by the X-axis. ### Input: CREATE TABLE Tryo... |
provide the number of patients whose death status is 1 and diagnoses short title is proteus infection nos? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Proteus infection NOS" | Below are sql tables 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 death status is 1 and diagnoses short title is proteus infection nos? ### Input: CREATE... |
when did the last time patient 025-51835 had a orthopedics consultation performed when they visited the hospital first time? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid ... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51835' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did the last time patient 025-51835 had a orthopedics consultation performed when they visited the hospital first time?... |
which representative was the earliest to take office ? | CREATE TABLE table_203_16 (
id number,
"name" text,
"took office" text,
"left office" text,
"party" text,
"district residence" text,
"notes" text
) | SELECT "name" FROM table_203_16 ORDER BY "took office" 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 representative was the earliest to take office ? ### Input: CREATE TABLE table_203_16 (
id number,
"name" text... |
What is Acquisition via, when Season is 2006-2012? | CREATE TABLE table_name_50 (
acquisition_via VARCHAR,
season VARCHAR
) | SELECT acquisition_via FROM table_name_50 WHERE season = "2006-2012" | Below are sql tables 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 Acquisition via, when Season is 2006-2012? ### Input: CREATE TABLE table_name_50 (
acquisition_via VARCHAR,
... |
Who lost on May 31? | CREATE TABLE table_79781 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Loss" FROM table_79781 WHERE "Date" = 'may 31' | Below are sql tables 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 lost on May 31? ### Input: CREATE TABLE table_79781 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss"... |
What was their record on Wed. Dec. 5, when they played in Boston Garden? | CREATE TABLE table_47345 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | SELECT "Record" FROM table_47345 WHERE "Location" = 'boston garden' AND "Date" = 'wed. dec. 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 was their record on Wed. Dec. 5, when they played in Boston Garden? ### Input: CREATE TABLE table_47345 (
"Game" re... |
For those employees who do not work in departments with managers that have ids between 100 and 200, what is the relationship between salary and department_id ? | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT SALARY, 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, what is the relationship... |
Which one is easier , EECS 557 or EECS 250 ? | 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.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 557 OR course.number = 250) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | Below are sql tables 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 one is easier , EECS 557 or EECS 250 ? ### Input: CREATE TABLE requirement (
requirement_id int,
requirement v... |
Return a bar chart on how many classes are held in each department?, list bars in descending order. | CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE EN... | 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: Return a bar chart on how many classes are held in each department?, list bars in descending order. ### Input: CREATE TABLE ... |
How many on the list are called the Austrian Grand Prix? | CREATE TABLE table_1132568_3 (
rd VARCHAR,
grand_prix VARCHAR
) | SELECT COUNT(rd) FROM table_1132568_3 WHERE grand_prix = "Austrian 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: How many on the list are called the Austrian Grand Prix? ### Input: CREATE TABLE table_1132568_3 (
rd VARCHAR,
grand... |
what is minimum days of hospital stay of patients whose ethnicity is black/haitian? | 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 MIN(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum days of hospital stay of patients whose ethnicity is black/haitian? ### Input: CREATE TABLE demographic (
... |
count the number of patients whose age is less than 79 and lab test fluid is pleural? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "79" AND lab.fluid = "Pleural" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose age is less than 79 and lab test fluid is pleural? ### Input: CREATE TABLE prescriptions ... |
for icd9 code 3891, specify the procedural short title. | 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 procedures.short_title FROM procedures WHERE procedures.icd9_code = "3891" | Below are sql tables 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 icd9 code 3891, specify the procedural short title. ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id... |
Top Android Users in Myanmar. | CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.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: Top Android Users in Myanmar. ### Input: CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... |
what is the primary disease and drug name of the patient marilyn norvell? | 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 demographic.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell" | Below are sql tables 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 primary disease and drug name of the patient marilyn norvell? ### Input: CREATE TABLE diagnoses (
subject_id... |
Give me a histogram to show the ordered list of customer ids? | CREATE TABLE Services (
Service_ID INTEGER,
Service_name VARCHAR(40)
)
CREATE TABLE First_Notification_of_Loss (
FNOL_ID INTEGER,
Customer_ID INTEGER,
Policy_ID INTEGER,
Service_ID INTEGER
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Effective_Date DATE,
... | SELECT Customer_name, Customer_ID FROM Customers ORDER BY Customer_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a histogram to show the ordered list of customer ids? ### Input: CREATE TABLE Services (
Service_ID INTEGER,
... |
What is the name of the competition that ended with a score of 2-1? | CREATE TABLE table_56365 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | SELECT "Competition" FROM table_56365 WHERE "Score" = '2-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 name of the competition that ended with a score of 2-1? ### Input: CREATE TABLE table_56365 (
"Date" text,
... |
Find the status of orders which belong to the customer named 'Jeramie', group by order status, and show the proportion of order status with a pie chart. | CREATE TABLE Shipment_Items (
shipment_id INTEGER,
order_item_id INTEGER
)
CREATE TABLE Products (
product_id INTEGER,
product_name VARCHAR(80),
product_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
product_id INTEGER,
order_id INTEGER,
order_item_status ... | SELECT T2.order_status, COUNT(T2.order_status) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" GROUP BY order_status | Below are sql tables 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 status of orders which belong to the customer named 'Jeramie', group by order status, and show the proportion of or... |
Tell me the total number of top 25 for wins less than 1 and cuts made of 22 | CREATE TABLE table_74502 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT COUNT("Top-25") FROM table_74502 WHERE "Cuts made" = '22' AND "Wins" < '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 total number of top 25 for wins less than 1 and cuts made of 22 ### Input: CREATE TABLE table_74502 (
"Tourn... |
on 12/24/2105 the arterial bp [systolic] of patient 12775 had been normal? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | SELECT COUNT(*) > 0 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 = 12775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... | Below are sql tables 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 12/24/2105 the arterial bp [systolic] of patient 12775 had been normal? ### Input: CREATE TABLE d_items (
row_id numb... |
Which Country has a Player of jodie mudd? | CREATE TABLE table_name_62 (
country VARCHAR,
player VARCHAR
) | SELECT country FROM table_name_62 WHERE player = "jodie mudd" | Below are sql tables 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 a Player of jodie mudd? ### Input: CREATE TABLE table_name_62 (
country VARCHAR,
player VARCHAR
) ... |
can you tell me what flights you have from BALTIMORE to DALLAS | CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop... | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: can you tell me what flights you have from BALTIMORE to DALLAS ### Input: CREATE TABLE class_of_service (
booking_class ... |
until 1 year ago, patient 003-39724 had any allergies? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-39724')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-1 y... | Below are sql tables 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, patient 003-39724 had any allergies? ### Input: CREATE TABLE lab (
labid number,
patientunitstayid... |
how many days has passed since patient 76332 had a pt laboratory test for the first time on their current hospital encounter? | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332 AND admissions.disch... | Below are sql tables 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 passed since patient 76332 had a pt laboratory test for the first time on their current hospital encounter... |
what is the percentile of 39.0 in a laboratory test of total co2 with the same age as patient 002-31956 in the first hospital visit? | 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 treatment (
treat... | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'total co2' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '002-31956' AND NOT pat... | Below are sql tables 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 percentile of 39.0 in a laboratory test of total co2 with the same age as patient 002-31956 in the first hospita... |
What is the number of 400 -level classes that are being offered for Spring and Summer term ? | 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 COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.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 number of 400 -level classes that are being offered for Spring and Summer term ? ### Input: CREATE TABLE course_... |
When the away team is Geelong, what is the highest crowd count? | CREATE TABLE table_56471 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT MAX("Crowd") FROM table_56471 WHERE "Away team" = 'geelong' | Below are sql tables 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 is Geelong, what is the highest crowd count? ### Input: CREATE TABLE table_56471 (
"Home team" text,
... |
Tell me the position for round less than 3 | CREATE TABLE table_name_1 (
position VARCHAR,
round INTEGER
) | SELECT position FROM table_name_1 WHERE round < 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: Tell me the position for round less than 3 ### Input: CREATE TABLE table_name_1 (
position VARCHAR,
round INTEGER
) ... |
what was the name of the drug patient 25696 was prescribed for during the same hospital visit after having undergone a cont inv mec ven <96 hrs procedure in 03/last year? | 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 t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 25696 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the drug patient 25696 was prescribed for during the same hospital visit after having undergone a cont ... |
Visualize a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute All_Home, and I want to sort from high to low by the Y. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road 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: Visualize a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute All_Home, and I want to sort f... |
A bar chart about the average of maximum score of wines each year, bin the year into the weekday interval, and I want to show in descending by the total number. | CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT Year, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score)) 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 about the average of maximum score of wines each year, bin the year into the weekday interval, and I want to sho... |
show me flights from DALLAS to PITTSBURGH | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | 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 = 'DALLAS' 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: show me flights from DALLAS to PITTSBURGH ### Input: CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
... |
Show first name and id for all customers with at least 2 accounts. Show bar chart. | CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
produ... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_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 first name and id for all customers with at least 2 accounts. Show bar chart. ### Input: CREATE TABLE Invoices (
in... |
Name the most game for record 4-0 | CREATE TABLE table_22815259_1 (
game INTEGER,
record VARCHAR
) | SELECT MAX(game) FROM table_22815259_1 WHERE record = "4-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: Name the most game for record 4-0 ### Input: CREATE TABLE table_22815259_1 (
game INTEGER,
record VARCHAR
) ### Resp... |
Visualize the average experience working length of journalists working on different role type using a pie chart. | 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 int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_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: Visualize the average experience working length of journalists working on different role type using a pie chart. ### Input: ... |
What is Name, when Best is 1:15.673? | CREATE TABLE table_name_44 (
name VARCHAR,
best VARCHAR
) | SELECT name FROM table_name_44 WHERE best = "1:15.673" | Below are sql tables 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 Name, when Best is 1:15.673? ### Input: CREATE TABLE table_name_44 (
name VARCHAR,
best VARCHAR
) ### Respon... |
Top queries related to Bootstrap. | CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Pos... | SELECT t.TagName, COUNT(*) AS count FROM Posts AS p, PostTags AS pt, Tags AS t, PostTags AS ptjs WHERE pt.PostId = p.Id AND pt.TagId = t.Id AND pt.PostId = ptjs.PostId AND ptjs.TagId = (SELECT Id FROM Tags WHERE LOWER(TagName) = 'd3.js') GROUP BY t.TagName 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: Top queries related to Bootstrap. ### Input: CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description t... |
How many characteristics does the product named 'sesame' have? | CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic_value text
)
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE ref_characteristic_types (
characteristic_type_code text,
characteristic_type_description... | SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame" | Below are sql tables 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 characteristics does the product named 'sesame' have? ### Input: CREATE TABLE product_characteristics (
product... |
For those records from the products and each product's manufacturer, find founder and the average of price , and group by attribute founder, and visualize them by a bar chart, and could you rank by the Founder in asc? | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, find founder and the average of price , and group by at... |
A bar chart for what are the number of the countries of all airlines whose names start with Orbit?, could you order names from low to high order? | CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varchar(3),
icao character varchar(4)
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER 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: A bar chart for what are the number of the countries of all airlines whose names start with Orbit?, could you order names fr... |
Give me a histogram to show the date and the amount for all the payments processed with Visa, order y axis in descending order. | CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amoun... | SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Amount_Payment 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: Give me a histogram to show the date and the amount for all the payments processed with Visa, order y axis in descending ord... |
when did the last test of patient 016-19343 happen in their last hospital visit? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-19343' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | Below are sql tables 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 last test of patient 016-19343 happen in their last hospital visit? ### Input: CREATE TABLE microlab (
micr... |
what were the three most frequent diagnoses for the patients of 40s since 6 years ago? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
r... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | Below are sql tables 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 three most frequent diagnoses for the patients of 40s since 6 years ago? ### Input: CREATE TABLE microbiologye... |
A bar chart about how many wines are there for each grape?, rank by the bars from high to low. | CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No... | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape 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 about how many wines are there for each grape?, rank by the bars from high to low. ### Input: CREATE TABLE wine ... |
during this month patient 15794 had been prescribed d5w? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND prescriptions.drug = 'd5w' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during this month patient 15794 had been prescribed d5w? ### Input: CREATE TABLE procedures_icd (
row_id number,
sub... |
indicate the daily minimum volume of nephrostomy that patient 007-7646 has had since 142 days ago. | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-7646')) AND intakeoutput.celllabel = 'nephro... | Below are sql tables 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 minimum volume of nephrostomy that patient 007-7646 has had since 142 days ago. ### Input: CREATE TABLE m... |
how many districts are there in this city ? | 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: how many districts are there in this city ? ### Input: CREATE TABLE table_204_739 (
id number,
"districts" text,
... |
What period of time has EEB 800 been available ? | 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 ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 800 AND semester.semester_id = course_offering.semester ORDER BY semester.year 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 period of time has EEB 800 been available ? ### Input: CREATE TABLE student_record (
student_id int,
course_id ... |
what drug was prescribed to patient 69761 within 2 days after the circumcision procedure since 16 months ago? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 69761 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | Below are sql tables 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 drug was prescribed to patient 69761 within 2 days after the circumcision procedure since 16 months ago? ### Input: CRE... |
list the ids of patients who were diagnosed with pressure ulcer,stage iii until 2 years ago. | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABL... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pressure ulcer,stage iii') AND DATETIME(diagnoses_icd.charttime) <= DATETI... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the ids of patients who were diagnosed with pressure ulcer,stage iii until 2 years ago. ### Input: CREATE TABLE chartev... |
What did Essendon score when they were the away team? | CREATE TABLE table_52929 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_52929 WHERE "Away team" = 'essendon' | Below are sql tables 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 Essendon score when they were the away team? ### Input: CREATE TABLE table_52929 (
"Home team" text,
"Home ... |
What is Circuit, when Series is ASTC Round 4? | CREATE TABLE table_44750 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | SELECT "Circuit" FROM table_44750 WHERE "Series" = 'astc round 4' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Circuit, when Series is ASTC Round 4? ### Input: CREATE TABLE table_44750 (
"Date" text,
"Series" text,
... |
who are the candidates where the district is florida 8? | CREATE TABLE table_1341672_10 (
candidates VARCHAR,
district VARCHAR
) | SELECT candidates FROM table_1341672_10 WHERE district = "Florida 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: who are the candidates where the district is florida 8? ### Input: CREATE TABLE table_1341672_10 (
candidates VARCHAR,
... |
Show the number of transaction types. | CREATE TABLE Financial_Transactions (
transaction_type VARCHAR
) | SELECT COUNT(DISTINCT transaction_type) FROM Financial_Transactions | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of transaction types. ### Input: CREATE TABLE Financial_Transactions (
transaction_type VARCHAR
) ### Re... |
provide the number of patients whose item id is 50801 and lab test abnormal status is delta? | 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 lab.itemid = "50801" AND lab.flag = "delta" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose item id is 50801 and lab test abnormal status is delta? ### Input: CREATE TABLE procedu... |
Show the number of customer address history in each month and bin date to by month interval with a bar chart, could you list from high to low by the Y? | CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(15),
customer_number VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
customer_email VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
product_type_cod... | SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id ORDER BY COUNT(date_to) 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 the number of customer address history in each month and bin date to by month interval with a bar chart, could you list... |
what are the five most frequent events in the output until 2102? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
pati... | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 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 are the five most frequent events in the output until 2102? ### Input: CREATE TABLE allergy (
allergyid number,
... |
please show me the return flights from MIAMI to NEW YORK | CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt ... | 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 = 'MIAMI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK... | Below are sql tables 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 show me the return flights from MIAMI to NEW YORK ### Input: CREATE TABLE dual_carrier (
main_airline varchar,
... |
how is patient 027-124213 first admitted to the hospital the previous year? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '027-124213' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime 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: how is patient 027-124213 first admitted to the hospital the previous year? ### Input: CREATE TABLE allergy (
allergyid ... |
what flights from DALLAS to HOUSTON on sunday | CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name 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 = 'HOUSTON' AND date_day.day_number = 27 AND date_day.month_number = 8 AND d... | Below are sql tables 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 flights from DALLAS to HOUSTON on sunday ### Input: CREATE TABLE food_service (
meal_code text,
meal_number int... |
has there been a abscess microbiology test performed in their first hospital encounter on patient 025-28600? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has there been a abscess microbiology test performed in their first hospital encounter on patient 025-28600? ### Input: CREA... |
During footscray's home game, how much did the away team score? | CREATE TABLE table_10973 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_10973 WHERE "Home team" = 'footscray' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: During footscray's home game, how much did the away team score? ### Input: CREATE TABLE table_10973 (
"Home team" text,
... |
What office is Jon Huntsman a candidate for? | CREATE TABLE table_20246201_9 (
office VARCHAR,
candidate VARCHAR
) | SELECT office FROM table_20246201_9 WHERE candidate = "Jon Huntsman" | Below are sql tables 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 office is Jon Huntsman a candidate for? ### Input: CREATE TABLE table_20246201_9 (
office VARCHAR,
candidate VA... |
list all flights from DENVER to SAN FRANCISCO on wednesday afternoon | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fa... | 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 (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all flights from DENVER to SAN FRANCISCO on wednesday afternoon ### Input: CREATE TABLE airport_service (
city_code... |
how many hours has it been since the last hpt c w/o hepat coma nos diagnosis for patient 9964 on the current hospital visit? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE c... | SELECT 24 * (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 = 'hpt c w/o hepat coma nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM ad... | Below are sql tables 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 has it been since the last hpt c w/o hepat coma nos diagnosis for patient 9964 on the current hospital visit?... |
What player has defensive back as the position, with a round less than 2? | CREATE TABLE table_79059 (
"Player" text,
"Round" real,
"Pick" real,
"Position" text,
"NFL Club" text
) | SELECT "Player" FROM table_79059 WHERE "Position" = 'defensive back' AND "Round" < '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 player has defensive back as the position, with a round less than 2? ### Input: CREATE TABLE table_79059 (
"Player"... |
For Spring or Summer 2019 , hardware courses are available ? | 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 instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREA... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw... | Below are sql tables 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 Spring or Summer 2019 , hardware courses are available ? ### Input: CREATE TABLE student_record (
student_id int,
... |
What incumbent was first elected in 2009? | CREATE TABLE table_23279 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | SELECT "Incumbent" FROM table_23279 WHERE "First elected" = '2009' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What incumbent was first elected in 2009? ### Input: CREATE TABLE table_23279 (
"District" text,
"Incumbent" text,
... |
What player was place of t1 in To Par and had a score of 70-73-69=212? | CREATE TABLE table_80397 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | SELECT "To par" FROM table_80397 WHERE "Place" = 't1' AND "Score" = '70-73-69=212' | Below are sql tables 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 was place of t1 in To Par and had a score of 70-73-69=212? ### Input: CREATE TABLE table_80397 (
"Place" tex... |
Draw a pie chart for how many patients do each physician take care of? List their names and number of patients they take care of. | CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE TABLE Prescribes (
Physician INTEGER,
... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a pie chart for how many patients do each physician take care of? List their names and number of patients they take car... |
what is the number of patients whose religion is episcopalian and lab test name is 24 hr protein? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "EPISCOPALIAN" AND lab.label = "24 hr Protein" | Below are sql tables 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 religion is episcopalian and lab test name is 24 hr protein? ### Input: CREATE TABLE di... |
Create a bar chart showing the number of meter 200 across meter 200, and display x-axis from high to low order. | CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a bar chart showing the number of meter 200 across meter 200, and display x-axis from high to low order. ### Input: C... |
Which Tournament has a 2007 of 19 4? | CREATE TABLE table_75960 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text,
"Win %" text
) | SELECT "Tournament" FROM table_75960 WHERE "2007" = '19–4' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Tournament has a 2007 of 19 4? ### Input: CREATE TABLE table_75960 (
"Tournament" text,
"2005" text,
"2006... |
how many patients are admitted in the year before 2194 and with results as abnormal status in the 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2194" AND lab.flag = "abnormal" | Below are sql tables 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 in the year before 2194 and with results as abnormal status in the lab test? ### Input: CREAT... |
was there any microbiological test results for patient 14611's sputum until 08/2104? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime ti... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14611) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-08' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was there any microbiological test results for patient 14611's sputum until 08/2104? ### Input: CREATE TABLE d_labitems (
... |
Return the date of birth for all the guests with gender code 'Male'. | CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE apartment_bookings (
apt_booking... | SELECT date_of_birth FROM guests WHERE gender_code = "Male" | Below are sql tables 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 date of birth for all the guests with gender code 'Male'. ### Input: CREATE TABLE apartment_facilities (
apt_... |
Tell me the sum of evening gown for average of 9.06 and swimsuit less than 8.76 | CREATE TABLE table_name_53 (
evening_gown INTEGER,
average VARCHAR,
swimsuit VARCHAR
) | SELECT SUM(evening_gown) FROM table_name_53 WHERE average = 9.06 AND swimsuit < 8.76 | Below are sql tables 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 sum of evening gown for average of 9.06 and swimsuit less than 8.76 ### Input: CREATE TABLE table_name_53 (
... |
Show all the activity names and the number of faculty involved in each activity. Show bar chart. | CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the activity names and the number of faculty involved in each activity. Show bar chart. ### Input: CREATE TABLE Par... |
count the number of patients whose age is less than 79 and lab test fluid is joint fluid? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "79" AND lab.fluid = "Joint Fluid" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose age is less than 79 and lab test fluid is joint fluid? ### Input: CREATE TABLE prescripti... |
calculate the number of icu visits patient 029-8212 has. | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-8212') | Below are sql tables 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 icu visits patient 029-8212 has. ### Input: CREATE TABLE intakeoutput (
intakeoutputid number,
... |
What is every conflict in Iraq? | CREATE TABLE table_22889 (
"Start of conflict" real,
"End of conflict" text,
"Conflict" text,
"Continent" text,
"Location" text,
"Branches involved" text
) | SELECT "Conflict" FROM table_22889 WHERE "Location" = 'Iraq' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every conflict in Iraq? ### Input: CREATE TABLE table_22889 (
"Start of conflict" real,
"End of conflict" te... |
Plot the number of result by grouped by result as a bar graph, and show by the y axis in ascending please. | CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
ID int,
Musi... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot the number of result by grouped by result as a bar graph, and show by the y axis in ascending please. ### Input: CREATE... |
give me the number of patients whose diagnoses long title is fever presenting with conditions classified elsewhere and lab test category is chemistry? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Fever presenting with conditions classified elsewhere" AND lab."CATEGORY" = "Chemistry" | Below are sql tables 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 diagnoses long title is fever presenting with conditions classified elsewhere and lab t... |
count the number of patients whose primary disease is hemopytsis and drug type is base? | 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.diagnosis = "HEMOPYTSIS" 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: count the number of patients whose primary disease is hemopytsis and drug type is base? ### Input: CREATE TABLE demographic ... |
What is every total for the University of the Cordilleras UC Dance Squad? | CREATE TABLE table_21995420_6 (
total VARCHAR,
school VARCHAR
) | SELECT total FROM table_21995420_6 WHERE school = "University of the Cordilleras UC Dance Squad" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every total for the University of the Cordilleras UC Dance Squad? ### Input: CREATE TABLE table_21995420_6 (
tot... |
On Mondays and Wednesdays is it possible to take 522 ? | CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semest... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND 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: On Mondays and Wednesdays is it possible to take 522 ? ### Input: CREATE TABLE jobs (
job_id int,
job_title varchar,... |
What was the result for Pennsylvania 8? | CREATE TABLE table_2668401_12 (
result VARCHAR,
district VARCHAR
) | SELECT result FROM table_2668401_12 WHERE district = "Pennsylvania 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 was the result for Pennsylvania 8? ### Input: CREATE TABLE table_2668401_12 (
result VARCHAR,
district VARCHAR
... |
what was the five most frequently taken test during a year before for patients with age 50s? | 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 t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the five most frequently taken test during a year before for patients with age 50s? ### Input: CREATE TABLE patient... |
Which opponent has a record of 6-2? | CREATE TABLE table_21091127_1 (
opponent VARCHAR,
record VARCHAR
) | SELECT opponent FROM table_21091127_1 WHERE record = "6-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: Which opponent has a record of 6-2? ### Input: CREATE TABLE table_21091127_1 (
opponent VARCHAR,
record VARCHAR
) ##... |
count the number of patients whose age is less than 56 and lab test category is hematology? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "56" 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 age is less than 56 and lab test category is hematology? ### Input: CREATE TABLE procedur... |
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, find job_id and the average of employee_id , and group by attribute job_id, and visualize them by a bar chart, I want to display from low to high by the y axis. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
show me the number of white ethnic background patients who have the diagnoses of portal hypertension. | 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.ethnicity = "WHITE" AND diagnoses.short_title = "Portal hypertension" | Below are sql tables 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 white ethnic background patients who have the diagnoses of portal hypertension. ### Input: CREATE TABL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.