instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Who was the girl on week 5 that came after week 3's Mikaela James?
CREATE TABLE table_name_72 ( week_5 VARCHAR, week_3 VARCHAR )
SELECT week_5 FROM table_name_72 WHERE week_3 = "mikaela james"
Below are sql tables 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 girl on week 5 that came after week 3's Mikaela James? ### Input: CREATE TABLE table_name_72 ( week_5 VARCHA...
what is the organism name found until 20 months ago in the last isolate microbiology test of patient 95470?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95470) AND microbiologyevents.spec_type_desc = 'isolate' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <= DATET...
Below are sql tables 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 organism name found until 20 months ago in the last isolate microbiology test of patient 95470? ### Input: CREAT...
provide the number of patients whose admission type is elective and procedure icd9 code is 4611?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "4611"
Below are sql tables 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 type is elective and procedure icd9 code is 4611? ### Input: CREATE TABLE pro...
From what country did someone score 71?
CREATE TABLE table_name_72 ( country VARCHAR, score VARCHAR )
SELECT country FROM table_name_72 WHERE score = 71
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: From what country did someone score 71? ### Input: CREATE TABLE table_name_72 ( country VARCHAR, score VARCHAR ) ###...
What is the recoupa sudamericana 1996 of the team with a copa libertadores 1996 result of the round of 16?
CREATE TABLE table_name_64 ( recopa_sudamericana_1996 VARCHAR, copa_libertadores_1996 VARCHAR )
SELECT recopa_sudamericana_1996 FROM table_name_64 WHERE copa_libertadores_1996 = "round of 16"
Below are sql tables 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 recoupa sudamericana 1996 of the team with a copa libertadores 1996 result of the round of 16? ### Input: CREATE...
What was the winning score for the tournament played on Jul 14, 1973?
CREATE TABLE table_41964 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
SELECT "Winning score" FROM table_41964 WHERE "Date" = 'jul 14, 1973'
Below are sql tables 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 winning score for the tournament played on Jul 14, 1973? ### Input: CREATE TABLE table_41964 ( "Date" text,...
what are the five year survival rates for those who were prescribed pantoprazole after having been diagnosed with bronchitis - acute?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five year survival rates for those who were prescribed pantoprazole after having been diagnosed with bronchitis...
What AMCULT 3 -credit courses are there ?
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
SELECT DISTINCT name, number FROM course WHERE department = 'AMCULT' AND credits = 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 AMCULT 3 -credit courses are there ? ### Input: CREATE TABLE course_prerequisite ( pre_course_id int, course_id...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the average of salary , and group by attribute job_id, sort by the y-axis from low to high.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(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: For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the average of sa...
specify birthdate and death status of patient mary davis
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 demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Mary Davis"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify birthdate and death status of patient mary davis ### Input: CREATE TABLE procedures ( subject_id text, hadm_...
Show all the ranks and the number of male and female faculty for each rank in a bar chart.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, c...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the ranks and the number of male and female faculty for each rank in a bar chart. ### Input: CREATE TABLE Participa...
Most used tags between Jan-15 Nov-15.
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS Questions14, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND P...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Most used tags between Jan-15 Nov-15. ### Input: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, ...
Bar chart of the total number from each party, I want to sort Y from high to low order please.
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text )
SELECT Party, COUNT(*) FROM representative GROUP BY Party 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 of the total number from each party, I want to sort Y from high to low order please. ### Input: CREATE TABLE elect...
for patients who were diagnosed with cystic kidney diseas nos since 2102, what are the top five most common treatments that followed afterwards during the same month?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
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 FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
Below are sql tables 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 patients who were diagnosed with cystic kidney diseas nos since 2102, what are the top five most common treatments that ...
what are the top five frequently prescribed drugs that patients have been prescribed in the same hospital encounter after having been diagnosed with acute respiratory failure - due to neurological process until 3 years ago?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respirato...
Below are sql tables 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 top five frequently prescribed drugs that patients have been prescribed in the same hospital encounter after ha...
For the match with a home team score of 11.14 (80), what was the venue?
CREATE TABLE table_33317 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (80)'
Below are sql tables 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 match with a home team score of 11.14 (80), what was the venue? ### Input: CREATE TABLE table_33317 ( "Home team...
What was the standing in the series after game 1?
CREATE TABLE table_name_1 ( series VARCHAR, game VARCHAR )
SELECT series FROM table_name_1 WHERE game = 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 was the standing in the series after game 1? ### Input: CREATE TABLE table_name_1 ( series VARCHAR, game VARCHA...
What club has a played number of 19, and the lost of 14?
CREATE TABLE table_76613 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
SELECT "Club" FROM table_76613 WHERE "Played" = '19' 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: What club has a played number of 19, and the lost of 14? ### Input: CREATE TABLE table_76613 ( "Club" text, "Played"...
I want to see trend of the number of open date by open date, display by the Open_Date from high to low.
CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY Open_Date DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to see trend of the number of open date by open date, display by the Open_Date from high to low. ### Input: CREATE TA...
How many married patients have had a direct bilirubin lab test?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Bilirubin, Direct"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many married patients have had a direct bilirubin lab test? ### Input: CREATE TABLE procedures ( subject_id text, ...
Which first leg had Galatasaray as Team 1?
CREATE TABLE table_56853 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
SELECT "1st leg" FROM table_56853 WHERE "Team 1" = 'galatasaray'
Below are sql tables 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 first leg had Galatasaray as Team 1? ### Input: CREATE TABLE table_56853 ( "Team 1" text, "Agg." text, "Te...
what was the name of the procedure that patient 005-4044 received two or more times during the first hospital visit.
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the procedure that patient 005-4044 received two or more times during the first hospital visit. ### Inp...
what lab tests are the five most commonly ordered until 2100?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 )...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) <= '2100' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 5)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what lab tests are the five most commonly ordered until 2100? ### Input: CREATE TABLE d_icd_diagnoses ( row_id number, ...
What is the Score on January 23?
CREATE TABLE table_name_8 ( score VARCHAR, date VARCHAR )
SELECT score FROM table_name_8 WHERE date = "january 23"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Score on January 23? ### Input: CREATE TABLE table_name_8 ( score VARCHAR, date VARCHAR ) ### Response: ...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of employee_id bin hire_date by time in a bar chart.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
Below are sql tables 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, show me about the distribution of hire_date and the sum of employe...
what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is cerebrospinal fluid (csf)?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" 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: what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is cerebrospin...
what is the number of patients whose age is less than 56 and drug route is po/ng?
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 < "56" AND prescriptions.route = "PO/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: what is the number of patients whose age is less than 56 and drug route is po/ng? ### Input: CREATE TABLE lab ( subject_...
what team play in february 18 in the supersonic season
CREATE TABLE table_21663 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Team" FROM table_21663 WHERE "Date" = 'February 18'
Below are sql tables 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 play in february 18 in the supersonic season ### Input: CREATE TABLE table_21663 ( "Game" real, "Date" tex...
when did patient 14621 get admitted to the hospital via the er admit since 2105 for the last time?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number,...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 14621 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 14621 get admitted to the hospital via the er admit since 2105 for the last time? ### Input: CREATE TABLE d...
What country had a Finish of t8?
CREATE TABLE table_62426 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
SELECT "Country" FROM table_62426 WHERE "Finish" = 't8'
Below are sql tables 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 country had a Finish of t8? ### Input: CREATE TABLE table_62426 ( "Player" text, "Country" text, "Year(s) w...
how much did patient 99205 have to pay for his stay in the hospital?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99205)
Below are sql tables 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 did patient 99205 have to pay for his stay in the hospital? ### Input: CREATE TABLE icustays ( row_id number, ...
What is the home team score of St Kilda?
CREATE TABLE table_name_4 ( home_team VARCHAR )
SELECT home_team AS score FROM table_name_4 WHERE home_team = "st kilda"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the home team score of St Kilda? ### Input: CREATE TABLE table_name_4 ( home_team VARCHAR ) ### Response: SELECT...
Find the id of the order which is shipped most recently.
CREATE TABLE products ( product_id number, product_name text, product_details text ) CREATE TABLE shipments ( shipment_id number, order_id number, invoice_number number, shipment_tracking_number text, shipment_date time, other_shipment_details text ) CREATE TABLE orders ( order...
SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments)
Below are sql tables 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 id of the order which is shipped most recently. ### Input: CREATE TABLE products ( product_id number, produ...
what are patient 017-47390's gender?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '017-47390'
Below are sql tables 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 patient 017-47390's gender? ### Input: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstay...
Which competition had an opponent of Police at the Selayang Stadium?
CREATE TABLE table_name_31 ( competition VARCHAR, opponent VARCHAR, venue VARCHAR )
SELECT competition FROM table_name_31 WHERE opponent = "police" AND venue = "selayang stadium"
Below are sql tables 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 competition had an opponent of Police at the Selayang Stadium? ### Input: CREATE TABLE table_name_31 ( competition...
What is the attendance at the game where San Jose was the visitor on May 4?
CREATE TABLE table_name_32 ( attendance VARCHAR, visitor VARCHAR, date VARCHAR )
SELECT attendance FROM table_name_32 WHERE visitor = "san jose" AND date = "may 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 attendance at the game where San Jose was the visitor on May 4? ### Input: CREATE TABLE table_name_32 ( atte...
What is the away team when north melbourne is at home?
CREATE TABLE table_name_99 ( away_team VARCHAR, home_team VARCHAR )
SELECT away_team FROM table_name_99 WHERE home_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 away team when north melbourne is at home? ### Input: CREATE TABLE table_name_99 ( away_team VARCHAR, ho...
Name the 2012 for 2009 of a and 2010 of a and 2011 of a
CREATE TABLE table_name_89 ( Id VARCHAR )
SELECT 2012 FROM table_name_89 WHERE 2009 = "a" AND 2010 = "a" AND 2011 = "a"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the 2012 for 2009 of a and 2010 of a and 2011 of a ### Input: CREATE TABLE table_name_89 ( Id VARCHAR ) ### Respons...
what ground transportation is available at the BOSTON airport
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND ground_service.airport_code = airport.airport_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what ground transportation is available at the BOSTON airport ### Input: CREATE TABLE city ( city_code varchar, city...
Which classes will I be able to take once I complete ELI 533 ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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, ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'ELI' AND COURSE_1.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: Which classes will I be able to take once I complete ELI 533 ? ### Input: CREATE TABLE gsi ( course_offering_id int, ...
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, order in ascending by the X-axis.
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
Below are sql tables 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, draw a bar chart about the distribution of headquarter ...
Show the total number of passengers of each location in a bar chart, and sort in desc by the total number of total passengers.
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location ORDER BY SUM(Total_Passengers) 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 total number of passengers of each location in a bar chart, and sort in desc by the total number of total passenger...
how many patients had drug code atro1i?
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 prescriptions.formulary_drug_cd = "ATRO1I"
Below are sql tables 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 had drug code atro1i? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, i...
provide the number of patients whose insurance is government and procedure long title is umbilical vein catheterization?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Umbilical vein catheterization"
Below are sql tables 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 insurance is government and procedure long title is umbilical vein catheterization? ###...
What is the lowest attendance when footscray is the away team?
CREATE TABLE table_4867 ( "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_4867 WHERE "Away team" = 'footscray'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest attendance when footscray is the away team? ### Input: CREATE TABLE table_4867 ( "Home team" text, ...
what is the three most frequently ordered lab test until 4 years ago for patients in the age of 30s?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(labevents.chartti...
Below are sql tables 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 three most frequently ordered lab test until 4 years ago for patients in the age of 30s? ### Input: CREATE TABLE...
List the 1st air date for season 12.
CREATE TABLE table_29520 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
SELECT "Original air date" FROM table_29520 WHERE "No. in season" = '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: List the 1st air date for season 12. ### Input: CREATE TABLE table_29520 ( "No. in series" real, "No. in season" rea...
how many times was diphenhydramine prescribed in the last year for patient 65467.
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65467) AND prescriptions.drug = 'diphenhydramine' AND DATETIME(prescriptions.startdate, '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: how many times was diphenhydramine prescribed in the last year for patient 65467. ### Input: CREATE TABLE admissions ( r...
Which potential's period 5 is 4 and has an element of antimony?
CREATE TABLE table_43274 ( "element" text, "group" real, "period" real, "reaction" text, "potential" text )
SELECT "potential" FROM table_43274 WHERE "period" = '5' AND "element" = 'antimony'
Below are sql tables 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 potential's period 5 is 4 and has an element of antimony? ### Input: CREATE TABLE table_43274 ( "element" text, ...
What is the original airdate when the season number is 4?
CREATE TABLE table_15824796_5 ( original_air_date VARCHAR, season__number VARCHAR )
SELECT original_air_date FROM table_15824796_5 WHERE season__number = 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 original airdate when the season number is 4? ### Input: CREATE TABLE table_15824796_5 ( original_air_date V...
What is the Method of the match with a Time of 4:07?
CREATE TABLE table_14161 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Time" text, "Location" text )
SELECT "Method" FROM table_14161 WHERE "Time" = '4:07'
Below are sql tables 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 Method of the match with a Time of 4:07? ### Input: CREATE TABLE table_14161 ( "Res." text, "Record" tex...
What team has 59.372 for qual 1?
CREATE TABLE table_35174 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
SELECT "Team" FROM table_35174 WHERE "Qual 1" = '59.372'
Below are sql tables 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 has 59.372 for qual 1? ### Input: CREATE TABLE table_35174 ( "Name" text, "Team" text, "Qual 1" text, ...
which flights arrive in ST. LOUIS from ST. PAUL on thursday morning
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 24 AND da...
Below are sql tables 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 flights arrive in ST. LOUIS from ST. PAUL on thursday morning ### Input: CREATE TABLE airline ( airline_code varch...
Who was the away team at Windy Hill?
CREATE TABLE table_name_11 ( away_team VARCHAR, venue VARCHAR )
SELECT away_team FROM table_name_11 WHERE venue = "windy hill"
Below are sql tables 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 away team at Windy Hill? ### Input: CREATE TABLE table_name_11 ( away_team VARCHAR, venue VARCHAR ) ### ...
give me the number of patients whose admission year is less than 2115 and procedure long title is insertion of non-drug-eluting coronary artery stent(s)?
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2115" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(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: give me the number of patients whose admission year is less than 2115 and procedure long title is insertion of non-drug-elut...
how much does it cost to take a drug called nystatin-triamcinolone cream?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'nystatin-triamcinolone cream')
Below are sql tables 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 it cost to take a drug called nystatin-triamcinolone cream? ### Input: CREATE TABLE d_icd_procedures ( row...
What is the gold number when the total is 8 and bronze is more than 4?
CREATE TABLE table_33938 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Gold") FROM table_33938 WHERE "Total" = '8' AND "Bronze" > '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 gold number when the total is 8 and bronze is more than 4? ### Input: CREATE TABLE table_33938 ( "Rank" text...
What shows for 2013 when the 2008 is 1r?
CREATE TABLE table_49788 ( "Tournament" text, "2008" text, "2010" text, "2011" text, "2012" text, "2013" text )
SELECT "2013" FROM table_49788 WHERE "2008" = '1r'
Below are sql tables 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 shows for 2013 when the 2008 is 1r? ### Input: CREATE TABLE table_49788 ( "Tournament" text, "2008" text, "...
Show all card type codes and the number of cards in each type by a bar chart, and I want to rank names in ascending order.
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHA...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all card type codes and the number of cards in each type by a bar chart, and I want to rank names in ascending order. #...
What is the smallest crowd with a Home team score of 7.10 (52)?
CREATE TABLE table_56918 ( "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_56918 WHERE "Home team score" = '7.10 (52)'
Below are sql tables 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 with a Home team score of 7.10 (52)? ### Input: CREATE TABLE table_56918 ( "Home team" text, ...
among patients on urgent admission, calculate the average age of those who remained admitted in hospital for 4 days.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay = "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: among patients on urgent admission, calculate the average age of those who remained admitted in hospital for 4 days. ### Inp...
How many laps had a grid number of 7?
CREATE TABLE table_56886 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT SUM("Laps") FROM table_56886 WHERE "Grid" = '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: How many laps had a grid number of 7? ### Input: CREATE TABLE table_56886 ( "Driver" text, "Constructor" text, "...
what is lab test category of subject id 2560?
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 lab."CATEGORY" FROM lab WHERE lab.subject_id = "2560"
Below are sql tables 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 lab test category of subject id 2560? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text,...
Which match where Hawthorn was the away team had the largest crowd?
CREATE TABLE table_74800 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT MAX("Crowd") FROM table_74800 WHERE "Away team" = 'hawthorn'
Below are sql tables 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 match where Hawthorn was the away team had the largest crowd? ### Input: CREATE TABLE table_74800 ( "Home team" te...
Who are all the Moto2 winners when the grand prix was Shell Advance Malaysian Grand Prix?
CREATE TABLE table_26781017_1 ( moto2_winner VARCHAR, grand_prix VARCHAR )
SELECT moto2_winner FROM table_26781017_1 WHERE grand_prix = "Shell Advance Malaysian grand_prix"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who are all the Moto2 winners when the grand prix was Shell Advance Malaysian Grand Prix? ### Input: CREATE TABLE table_2678...
How many faculty members participate in each activity? Return the activity names and the number of faculty members Show bar chart, and display x-axis from high to low order.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, c...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_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: How many faculty members participate in each activity? Return the activity names and the number of faculty members Show bar ...
Return a bar chart showing the number of companies in each building.
CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREATE TABLE building...
SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id 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: Return a bar chart showing the number of companies in each building. ### Input: CREATE TABLE Office_locations ( building...
how many patients with death status 1 had primary disease as aortic valve insuffiency\aortic valve replacement /sda?
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 WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA"
Below are sql tables 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 with death status 1 had primary disease as aortic valve insuffiency\aortic valve replacement /sda? ### Inp...
how many patients whose procedure icd9 code is 4523 and drug route is iv?
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4523" 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 procedure icd9 code is 4523 and drug route is iv? ### Input: CREATE TABLE lab ( subject_id text,...
what was the four most frequently taken lab tests since 5 years ago for patients in the age of 40s?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(labevents.chartti...
Below are sql tables 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 four most frequently taken lab tests since 5 years ago for patients in the age of 40s? ### Input: CREATE TABLE ...
Who was the opponent on the game with a 65,569 attendance before week 12?
CREATE TABLE table_name_62 ( opponent VARCHAR, week VARCHAR, attendance VARCHAR )
SELECT opponent FROM table_name_62 WHERE week < 12 AND attendance = "65,569"
Below are sql tables 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 on the game with a 65,569 attendance before week 12? ### Input: CREATE TABLE table_name_62 ( oppone...
What was the name of the epiode written by Gary M. Goodrich?
CREATE TABLE table_2409041_9 ( title VARCHAR, written_by VARCHAR )
SELECT title FROM table_2409041_9 WHERE written_by = "Gary M. Goodrich"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the name of the epiode written by Gary M. Goodrich? ### Input: CREATE TABLE table_2409041_9 ( title VARCHAR, ...
At 1:48.16 what was the number of track time?
CREATE TABLE table_16689920_1 ( track VARCHAR, time VARCHAR )
SELECT COUNT(track) FROM table_16689920_1 WHERE time = "1:48.16"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: At 1:48.16 what was the number of track time? ### Input: CREATE TABLE table_16689920_1 ( track VARCHAR, time VARCHAR...
had patient 2700 visited the er until 2104?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 2700 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) <= '2104'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 2700 visited the er until 2104? ### Input: CREATE TABLE d_items ( row_id number, itemid number, labe...
What was the score of the away team at princes park?
CREATE TABLE table_name_30 ( away_team VARCHAR, venue VARCHAR )
SELECT away_team AS score FROM table_name_30 WHERE venue = "princes park"
Below are sql tables 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 of the away team at princes park? ### Input: CREATE TABLE table_name_30 ( away_team VARCHAR, venu...
When the away team was geelong, what was the away team score?
CREATE TABLE table_10951 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_10951 WHERE "Away team" = 'geelong'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the away team was geelong, what was the away team score? ### Input: CREATE TABLE table_10951 ( "Home team" text, ...
Give me a histogram for how many students are older than 20 in each dorm?, display x axis from high to low order.
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Ad...
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY dorm_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: Give me a histogram for how many students are older than 20 in each dorm?, display x axis from high to low order. ### Input:...
When hale irwin is the winner what is the margin of victory?
CREATE TABLE table_73626 ( "Year" real, "Tournament" text, "Winner" text, "Margin of victory" text, "Winners share ( $ )" real, "Par" real, "Course length" text )
SELECT "Margin of victory" FROM table_73626 WHERE "Winner" = 'Hale Irwin'
Below are sql tables 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 hale irwin is the winner what is the margin of victory? ### Input: CREATE TABLE table_73626 ( "Year" real, "Tou...
Top 50 users in Bloemfontein.
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 Comments ( Id number, PostId number, Score numb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%south africa%' OR UPPER(Location) LIKE '%South Africa' ORDER BY Reputation DESC LIMIT 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: Top 50 users in Bloemfontein. ### Input: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate ti...
What was the time recorded for grid 18?
CREATE TABLE table_name_89 ( time_retired VARCHAR, grid VARCHAR )
SELECT time_retired FROM table_name_89 WHERE grid = 18
Below are sql tables 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 time recorded for grid 18? ### Input: CREATE TABLE table_name_89 ( time_retired VARCHAR, grid VARCHAR )...
Draw a pie chart with all distinct product categories along with the number of mailshots in each category.
CREATE TABLE Products ( product_id INTEGER, product_category VARCHAR(15), product_name VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, premise_id INTEGER, date_address_from DATETIME, address_type_code VARCHAR(15), date_address_to DATETIME ) CREATE TABLE Premises ( ...
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a pie chart with all distinct product categories along with the number of mailshots in each category. ### Input: CREATE...
get me patient 27451's total output volume until 2031 days ago.
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ...
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 = 27451)) AND DATETIME(outputevents.charttime) <= DATETIME(CURRENT_TIME(), '-2031 day')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me patient 27451's total output volume until 2031 days ago. ### Input: CREATE TABLE d_icd_procedures ( row_id number...
how many patients whose admission year is less than 2177 and lab test abnormal status is delta?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2177" AND lab.flag = "delta"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission year is less than 2177 and lab test abnormal status is delta? ### Input: CREATE TABLE proc...
Which Player has a Score of 67-72-71-75=285?
CREATE TABLE table_name_22 ( player VARCHAR, score VARCHAR )
SELECT player FROM table_name_22 WHERE score = 67 - 72 - 71 - 75 = 285
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Player has a Score of 67-72-71-75=285? ### Input: CREATE TABLE table_name_22 ( player VARCHAR, score VARCHAR )...
what was the first height of patient 006-153198 in 10/last year.
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), '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 was the first height of patient 006-153198 in 10/last year. ### Input: CREATE TABLE treatment ( treatmentid number,...
What are the first and last name of the president of the club 'Bootup Baltimore'?
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE club ( clubid number, clubname text, clubdes...
SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President"
Below are sql tables 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 first and last name of the president of the club 'Bootup Baltimore'? ### Input: CREATE TABLE student ( stui...
when patient 025-56111 last received a glucose - d50 procedure in the previous year?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-56111')) AND treatment.treatmentname = 'glucose - d50' AND DA...
Below are sql tables 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 patient 025-56111 last received a glucose - d50 procedure in the previous year? ### Input: CREATE TABLE microlab ( ...
Give me the comparison about School_ID over the ACC_Regular_Season by a bar chart, and I want to rank in desc by the y axis.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY School_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: Give me the comparison about School_ID over the ACC_Regular_Season by a bar chart, and I want to rank in desc by the y axis....
Name the rating for 3.79 viewers
CREATE TABLE table_25360 ( "Order" real, "Episode" text, "Airdate" text, "Rating" text, "Share" real, "Rating/Share (18\u201349)" text, "Viewers (millions)" text, "Rank (night)" real )
SELECT "Rating/Share (18\u201349)" FROM table_25360 WHERE "Viewers (millions)" = '3.79'
Below are sql tables 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 rating for 3.79 viewers ### Input: CREATE TABLE table_25360 ( "Order" real, "Episode" text, "Airdate" t...
did patient 021-25408 have normal levels of sao2 on the last icu visit?
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 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 = '021-25408') AND NOT patient.unitdischargetime IS NULL ORDER BY patie...
Below are sql tables 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 021-25408 have normal levels of sao2 on the last icu visit? ### Input: CREATE TABLE patient ( uniquepid text...
How many games were played in the season?
CREATE TABLE table_20359 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT MAX("Game") FROM table_20359
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games were played in the season? ### Input: CREATE TABLE table_20359 ( "Game" real, "Date" text, "Team"...
show me fares from DALLAS to BALTIMORE that cost less than 300 dollars
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TAB...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me fares from DALLAS to BALTIMORE that cost less than 300 dollars ### Input: CREATE TABLE ground_service ( city_cod...
What is the per-capita GDP of the country with an overall GDP of 80.955?
CREATE TABLE table_name_40 ( gdp_per_capita__us$_ VARCHAR, gdp__billion_us$_ VARCHAR )
SELECT gdp_per_capita__us$_ FROM table_name_40 WHERE gdp__billion_us$_ = "80.955"
Below are sql tables 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 per-capita GDP of the country with an overall GDP of 80.955? ### Input: CREATE TABLE table_name_40 ( gdp_per...
What is the smallest bronze with a Silver smaller than 2, and a Gold of 1, and a Nation of western isles, and a Total larger than 6?
CREATE TABLE table_14492 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Bronze") FROM table_14492 WHERE "Silver" < '2' AND "Gold" = '1' AND "Nation" = 'western isles' AND "Total" > '6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest bronze with a Silver smaller than 2, and a Gold of 1, and a Nation of western isles, and a Total larger...
What is the date of the game when the record is 2-0?
CREATE TABLE table_48452 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
SELECT "Date" FROM table_48452 WHERE "Record" = '2-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 date of the game when the record is 2-0? ### Input: CREATE TABLE table_48452 ( "Game" real, "Date" text,...
For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the hire_date bin hire_date by time, show in descending by the y-axis please.
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,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_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 was hired before 2002-06-21, give me the comparison about the average of manager_id over the hire_da...
what was the maximum yearly number of patients who were admitted for syst/diast hrt fail nos 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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_co...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'syst/diast hrt fail nos') AND DATETIME(diagnoses_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: what was the maximum yearly number of patients who were admitted for syst/diast hrt fail nos until 1 year ago? ### Input: CR...
Which Year(s) won has a To par of +8?
CREATE TABLE table_9754 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
SELECT "Year(s) won" FROM table_9754 WHERE "To par" = '+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: Which Year(s) won has a To par of +8? ### Input: CREATE TABLE table_9754 ( "Player" text, "Country" text, "Year(...
When did Bonecrusher win the championship at Bayam n, Puerto Rico?
CREATE TABLE table_68147 ( "Championship" text, "Champion(s)" text, "Previous champion(s)" text, "Date Won" text, "Location" text )
SELECT "Date Won" FROM table_68147 WHERE "Location" = 'bayamón, puerto rico' AND "Champion(s)" = 'bonecrusher'
Below are sql tables 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 Bonecrusher win the championship at Bayam n, Puerto Rico? ### Input: CREATE TABLE table_68147 ( "Championship" ...
What is the number of climbers for each mountain? Show me a bar chart, list by the x-axis in ascending.
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text )
SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name ORDER 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: What is the number of climbers for each mountain? Show me a bar chart, list by the x-axis in ascending. ### Input: CREATE TA...