instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
When 4 is the week what is the location? | CREATE TABLE table_26617 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
) | SELECT "Location" FROM table_26617 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: When 4 is the week what is the location? ### Input: CREATE TABLE table_26617 (
"Week" real,
"Date" text,
"Oppone... |
Give the name of each department and the number of employees in each in a bar chart. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY T2.DEPARTMENT_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: Give the name of each department and the number of employees in each in a bar chart. ### Input: CREATE TABLE job_history (
... |
who wrote episode 14? | CREATE TABLE table_21929 (
"Episode #" text,
"Season #" real,
"Title" text,
"Writer(s)" text,
"Director" text,
"Originalairdate" text
) | SELECT "Writer(s)" FROM table_21929 WHERE "Episode #" = '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: who wrote episode 14? ### Input: CREATE TABLE table_21929 (
"Episode #" text,
"Season #" real,
"Title" text,
... |
what is drug name of subject name kelly gallardo? | 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 prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo" | Below are sql tables 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 drug name of subject name kelly gallardo? ### Input: CREATE TABLE demographic (
subject_id text,
hadm_id tex... |
What is Fitzroy's home field? | CREATE TABLE table_name_82 (
venue VARCHAR,
home_team VARCHAR
) | SELECT venue FROM table_name_82 WHERE home_team = "fitzroy" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Fitzroy's home field? ### Input: CREATE TABLE table_name_82 (
venue VARCHAR,
home_team VARCHAR
) ### Respons... |
how many patients diagnosed with ac post hemorrhag anemia are administered via ng drug route? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ac posthemorrhag anemia" 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 diagnosed with ac post hemorrhag anemia are administered via ng drug route? ### Input: CREATE TABLE proced... |
Which Monarch has succession unclear 1100-1103 as his Status? | CREATE TABLE table_name_60 (
monarch VARCHAR,
status VARCHAR
) | SELECT monarch FROM table_name_60 WHERE status = "succession unclear 1100-1103" | Below are sql tables 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 Monarch has succession unclear 1100-1103 as his Status? ### Input: CREATE TABLE table_name_60 (
monarch VARCHAR,
... |
show me flights from WASHINGTON to SAN FRANCISCO with a stopover in DENVER | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airport_servic... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | Below are sql tables 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 WASHINGTON to SAN FRANCISCO with a stopover in DENVER ### Input: CREATE TABLE month (
month_number ... |
Android thread volume, page views, unique OPs by month. | CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE ('tags' LIKE '%<android%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIM... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Android thread volume, page views, unique OPs by month. ### Input: CREATE TABLE Users (
Id number,
Reputation number... |
how many dead/expired discharged patients had venous catheterization for renal dialysis? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND procedures.short_title = "Ven cath renal dialysis" | Below are sql tables 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 dead/expired discharged patients had venous catheterization for renal dialysis? ### Input: CREATE TABLE lab (
s... |
Name the w/l for czech republic | CREATE TABLE table_2715 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"W/L" text,
"Result" text
) | SELECT "W/L" FROM table_2715 WHERE "Against" = 'Czech Republic' | Below are sql tables 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 w/l for czech republic ### Input: CREATE TABLE table_2715 (
"Edition" text,
"Round" text,
"Date" text,
... |
Which visitor has detroit as the home, and february 24 as the date? | CREATE TABLE table_6607 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | SELECT "Visitor" FROM table_6607 WHERE "Home" = 'detroit' AND "Date" = 'february 24' | Below are sql tables 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 visitor has detroit as the home, and february 24 as the date? ### Input: CREATE TABLE table_6607 (
"Date" text,
... |
presence of systolic blood pressure > 190 | CREATE TABLE table_train_157 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"platelets" int,
"renal_disease" bool,
"c_reactive_protein" float,
"creatinine_clearance_cl" float,
"urine_protein" int,
"serum_creatinine" float,
"prote... | SELECT * FROM table_train_157 WHERE systolic_blood_pressure_sbp > 190 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: presence of systolic blood pressure > 190 ### Input: CREATE TABLE table_train_157 (
"id" int,
"gender" string,
"... |
who finished after will power ? | CREATE TABLE table_203_452 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | SELECT "driver" FROM table_203_452 WHERE "pos" = (SELECT "pos" FROM table_203_452 WHERE "driver" = 'will power') + 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: who finished after will power ? ### Input: CREATE TABLE table_203_452 (
id number,
"pos" number,
"no" number,
... |
What is the title when 2.50 is u.s. viewers (in millions)? | CREATE TABLE table_73555 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | SELECT "Title" FROM table_73555 WHERE "U.S. viewers (in millions)" = '2.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: What is the title when 2.50 is u.s. viewers (in millions)? ### Input: CREATE TABLE table_73555 (
"No. in series" real,
... |
Find the names of nurses who are on call. | CREATE TABLE on_call (
nurse VARCHAR
)
CREATE TABLE nurse (
name VARCHAR,
EmployeeID VARCHAR
) | SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse | Below are sql tables 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 names of nurses who are on call. ### Input: CREATE TABLE on_call (
nurse VARCHAR
)
CREATE TABLE nurse (
na... |
what's the cylinders/ valves with model being 1.8 20v | CREATE TABLE table_1176162_3 (
cylinders__valves VARCHAR,
model VARCHAR
) | SELECT cylinders__valves FROM table_1176162_3 WHERE model = "1.8 20V" | Below are sql tables 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 cylinders/ valves with model being 1.8 20v ### Input: CREATE TABLE table_1176162_3 (
cylinders__valves VARCHA... |
For those records from the products and each product's manufacturer, give me the comparison about price over the name , and group by attribute founder, list by the y axis in asc please. | 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.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about price over the name , and ... |
How many total rounds has lehigh as the college? | CREATE TABLE table_name_90 (
round VARCHAR,
college VARCHAR
) | SELECT COUNT(round) FROM table_name_90 WHERE college = "lehigh" | Below are sql tables 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 rounds has lehigh as the college? ### Input: CREATE TABLE table_name_90 (
round VARCHAR,
college VARC... |
Which Location has Floors smaller than 27, and a Building of 150 elgin? | CREATE TABLE table_name_71 (
location VARCHAR,
floors VARCHAR,
building VARCHAR
) | SELECT location FROM table_name_71 WHERE floors < 27 AND building = "150 elgin" | Below are sql tables 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 Location has Floors smaller than 27, and a Building of 150 elgin? ### Input: CREATE TABLE table_name_71 (
location... |
what flights from ATLANTA to TORONTO | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONT... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights from ATLANTA to TORONTO ### Input: CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
ai... |
what were the names of the specimen test that patient 031-23605 last received in 08/last year? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND DATETIME(microlab.culturetakentime, 'start of year') ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the names of the specimen test that patient 031-23605 last received in 08/last year? ### Input: CREATE TABLE vital... |
how many patients have the drug route neb? | 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 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 have the drug route neb? ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
... |
Show the number of documents for each location code in a bar chart. | CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destructio... | SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_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: Show the number of documents for each location code in a bar chart. ### Input: CREATE TABLE Ref_Calendar (
Calendar_Date... |
when did patient 40059 last get the sputum microbiology test during this month? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 40059 last get the sputum microbiology test during this month? ### Input: CREATE TABLE inputevents_cv (
... |
On what date was the streak at lost 7? | CREATE TABLE table_name_67 (
date VARCHAR,
streak VARCHAR
) | SELECT date FROM table_name_67 WHERE streak = "lost 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: On what date was the streak at lost 7? ### Input: CREATE TABLE table_name_67 (
date VARCHAR,
streak VARCHAR
) ### Re... |
What team was the away team at Junction Oval? | CREATE TABLE table_52608 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team" FROM table_52608 WHERE "Venue" = 'junction 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 team was the away team at Junction Oval? ### Input: CREATE TABLE table_52608 (
"Home team" text,
"Home team sco... |
the first time patient 20898 was prescribed bisacodyl in 12/2105? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime ti... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898) AND prescriptions.drug = 'bisacodyl' AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' ORDER BY prescriptions.startdate 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: the first time patient 20898 was prescribed bisacodyl in 12/2105? ### Input: CREATE TABLE d_labitems (
row_id number,
... |
is there a flight on TW from BALTIMORE to SAN FRANCISCO with a stop in DENVER | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_stop (
flight_id in... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is there a flight on TW from BALTIMORE to SAN FRANCISCO with a stop in DENVER ### Input: CREATE TABLE time_zone (
time_z... |
Name the Years as tallest that has Height metres / ft of 01.0 27 / 90? | CREATE TABLE table_name_14 (
years_as_tallest VARCHAR,
height_metres___ft VARCHAR
) | SELECT years_as_tallest FROM table_name_14 WHERE height_metres___ft = "01.0 27 / 90" | Below are sql tables 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 Years as tallest that has Height metres / ft of 01.0 27 / 90? ### Input: CREATE TABLE table_name_14 (
years_as_... |
Name the original air date for series number 15 | CREATE TABLE table_28550 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | SELECT "Original air date" FROM table_28550 WHERE "Series #" = '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: Name the original air date for series number 15 ### Input: CREATE TABLE table_28550 (
"Series #" real,
"Title" text,... |
What are card ids, customer ids, card types, and card numbers for each customer card?, and could you show y axis in desc order? | 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, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) 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 are card ids, customer ids, card types, and card numbers for each customer card?, and could you show y axis in desc ord... |
What is the title of episode 10? | CREATE TABLE table_29436059_1 (
title VARCHAR,
no_in_season VARCHAR
) | SELECT title FROM table_29436059_1 WHERE no_in_season = 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: What is the title of episode 10? ### Input: CREATE TABLE table_29436059_1 (
title VARCHAR,
no_in_season VARCHAR
) ##... |
What was the location and attendance for the game after game 36 against Atlanta? | CREATE TABLE table_name_1 (
location_attendance VARCHAR,
game VARCHAR,
team VARCHAR
) | SELECT location_attendance FROM table_name_1 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_name_1 (
... |
how many different poll companies are listed ? | CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
) | SELECT COUNT(DISTINCT "poll company") FROM table_204_639 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many different poll companies are listed ? ### Input: CREATE TABLE table_204_639 (
id number,
"poll company" tex... |
provide the number of patients whose admission year is less than 2139 and item id is 51276? | 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.admityear < "2139" AND lab.itemid = "51276" | Below are sql tables 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 year is less than 2139 and item id is 51276? ### Input: CREATE TABLE demograp... |
What's the record for the game with an attendance of 49,222? | CREATE TABLE table_name_28 (
record VARCHAR,
attendance VARCHAR
) | SELECT record FROM table_name_28 WHERE attendance = "49,222" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the record for the game with an attendance of 49,222? ### Input: CREATE TABLE table_name_28 (
record VARCHAR,
... |
Do any of my courses relate to human computer interaction ? | CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%human computer interaction%' AND student_record.student_id = 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: Do any of my courses relate to human computer interaction ? ### Input: CREATE TABLE course_tags_count (
course_id int,
... |
How many bronze medals does the nation ranked number 1 have? | CREATE TABLE table_77421 (
"Rank" text,
"Nation" text,
"Gold" text,
"Silver" text,
"Bronze" text,
"Total" text
) | SELECT "Bronze" FROM table_77421 WHERE "Rank" = '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many bronze medals does the nation ranked number 1 have? ### Input: CREATE TABLE table_77421 (
"Rank" text,
"Nat... |
how many female patients used the drug code metl25? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "METL25" | Below are sql tables 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 female patients used the drug code metl25? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
... |
Show the home city with the most number of drivers. | CREATE TABLE driver (
home_city VARCHAR
) | SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the home city with the most number of drivers. ### Input: CREATE TABLE driver (
home_city VARCHAR
) ### Response: S... |
what is the amount of urine out ureteral stent #2 output patient 44625 has? | 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 inputevents_cv (
row_id number,
subject_id number,
... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 44625)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri... | Below are sql tables 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 urine out ureteral stent #2 output patient 44625 has? ### Input: CREATE TABLE icustays (
row_id nu... |
When is 847 being offered ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | Below are sql tables 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 847 being offered ? ### Input: CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE... |
What skip has denmark as the country? | CREATE TABLE table_name_58 (
skip VARCHAR,
country VARCHAR
) | SELECT skip FROM table_name_58 WHERE country = "denmark" | Below are sql tables 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 skip has denmark as the country? ### Input: CREATE TABLE table_name_58 (
skip VARCHAR,
country VARCHAR
) ### Re... |
What is the smallest number of silvers associated with bronzes under 20, totals of 1, golds of 0, and in Water Polo? | CREATE TABLE table_43929 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Silver") FROM table_43929 WHERE "Bronze" < '20' AND "Total" = '1' AND "Sport" = 'water polo' 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 smallest number of silvers associated with bronzes under 20, totals of 1, golds of 0, and in Water Polo? ### Inp... |
Which team was played on April 20? | CREATE TABLE table_17322 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | SELECT "Team" FROM table_17322 WHERE "Date" = 'April 20' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team was played on April 20? ### Input: CREATE TABLE table_17322 (
"Game" real,
"Date" text,
"Team" text,
... |
what is the entrant for the ferrari v8 with points less than 4? | CREATE TABLE table_66902 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | SELECT "Entrant" FROM table_66902 WHERE "Engine" = 'ferrari v8' AND "Points" < '4' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the entrant for the ferrari v8 with points less than 4? ### Input: CREATE TABLE table_66902 (
"Year" real,
"... |
Return a bar chart about the distribution of meter_400 and meter_100 . | CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT meter_400, meter_100 FROM swimmer | Below are sql tables 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 meter_400 and meter_100 . ### Input: CREATE TABLE record (
ID int,
Resu... |
What is the total number of events that had 34 cuts and 3 in the top 10? | CREATE TABLE table_51097 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT COUNT("Events") FROM table_51097 WHERE "Cuts made" < '34' AND "Top-10" > '3' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of events that had 34 cuts and 3 in the top 10? ### Input: CREATE TABLE table_51097 (
"Tourname... |
Which Spring classes are ECON upper level ? | 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 course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ECON' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring... | Below are sql tables 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 Spring classes are ECON upper level ? ### Input: CREATE TABLE course (
course_id int,
name varchar,
depart... |
what are the five most frequently given specimen tests for patients who had previously been diagnosed with lower urinary tract infection during the same month, until 2104? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'lower urinary tract infection' AND STRFTIME(... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequently given specimen tests for patients who had previously been diagnosed with lower urinary tra... |
who came in first ? | CREATE TABLE table_204_584 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | SELECT "driver" FROM table_204_584 WHERE "pos" = 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: who came in first ? ### Input: CREATE TABLE table_204_584 (
id number,
"pos" text,
"no" number,
"driver" tex... |
What is the latest year that data is available for? | CREATE TABLE table_22834834_12 (
year INTEGER
) | SELECT MAX(year) FROM table_22834834_12 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the latest year that data is available for? ### Input: CREATE TABLE table_22834834_12 (
year INTEGER
) ### Respo... |
Which home team played against the away team Carlton? | CREATE TABLE table_56902 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team" FROM table_56902 WHERE "Away team" = 'carlton' | Below are sql tables 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 home team played against the away team Carlton? ### Input: CREATE TABLE table_56902 (
"Home team" text,
"Home ... |
What is the rank of the cinema when the headquarters are in toronto, ON and the screens is less than 1,438? | CREATE TABLE table_name_19 (
rank INTEGER,
headquarters VARCHAR,
screens VARCHAR
) | SELECT AVG(rank) FROM table_name_19 WHERE headquarters = "toronto, on" AND screens < 1 OFFSET 438 | Below are sql tables 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 rank of the cinema when the headquarters are in toronto, ON and the screens is less than 1,438? ### Input: CREAT... |
how many patients whose year of birth is less than 2073 and drug route is iv? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2073" AND prescriptions.route = "IV" | Below are sql tables 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 birth is less than 2073 and drug route is iv? ### Input: CREATE TABLE diagnoses (
subjec... |
Please show the employee first names and ids of employees who serve at least 10 customers. | CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
composer text,
milliseconds number,
bytes number,
unitprice number
)
CREATE TABLE album (
albumid number,
title text,
artistid number
)
CREATE TABLE customer (
custom... | SELECT T1.firstname, T1.supportrepid FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) >= 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: Please show the employee first names and ids of employees who serve at least 10 customers. ### Input: CREATE TABLE track (
... |
What did the home team score when playing at Western Oval? | CREATE TABLE table_name_41 (
home_team VARCHAR,
venue VARCHAR
) | SELECT home_team AS score FROM table_name_41 WHERE venue = "western 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 did the home team score when playing at Western Oval? ### Input: CREATE TABLE table_name_41 (
home_team VARCHAR,
... |
What was the title of the episode directed by David Mamet? | CREATE TABLE table_26200084_1 (
title VARCHAR,
directed_by VARCHAR
) | SELECT title FROM table_26200084_1 WHERE directed_by = "David Mamet" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the title of the episode directed by David Mamet? ### Input: CREATE TABLE table_26200084_1 (
title VARCHAR,
... |
What are the names and average salaries for departments with average salary higher than 42000 Plot them as bar chart, and sort by the X-axis from low to high. | CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
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 section (
course_id varchar(8),
... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_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: What are the names and average salaries for departments with average salary higher than 42000 Plot them as bar chart, and so... |
What is the rank of the team with 1 bronze and 0 gold medals? | CREATE TABLE table_56044 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT "Rank" FROM table_56044 WHERE "Bronze" = '1' 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 rank of the team with 1 bronze and 0 gold medals? ### Input: CREATE TABLE table_56044 (
"Rank" text,
"Na... |
how many times since 2101 had patient 1417 visited the hospital? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 1417 AND STRFTIME('%y', admissions.admittime) >= '2101' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times since 2101 had patient 1417 visited the hospital? ### Input: CREATE TABLE procedures_icd (
row_id number,... |
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the job_id , and group by attribute job_id by a bar chart, and I want to order y axis from low to high order. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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,
JO... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the job_id... |
what tests did patient 30789 have first in 01/last year? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30789) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what tests did patient 30789 have first in 01/last year? ### Input: CREATE TABLE d_icd_procedures (
row_id number,
i... |
Top tags and their top users. | 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 TagName, 'count', OwnerUserId AS "user_link", Score FROM (SELECT t.TagName, t.Count, a.OwnerUserId, SUM(a.Score) AS Score, RANK() OVER (PARTITION BY t.TagName ORDER BY SUM(a.Score) DESC) AS Rank FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Ta... | Below are sql tables 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 tags and their top users. ### Input: CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptP... |
Who is the home team on March 5? | CREATE TABLE table_name_52 (
home VARCHAR,
date VARCHAR
) | SELECT home FROM table_name_52 WHERE date = "march 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 home team on March 5? ### Input: CREATE TABLE table_name_52 (
home VARCHAR,
date VARCHAR
) ### Response: ... |
What is the winery at which the wine with the highest score was made? | CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,... | SELECT winery FROM wine ORDER BY score LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the winery at which the wine with the highest score was made? ### Input: CREATE TABLE wine (
no number,
grap... |
has patient 59049 received a glucose test since 01/2105? | 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 icustays (
row_id number,
subject_id number,
h... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59049) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-01' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 59049 received a glucose test since 01/2105? ### Input: CREATE TABLE diagnoses_icd (
row_id number,
subj... |
what is the fare from PHILADELPHIA to PITTSBURGH BUSINESS class one way | CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the fare from PHILADELPHIA to PITTSBURGH BUSINESS class one way ### Input: CREATE TABLE dual_carrier (
main_airl... |
What is the smallest crowd size for a game when the away team scored 17.16 (118)? | CREATE TABLE table_51786 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT MIN("Crowd") FROM table_51786 WHERE "Away team score" = '17.16 (118)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest crowd size for a game when the away team scored 17.16 (118)? ### Input: CREATE TABLE table_51786 (
... |
What is the overall FHT points for Denis Kornilov? | CREATE TABLE table_name_90 (
overall_fht_points VARCHAR,
name VARCHAR
) | SELECT overall_fht_points FROM table_name_90 WHERE name = "denis kornilov" | Below are sql tables 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 FHT points for Denis Kornilov? ### Input: CREATE TABLE table_name_90 (
overall_fht_points VARCHAR,
... |
what is maximum age of patients whose ethnicity is black/african american and year of death is less than 2138? | 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 MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dod_year < "2138.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 maximum age of patients whose ethnicity is black/african american and year of death is less than 2138? ### Input: CR... |
What is the result when the week is greater than 7 and the Houston Oilers were the opponent? | CREATE TABLE table_name_60 (
result VARCHAR,
week VARCHAR,
opponent VARCHAR
) | SELECT result FROM table_name_60 WHERE week > 7 AND opponent = "houston oilers" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result when the week is greater than 7 and the Houston Oilers were the opponent? ### Input: CREATE TABLE table_n... |
What is the Name of the person from the Netherlands in a Lane lower than 5, with a Rank better than 5, and a time of less than 55.62? | CREATE TABLE table_name_19 (
name VARCHAR,
nationality VARCHAR,
lane VARCHAR,
rank VARCHAR,
time VARCHAR
) | SELECT name FROM table_name_19 WHERE rank < 5 AND time < 55.62 AND lane < 5 AND nationality = "netherlands" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Name of the person from the Netherlands in a Lane lower than 5, with a Rank better than 5, and a time of less th... |
What is the series 4 with sarah newman in series 1? | CREATE TABLE table_name_70 (
series_4 VARCHAR,
series_1 VARCHAR
) | SELECT series_4 FROM table_name_70 WHERE series_1 = "sarah newman" | Below are sql tables 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 series 4 with sarah newman in series 1? ### Input: CREATE TABLE table_name_70 (
series_4 VARCHAR,
series... |
did patient 025-32034 have a sao2 that was greater than 100.0 on this month/07? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-32034')) AND vitalperiodic.sao2 > 100.0 AND NOT vitalperiodic.sa... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 025-32034 have a sao2 that was greater than 100.0 on this month/07? ### Input: CREATE TABLE allergy (
allerg... |
Where was the game played where the record was 10-1? | CREATE TABLE table_27715173_6 (
location_attendance VARCHAR,
record VARCHAR
) | SELECT location_attendance FROM table_27715173_6 WHERE record = "10-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 game played where the record was 10-1? ### Input: CREATE TABLE table_27715173_6 (
location_attendance VARC... |
Show a bar chart about how many employees does each role have? | CREATE TABLE Circulation_History (
document_id INTEGER,
draft_number INTEGER,
copy_number INTEGER,
employee_id INTEGER
)
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15),
document_type_description VARCHAR(255)
)
CREATE TABLE Documents_Mailed (
document_id INTEGER,
mailed_t... | SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_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: Show a bar chart about how many employees does each role have? ### Input: CREATE TABLE Circulation_History (
document_id... |
Show me mean cloud cover by date in a histogram, could you display the average of cloud cover in ascending order? | CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) | Below are sql tables 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 mean cloud cover by date in a histogram, could you display the average of cloud cover in ascending order? ### Input:... |
how many patients of asian ethnicity were admitted before the year 2165? | 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.ethnicity = "ASIAN" AND demographic.admityear < "2165" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients of asian ethnicity were admitted before the year 2165? ### Input: CREATE TABLE diagnoses (
subject_id ... |
Provide the number of patients who have been diagnosed with acute pancreatitis and have a prescription for additive drug types. | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute pancreatitis" 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: Provide the number of patients who have been diagnosed with acute pancreatitis and have a prescription for additive drug typ... |
For each director who directed more than one movie, what are the titles and dates of release for all those movies? | CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | SELECT T1.title, T1.year FROM movie AS T1 JOIN movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each director who directed more than one movie, what are the titles and dates of release for all those movies? ### Input... |
Name the high assists for december 14 | CREATE TABLE table_1352 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "High assists" FROM table_1352 WHERE "Date" = 'December 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: Name the high assists for december 14 ### Input: CREATE TABLE table_1352 (
"Game" real,
"Date" text,
"Team" text... |
What chassis had fewer than 0 points in a year before 1954? | CREATE TABLE table_69944 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | SELECT "Chassis" FROM table_69944 WHERE "Year" < '1954' AND "Points" = '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 chassis had fewer than 0 points in a year before 1954? ### Input: CREATE TABLE table_69944 (
"Year" real,
"Entr... |
has patient 77676 had any surgeries until 1 year ago? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptio... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77676) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-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: has patient 77676 had any surgeries until 1 year ago? ### Input: CREATE TABLE microbiologyevents (
row_id number,
su... |
what is the seats 2006 total with %2001 of 39 and seats 2001 less than 12? | CREATE TABLE table_name_64 (
seats_2006 INTEGER,
_percentage_2001 VARCHAR,
seats_2001 VARCHAR
) | SELECT MAX(seats_2006) FROM table_name_64 WHERE _percentage_2001 = 39 AND seats_2001 < 12 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the seats 2006 total with %2001 of 39 and seats 2001 less than 12? ### Input: CREATE TABLE table_name_64 (
seats... |
What is the number of patients who had a blood lab test and were discharged to skilled nursing facility? | 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.discharge_location = "SNF" AND lab.label = "Blood" | Below are sql tables 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 blood lab test and were discharged to skilled nursing facility? ### Input: CREATE T... |
what is the highest events when the cuts made is less than 34, the top-25 is less than 5 and the top-10 is more than 1? | CREATE TABLE table_76399 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT MAX("Events") FROM table_76399 WHERE "Cuts made" < '34' AND "Top-25" < '5' AND "Top-10" > '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 highest events when the cuts made is less than 34, the top-25 is less than 5 and the top-10 is more than 1? ### ... |
What was the score on may 21? | CREATE TABLE table_8003 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | SELECT "Score" FROM table_8003 WHERE "Date" = 'may 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: What was the score on may 21? ### Input: CREATE TABLE table_8003 (
"Game" real,
"Date" text,
"Team" text,
"S... |
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, and I want to display in desc by the Y-axis. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum... |
how many patients are below 49 years of age and admitted under the year 2198? | 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.age < "49" AND demographic.admityear < "2198" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are below 49 years of age and admitted under the year 2198? ### Input: CREATE TABLE lab (
subject_id t... |
What is the fewest bronze medals for a team with fewer than 1 silver and rank lower than 5? | CREATE TABLE table_name_75 (
bronze INTEGER,
silver VARCHAR,
rank VARCHAR
) | SELECT MIN(bronze) FROM table_name_75 WHERE silver < 1 AND rank < 5 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the fewest bronze medals for a team with fewer than 1 silver and rank lower than 5? ### Input: CREATE TABLE table_na... |
i'd like to book a flight from CINCINNATI to NEW YORK on UA for next saturday | CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
air... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND CITY_1.state_code = 'state_code0' AND date_day.day_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: i'd like to book a flight from CINCINNATI to NEW YORK on UA for next saturday ### Input: CREATE TABLE time_interval (
pe... |
A bar chart for finding the number of the name of rooms booked by some customers whose first name contains ROY, display X-axis in descending order. | CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for finding the number of the name of rooms booked by some customers whose first name contains ROY, display X-ax... |
first time patient 004-34650 was prescribed a drug in 05/last year? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-34650')) AND DATETIME(medication.drugstarttime, 'start of ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: first time patient 004-34650 was prescribed a drug in 05/last year? ### Input: CREATE TABLE vitalperiodic (
vitalperiodi... |
where is a good restaurant in mountain view for arabic food ? | CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.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: where is a good restaurant in mountain view for arabic food ? ### Input: CREATE TABLE restaurant (
id int,
name varc... |
calculate the number of patients who had received a fiber-optic bronchoscopy procedure until 1 year ago. | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
)
... | 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 = 'fiber-optic bronchoscopy') AND DATETIME(procedures_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: calculate the number of patients who had received a fiber-optic bronchoscopy procedure until 1 year ago. ### Input: CREATE T... |
How many different classes at level 300 are there to take for the Fall and Winter ? | CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | SELECT COUNT(DISTINCT course.department, course.name, course.number, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different classes at level 300 are there to take for the Fall and Winter ? ### Input: CREATE TABLE semester (
s... |
provide the number of patients whose admission location is clinic referral/premature and discharge location is left against medical advi? | 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" | Below are sql tables 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 discharge location is left against ... |
Dr. Kristen Verhey is instructing which classes next semester ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kristen Verhey%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Dr. Kristen Verhey is instructing which classes next semester ? ### Input: CREATE TABLE course_prerequisite (
pre_course... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.