instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
what flights do you have from BURBANK to TACOMA WASHINGTON
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time 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, flight, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_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 flights do you have from BURBANK to TACOMA WASHINGTON ### Input: CREATE TABLE airport_service ( city_code varchar, ...
How many assists per game in the tournament 2010 fiba world championship?
CREATE TABLE table_73586 ( "Tournament" text, "Games played" real, "Points per game" text, "Rebounds per game" text, "Assists per game" text )
SELECT "Assists per game" FROM table_73586 WHERE "Tournament" = '2010 FIBA World Championship'
Below are sql tables 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 assists per game in the tournament 2010 fiba world championship? ### Input: CREATE TABLE table_73586 ( "Tournam...
What is the lowest pick that has arizona cardinals as the NFL club?
CREATE TABLE table_name_43 ( pick INTEGER, nfl_club VARCHAR )
SELECT MIN(pick) FROM table_name_43 WHERE nfl_club = "arizona cardinals"
Below are sql tables 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 pick that has arizona cardinals as the NFL club? ### Input: CREATE TABLE table_name_43 ( pick INTEGER...
what is the first procedure that patient 8244 received since 2103?
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8244) AND STRFTIME('%y', procedures_icd.charttime) >= '2103' ORDER B...
Below are sql tables 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 first procedure that patient 8244 received since 2103? ### Input: CREATE TABLE chartevents ( row_id number, ...
Who was the high rebound for the high assists of d. j. augustin (8)?
CREATE TABLE table_21196 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "High rebounds" FROM table_21196 WHERE "High assists" = 'D. J. Augustin (8)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the high rebound for the high assists of d. j. augustin (8)? ### Input: CREATE TABLE table_21196 ( "Game" real, ...
Course 322 has been taught by Prof. Zuzana Srostlik how many times ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 322 AND instructor.name LIKE '%Zuzana Srostlik%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.off...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Course 322 has been taught by Prof. Zuzana Srostlik how many times ? ### Input: CREATE TABLE jobs ( job_id int, job_...
What opponent has a record of 86-62?
CREATE TABLE table_79724 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Opponent" FROM table_79724 WHERE "Record" = '86-62'
Below are sql tables 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 opponent has a record of 86-62? ### Input: CREATE TABLE table_79724 ( "Date" text, "Opponent" text, "Score"...
what is the admission location and procedure icd9 code for patient id 1121?
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 prescriptions...
SELECT demographic.admission_location, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "1121"
Below are sql tables 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 admission location and procedure icd9 code for patient id 1121? ### Input: CREATE TABLE lab ( subject_id tex...
Give me the number of unmarried patients who were ordered a transferrin 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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Transferrin"
Below are sql tables 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 unmarried patients who were ordered a transferrin lab test. ### Input: CREATE TABLE procedures ( s...
What is the average last cf of the st. louis blues, who has less than 4 cf appearances and less than 1 cf wins?
CREATE TABLE table_60294 ( "Team" text, "CF appearances" real, "CF wins" real, "Cup wins" real, "Last CF" real )
SELECT AVG("Last CF") FROM table_60294 WHERE "CF appearances" < '4' AND "CF wins" < '1' AND "Team" = 'st. louis blues'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average last cf of the st. louis blues, who has less than 4 cf appearances and less than 1 cf wins? ### Input: C...
what country is listed before france ?
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "nation" FROM table_203_374 WHERE id = (SELECT id FROM table_203_374 WHERE "nation" = 'france') - 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 country is listed before france ? ### Input: CREATE TABLE table_203_374 ( id number, "rank" number, "nation...
when did patient 18866 last have a urine out foley event on the current icu visit?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT outputevents.charttime 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 = 18866) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_item...
Below are sql tables 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 18866 last have a urine out foley event on the current icu visit? ### Input: CREATE TABLE microbiologyevent...
has the heartrate of patient 004-64091 during a day before been less than 79.0?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT 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 = '004-64091')) AND vitalperiodic.heartrate < 79.0 AND NOT vitalperiodi...
Below are sql tables 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 the heartrate of patient 004-64091 during a day before been less than 79.0? ### Input: CREATE TABLE vitalperiodic ( ...
Which game had a 9-7 record?
CREATE TABLE table_14276 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
SELECT "Game" FROM table_14276 WHERE "Record" = '9-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: Which game had a 9-7 record? ### Input: CREATE TABLE table_14276 ( "Game" real, "Date" text, "Opponent" text, ...
What was the attendance of the game November 24
CREATE TABLE table_11959669_3 ( location_attendance VARCHAR, date VARCHAR )
SELECT location_attendance FROM table_11959669_3 WHERE date = "November 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: What was the attendance of the game November 24 ### Input: CREATE TABLE table_11959669_3 ( location_attendance VARCHAR, ...
how many countries have earned over a hundred medals in total ?
CREATE TABLE table_203_612 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT("nation") FROM table_203_612 WHERE "total" > 100
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many countries have earned over a hundred medals in total ? ### Input: CREATE TABLE table_203_612 ( id number, "...
provide the number of patients with procedure icd9 code 9229 who died on or before 2126.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.icd9_code = "9229"
Below are sql tables 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 with procedure icd9 code 9229 who died on or before 2126. ### Input: CREATE TABLE prescriptio...
When are the birthdays of customer who are classified as 'Good Customer' status, and count them by a line chart, and list from high to low by the X-axis please.
CREATE TABLE Customer_Payments ( customer_id INTEGER, datetime_payment DATETIME, payment_method_code VARCHAR(10), amount_payment DOUBLE ) CREATE TABLE Lessons ( lesson_id INTEGER, customer_id INTEGER, lesson_status_code VARCHAR(15), staff_id INTEGER, vehicle_id INTEGER, lesson_d...
SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer' ORDER BY date_of_birth 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: When are the birthdays of customer who are classified as 'Good Customer' status, and count them by a line chart, and list fr...
what is minimum age of patients whose insurance is medicaid and ethnicity is american indian/alaska native?
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 MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose insurance is medicaid and ethnicity is american indian/alaska native? ### Input: CREAT...
all UA flights with stopovers in DENVER
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_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: all UA flights with stopovers in DENVER ### Input: CREATE TABLE class_of_service ( booking_class varchar, rank int, ...
What type of surface was used for the game played on September 20, 1993?
CREATE TABLE table_6977 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text )
SELECT "Surface" FROM table_6977 WHERE "Date" = 'september 20, 1993'
Below are sql tables 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 type of surface was used for the game played on September 20, 1993? ### Input: CREATE TABLE table_6977 ( "Date" tex...
who is the the incumbent with opponent being peter king (r) 56.0% david mejias (d) 44.0%
CREATE TABLE table_889 ( "District" real, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text )
SELECT "Incumbent" FROM table_889 WHERE "Opponent" = 'Peter King (R) 56.0% David Mejias (D) 44.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: who is the the incumbent with opponent being peter king (r) 56.0% david mejias (d) 44.0% ### Input: CREATE TABLE table_889 (...
Is ASIAN 252 available during Spring 2010 ?
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ASIAN' AND course.number = 252 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2010
Below are sql tables 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 ASIAN 252 available during Spring 2010 ? ### Input: CREATE TABLE student ( student_id int, lastname varchar, ...
What is the last year that someone is first elected?
CREATE TABLE table_1341690_9 ( first_elected INTEGER )
SELECT MAX(first_elected) FROM table_1341690_9
Below are sql tables 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 last year that someone is first elected? ### Input: CREATE TABLE table_1341690_9 ( first_elected INTEGER ) #...
What is the greatest interview that has a swimsuit less than 8.838?
CREATE TABLE table_11539 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
SELECT MAX("Interview") FROM table_11539 WHERE "Swimsuit" < '8.838'
Below are sql tables 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 greatest interview that has a swimsuit less than 8.838? ### Input: CREATE TABLE table_11539 ( "State" text, ...
Top PHP users in Ahmedabad, India.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, Dele...
SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "rank", Users.Id AS user_id, Users.DisplayName, Users.Reputation, Users.WebsiteUrl, Users.Location, Tags.TagName FROM Users JOIN Posts ON Posts.OwnerUserId = Users.Id JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE LOWE...
Below are sql tables 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 PHP users in Ahmedabad, India. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description t...
give me the number of patients whose admission type is elective and drug name is 5% dextrose (excel bag)?
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.admission_type = "ELECTIVE" AND prescriptions.drug = "5% Dextrose (EXCEL BAG)"
Below are sql tables 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 type is elective and drug name is 5% dextrose (excel bag)? ### Input: CREATE ...
How many players are injured in each day? Show a bar chart, and I want to order from high to low by the x-axis.
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( ...
SELECT Date, COUNT(Date) FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id GROUP BY Date ORDER BY 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: How many players are injured in each day? Show a bar chart, and I want to order from high to low by the x-axis. ### Input: C...
What is the sum of the rounds where the draft pick came from the college of tennessee and had an overall pick number bigger than 153 and a pick less than 14?
CREATE TABLE table_45972 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT SUM("Round") FROM table_45972 WHERE "College" = 'tennessee' AND "Overall" > '153' AND "Pick" < '14'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of the rounds where the draft pick came from the college of tennessee and had an overall pick number bigger ...
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Home.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Home
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Home. ### Input: CREATE TABLE basket...
how many patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of birth is less than 2095?
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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dob_year < "2095"
Below are sql tables 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 primary disease is coronary artery disease\coronary artery bypass graft /sda and year of birth is le...
In how many rounds of the draft was there a college from Georgia involved?
CREATE TABLE table_32776 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
SELECT COUNT("Round") FROM table_32776 WHERE "College" = 'georgia'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In how many rounds of the draft was there a college from Georgia involved? ### Input: CREATE TABLE table_32776 ( "Round"...
Which organisation hired the most number of research staff? List the organisation id, type and detail.
CREATE TABLE Research_Staff ( employer_organisation_id VARCHAR ) CREATE TABLE Organisations ( organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR )
SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id 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: Which organisation hired the most number of research staff? List the organisation id, type and detail. ### Input: CREATE TAB...
What is the Away team with Newcastle United as the Home team?
CREATE TABLE table_13198 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Away team" FROM table_13198 WHERE "Home team" = 'newcastle united'
Below are sql tables 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 with Newcastle United as the Home team? ### Input: CREATE TABLE table_13198 ( "Tie no" text, "...
provide the number of patients whose diagnoses short title is opioid dependence-unspec and drug route is dwell?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT 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 = "Opioid dependence-unspec" AND prescriptions.route = "DWELL"
Below are sql tables 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 diagnoses short title is opioid dependence-unspec and drug route is dwell? ### Input: C...
What was the score on April 21?
CREATE TABLE table_75214 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Score" FROM table_75214 WHERE "Date" = 'april 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 April 21? ### Input: CREATE TABLE table_75214 ( "Date" text, "Opponent" text, "Score" text...
What was the call sign for ERP W of 99?
CREATE TABLE table_name_68 ( call_sign VARCHAR, erp_w VARCHAR )
SELECT call_sign FROM table_name_68 WHERE erp_w = 99
Below are sql tables 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 call sign for ERP W of 99? ### Input: CREATE TABLE table_name_68 ( call_sign VARCHAR, erp_w VARCHAR ) #...
A bar chart for what are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, display in asc by the Y.
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(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: A bar chart for what are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, di...
What is the result for the event that lasted 2:20?
CREATE TABLE table_name_7 ( res VARCHAR, time VARCHAR )
SELECT res FROM table_name_7 WHERE time = "2:20"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result for the event that lasted 2:20? ### Input: CREATE TABLE table_name_7 ( res VARCHAR, time VARCHAR ...
What is the attendance of week 1
CREATE TABLE table_name_92 ( attendance VARCHAR, week VARCHAR )
SELECT attendance FROM table_name_92 WHERE week = 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 attendance of week 1 ### Input: CREATE TABLE table_name_92 ( attendance VARCHAR, week VARCHAR ) ### Resp...
on this hospital encounter, how old is patient 13054?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE i...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 13054 AND admissions.dischtime IS NULL
Below are sql tables 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 this hospital encounter, how old is patient 13054? ### Input: CREATE TABLE procedures_icd ( row_id number, subjec...
In Strategy of Sport Organizations what courses satisfy the PreMajor requirement ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Strategy of Sport Organizations%' OR course.description LIKE '%Strategy of Sport Organizations%'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In Strategy of Sport Organizations what courses satisfy the PreMajor requirement ? ### Input: CREATE TABLE student_record ( ...
Next Winter , who is teaching the Other classes ?
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Next Winter , who is teaching the Other classes ? ### Input: CREATE TABLE student ( student_id int, lastname varchar...
What is the Host of the Show with a Market of New York?
CREATE TABLE table_50181 ( "Show" text, "Host(s)" text, "Flagship" text, "Market" text, "iHeartRadio" text )
SELECT "Host(s)" FROM table_50181 WHERE "Market" = 'new york'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Host of the Show with a Market of New York? ### Input: CREATE TABLE table_50181 ( "Show" text, "Host(s)"...
when did patient 031-9128 last undergo a microbiology test in 11/last 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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND DATETIME(microlab.culturetakentime, 'start of yea...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 031-9128 last undergo a microbiology test in 11/last year? ### Input: CREATE TABLE microlab ( microlabi...
Return a bar chart about the distribution of date_address_to and the amount of date_address_to bin date_address_to by weekday.
CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id I...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of date_address_to and the amount of date_address_to bin date_address_to by weekda...
Return the average price of products that have each category code, and show X in desc order.
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the average price of products that have each category code, and show X in desc order. ### Input: CREATE TABLE Complai...
okay and on 5 4 i would like to go from ATLANTA to DENVER leaving early in the morning around 8
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hig...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 830 AND 730) AND date_day.day_number = 4 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_nam...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: okay and on 5 4 i would like to go from ATLANTA to DENVER leaving early in the morning around 8 ### Input: CREATE TABLE city...
Who was the oppenent what the score was L 68-60?
CREATE TABLE table_17104539_10 ( opponent VARCHAR, score VARCHAR )
SELECT opponent FROM table_17104539_10 WHERE score = "L 68-60"
Below are sql tables 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 oppenent what the score was L 68-60? ### Input: CREATE TABLE table_17104539_10 ( opponent VARCHAR, score...
Give the number of patients that survived and had a lab test name of phosphate, urine.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Phosphate, Urine"
Below are sql tables 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 number of patients that survived and had a lab test name of phosphate, urine. ### Input: CREATE TABLE diagnoses ( ...
Which CONMEBOL 1994 has a Supercopa 1994 of n/a, and a Recopa 1994 of n/a, and a Team of san lorenzo?
CREATE TABLE table_name_12 ( conmebol_1994 VARCHAR, team VARCHAR, supercopa_1994 VARCHAR, recopa_1994 VARCHAR )
SELECT conmebol_1994 FROM table_name_12 WHERE supercopa_1994 = "n/a" AND recopa_1994 = "n/a" AND team = "san lorenzo"
Below are sql tables 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 CONMEBOL 1994 has a Supercopa 1994 of n/a, and a Recopa 1994 of n/a, and a Team of san lorenzo? ### Input: CREATE TABL...
What is the latest week with the date of november 5, 1995?
CREATE TABLE table_32831 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT MAX("Week") FROM table_32831 WHERE "Date" = 'november 5, 1995'
Below are sql tables 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 week with the date of november 5, 1995? ### Input: CREATE TABLE table_32831 ( "Week" real, "Date"...
What is the name of department where has the smallest number of professors?
CREATE TABLE professor ( dept_code VARCHAR ) CREATE TABLE department ( dept_name VARCHAR, dept_code VARCHAR )
SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) 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 name of department where has the smallest number of professors? ### Input: CREATE TABLE professor ( dept_cod...
give me the cheapest round trip flight from DALLAS to BALTIMORE
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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....
Below are sql tables 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 cheapest round trip flight from DALLAS to BALTIMORE ### Input: CREATE TABLE airport_service ( city_code varc...
what intake did patient 25951 have the last time on 06/15/this year.
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25951)) AND DATETIME(inputevents_cv....
Below are sql tables 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 intake did patient 25951 have the last time on 06/15/this year. ### Input: CREATE TABLE prescriptions ( row_id numb...
Find the number of records of each policy type and its type code Visualize by bar chart, I want to list by the y axis in asc.
CREATE TABLE Claim_Headers ( Claim_Header_ID INTEGER, Claim_Status_Code CHAR(15), Claim_Type_Code CHAR(15), Policy_ID INTEGER, Date_of_Claim DATETIME, Date_of_Settlement DATETIME, Amount_Claimed DECIMAL(20,4), Amount_Piad DECIMAL(20,4) ) CREATE TABLE Staff ( Staff_ID INTEGER, St...
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of records of each policy type and its type code Visualize by bar chart, I want to list by the y axis in asc...
what was the last intake that patient 009-1746 had received on the first 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 intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-1746') AND NOT patient.unitdischargetime IS NULL ORDER B...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last intake that patient 009-1746 had received on the first icu visit? ### Input: CREATE TABLE patient ( un...
Show all payment method codes and the number of orders for each code. Visualize by pie chart.
CREATE TABLE Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR(255), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date ...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_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 payment method codes and the number of orders for each code. Visualize by pie chart. ### Input: CREATE TABLE Produc...
What classes during the Fall and Winter terms are upper-level electives ?
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 course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (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: What classes during the Fall and Winter terms are upper-level electives ? ### Input: CREATE TABLE course_prerequisite ( ...
What is the average Goals, when Team is 'Rah Ahan', and when Division is less than 1?
CREATE TABLE table_79119 ( "Season" text, "Team" text, "Country" text, "Division" real, "Goals" real )
SELECT AVG("Goals") FROM table_79119 WHERE "Team" = 'rah ahan' AND "Division" < '1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Goals, when Team is 'Rah Ahan', and when Division is less than 1? ### Input: CREATE TABLE table_79119 ( ...
For those employees who was hired before 2002-06-21, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_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 amount of job_id over the job_id , and...
Name the location attendance for january 18
CREATE TABLE table_23286112_8 ( location_attendance VARCHAR, date VARCHAR )
SELECT location_attendance FROM table_23286112_8 WHERE date = "January 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: Name the location attendance for january 18 ### Input: CREATE TABLE table_23286112_8 ( location_attendance VARCHAR, ...
Return the number of the claim start date for the claims whose claimed amount is no more than the average
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Customer_Policies ( Policy_ID INTEGE...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the number of the claim start date for the claims whose claimed amount is no more than the average ### Input: CREATE ...
What is the roll for the school with state authority and a decile of 9?
CREATE TABLE table_14695 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
SELECT "Roll" FROM table_14695 WHERE "Authority" = 'state' AND "Decile" = '9'
Below are sql tables 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 roll for the school with state authority and a decile of 9? ### Input: CREATE TABLE table_14695 ( "Name" tex...
What was the partner of the team that faced the guillermo garc a-l pez albert portas on clay?
CREATE TABLE table_name_45 ( partner VARCHAR, surface VARCHAR, opponents VARCHAR )
SELECT partner FROM table_name_45 WHERE surface = "clay" AND opponents = "guillermo garcía-lópez albert portas"
Below are sql tables 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 partner of the team that faced the guillermo garc a-l pez albert portas on clay? ### Input: CREATE TABLE table_...
What classes next Winter are MDE ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What classes next Winter are MDE ? ### Input: CREATE TABLE student_record ( student_id int, course_id int, semes...
what was the total number of clubs in division 1 in the 2010 northern football league season ?
CREATE TABLE table_204_959 ( id number, "club" text, "founded" number, "nickname" text, "location" text, "home ground" text, "entered competition" number, "most recent promotion" number )
SELECT COUNT("club") FROM table_204_959
Below are sql tables 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 total number of clubs in division 1 in the 2010 northern football league season ? ### Input: CREATE TABLE table...
Show me a bar chart for how many captains with younger than 50 are in each rank?, display in ascending by the bars.
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY 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 me a bar chart for how many captains with younger than 50 are in each rank?, display in ascending by the bars. ### Inpu...
Tell me the type of admission and status of death of the patient with patient id 10317.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "10317"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the type of admission and status of death of the patient with patient id 10317. ### Input: CREATE TABLE diagnoses ( ...
what was the score on june 29?
CREATE TABLE table_name_83 ( score VARCHAR, date VARCHAR )
SELECT score FROM table_name_83 WHERE date = "june 29"
Below are sql tables 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 june 29? ### Input: CREATE TABLE table_name_83 ( score VARCHAR, date VARCHAR ) ### Response: S...
how many patients have their admission location as clinic referral/premature and ventricular tachycardia as their primary disease?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA"
Below are sql tables 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 their admission location as clinic referral/premature and ventricular tachycardia as their primary di...
Count the number of different statuses.
CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE farm_competition ( competition_id number, year number, theme text, host_city_id number, hosts text ) CREATE TABLE competition_record ...
SELECT COUNT(DISTINCT status) FROM 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: Count the number of different statuses. ### Input: CREATE TABLE city ( city_id number, official_name text, statu...
how many dead/expired discharged patients were admitted before the year 2145?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.admityear < "2145"
Below are sql tables 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 were admitted before the year 2145? ### Input: CREATE TABLE diagnoses ( subjec...
when is the last time patient 5865 was admitted to hospital during a year before?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 5865 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when is the last time patient 5865 was admitted to hospital during a year before? ### Input: CREATE TABLE microbiologyevents...
What is the result for 2004 when A is the result for 2005, and the result of q1 when 2009?
CREATE TABLE table_50386 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2004" FROM table_50386 WHERE "2005" = 'a' AND "2009" = 'q1'
Below are sql tables 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 for 2004 when A is the result for 2005, and the result of q1 when 2009? ### Input: CREATE TABLE table_503...
what is the insurance of patient id 2560?
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 demographic.insurance FROM demographic WHERE demographic.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 the insurance of patient id 2560? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid te...
give me the round trip COACH fare from BALTIMORE to DALLAS
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE ...
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, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code ...
Below are sql tables 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 round trip COACH fare from BALTIMORE to DALLAS ### Input: CREATE TABLE restriction ( restriction_code text, ...
Are there many lecture sections offered for JAZZ 467 next semester ?
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'JAZZ' AND course.number = 467 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there many lecture sections offered for JAZZ 467 next semester ? ### Input: CREATE TABLE student ( student_id int, ...
What scored is recorded on April 24?
CREATE TABLE table_79746 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Score" FROM table_79746 WHERE "Date" = 'april 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: What scored is recorded on April 24? ### Input: CREATE TABLE table_79746 ( "Date" text, "Opponent" text, "Score"...
how many times does since 85 months ago patient 80645 get a creatinine clearance test?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine clearance') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80645) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-85 ...
Below are sql tables 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 does since 85 months ago patient 80645 get a creatinine clearance test? ### Input: CREATE TABLE labevents ( ...
mmse range: 10 to 28
CREATE TABLE table_train_98 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "lyperlipidemia_ldl" int, "allergy_to_milk" bool, "allergy_to_soy" bool, "body_mass_index_bmi" float, "NOUSE" float )
SELECT * FROM table_train_98 WHERE mini_mental_state_examination_mmse >= 10 AND mini_mental_state_examination_mmse <= 28
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mmse range: 10 to 28 ### Input: CREATE TABLE table_train_98 ( "id" int, "mini_mental_state_examination_mmse" int, ...
what name is at the top of the list ?
CREATE TABLE table_204_741 ( id number, "rank" number, "name" text, "nationality" text, "1,62" text, "1,67" text, "1,72" text, "1,75" text, "notes" text )
SELECT "name" FROM table_204_741 WHERE 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: what name is at the top of the list ? ### Input: CREATE TABLE table_204_741 ( id number, "rank" number, "name" t...
Which Week has a Result of l 10 30, and an Attendance larger than 57,312?
CREATE TABLE table_62476 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
SELECT AVG("Week") FROM table_62476 WHERE "Result" = 'l 10–30' AND "Attendance" > '57,312'
Below are sql tables 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 Week has a Result of l 10 30, and an Attendance larger than 57,312? ### Input: CREATE TABLE table_62476 ( "Week" r...
Name for me all PreMajor classes .
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_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: Name for me all PreMajor classes . ### Input: CREATE TABLE program_course ( program_id int, course_id int, workl...
how many different opponents did baljic play ?
CREATE TABLE table_203_179 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
SELECT COUNT(DISTINCT "opponent") FROM table_203_179
Below are sql tables 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 opponents did baljic play ? ### Input: CREATE TABLE table_203_179 ( id number, "goal" number, ...
For those records from the products and each product's manufacturer, show me about the distribution of name and code , and group by attribute name in a bar chart, display by the y-axis in descending please.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the distribution of name and code , and g...
What is the lest amount of bronzes that ranked 2 and has less silvers than 0?
CREATE TABLE table_45287 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Bronze") FROM table_45287 WHERE "Rank" = '2' AND "Silver" < '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 lest amount of bronzes that ranked 2 and has less silvers than 0? ### Input: CREATE TABLE table_45287 ( "Ran...
What candidate is associated with the Georgia 4 district?
CREATE TABLE table_18566 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Candidates" FROM table_18566 WHERE "District" = 'Georgia 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 candidate is associated with the Georgia 4 district? ### Input: CREATE TABLE table_18566 ( "District" text, "In...
give me the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and lab test fluid is pleural?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Pleural"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda...
tell me the four most common output events in 2104?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2104' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the four most common output events in 2104? ### Input: CREATE TABLE treatment ( treatmentid number, patientu...
what is drug name and drug route of drug code hydm4?
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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "HYDM4"
Below are sql tables 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 and drug route of drug code hydm4? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_i...
Find the name and training hours of players whose hours are below 1500.
CREATE TABLE Player ( pName VARCHAR, HS INTEGER )
SELECT pName, HS FROM Player WHERE HS < 1500
Below are sql tables 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 name and training hours of players whose hours are below 1500. ### Input: CREATE TABLE Player ( pName VARCHAR, ...
For each bed type, find the average room price. Show the proportion.
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
Below are sql tables 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 bed type, find the average room price. Show the proportion. ### Input: CREATE TABLE Rooms ( RoomId TEXT, ro...
What is the code name when the Southbridge shows as amd-766, via-vt82c686b?
CREATE TABLE table_name_26 ( code_name VARCHAR, southbridge VARCHAR )
SELECT code_name FROM table_name_26 WHERE southbridge = "amd-766, via-vt82c686b"
Below are sql tables 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 code name when the Southbridge shows as amd-766, via-vt82c686b? ### Input: CREATE TABLE table_name_26 ( code...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and employee_id , and sort Y from high to low order.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about...
tell me the sex of patient 035-19890.
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '035-19890'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the sex of patient 035-19890. ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayi...
Top user from Tiruchirappalli, Tamil Nadu.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, U...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Malaysia%' ORDER BY Reputation DESC LIMIT 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: Top user from Tiruchirappalli, Tamil Nadu. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, ...
Get All Users of Posts for a aws-lambda tag.
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
SELECT * FROM Users WHERE Id IN (SELECT OwnerUserId FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE Tags LIKE '%aws-lambda%'))
Below are sql tables 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 All Users of Posts for a aws-lambda tag. ### Input: CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREA...
tell me what is the top five most common procedures in 2103?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2103' GROUP BY procedures_icd.icd9_code) AS t1 ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me what is the top five most common procedures in 2103? ### Input: CREATE TABLE cost ( row_id number, subject_i...
how many people were diagnosed with choledochlith nos w obst and did not visit the hospital within 2 months this year?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'choledochl...
Below are sql tables 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 people were diagnosed with choledochlith nos w obst and did not visit the hospital within 2 months this year? ### I...