instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What is the average game number when the record is 4-1? | CREATE TABLE table_48453 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | SELECT AVG("Game") FROM table_48453 WHERE "Record" = '4-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 game number when the record is 4-1? ### Input: CREATE TABLE table_48453 (
"Game" real,
"Date" te... |
number of times patient 54281 was prescribed emtriva in their first hospital visit. | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_r... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'emtriva' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: number of times patient 54281 was prescribed emtriva in their first hospital visit. ### Input: CREATE TABLE microbiologyeven... |
Which Away team has a Venue of mcg? | CREATE TABLE table_name_82 (
away_team VARCHAR,
venue VARCHAR
) | SELECT away_team FROM table_name_82 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: Which Away team has a Venue of mcg? ### Input: CREATE TABLE table_name_82 (
away_team VARCHAR,
venue VARCHAR
) ### R... |
Who was the opponent in week 13? | CREATE TABLE table_79230 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text
) | SELECT "Opponent" FROM table_79230 WHERE "Week" = '13' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent in week 13? ### Input: CREATE TABLE table_79230 (
"Week" real,
"Date" text,
"Opponent" text... |
What was week 17's date? | CREATE TABLE table_47964 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | SELECT "Date" FROM table_47964 WHERE "Week" = '17' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was week 17's date? ### Input: CREATE TABLE table_47964 (
"Week" real,
"Date" text,
"Opponent" text,
"R... |
how many patients have diagnoses icd9 code 28803? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "28803" | Below are sql tables 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 have diagnoses icd9 code 28803? ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id t... |
count the number of patients whose ethnicity is black/cape verdean and item id is 51249? | 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.ethnicity = "BLACK/CAPE VERDEAN" AND lab.itemid = "51249" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose ethnicity is black/cape verdean and item id is 51249? ### Input: CREATE TABLE prescriptio... |
Which Gold has a Bronze larger than 6? | CREATE TABLE table_36676 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Gold") FROM table_36676 WHERE "Bronze" > '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: Which Gold has a Bronze larger than 6? ### Input: CREATE TABLE table_36676 (
"Rank" real,
"Nation" text,
"Gold" ... |
Who is Winners that has editions of 1992, 2003 as Not Winning | CREATE TABLE table_name_77 (
winners VARCHAR,
not_winning_editions VARCHAR
) | SELECT winners FROM table_name_77 WHERE not_winning_editions = "1992, 2003" | Below are sql tables 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 Winners that has editions of 1992, 2003 as Not Winning ### Input: CREATE TABLE table_name_77 (
winners VARCHAR,
... |
Who was the opponent in week 4? | CREATE TABLE table_19637 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | SELECT "Opponent" FROM table_19637 WHERE "Week" = '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 was the opponent in week 4? ### Input: CREATE TABLE table_19637 (
"Week" real,
"Date" text,
"Opponent" text,... |
What are the family relations of the king with the throne name 303? | CREATE TABLE table_36347 (
"Throne Name" text,
"Title" text,
"Born-Died" text,
"Entered office" text,
"Left office" text,
"Family Relations" text
) | SELECT "Family Relations" FROM table_36347 WHERE "Throne Name" = '303' | Below are sql tables 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 family relations of the king with the throne name 303? ### Input: CREATE TABLE table_36347 (
"Throne Name" ... |
what are all the gold medals when the silver medals is smaller than 1.0? | CREATE TABLE table_17964 (
"Ensemble" text,
"Gold Medals" real,
"Silver Medals" real,
"Bronze Medals" real,
"Total Medals" real
) | SELECT "Gold Medals" FROM table_17964 WHERE "Silver Medals" < '1.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 are all the gold medals when the silver medals is smaller than 1.0? ### Input: CREATE TABLE table_17964 (
"Ensemble... |
list the cheapest one way flight from MIAMI FLORIDA to CHARLOTTE NORTH CAROLINA | CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
mon... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare, state AS STATE_0, state AS STATE_1 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MIAMI' AND CITY_1.city_code = AIRP... | Below are sql tables 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 cheapest one way flight from MIAMI FLORIDA to CHARLOTTE NORTH CAROLINA ### Input: CREATE TABLE restriction (
re... |
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, order X from high to low order. | CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_las... | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY booking_status_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: How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with ... |
count the number of patients on ng route of drug administration who have diagnoses icd9 code 99799. | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "99799" 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: count the number of patients on ng route of drug administration who have diagnoses icd9 code 99799. ### Input: CREATE TABLE ... |
how many patients aged below 83 years had the drug code cipr200pm? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "CIPR200PM" | Below are sql tables 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 aged below 83 years had the drug code cipr200pm? ### Input: CREATE TABLE lab (
subject_id text,
ha... |
how many black/haitian american patients had the drug name collagenase ointment | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug = "Collagenase Ointment" | Below are sql tables 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 black/haitian american patients had the drug name collagenase ointment ### Input: CREATE TABLE prescriptions (
... |
What was the date for the game in week 7? | CREATE TABLE table_52230 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | SELECT "Date" FROM table_52230 WHERE "Week" = '7' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date for the game in week 7? ### Input: CREATE TABLE table_52230 (
"Week" real,
"Date" text,
"Oppon... |
Compare the distribution of the players' gender using a bar chart, show by the total number from high to low please. | CREATE TABLE club (
Club_ID int,
Club_name text,
Region text,
Start_year int
)
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
Bronze int,
Points int
)
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_... | SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) 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: Compare the distribution of the players' gender using a bar chart, show by the total number from high to low please. ### Inp... |
Number of posts by user from France or India per age and location. | CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT a2."age" AS "Age", a2.Location AS "Location", COUNT(*) AS "count_posts" FROM "Posts " AS a1 LEFT OUTER JOIN Users AS a2 ON (a2.Id = a1."LastEditorUserId ") WHERE (a2.Location IN ('France', 'India')) GROUP BY a2."age", a2.Location ORDER BY 'Age' DESC, 'Location' 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: Number of posts by user from France or India per age and location. ### Input: CREATE TABLE SuggestedEdits (
Id number,
... |
What's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of scheduled time (over three months)? | CREATE TABLE table_1636 (
"Period" text,
"% trains arriving within 5 mins of scheduled time (over three months)" text,
"Change over same quarter the previous year" text,
"% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text,
"Change over previous year as a whole" text
... | SELECT "Change over same quarter the previous year" FROM table_1636 WHERE "% trains arriving within 5 mins of scheduled time (over three months)" = '89.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's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of ... |
Bar chart x axis card type code y axis the total number, and display by the y-axis from high to low please. | CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code 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: Bar chart x axis card type code y axis the total number, and display by the y-axis from high to low please. ### Input: CREAT... |
how many patients whose admission type is urgent and item id is 50806? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50806" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is urgent and item id is 50806? ### Input: CREATE TABLE diagnoses (
subject_id te... |
In next semester , the number of MKT classes offered is ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE semester (
semester_id int,
... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In next semester , the number of MKT classes offered is ? ### Input: CREATE TABLE instructor (
instructor_id int,
na... |
What was the lowest Attendance on 8 October 1986? | CREATE TABLE table_7385 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | SELECT MIN("Attendance") FROM table_7385 WHERE "Date" = '8 october 1986' | Below are sql tables 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 lowest Attendance on 8 October 1986? ### Input: CREATE TABLE table_7385 (
"Date" text,
"Opponent" text,... |
which had the least amount of time ? | CREATE TABLE table_203_734 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | SELECT "competition" FROM table_203_734 ORDER BY "notes" 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 had the least amount of time ? ### Input: CREATE TABLE table_203_734 (
id number,
"year" number,
"competit... |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and employee_id , show in asc by the y-axis please. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY 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 who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart ab... |
What was the maximum amount of the poles? | CREATE TABLE table_2190919_3 (
poles INTEGER
) | SELECT MAX(poles) FROM table_2190919_3 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the maximum amount of the poles? ### Input: CREATE TABLE table_2190919_3 (
poles INTEGER
) ### Response: SELECT... |
Select the average price of each manufacturer's products, showing the manufacturer's name. | CREATE TABLE Manufacturers (
name VARCHAR,
code VARCHAR
)
CREATE TABLE products (
Price INTEGER,
manufacturer VARCHAR
) | SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.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: Select the average price of each manufacturer's products, showing the manufacturer's name. ### Input: CREATE TABLE Manufactu... |
Compare the total number of each fate with a bar chart, could you show by the the number of fate in desc? | CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate) 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: Compare the total number of each fate with a bar chart, could you show by the the number of fate in desc? ### Input: CREATE ... |
what is minimum age of patients whose insurance is medicaid and ethnicity is white? | 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 MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "WHITE" | Below are sql tables 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 age of patients whose insurance is medicaid and ethnicity is white? ### Input: CREATE TABLE procedures (
... |
What is the crowd for away team of north melbourne? | CREATE TABLE table_52958 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Crowd" FROM table_52958 WHERE "Away team" = 'north melbourne' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the crowd for away team of north melbourne? ### Input: CREATE TABLE table_52958 (
"Home team" text,
"Home te... |
What courses would you suggest I take before taking EHS 615 ? | CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'EHS' AND number = 615 | Below are sql tables 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 courses would you suggest I take before taking EHS 615 ? ### Input: CREATE TABLE area (
course_id int,
area var... |
Name the height in feet for the guard from north carolina-charlotte | CREATE TABLE table_name_35 (
height_in_ft VARCHAR,
position VARCHAR,
school_club_team_country VARCHAR
) | SELECT height_in_ft FROM table_name_35 WHERE position = "guard" AND school_club_team_country = "north carolina-charlotte" | Below are sql tables 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 height in feet for the guard from north carolina-charlotte ### Input: CREATE TABLE table_name_35 (
height_in_ft... |
please show me flights which cost less than or equal to 466 dollars from NEW YORK to MIAMI leaving on a TUESDAY | CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code va... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DAYS_0.day_name = 'TUESDAY' AND DAYS_1.day_name = 'TUESDAY' AND fare_basis.basis_days = DAYS_1.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: please show me flights which cost less than or equal to 466 dollars from NEW YORK to MIAMI leaving on a TUESDAY ### Input: C... |
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 hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart, could you show in ascending by the y axis? | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
count the number of patients whose year of death is less than or equal to 2115 and procedure icd9 code is 4341? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.icd9_code = "4341" | Below are sql tables 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 year of death is less than or equal to 2115 and procedure icd9 code is 4341? ### Input: C... |
For those employees who was hired before 2002-06-21, find hire_date and the average of employee_id bin hire_date by weekday, and visualize them by a bar chart. | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, find hire_date and the average of employee_id bin hire_date by weekday,... |
What are all the run times with 8.2 million viewers? | CREATE TABLE table_19219 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | SELECT "Run time" FROM table_19219 WHERE "Viewers (in millions)" = '8.2' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the run times with 8.2 million viewers? ### Input: CREATE TABLE table_19219 (
"Episode" text,
"Broadcas... |
Tell me the date for acts of 6 bands and year larger than 1981 for monsters of rock | CREATE TABLE table_name_4 (
date VARCHAR,
event VARCHAR,
acts VARCHAR,
year VARCHAR
) | SELECT date FROM table_name_4 WHERE acts = "6 bands" AND year > 1981 AND event = "monsters of rock" | Below are sql tables 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 date for acts of 6 bands and year larger than 1981 for monsters of rock ### Input: CREATE TABLE table_name_4 (
... |
What was the record when Vancouver was the visitor? | CREATE TABLE table_9867 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
) | SELECT "Record" FROM table_9867 WHERE "Visitor" = 'vancouver' | Below are sql tables 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 record when Vancouver was the visitor? ### Input: CREATE TABLE table_9867 (
"Date" text,
"Visitor" text... |
what is the amount of input patient 21134 has received? | CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21134)) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the amount of input patient 21134 has received? ### Input: CREATE TABLE prescriptions (
row_id number,
subje... |
What is the to par for japan | CREATE TABLE table_66292 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | SELECT "To par" FROM table_66292 WHERE "Country" = 'japan' | Below are sql tables 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 to par for japan ### Input: CREATE TABLE table_66292 (
"Place" text,
"Player" text,
"Country" text,
... |
Create a bar chart showing the total number across team | CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machin... | SELECT Team, COUNT(*) FROM technician GROUP BY Team | Below are sql tables 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 total number across team ### Input: CREATE TABLE repair (
repair_ID int,
name text,
... |
for the patients with age 20s until 3 years ago what are the top four most frequent diagnoses? | 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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 yea... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: for the patients with age 20s until 3 years ago what are the top four most frequent diagnoses? ### Input: CREATE TABLE aller... |
find the number of patients born before 2126 who had abnormal lab test status. | 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.dob_year < "2126" 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: find the number of patients born before 2126 who had abnormal lab test status. ### Input: CREATE TABLE prescriptions (
s... |
What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds? | CREATE TABLE weather (
date VARCHAR,
mean_temperature_f VARCHAR,
mean_humidity VARCHAR,
max_gust_speed_mph VARCHAR
) | SELECT date, mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds? ### Input: CREATE... |
Show aircraft names and number of flights for each aircraft with a bar chart, and sort in ascending by the y-axis. | CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show aircraft names and number of flights for each aircraft with a bar chart, and sort in ascending by the y-axis. ### Input... |
provide the number of patients whose admission location is clinic referral/premature and item id is 50818? | 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.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50818" | Below are sql tables 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 clinic referral/premature and item id is 50818? ### Input: CREATE... |
What was the Score on September 29, 2003? | CREATE TABLE table_name_64 (
score VARCHAR,
date VARCHAR
) | SELECT score FROM table_name_64 WHERE date = "september 29, 2003" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Score on September 29, 2003? ### Input: CREATE TABLE table_name_64 (
score VARCHAR,
date VARCHAR
) ### ... |
How many papers has David M. Blei published in AISTATS ? | CREATE TABLE field (
fieldid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
... | SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'David M. Blei' AND venue.venueid = paper.venueid AND venue.venuename = 'AISTATS' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many papers has David M. Blei published in AISTATS ? ### Input: CREATE TABLE field (
fieldid int
)
CREATE TABLE jou... |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%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: For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date an... |
Is lab also included in 451 ? | 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,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 451 | Below are sql tables 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 lab also included in 451 ? ### Input: CREATE TABLE student (
student_id int,
lastname varchar,
firstname varc... |
what is the number of patients whose diagnoses icd9 code is 2749 and lab test category is chemistry? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2749" 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: what is the number of patients whose diagnoses icd9 code is 2749 and lab test category is chemistry? ### Input: CREATE TABLE... |
What was the attendance on November 3, 1968, that was a week smaller than 8? | CREATE TABLE table_name_81 (
attendance VARCHAR,
date VARCHAR,
week VARCHAR
) | SELECT COUNT(attendance) FROM table_name_81 WHERE date = "november 3, 1968" AND week < 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 attendance on November 3, 1968, that was a week smaller than 8? ### Input: CREATE TABLE table_name_81 (
att... |
how many nations won at least 10 medals ? | CREATE TABLE table_203_70 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | SELECT COUNT("nation") FROM table_203_70 WHERE "total" >= 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: how many nations won at least 10 medals ? ### Input: CREATE TABLE table_203_70 (
id number,
"rank" number,
"nati... |
What is the Date of the Game with a Record of 46-22? | CREATE TABLE table_14215 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | SELECT "Date" FROM table_14215 WHERE "Record" = '46-22' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date of the Game with a Record of 46-22? ### Input: CREATE TABLE table_14215 (
"Game" text,
"Date" text,... |
Where did Richmond play as the home team? | CREATE TABLE table_name_43 (
venue VARCHAR,
home_team VARCHAR
) | SELECT venue FROM table_name_43 WHERE home_team = "richmond" | Below are sql tables 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 did Richmond play as the home team? ### Input: CREATE TABLE table_name_43 (
venue VARCHAR,
home_team VARCHAR
)... |
what is the days of hospital stay and drug type of subject id 52012? | 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 prescriptions... | SELECT demographic.days_stay, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "52012" | Below are sql tables 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 days of hospital stay and drug type of subject id 52012? ### Input: CREATE TABLE diagnoses (
subject_id text... |
calculate the maximum age of elective hospital admission patients who were hospitalized for 17 days. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "17" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the maximum age of elective hospital admission patients who were hospitalized for 17 days. ### Input: CREATE TABLE... |
i need the flight numbers of flights leaving from CLEVELAND and arriving at DALLAS | CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
fligh... | 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 = 'CLEVELAND' 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: i need the flight numbers of flights leaving from CLEVELAND and arriving at DALLAS ### Input: CREATE TABLE code_description ... |
what is the highest drawn when played is more than 14? | CREATE TABLE table_45413 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | SELECT MAX("Drawn") FROM table_45413 WHERE "Played" > '14' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the highest drawn when played is more than 14? ### Input: CREATE TABLE table_45413 (
"Position" real,
"Name"... |
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings. Show a pie chart. | CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking... | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_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 bookings does each booking status have? List the booking status code and the number of corresponding bookings. Show... |
display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name. | CREATE TABLE employees (
employee_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR,
salary INTEGER,
department_id VARCHAR
) | SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: display the employee number, name( first name and last name ), and salary for all employees who earn more than the average s... |
what is the number of patients who had a delayed clos abd wound procedure in 2103? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'delayed clos abd wound') AND STRFTIME('%y', procedur... | Below are sql tables 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 had a delayed clos abd wound procedure in 2103? ### Input: CREATE TABLE transfers (
r... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the last_name by a bar chart, list bar in ascending order please. | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a... |
how many patients aged below 79 years had neb as the drug route? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "79" AND prescriptions.route = "NEB" | Below are sql tables 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 aged below 79 years had neb as the drug route? ### Input: CREATE TABLE diagnoses (
subject_id text,
... |
Which Opponent has an Attendance of 24,791? | CREATE TABLE table_name_94 (
opponent VARCHAR,
attendance VARCHAR
) | SELECT opponent FROM table_name_94 WHERE attendance = "24,791" | Below are sql tables 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 an Attendance of 24,791? ### Input: CREATE TABLE table_name_94 (
opponent VARCHAR,
attendance VAR... |
how many patients who stayed in the hospital for more than 11 days had cerebrospinal fluid (csf) as their lab test 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.days_stay > "11" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients who stayed in the hospital for more than 11 days had cerebrospinal fluid (csf) as their lab test fluid? ##... |
Return a bar chart about the distribution of dept_name and the average of salary , and group by attribute dept_name. | CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE prereq (
course_id va... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name 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: Return a bar chart about the distribution of dept_name and the average of salary , and group by attribute dept_name. ### Inp... |
How many viewers in millions for episode number 38? | CREATE TABLE table_28257 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (million)" text
) | SELECT "U.S. viewers (million)" FROM table_28257 WHERE "No." = '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: How many viewers in millions for episode number 38? ### Input: CREATE TABLE table_28257 (
"No." real,
"#" real,
... |
Count the number of captains younger than 50 of each rank by a bar chart, show in descending by the y-axis. | 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 Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank 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: Count the number of captains younger than 50 of each rank by a bar chart, show in descending by the y-axis. ### Input: CREAT... |
What race did the team Mi-Jack Conquest racing win with a pole position of andreas wirth? | CREATE TABLE table_name_16 (
race_name VARCHAR,
winning_team VARCHAR,
pole_position VARCHAR
) | SELECT race_name FROM table_name_16 WHERE winning_team = "mi-jack conquest racing" AND pole_position = "andreas wirth" | Below are sql tables 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 race did the team Mi-Jack Conquest racing win with a pole position of andreas wirth? ### Input: CREATE TABLE table_name... |
Prevalence of Database, Database Schema. | CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate tim... | SELECT COUNT(Id) FROM Posts WHERE (Tags LIKE '%database%' OR Tags LIKE '%database schema%' OR Tags LIKE '%schema%') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Prevalence of Database, Database Schema. ### Input: CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TA... |
What is Lost, when Points For is '205'? | CREATE TABLE table_name_16 (
lost VARCHAR,
points_for VARCHAR
) | SELECT lost FROM table_name_16 WHERE points_for = "205" | Below are sql tables 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 Lost, when Points For is '205'? ### Input: CREATE TABLE table_name_16 (
lost VARCHAR,
points_for VARCHAR
) #... |
Top 100 user in India. | CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id nu... | SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "#", Users.Id AS "user_link", Users.Age, Users.Location, Users.Reputation, Users.Views, Users.UpVotes, Users.DownVotes, (SELECT COUNT(*) FROM Posts AS PQ WHERE PostTypeId = 1 AND PQ.OwnerUserId = Users.Id) AS "questions", (SELECT COUNT(*) FROM Posts AS PA WHE... | Below are sql tables 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 user in India. ### Input: CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREA... |
until 2 years ago what were the top three most frequent procedures that patients received in the same hospital visit after the diagnosis of traumatic subdural hem? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 2 years ago what were the top three most frequent procedures that patients received in the same hospital visit after t... |
Who is the Constructor for round 5? | CREATE TABLE table_name_58 (
constructor VARCHAR,
rounds VARCHAR
) | SELECT constructor FROM table_name_58 WHERE rounds = "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: Who is the Constructor for round 5? ### Input: CREATE TABLE table_name_58 (
constructor VARCHAR,
rounds VARCHAR
) ##... |
Return the minimum, average and maximum distances traveled across all aircrafts. | CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)... | SELECT MIN(distance), AVG(distance), MAX(distance) FROM aircraft | Below are sql tables 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 minimum, average and maximum distances traveled across all aircrafts. ### Input: CREATE TABLE flight (
flno n... |
What is the procedure short title of Paul Edwards? | 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 procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Paul Edwards" | Below are sql tables 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 procedure short title of Paul Edwards? ### Input: CREATE TABLE demographic (
subject_id text,
hadm_id te... |
how many of the patients belonging to black/african american ethnic origin received additive therapy? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug_type = "ADDITIVE" | Below are sql tables 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 belonging to black/african american ethnic origin received additive therapy? ### Input: CREATE TABL... |
during the last year how many patients were discharged from the hospital? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, '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: during the last year how many patients were discharged from the hospital? ### Input: CREATE TABLE diagnosis (
diagnosisi... |
what is the minimum days of hospital stay of patients who are aged 54 years or more than that? | 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 MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "54" | Below are sql tables 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 minimum days of hospital stay of patients who are aged 54 years or more than that? ### Input: CREATE TABLE presc... |
Show the names of products and the number of events they are in Visualize by bar chart, sort in desc by the bars. | CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_ID INTEGER,
Role_Code CHAR(15)
)
CREATE TABLE Agreements (
Document_ID IN... | SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY Product_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: Show the names of products and the number of events they are in Visualize by bar chart, sort in desc by the bars. ### Input:... |
What was the date of the friendly competition with a score of 4-0? | CREATE TABLE table_5408 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | SELECT "Date" FROM table_5408 WHERE "Competition" = 'friendly' AND "Score" = '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: What was the date of the friendly competition with a score of 4-0? ### Input: CREATE TABLE table_5408 (
"Date" text,
... |
Tell me the country for julian schnabel | CREATE TABLE table_name_38 (
country VARCHAR,
director VARCHAR
) | SELECT country FROM table_name_38 WHERE director = "julian schnabel" | Below are sql tables 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 country for julian schnabel ### Input: CREATE TABLE table_name_38 (
country VARCHAR,
director VARCHAR
) ... |
when is the first time patient 16549 visited the hospital until 2104? | 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 procedures_icd (
row_id number,
subject_id number,
... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 16549 AND STRFTIME('%y', admissions.admittime) <= '2104' ORDER BY admissions.admittime 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 is the first time patient 16549 visited the hospital until 2104? ### Input: CREATE TABLE icustays (
row_id number,
... |
how much does antihypertensive drug - beta blocker cost. | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'antihypertensive drug - beta blocker') | Below are sql tables 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 does antihypertensive drug - beta blocker cost. ### Input: CREATE TABLE allergy (
allergyid number,
patient... |
Bin the hire date of employees into the day of week interval and count them for visualizing a bar chart. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bin the hire date of employees into the day of week interval and count them for visualizing a bar chart. ### Input: CREATE T... |
Will EMBA 603 help me fulfill any requirement besides general elective ? | 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 program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'EMBA' AND course.number = 603 AND program_course.course_id = course.course_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: Will EMBA 603 help me fulfill any requirement besides general elective ? ### Input: CREATE TABLE requirement (
requireme... |
Goalsagainst that has a Points of 108, and a Lost smaller than 14 has what average? | CREATE TABLE table_70638 (
"Season" text,
"Games" real,
"Lost" real,
"Points" real,
"Goalsfor" real,
"Goalsagainst" real
) | SELECT AVG("Goalsagainst") FROM table_70638 WHERE "Points" = '108' AND "Lost" < '14' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Goalsagainst that has a Points of 108, and a Lost smaller than 14 has what average? ### Input: CREATE TABLE table_70638 (
... |
For those records from the products and each product's manufacturer, show me about the correlation between manufacturer and code , and group by attribute name in a scatter chart. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the correlation between manufacturer and ... |
What is the lowest To par, when Total is greater than 148, and when Year(s) Won is '1959 , 1968 , 1974'? | CREATE TABLE table_name_97 (
to_par INTEGER,
total VARCHAR,
year_s__won VARCHAR
) | SELECT MIN(to_par) FROM table_name_97 WHERE total < 148 AND year_s__won = "1959 , 1968 , 1974" | Below are sql tables 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 To par, when Total is greater than 148, and when Year(s) Won is '1959 , 1968 , 1974'? ### Input: CREATE T... |
count the number of patients on norepinephrine prescription who were born before the year 2109. | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2109" AND prescriptions.drug = "NORepinephrine" | Below are sql tables 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 on norepinephrine prescription who were born before the year 2109. ### Input: CREATE TABLE pres... |
During which round was the first defensive end with an overall rank larger than 186 drafted? | CREATE TABLE table_4873 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | SELECT MIN("Round") FROM table_4873 WHERE "Overall" > '186' AND "Position" = 'defensive end' | Below are sql tables 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 which round was the first defensive end with an overall rank larger than 186 drafted? ### Input: CREATE TABLE table_4... |
How many laps were driven when the time/retired is +44.284? | CREATE TABLE table_name_93 (
laps VARCHAR,
time_retired VARCHAR
) | SELECT COUNT(laps) FROM table_name_93 WHERE time_retired = "+44.284" | Below are sql tables 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 laps were driven when the time/retired is +44.284? ### Input: CREATE TABLE table_name_93 (
laps VARCHAR,
ti... |
What is the novelty of Tylocephale? | CREATE TABLE table_42374 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text
) | SELECT "Novelty" FROM table_42374 WHERE "Name" = 'tylocephale' | Below are sql tables 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 novelty of Tylocephale? ### Input: CREATE TABLE table_42374 (
"Name" text,
"Novelty" text,
"Status" ... |
What was the date of the week 13 game? | CREATE TABLE table_68042 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | SELECT "Date" FROM table_68042 WHERE "Week" = '13' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the week 13 game? ### Input: CREATE TABLE table_68042 (
"Week" real,
"Date" text,
"Opponent... |
Select * from Users where Location='Turkey'. | CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | SELECT * FROM Users WHERE Location LIKE '%Turkey%' ORDER BY Reputation 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: Select * from Users where Location='Turkey'. ### Input: CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
... |
count the number of patients whose marital status is divorced and admission year is less than 2120? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2120" | Below are sql tables 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 marital status is divorced and admission year is less than 2120? ### Input: CREATE TABLE ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.