instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What are the speeds of the longest roller coaster?
CREATE TABLE country ( country_id number, name text, population number, area number, languages text ) CREATE TABLE roller_coaster ( roller_coaster_id number, name text, park text, country_id number, length number, height number, speed text, opened text, status te...
SELECT speed FROM roller_coaster ORDER BY length 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: What are the speeds of the longest roller coaster? ### Input: CREATE TABLE country ( country_id number, name text, ...
how many hours have it been since patient 97395 had the first idio periph neurpthy nos diagnosis during this hospital visit?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'idio periph neurpthy nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM ad...
Below are sql tables 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 hours have it been since patient 97395 had the first idio periph neurpthy nos diagnosis during this hospital visit?...
List the names of aircrafts and that won matches at least twice.
CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, winning_aircraft text ) CREATE TABLE aircraft ( aircraft_id number, ...
SELECT T1.aircraft FROM aircraft AS T1 JOIN match AS T2 ON T1.aircraft_id = T2.winning_aircraft GROUP BY T2.winning_aircraft HAVING COUNT(*) >= 2
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the names of aircrafts and that won matches at least twice. ### Input: CREATE TABLE airport_aircraft ( id number, ...
what's the percentile of 86.0 in a -polys lab test at the same age as patient 015-60616 when they visited the hospital first time?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE v...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = '-polys' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '015-60616' AND NOT patien...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the percentile of 86.0 in a -polys lab test at the same age as patient 015-60616 when they visited the hospital first...
what is the drug that patient 54386 was prescribed with within 2 days after having undergone entral infus nutrit sub on the last hospital encounter?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 54386 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the drug that patient 54386 was prescribed with within 2 days after having undergone entral infus nutrit sub on the ...
what was the last value of a ph lab test of patient 006-77873 in 11/last year?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-77873')) AND lab.labname = 'ph' AND DATETIME(lab.labresulttime, '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 last value of a ph lab test of patient 006-77873 in 11/last year? ### Input: CREATE TABLE cost ( costid num...
What's the highest lane of rank 4 with a time less than 24.72?
CREATE TABLE table_64910 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
SELECT MAX("Lane") FROM table_64910 WHERE "Time" < '24.72' AND "Rank" = '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's the highest lane of rank 4 with a time less than 24.72? ### Input: CREATE TABLE table_64910 ( "Rank" real, "L...
mini _ mental state examination ( mmse ) score of 16 to 26 .
CREATE TABLE table_train_91 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "rosen_modified_hachinski_ischemic_score" int, "NOUSE" float )
SELECT * FROM table_train_91 WHERE mini_mental_state_examination_mmse >= 16 AND mini_mental_state_examination_mmse <= 26
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mini _ mental state examination ( mmse ) score of 16 to 26 . ### Input: CREATE TABLE table_train_91 ( "id" int, "min...
Who played Melbourne as the home team?
CREATE TABLE table_name_38 ( home_team VARCHAR, away_team VARCHAR )
SELECT home_team FROM table_name_38 WHERE away_team = "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: Who played Melbourne as the home team? ### Input: CREATE TABLE table_name_38 ( home_team VARCHAR, away_team VARCHAR ...
After 10:00 , does PEDDENT 598 have any sections ?
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'PEDDENT' AND course.number = 598 AND semester.semester = 'WN' 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: After 10:00 , does PEDDENT 598 have any sections ? ### Input: CREATE TABLE course_offering ( offering_id int, course...
have type i or ii diabetes
CREATE TABLE table_train_12 ( "id" int, "sequential_organ_failure_assessment_sofa" int, "active_infection" bool, "taking_pioglitazone" bool, "taking_rosiglitazone" bool, "body_weight" float, "diabetic" string, "organ_failure" bool, "age" float, "NOUSE" float )
SELECT * FROM table_train_12 WHERE diabetic = 'i' OR diabetic = 'ii'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: have type i or ii diabetes ### Input: CREATE TABLE table_train_12 ( "id" int, "sequential_organ_failure_assessment_s...
A bar chart about how many students live in each city?, and sort by the bar in desc.
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_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: A bar chart about how many students live in each city?, and sort by the bar in desc. ### Input: CREATE TABLE Allergy_Type ( ...
count the number of patients whose age is less than 70 and admission year is less than 2180?
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 WHERE demographic.age < "70" AND demographic.admityear < "2180"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose age is less than 70 and admission year is less than 2180? ### Input: CREATE TABLE prescri...
what is gender and drug code of subject 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT demographic.gender, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id 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 gender and drug code of subject id 2560? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, it...
What is the average number of goals with more than 9 points, less than 14 goals against, and a goal difference less than 17?
CREATE TABLE table_9107 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
SELECT AVG("Goals for") FROM table_9107 WHERE "Points" > '9' AND "Goals against" < '14' AND "Goal Difference" < '17'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of goals with more than 9 points, less than 14 goals against, and a goal difference less than 17?...
What is the number drawn when 3 have been lost?
CREATE TABLE table_name_74 ( drawn VARCHAR, lost VARCHAR )
SELECT drawn FROM table_name_74 WHERE lost = "3"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number drawn when 3 have been lost? ### Input: CREATE TABLE table_name_74 ( drawn VARCHAR, lost VARCHAR ...
find the dignoses of subject id 6983.
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.diagnosis FROM demographic WHERE demographic.subject_id = "6983"
Below are sql tables 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 dignoses of subject id 6983. ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_c...
Which Melbourne has Gold Coast yes, Perth cancelled, and Adelaide cancelled?
CREATE TABLE table_name_11 ( melbourne VARCHAR, adelaide VARCHAR, gold_coast VARCHAR, perth VARCHAR )
SELECT melbourne FROM table_name_11 WHERE gold_coast = "yes" AND perth = "cancelled" AND adelaide = "cancelled"
Below are sql tables 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 Melbourne has Gold Coast yes, Perth cancelled, and Adelaide cancelled? ### Input: CREATE TABLE table_name_11 ( mel...
find the diagnoses and procedure name for subject id 4342.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4342"
Below are sql tables 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 diagnoses and procedure name for subject id 4342. ### Input: CREATE TABLE diagnoses ( subject_id text, hadm...
give me the number of patients whose marital status is single and procedure long title is open and other right hemicolectomy?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Open and other right hemicolectomy"
Below are sql tables 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 marital status is single and procedure long title is open and other right hemicolectomy...
Show the name for regions and the number of storms for each region by a bar chart, and display in descending by the Y please.
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id 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: Show the name for regions and the number of storms for each region by a bar chart, and display in descending by the Y please...
What is the crowd number for the event that has a score of 8.25 (73) for the Away team?
CREATE TABLE table_57640 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT COUNT("Crowd") FROM table_57640 WHERE "Away team score" = '8.25 (73)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the crowd number for the event that has a score of 8.25 (73) for the Away team? ### Input: CREATE TABLE table_57640 ...
how many of the adult patients with bmi less than 19 received additive therapy?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "BMI less than 19,adult" AND prescriptions.drug_type = "ADDITIVE"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the adult patients with bmi less than 19 received additive therapy? ### Input: CREATE TABLE procedures ( sub...
Which player has a pick of 175?
CREATE TABLE table_39071 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
SELECT "Player" FROM table_39071 WHERE "Pick" = '175'
Below are sql tables 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 pick of 175? ### Input: CREATE TABLE table_39071 ( "Round" real, "Pick" real, "Player" text, ...
Who did the team lose to on September 8?
CREATE TABLE table_name_52 ( loss VARCHAR, date VARCHAR )
SELECT loss FROM table_name_52 WHERE date = "september 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 did the team lose to on September 8? ### Input: CREATE TABLE table_name_52 ( loss VARCHAR, date VARCHAR ) ### Re...
give me the number of patients whose diagnoses long title is other respiratory problems after birth and drug type is main?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other respiratory problems after birth" AND prescriptions.drug_type = "MAIN"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose diagnoses long title is other respiratory problems after birth and drug type is main? #...
what is the time/retired when the grid is less than 3 and 45 laps?
CREATE TABLE table_name_95 ( time_retired VARCHAR, grid VARCHAR, laps VARCHAR )
SELECT time_retired FROM table_name_95 WHERE grid < 3 AND laps = 45
Below are sql tables 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 time/retired when the grid is less than 3 and 45 laps? ### Input: CREATE TABLE table_name_95 ( time_retired ...
what is average age of patients whose marital status is single and year of birth is greater than 2098?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2098"
Below are sql tables 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 average age of patients whose marital status is single and year of birth is greater than 2098? ### Input: CREATE TAB...
what was patient 40435 diagnosed with first time in 2105.
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' ORDER BY diagn...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 40435 diagnosed with first time in 2105. ### Input: CREATE TABLE chartevents ( row_id number, subje...
Which incumbent was first elected in 1940?
CREATE TABLE table_1342256_10 ( incumbent VARCHAR, first_elected VARCHAR )
SELECT incumbent FROM table_1342256_10 WHERE first_elected = 1940
Below are sql tables 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 incumbent was first elected in 1940? ### Input: CREATE TABLE table_1342256_10 ( incumbent VARCHAR, first_elect...
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and order in asc by the Y.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_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 did not have any job in the past, draw a bar chart about the distribution of hire_date and the avera...
What is the Host of the Show with a Market of New York?
CREATE TABLE table_name_78 ( host_s_ VARCHAR, market VARCHAR )
SELECT host_s_ FROM table_name_78 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_name_78 ( host_s_ VARCHAR, mar...
Total number of views for a given tag.
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Descr...
SELECT SUM(ViewCount) AS Views FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Questions.PostTypeId = 1 AND Tags.TagName = '##tagname##'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Total number of views for a given tag. ### Input: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Post...
how many patients admitted before the year 2167 had an emergency admission type?
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2167"
Below are sql tables 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 admitted before the year 2167 had an emergency admission type? ### Input: CREATE TABLE prescriptions ( ...
What's the to par for the score of 68-74-71-77=290?
CREATE TABLE table_name_5 ( to_par VARCHAR, score VARCHAR )
SELECT to_par FROM table_name_5 WHERE score = 68 - 74 - 71 - 77 = 290
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the to par for the score of 68-74-71-77=290? ### Input: CREATE TABLE table_name_5 ( to_par VARCHAR, score VAR...
show me the top four most common diagnoses until 2103?
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2103' GROUP BY diagnosis.diagnosisname) 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: show me the top four most common diagnoses until 2103? ### Input: CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
Give me a histogram for how many events are there for each party?, and display by the bars in asc.
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE region ( Region_ID int, Region_name tex...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a histogram for how many events are there for each party?, and display by the bars in asc. ### Input: CREATE TABLE p...
In Tie #19, what was the name of the away team?
CREATE TABLE table_50151 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Away team" FROM table_50151 WHERE "Tie no" = '19'
Below are sql tables 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 Tie #19, what was the name of the away team? ### Input: CREATE TABLE table_50151 ( "Tie no" text, "Home team" tex...
How many silver medals had a rank of 3 with bronze larger than 0?
CREATE TABLE table_name_90 ( silver VARCHAR, rank VARCHAR, bronze VARCHAR )
SELECT COUNT(silver) FROM table_name_90 WHERE rank = 3 AND bronze > 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: How many silver medals had a rank of 3 with bronze larger than 0? ### Input: CREATE TABLE table_name_90 ( silver VARCHAR...
what is the amount of urine output patient 028-70851 has until 06/15/2104?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851')) AND intakeoutput.celllabel = '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: what is the amount of urine output patient 028-70851 has until 06/15/2104? ### Input: CREATE TABLE cost ( costid number,...
Name the number of games on june 12
CREATE TABLE table_72251 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
SELECT COUNT("Game") FROM table_72251 WHERE "Date" = 'June 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: Name the number of games on june 12 ### Input: CREATE TABLE table_72251 ( "Game" real, "Date" text, "Team" text,...
Record of 11 12 involved what average attendance figures?
CREATE TABLE table_36526 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT AVG("Attendance") FROM table_36526 WHERE "Record" = '11–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: Record of 11 12 involved what average attendance figures? ### Input: CREATE TABLE table_36526 ( "Date" text, "Oppone...
What's the heat in the lane less than 3 with a time of 14:48.39?
CREATE TABLE table_name_99 ( heat INTEGER, lane VARCHAR, time VARCHAR )
SELECT AVG(heat) FROM table_name_99 WHERE lane < 3 AND time = "14:48.39"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the heat in the lane less than 3 with a time of 14:48.39? ### Input: CREATE TABLE table_name_99 ( heat INTEGER, ...
What is the gold when silver is 1, rank is larger than 3, total is smaller than 2, bronze is smaller than 0?
CREATE TABLE table_name_52 ( gold INTEGER, bronze VARCHAR, total VARCHAR, silver VARCHAR, rank VARCHAR )
SELECT SUM(gold) FROM table_name_52 WHERE silver = 1 AND rank > 3 AND total < 2 AND bronze < 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 gold when silver is 1, rank is larger than 3, total is smaller than 2, bronze is smaller than 0? ### Input: CREA...
what is the name of a procedure that patient 015-94351 has been given for two times in 07/last year?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT 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 is the name of a procedure that patient 015-94351 has been given for two times in 07/last year? ### Input: CREATE TABLE...
what are the three most frequently prescribed drugs for patients who are also prescribed amlodipine besylate at the same time in 2105?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'amlodipine besylate' AND STRFTIME('%y', prescriptions.startdate) ...
Below are sql tables 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 three most frequently prescribed drugs for patients who are also prescribed amlodipine besylate at the same tim...
when was patient 035-11687 for the first time prescribed a medication via the po route since 12/2102?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patient...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11687')) AND medication.routeadmin = 'po' AND STRFTIME('%y...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 035-11687 for the first time prescribed a medication via the po route since 12/2102? ### Input: CREATE TABL...
count the number of patients whose marital status is single and diagnoses long title is malignant neoplasm of descending colon?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Malignant neoplasm of descending colon"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose marital status is single and diagnoses long title is malignant neoplasm of descending col...
I want to know the proportion of All_Games_Percent for each all neutral.
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 All_Neutral, All_Games_Percent FROM basketball_match
Below are sql tables 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 know the proportion of All_Games_Percent for each all neutral. ### Input: CREATE TABLE university ( School_ID ...
Give me a bar chart for mean team id of each all home
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 All_Home, AVG(Team_ID) 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: Give me a bar chart for mean team id of each all home ### Input: CREATE TABLE university ( School_ID int, School tex...
A bar chart about what are the different software platforms for devices, and how many devices have each?, and rank by the the total number from low to high.
CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE stock ( Shop_ID int, Device...
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform 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: A bar chart about what are the different software platforms for devices, and how many devices have each?, and rank by the th...
have patient 030-53717's sao2 been today greater than 95.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 allergy ( allergy...
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 = '030-53717')) AND vitalperiodic.sao2 > 95.0 AND NOT vitalperiodic.sao...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: have patient 030-53717's sao2 been today greater than 95.0? ### Input: CREATE TABLE vitalperiodic ( vitalperiodicid numb...
what is the number of patients whose ethnicity is white - russian and admission year is less than 2156?
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 WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2156"
Below are sql tables 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 ethnicity is white - russian and admission year is less than 2156? ### Input: CREATE TA...
Name the fewest tries for leicester tigers with points less than 207
CREATE TABLE table_name_6 ( tries INTEGER, club VARCHAR, points VARCHAR )
SELECT MIN(tries) FROM table_name_6 WHERE club = "leicester tigers" AND points < 207
Below are sql tables 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 fewest tries for leicester tigers with points less than 207 ### Input: CREATE TABLE table_name_6 ( tries INTEGE...
tell me the yearly maximum sao2 of patient 015-94542.
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND NOT vitalperiodic.sao2 IS NULL GROUP BY ...
Below are sql tables 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 yearly maximum sao2 of patient 015-94542. ### Input: CREATE TABLE cost ( costid number, uniquepid text, ...
What was the tie number when bradford park avenue was the away team?
CREATE TABLE table_44774 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Tie no" FROM table_44774 WHERE "Away team" = 'bradford park avenue'
Below are sql tables 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 tie number when bradford park avenue was the away team? ### Input: CREATE TABLE table_44774 ( "Tie no" text...
when was the last time that patient 016-35481 was prescribed dextrose and nss infusion at the same time?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dextrose' AND patient.uniquepid = '016-35481') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medica...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time that patient 016-35481 was prescribed dextrose and nss infusion at the same time? ### Input: CREATE T...
tell me the time of admission and icu stay id for patient marilyn norvell.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.admittime, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
Below are sql tables 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 time of admission and icu stay id for patient marilyn norvell. ### Input: CREATE TABLE diagnoses ( subject_i...
A bar chart shows the distribution of Sex and the sum of Weight , and group by attribute Sex.
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
Below are sql tables 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 shows the distribution of Sex and the sum of Weight , and group by attribute Sex. ### Input: CREATE TABLE people...
What is the last match with a vacancy date of round 2 and Ney Franco as outgoing manager?
CREATE TABLE table_35437 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text )
SELECT "Last match" FROM table_35437 WHERE "Date of vacancy" = 'round 2' AND "Outgoing manager" = 'ney franco'
Below are sql tables 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 match with a vacancy date of round 2 and Ney Franco as outgoing manager? ### Input: CREATE TABLE table_3543...
What is the result for 1989 that has a 1992 result of 0 / 1?
CREATE TABLE table_name_35 ( Id VARCHAR )
SELECT 1989 FROM table_name_35 WHERE 1992 = "0 / 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 result for 1989 that has a 1992 result of 0 / 1? ### Input: CREATE TABLE table_name_35 ( Id VARCHAR ) ### Re...
Which League has a League Cup smaller than 0?
CREATE TABLE table_40664 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real )
SELECT MIN("League") FROM table_40664 WHERE "League Cup" < '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: Which League has a League Cup smaller than 0? ### Input: CREATE TABLE table_40664 ( "Player" text, "Club" text, ...
What was the largest crowd when the away team scored 2.19 (31)?
CREATE TABLE table_53457 ( "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_53457 WHERE "Away team score" = '2.19 (31)'
Below are sql tables 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 largest crowd when the away team scored 2.19 (31)? ### Input: CREATE TABLE table_53457 ( "Home team" text, ...
how many patients with admission location as clinic referral/premature were diagnosed with diverticulosis of colon with hemorrhage?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Diverticulosis of colon with hemorrhage"
Below are sql tables 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 admission location as clinic referral/premature were diagnosed with diverticulosis of colon with hemo...
Who did the most high rebounds in the game played on November 1?
CREATE TABLE table_17326036_5 ( high_rebounds VARCHAR, date VARCHAR )
SELECT high_rebounds FROM table_17326036_5 WHERE date = "November 1"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who did the most high rebounds in the game played on November 1? ### Input: CREATE TABLE table_17326036_5 ( high_rebound...
Which Adelaide has a Sydney of yes, a Perth of no, a Melbourne of yes, and an Auckland of no?
CREATE TABLE table_name_30 ( adelaide VARCHAR, auckland VARCHAR, melbourne VARCHAR, sydney VARCHAR, perth VARCHAR )
SELECT adelaide FROM table_name_30 WHERE sydney = "yes" AND perth = "no" AND melbourne = "yes" AND auckland = "no"
Below are sql tables 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 Adelaide has a Sydney of yes, a Perth of no, a Melbourne of yes, and an Auckland of no? ### Input: CREATE TABLE table_...
provide the number of patients whose admission type is elective and diagnoses icd9 code is 7761?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "7761"
Below are sql tables 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 diagnoses icd9 code is 7761? ### Input: CREATE TABLE pre...
since 2103, when was the last hospital admission time of patient 021-69410?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '021-69410' AND STRFTIME('%y', patient.hospitaladmittime) >= '2103' ORDER BY patient.hospitaladmittime 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: since 2103, when was the last hospital admission time of patient 021-69410? ### Input: CREATE TABLE medication ( medicat...
What were the competitions when the away team was fk kozara gradiska?
CREATE TABLE table_31311 ( "Date" text, "Competition" text, "Location" text, "Home Team" text, "Result" text, "Away Team" text )
SELECT "Competition" FROM table_31311 WHERE "Away Team" = 'FK Kozara Gradiska'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were the competitions when the away team was fk kozara gradiska? ### Input: CREATE TABLE table_31311 ( "Date" text,...
What are the ids and names of all start stations that were the beginning of at least 200 trips Show bar chart, list by the X-axis in descending.
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_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: What are the ids and names of all start stations that were the beginning of at least 200 trips Show bar chart, list by the X...
what team scored 17
CREATE TABLE table_5590 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
SELECT "Date" FROM table_5590 WHERE "Game" = '17'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what team scored 17 ### Input: CREATE TABLE table_5590 ( "Game" real, "Date" text, "Opponent" text, "Score" ...
Who is the incumbent who was first elected before 2002 from the maryland 3 district?
CREATE TABLE table_79087 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
SELECT "Incumbent" FROM table_79087 WHERE "First elected" < '2002' AND "District" = 'maryland 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: Who is the incumbent who was first elected before 2002 from the maryland 3 district? ### Input: CREATE TABLE table_79087 ( ...
how many patients are with lab test chart time 2111-12-22 19:13:00?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2111-12-22 19:13:00"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are with lab test chart time 2111-12-22 19:13:00? ### Input: CREATE TABLE prescriptions ( subject_id t...
Who is the away side at windy hill?
CREATE TABLE table_name_35 ( away_team VARCHAR, venue VARCHAR )
SELECT away_team FROM table_name_35 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 is the away side at windy hill? ### Input: CREATE TABLE table_name_35 ( away_team VARCHAR, venue VARCHAR ) ### R...
Who was responsible and what was the number for the high rebounds on December 22?
CREATE TABLE table_884 ( "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_884 WHERE "Date" = 'December 22'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was responsible and what was the number for the high rebounds on December 22? ### Input: CREATE TABLE table_884 ( "G...
what is the schedule of flights from BOSTON to DENVER next monday
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time 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 AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (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 is the schedule of flights from BOSTON to DENVER next monday ### Input: CREATE TABLE time_interval ( period text, ...
what is the number of patients whose admission type is urgent and lab test name is amylase, ascites?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Amylase, Ascites"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is urgent and lab test name is amylase, ascites? ### Input: CREATE TABLE...
what were the five most frequently prescribed drugs that patients were prescribed during the same hospital visit after having been diagnosed with ac posthemorrhag anemia until 2104?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most frequently prescribed drugs that patients were prescribed during the same hospital visit after havin...
How many faculty members participate in each activity? Return the activity names and the number of faculty members Show bar chart, and list by the Y in descending.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName...
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 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: How many faculty members participate in each activity? Return the activity names and the number of faculty members Show bar ...
What is the value in 2008 for the US Open?
CREATE TABLE table_name_31 ( tournament VARCHAR )
SELECT 2008 FROM table_name_31 WHERE tournament = "us open"
Below are sql tables 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 value in 2008 for the US Open? ### Input: CREATE TABLE table_name_31 ( tournament VARCHAR ) ### Response: SE...
Most popular tag May 2013.
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
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 QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
Below are sql tables 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 popular tag May 2013. ### Input: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, ...
What was the amount of laps for the vehicle manufactured by honda with a grid of 9?
CREATE TABLE table_name_34 ( laps VARCHAR, manufacturer VARCHAR, grid VARCHAR )
SELECT laps FROM table_name_34 WHERE manufacturer = "honda" AND grid = "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 was the amount of laps for the vehicle manufactured by honda with a grid of 9? ### Input: CREATE TABLE table_name_34 ( ...
Next year , do you know which courses Prof. Bufford Ang will be teaching ?
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Bufford Ang%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
Below are sql tables 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 year , do you know which courses Prof. Bufford Ang will be teaching ? ### Input: CREATE TABLE ta ( campus_job_id in...
Please compare the number of the church by open date (bin into the weekday) using a bar chart.
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) 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 t...
SELECT Open_Date, COUNT(Open_Date) FROM church
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please compare the number of the church by open date (bin into the weekday) using a bar chart. ### Input: CREATE TABLE peopl...
subjects must have an admission blood glucose > 140 mg and < 400 mg / dl and no evidence of ketoacidosis ( serum bicarbonate < 18 meq / l
CREATE TABLE table_train_233 ( "id" int, "serum_bicarbonate" int, "language" string, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "admission_blood_glucose" int, "urine_albumin" int, "ketoacidosis" bool, "age" float, "NOUSE" float )
SELECT * FROM table_train_233 WHERE admission_blood_glucose > 140 AND admission_blood_glucose < 400 AND (ketoacidosis = 0 OR serum_bicarbonate > 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: subjects must have an admission blood glucose > 140 mg and < 400 mg / dl and no evidence of ketoacidosis ( serum bicarbonate...
tell me the time when patient 48868 was last diagnosed with ac salpingo-oophoritis in their last hospital visit?
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 diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac salpingo-oophoritis') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 48868 AND NOT admis...
Below are sql tables 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 time when patient 48868 was last diagnosed with ac salpingo-oophoritis in their last hospital visit? ### Input: ...
what is the number of patients whose age is less than 70 and lab test fluid is cerebrospinal fluid (csf)?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" 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 age is less than 70 and lab test fluid is cerebrospinal fluid (csf)? ### Input: CREATE ...
how many countries have at least 10 total medals ?
CREATE TABLE table_203_716 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT("nation") FROM table_203_716 WHERE "total" >= 10
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many countries have at least 10 total medals ? ### Input: CREATE TABLE table_203_716 ( id number, "rank" number,...
how many patients less than 30 years of age have been discharged to home health care?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "30"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients less than 30 years of age have been discharged to home health care? ### Input: CREATE TABLE lab ( subj...
cheapest flight from MEMPHIS to MIAMI
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' 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: cheapest flight from MEMPHIS to MIAMI ### Input: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text,...
What date had a CD format, under Columbia/Legacy from the UK?
CREATE TABLE table_64153 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
SELECT "Date" FROM table_64153 WHERE "Format" = 'cd' AND "Label" = 'columbia/legacy' AND "Country" = 'uk'
Below are sql tables 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 date had a CD format, under Columbia/Legacy from the UK? ### Input: CREATE TABLE table_64153 ( "Date" text, "La...
What is the average age for a male in each job. Visualize by bar chart.
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job
Below are sql tables 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 age for a male in each job. Visualize by bar chart. ### Input: CREATE TABLE PersonFriend ( name varc...
What is the difference between the courses PHYSED 414 and PHYSED 142 ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT department, description, number FROM course WHERE (department = 'PHYSED' AND number = 414) OR (department = 'PHYSED' AND number = 142)
Below are sql tables 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 difference between the courses PHYSED 414 and PHYSED 142 ? ### Input: CREATE TABLE student_record ( student_...
how many male patients had unspecified erythematous condition?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Unspecified erythematous condition"
Below are sql tables 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 male patients had unspecified erythematous condition? ### Input: CREATE TABLE prescriptions ( subject_id text, ...
on 12/26/last year, when was the first time that the sao2 of patient 030-8973 was less than 99.0?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973')) AND vitalperiodic.sao2 < 99.0 AND NOT v...
Below are sql tables 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 12/26/last year, when was the first time that the sao2 of patient 030-8973 was less than 99.0? ### Input: CREATE TABLE di...
what is drug type and drug route of drug code kpho45i?
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_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "KPHO45I"
Below are sql tables 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 type and drug route of drug code kpho45i? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm...
report the number of black/haitian ethnic background patients suffering from copd exacerbation primary disease.
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.ethnicity = "BLACK/HAITIAN" AND demographic.diagnosis = "COPD EXACERBATION"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: report the number of black/haitian ethnic background patients suffering from copd exacerbation primary disease. ### Input: C...
how many times patient 11095 had received free water bolus on 05/06/2105?
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 labevents ( row_id number, subject_id number, ...
SELECT COUNT(*) 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 = 11095)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'free water 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: how many times patient 11095 had received free water bolus on 05/06/2105? ### Input: CREATE TABLE d_icd_procedures ( row...
Are exams always set by Prof. Johanna Eriksson for her classes ?
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 area ( course_id int, area varchar ) CREATE TABLE gsi ( course_offeri...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
Below are sql tables 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 exams always set by Prof. Johanna Eriksson for her classes ? ### Input: CREATE TABLE student_record ( student_id int...
Plot a scatter chart, gameid by sum hours played.
CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE SportsInfo ( Stu...
SELECT GameID, SUM(Hours_Played) FROM Plays_Games GROUP BY GameID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot a scatter chart, gameid by sum hours played. ### Input: CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGE...