instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
who is the team 2 when the 2nd leg is 3-4? | CREATE TABLE table_53844 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | SELECT "Team 2" FROM table_53844 WHERE "2nd leg" = '3-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: who is the team 2 when the 2nd leg is 3-4? ### Input: CREATE TABLE table_53844 (
"Team 1" text,
"Agg." text,
"Te... |
Between 10:00 and 2:00 is there any section of JAZZ 471 offered ? | CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '2:00' AND course_offering.start_time >= '10:00' AND course.course_id = course_offering.course_id AND course.department = 'JAZZ' AND course.number... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Between 10:00 and 2:00 is there any section of JAZZ 471 offered ? ### Input: CREATE TABLE program_requirement (
program_... |
Show names of musicals and the number of actors who have appeared in the musicals by a pie chart. | CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show names of musicals and the number of actors who have appeared in the musicals by a pie chart. ### Input: CREATE TABLE mu... |
could you please give me a one way fare from PITTSBURGH to ATLANTA | 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,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name ... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.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: could you please give me a one way fare from PITTSBURGH to ATLANTA ### Input: CREATE TABLE fare (
fare_id int,
from_... |
what is the number of patients who died in or before 2122 and with drug code pred5sm? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "PRED5SM" | Below are sql tables 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 who died in or before 2122 and with drug code pred5sm? ### Input: CREATE TABLE procedures (
... |
Which January has a Game of 50? | CREATE TABLE table_5376 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | SELECT AVG("January") FROM table_5376 WHERE "Game" = '50' | Below are sql tables 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 January has a Game of 50? ### Input: CREATE TABLE table_5376 (
"Game" real,
"January" real,
"Opponent" tex... |
What day had 37,500 attending? | CREATE TABLE table_74708 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | SELECT "Date" FROM table_74708 WHERE "Attendance" = '37,500' | Below are sql tables 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 day had 37,500 attending? ### Input: CREATE TABLE table_74708 (
"Week" real,
"Date" text,
"Opponent" text,
... |
How many government insurance patients had an incision of aorta procedure? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Incision of aorta" | Below are sql tables 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 government insurance patients had an incision of aorta procedure? ### Input: CREATE TABLE procedures (
subject_... |
311 class has a lab ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_l... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 311 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: 311 class has a lab ? ### Input: CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
... |
what was the number of times patient 025-44842 visited the hospital? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '025-44842' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the number of times patient 025-44842 visited the hospital? ### Input: CREATE TABLE diagnosis (
diagnosisid num... |
provide the number of patients whose admission location is transfer from hosp/extram and discharge location is disch-tran to psych hosp? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" | Below are sql tables 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 admission location is transfer from hosp/extram and discharge location is disch-tran to... |
How many distinct allergies are there? | CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) | SELECT COUNT(DISTINCT allergytype) FROM allergy_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: How many distinct allergies are there? ### Input: CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TA... |
how much is the minimum total hospital cost that includes s/p surgical repair of fracture - spine since 2104? | 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 patient (
... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p surgical repair of fracture - spine')) A... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much is the minimum total hospital cost that includes s/p surgical repair of fracture - spine since 2104? ### Input: CRE... |
List the number of games in each season with a line chart. | CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE sta... | SELECT Season, COUNT(Season) FROM game GROUP BY Season | Below are sql tables 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 number of games in each season with a line chart. ### Input: CREATE TABLE injury_accident (
game_id int,
id... |
CAAS 438 is offered at what morning times ? | CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admi... | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CAAS' AND cou... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: CAAS 438 is offered at what morning times ? ### Input: CREATE TABLE program (
program_id int,
name varchar,
coll... |
Visualize a bar chart for what are the ids and names of the medicine that can interact with two or more enzymes? | CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.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: Visualize a bar chart for what are the ids and names of the medicine that can interact with two or more enzymes? ### Input: ... |
How many students taking a course who received an A or C? Group by students' first name with a bar chart, and display in desc by the total number. | 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 DE... | SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME) 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: How many students taking a course who received an A or C? Group by students' first name with a bar chart, and display in des... |
give me the number of patients whose age is less than 72 and diagnoses icd9 code is v1006? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "72" AND diagnoses.icd9_code = "V1006" | Below are sql tables 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 age is less than 72 and diagnoses icd9 code is v1006? ### Input: CREATE TABLE procedure... |
tell me the maximum total cost of a hospital that contains pregnancy since 2104? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pregnancy')) AND STRFTIME('%y', cost.charget... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the maximum total cost of a hospital that contains pregnancy since 2104? ### Input: CREATE TABLE diagnosis (
dia... |
What is every entry for passed when NO votes is 312187? | CREATE TABLE table_3354 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
) | SELECT "passed" FROM table_3354 WHERE "NO votes" = '312187' | Below are sql tables 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 entry for passed when NO votes is 312187? ### Input: CREATE TABLE table_3354 (
"meas. num." real,
"pas... |
how many UA flights are there to SAN FRANCISCO | CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO' AND flight.airline_code = 'UA' AND flight.to_airport = airport_service.airport_code | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many UA flights are there to SAN FRANCISCO ### Input: CREATE TABLE airport (
airport_code varchar,
airport_name ... |
What is the lowest silver that has 1 for the bronze, 1 as the total, 17 as the rank, with a gold less than 0? | CREATE TABLE table_64832 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Silver") FROM table_64832 WHERE "Bronze" = '1' AND "Total" = '1' AND "Rank" = '17' AND "Gold" < '0' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest silver that has 1 for the bronze, 1 as the total, 17 as the rank, with a gold less than 0? ### Input: CRE... |
how many patients whose diagnoses short title is epistaxis and drug route is ng? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Epistaxis" AND prescriptions.route = "NG" | Below are sql tables 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 diagnoses short title is epistaxis and drug route is ng? ### Input: CREATE TABLE prescriptions (
... |
Show all allergy types and the number of allergies in each type. Plot them as bar chart. | CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType | Below are sql tables 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 allergy types and the number of allergies in each type. Plot them as bar chart. ### Input: CREATE TABLE Has_Allergy... |
Can undergraduates do 285 ? | CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 285 | Below are sql tables 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 undergraduates do 285 ? ### Input: CREATE TABLE course (
course_id int,
name varchar,
department varchar,
... |
What is the number of tries for that has 30 tries against? | CREATE TABLE table_name_74 (
tries_for VARCHAR,
tries_against VARCHAR
) | SELECT tries_for FROM table_name_74 WHERE tries_against = "30" | Below are sql tables 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 tries for that has 30 tries against? ### Input: CREATE TABLE table_name_74 (
tries_for VARCHAR,
... |
What is the Surface of the match with a Score of 2 6, 6 4, 7 6? | CREATE TABLE table_61218 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | SELECT "Surface" FROM table_61218 WHERE "Score" = '2–6, 6–4, 7–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 Surface of the match with a Score of 2 6, 6 4, 7 6? ### Input: CREATE TABLE table_61218 (
"Outcome" text,
... |
when for the first time until 31 months ago was patient 26922 prescribed d5w and furosemide at the same time? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
cha... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'd5w' AND admissions.subject_id = 26922 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-31 month')) AS t1 JOIN (... | Below are sql tables 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 for the first time until 31 months ago was patient 26922 prescribed d5w and furosemide at the same time? ### Input: CRE... |
what were the top four most commonly prescribed medications that patients were prescribed within 2 months after being diagnosed the last year with epilep nos w/o intr epil? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inpute... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | Below are sql tables 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 top four most commonly prescribed medications that patients were prescribed within 2 months after being diagno... |
Why did the manager who departed on August 1, 2008 leave? | CREATE TABLE table_name_84 (
reason_of_departure VARCHAR,
date_outgoing VARCHAR
) | SELECT reason_of_departure FROM table_name_84 WHERE date_outgoing = "august 1, 2008" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Why did the manager who departed on August 1, 2008 leave? ### Input: CREATE TABLE table_name_84 (
reason_of_departure VA... |
count the number of patients whose diagnoses short title is pressure ulcer, hip and drug type is base? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pressure ulcer, hip" 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 diagnoses short title is pressure ulcer, hip and drug type is base? ### Input: CREATE TAB... |
give me the number of patients whose diagnoses short title is epistaxis and lab test category is chemistry? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Epistaxis" 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 short title is epistaxis and lab test category is chemistry? ### Input: CREAT... |
Find All_Home and Team_ID , and group by attribute ACC_Home, and visualize them by a bar chart, and list in desc by the bars. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home 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 All_Home and Team_ID , and group by attribute ACC_Home, and visualize them by a bar chart, and list in desc by the bars... |
Return a bar chart showing how many customers whose contact channel code is email for each year, show by the Y-axis in desc. | CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
address_type VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
product_details VARCHAR(255)
)
CREATE TABLE Customer_Contact_Channels (
customer_id IN... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date) 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 showing how many customers whose contact channel code is email for each year, show by the Y-axis in desc.... |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and commission_pct in a bar chart, and sort by the Y-axis in descending. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT 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, show me about the distri... |
how many patients are admitted under the elective type were tested for ascites in lab? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Ascites" | Below are sql tables 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 under the elective type were tested for ascites in lab? ### Input: CREATE TABLE procedures (
... |
Visualize a bar chart for what are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?, show by the City_Population in ascending. | CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store_product (
Store_ID int,
Product_ID int
)
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE store (
Store_ID ... | SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population | Below are sql tables 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 district names and city populations for all districts that between 200,000 and 2,000,... |
what is the average base price of different bed type? List bed type and average base price, order by the bedType in desc. | 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 bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType 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: what is the average base price of different bed type? List bed type and average base price, order by the bedType in desc. ##... |
Give me the number of patients who were prescribed cyanocobalamin and died in or before 2155. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2155.0" AND prescriptions.drug = "Cyanocobalamin" | Below are sql tables 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 who were prescribed cyanocobalamin and died in or before 2155. ### Input: CREATE TABLE diagno... |
What is the average time with a rank lower than 2 for Andy Turner? | CREATE TABLE table_66096 (
"Rank" real,
"Heat" real,
"Name" text,
"Nationality" text,
"Time" real
) | SELECT AVG("Time") FROM table_66096 WHERE "Rank" > '2' AND "Name" = 'andy turner' | Below are sql tables 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 time with a rank lower than 2 for Andy Turner? ### Input: CREATE TABLE table_66096 (
"Rank" real,
... |
retrieve the time of patient 003-10438's hospial admission. | 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 intakeoutput (
in... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '003-10438' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: retrieve the time of patient 003-10438's hospial admission. ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid numb... |
what number of patients who died in or before the year 2138 were diagnosed with acute on chronic systolic heart failure? | 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.dod_year <= "2138.0" AND diagnoses.long_title = "Acute on chronic systolic heart failure" | Below are sql tables 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 number of patients who died in or before the year 2138 were diagnosed with acute on chronic systolic heart failure? ###... |
what is primary disease and diagnoses short title of subject id 85673? | 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 demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "85673" | Below are sql tables 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 primary disease and diagnoses short title of subject id 85673? ### Input: CREATE TABLE procedures (
subject_id t... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday by a bar chart, sort how many hire date in ascending order. | 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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(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, give me the comparison a... |
is the phosphate value of patient 027-165214 last measured on the current hospital visit greater than the value of the patient first measured on the current hospital visit? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'phos... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the phosphate value of patient 027-165214 last measured on the current hospital visit greater than the value of the patie... |
what is days of hospital stay and death status of subject name michael tyndall? | 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.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Michael Tyndall" | Below are sql tables 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 days of hospital stay and death status of subject name michael tyndall? ### Input: CREATE TABLE diagnoses (
subj... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and manufacturer , and group by attribute founder, and rank by the X in descending. | 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name 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 records from the products and each product's manufacturer, return a bar chart about the distribution of name and m... |
What Sustainable Cities courses , if any , will satisfy the PreMajor requirement ? | CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Sustainable Cities%' OR course.description LIKE '%Sustainable Cities%' OR course.name LIKE '%Sus... | Below are sql tables 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 Sustainable Cities courses , if any , will satisfy the PreMajor requirement ? ### Input: CREATE TABLE student_record (
... |
Show the stars of each director by a bar chart, and could you order stars in asc order? | CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY stars | Below are sql tables 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 stars of each director by a bar chart, and could you order stars in asc order? ### Input: CREATE TABLE Rating (
... |
i mean what was the first arterial bp mean for patient 16066 on 01/09/last year? | 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | 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 = 16066)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i mean what was the first arterial bp mean for patient 16066 on 01/09/last year? ### Input: CREATE TABLE chartevents (
r... |
what was the five most common specimen test that was given this year? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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,
... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t... | Below are sql tables 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 common specimen test that was given this year? ### Input: CREATE TABLE diagnoses_icd (
row_id num... |
tell me the drug that was prescribed to patient 6580 for the last time through the po route since 04/2105? | 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 prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6580) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-04' ORDER BY prescriptions.startdate 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: tell me the drug that was prescribed to patient 6580 for the last time through the po route since 04/2105? ### Input: CREATE... |
Top 100 StackOverflow users from South Africa. Displays a list of the the 100 StackOverflow users in South Africa | CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId n... | SELECT Id, DisplayName AS "display_name", Reputation, WebsiteUrl AS Website, Location FROM Users WHERE Location LIKE '%South Africa%' ORDER BY Reputation DESC LIMIT 100 | Below are sql tables 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 100 StackOverflow users from South Africa. Displays a list of the the 100 StackOverflow users in South Africa ### Input:... |
What is the overall pick average with the pick # lower than 15? | CREATE TABLE table_69557 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | SELECT AVG("Overall") FROM table_69557 WHERE "Pick #" < '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 is the overall pick average with the pick # lower than 15? ### Input: CREATE TABLE table_69557 (
"Round" real,
... |
what is the round when the college is north carolina and the overall is more than 124? | CREATE TABLE table_46491 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | SELECT SUM("Round") FROM table_46491 WHERE "College" = 'north carolina' AND "Overall" > '124' | Below are sql tables 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 round when the college is north carolina and the overall is more than 124? ### Input: CREATE TABLE table_46491 (... |
Name the tournament for march 25, 2012 | CREATE TABLE table_67239 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | SELECT "Tournament" FROM table_67239 WHERE "Date" = 'march 25, 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: Name the tournament for march 25, 2012 ### Input: CREATE TABLE table_67239 (
"Outcome" text,
"Date" text,
"Tourn... |
What was the location and attendance for the game after game 36 against Atlanta? | CREATE TABLE table_8007 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "Location Attendance" FROM table_8007 WHERE "Game" > '36' AND "Team" = 'atlanta' | Below are sql tables 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 location and attendance for the game after game 36 against Atlanta? ### Input: CREATE TABLE table_8007 (
"G... |
what partner made the scores 6 4, 6 1? | CREATE TABLE table_name_19 (
partner VARCHAR,
score_in_the_final VARCHAR
) | SELECT partner FROM table_name_19 WHERE score_in_the_final = "6–4, 6–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 partner made the scores 6 4, 6 1? ### Input: CREATE TABLE table_name_19 (
partner VARCHAR,
score_in_the_final V... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, could you order x axis in desc order? | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
systolic blood pressure > 180 mm hg or diastolic blood pressure > 100 mm hg | CREATE TABLE table_train_161 (
"id" int,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"c_peptide_level" float,
"diastolic_blood_pressure_dbp" int,
"heart_rate" int,
"glycosylated_hemoglobin" float,
"NOUSE" float
) | SELECT * FROM table_train_161 WHERE systolic_blood_pressure_sbp > 180 OR diastolic_blood_pressure_dbp > 100 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: systolic blood pressure > 180 mm hg or diastolic blood pressure > 100 mm hg ### Input: CREATE TABLE table_train_161 (
"i... |
What are names of 5 -credit courses ? | 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 offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | SELECT DISTINCT name, number FROM course WHERE credits = 5 AND department = 'EECS' | Below are sql tables 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 names of 5 -credit courses ? ### Input: CREATE TABLE student_record (
student_id int,
course_id int,
se... |
A bar chart about how many hosts does each nationality have? List the nationality and the count, and order by the names from high to low. | CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality 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 hosts does each nationality have? List the nationality and the count, and order by the names from... |
What is the average Total with a Bronze that is larger than 1? | CREATE TABLE table_42345 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT AVG("Total") FROM table_42345 WHERE "Bronze" > '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Total with a Bronze that is larger than 1? ### Input: CREATE TABLE table_42345 (
"Rank" real,
"N... |
What are the name and population of each county? | CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | SELECT county_name, population FROM county | Below are sql tables 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 name and population of each county? ### Input: CREATE TABLE county (
county_id number,
county_name text... |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and display by the Y-axis in desc please. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and t... |
What college received Pick 5? | CREATE TABLE table_42744 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | SELECT "College" FROM table_42744 WHERE "Pick" = '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 college received Pick 5? ### Input: CREATE TABLE table_42744 (
"Pick" real,
"Player" text,
"Country of orig... |
What was the attendance on May 26? | CREATE TABLE table_name_90 (
attendance VARCHAR,
date VARCHAR
) | SELECT attendance FROM table_name_90 WHERE date = "may 26" | Below are sql tables 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 attendance on May 26? ### Input: CREATE TABLE table_name_90 (
attendance VARCHAR,
date VARCHAR
) ### Re... |
give me the top four of the most common output events? | 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 d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | 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 GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 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: give me the top four of the most common output events? ### Input: CREATE TABLE icustays (
row_id number,
subject_id ... |
Plot the average of age by grouped by class as a bar graph | 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, AVG(age) FROM captain GROUP 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: Plot the average of age by grouped by class as a bar graph ### Input: CREATE TABLE Ship (
Ship_ID int,
Name text,
... |
find out the minimum age of black/cape verdean ethnic background patients who stayed in the hospital for 10 days. | 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 MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay = "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: find out the minimum age of black/cape verdean ethnic background patients who stayed in the hospital for 10 days. ### Input:... |
What's the report of the race won by Michael Andretti, with Nigel Mansell driving the fastest lap? | CREATE TABLE table_19908651_3 (
report VARCHAR,
winning_driver VARCHAR,
fastest_lap VARCHAR
) | SELECT report FROM table_19908651_3 WHERE winning_driver = "Michael Andretti" AND fastest_lap = "Nigel 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: What's the report of the race won by Michael Andretti, with Nigel Mansell driving the fastest lap? ### Input: CREATE TABLE t... |
how many patients whose year of death is less than or equal to 2165 and item id is 51053? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.itemid = "51053" | Below are sql tables 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 year of death is less than or equal to 2165 and item id is 51053? ### Input: CREATE TABLE demographi... |
How many of the patients with item id 51478 belonged to hispanic or latino/puertorican ethnic origin? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "51478" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many of the patients with item id 51478 belonged to hispanic or latino/puertorican ethnic origin? ### Input: CREATE TABL... |
indicate the monthly maximum volume of chesttube total that patient 015-23047 has had since 04/29/2104. | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.celllabel = 'chest... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the monthly maximum volume of chesttube total that patient 015-23047 has had since 04/29/2104. ### Input: CREATE TA... |
List all those first elected in the California 22 voting district. | CREATE TABLE table_1342149_6 (
first_elected VARCHAR,
district VARCHAR
) | SELECT first_elected FROM table_1342149_6 WHERE district = "California 22" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all those first elected in the California 22 voting district. ### Input: CREATE TABLE table_1342149_6 (
first_elect... |
What town has the population of 777? | CREATE TABLE table_73826 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT "Cyrillic Name Other Names" FROM table_73826 WHERE "Population (2011)" = '777' | Below are sql tables 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 town has the population of 777? ### Input: CREATE TABLE table_73826 (
"Settlement" text,
"Cyrillic Name Other N... |
You can return a bar chart with employees' first names and their salaries, display by the Y in ascending. | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varc... | SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: You can return a bar chart with employees' first names and their salaries, display by the Y in ascending. ### Input: CREATE ... |
get me the number of patients with *lit language who had creatine kinase, mb isoenzyme lab test. | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "*LIT" AND lab.label = "Creatine Kinase, MB Isoenzyme" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the number of patients with *lit language who had creatine kinase, mb isoenzyme lab test. ### Input: CREATE TABLE pre... |
What was the number of draws when the Elche CF club played 38 and had a goal difference of -16? | CREATE TABLE table_69343 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | SELECT MIN("Draws") FROM table_69343 WHERE "Goal Difference" > '-16' AND "Club" = 'elche cf' AND "Played" > '38' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the number of draws when the Elche CF club played 38 and had a goal difference of -16? ### Input: CREATE TABLE tabl... |
What is the most number of cuts made that had more than 7 events played and more than 2 top-25s? | CREATE TABLE table_name_18 (
cuts_made INTEGER,
events VARCHAR,
top_25 VARCHAR
) | SELECT MAX(cuts_made) FROM table_name_18 WHERE events = 7 AND top_25 > 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 most number of cuts made that had more than 7 events played and more than 2 top-25s? ### Input: CREATE TABLE tab... |
What is College, when Pick is 20? | CREATE TABLE table_44767 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | SELECT "College" FROM table_44767 WHERE "Pick" = '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 College, when Pick is 20? ### Input: CREATE TABLE table_44767 (
"Round" real,
"Pick" real,
"Overall" rea... |
when was the last time that patient 005-76912 since 481 days ago had the maximum respiration value. | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | 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 = '005-76912')) AND NOT vitalperiodic.respiration 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: when was the last time that patient 005-76912 since 481 days ago had the maximum respiration value. ### Input: CREATE TABLE ... |
what was the last time patient 21003 had the minimum level of creatinine in 09/this year? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21003) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR... | Below are sql tables 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 last time patient 21003 had the minimum level of creatinine in 09/this year? ### Input: CREATE TABLE outputeven... |
Find the captain rank that has some captains in both Cutter and Armed schooner classes. | CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
) | SELECT rank FROM captain WHERE class = 'Cutter' INTERSECT SELECT rank FROM captain WHERE class = 'Armed schooner' | Below are sql tables 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 captain rank that has some captains in both Cutter and Armed schooner classes. ### Input: CREATE TABLE captain (
... |
which team had top attendance through 2005 ? | CREATE TABLE table_204_55 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | SELECT "opponent#" FROM table_204_55 ORDER BY "attendance" 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 team had top attendance through 2005 ? ### Input: CREATE TABLE table_204_55 (
id number,
"date" text,
"tim... |
What was the crowd size at Arden Street Oval? | CREATE TABLE table_name_51 (
crowd VARCHAR,
venue VARCHAR
) | SELECT crowd FROM table_name_51 WHERE venue = "arden street oval" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the crowd size at Arden Street Oval? ### Input: CREATE TABLE table_name_51 (
crowd VARCHAR,
venue VARCHAR
)... |
during the current hospital visit, what was the average bicarbonate value for patient 4401? | 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 AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') | Below are sql tables 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 the current hospital visit, what was the average bicarbonate value for patient 4401? ### Input: CREATE TABLE admissio... |
what is maximum days of hospital stay of patients whose year of birth is greater than 2053? | 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 MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2053" | Below are sql tables 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 maximum days of hospital stay of patients whose year of birth is greater than 2053? ### Input: CREATE TABLE diagnose... |
What's the attendance for the game held on January 2, 2005? | CREATE TABLE table_name_28 (
attendance VARCHAR,
date VARCHAR
) | SELECT attendance FROM table_name_28 WHERE date = "january 2, 2005" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the attendance for the game held on January 2, 2005? ### Input: CREATE TABLE table_name_28 (
attendance VARCHAR,
... |
Show the names of countries and the average speed of roller coasters from each country Plot them as bar chart, and sort in asc by the bars. | CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
) | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name 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 of countries and the average speed of roller coasters from each country Plot them as bar chart, and sort in a... |
show me flights from DENVER to ATLANTA | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA... | Below are sql tables 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 DENVER to ATLANTA ### Input: CREATE TABLE city (
city_code varchar,
city_name varchar,
stat... |
What is the Finish of the Player with a Total of 273? | CREATE TABLE table_12442 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | SELECT "Finish" FROM table_12442 WHERE "Total" = '273' | Below are sql tables 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 Finish of the Player with a Total of 273? ### Input: CREATE TABLE table_12442 (
"Player" text,
"Country"... |
where was the last meeting in which kaseorg competed ? | CREATE TABLE table_204_202 (
id number,
"year" number,
"tournament" text,
"venue" text,
"result" text,
"rank" text,
"event" text
) | SELECT "venue" FROM table_204_202 ORDER BY id 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: where was the last meeting in which kaseorg competed ? ### Input: CREATE TABLE table_204_202 (
id number,
"year" num... |
How many total Gold medals did the nation ranked #3 receive? | CREATE TABLE table_42579 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT SUM("Gold") FROM table_42579 WHERE "Rank" = '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: How many total Gold medals did the nation ranked #3 receive? ### Input: CREATE TABLE table_42579 (
"Rank" text,
"Nat... |
Who's the Republican ticket with a Socialist ticket of edna mitchell blue? | CREATE TABLE table_42300 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"American Labor ticket" text,
"Socialist ticket" text
) | SELECT "Republican ticket" FROM table_42300 WHERE "Socialist ticket" = 'edna mitchell blue' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who's the Republican ticket with a Socialist ticket of edna mitchell blue? ### Input: CREATE TABLE table_42300 (
"Office... |
what procedure is provided to patient 006-97726 two times since 104 months ago? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what procedure is provided to patient 006-97726 two times since 104 months ago? ### Input: CREATE TABLE cost (
costid nu... |
when was patient 88079 last admitted to the hospital via phys referral/normal deli since 3 years ago? | CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 88079 AND admissions.admission_location = 'phys referral/normal deli' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime 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: when was patient 88079 last admitted to the hospital via phys referral/normal deli since 3 years ago? ### Input: CREATE TABL... |
When the Venue was mcg what was the sum of all Crowds for that venue? | CREATE TABLE table_55038 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT SUM("Crowd") FROM table_55038 WHERE "Venue" = 'mcg' | Below are sql tables 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 Venue was mcg what was the sum of all Crowds for that venue? ### Input: CREATE TABLE table_55038 (
"Home team" ... |
What day had 37,500 attending? | CREATE TABLE table_name_56 (
date VARCHAR,
attendance VARCHAR
) | SELECT date FROM table_name_56 WHERE attendance = "37,500" | Below are sql tables 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 day had 37,500 attending? ### Input: CREATE TABLE table_name_56 (
date VARCHAR,
attendance VARCHAR
) ### Respon... |
what was patient 004-64091's last output since 12/29/2105? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND intakeoutput.cellpath LIKE '%output%' AND S... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 004-64091's last output since 12/29/2105? ### Input: CREATE TABLE microlab (
microlabid number,
pat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.