instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
A bar chart about how many faculty members do we have for each faculty rank?
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 Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT Rank, COUNT(*) FROM Faculty GROUP 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: A bar chart about how many faculty members do we have for each faculty rank? ### Input: CREATE TABLE Student ( StuID INT...
have any laboratory tests been performed since 2102 on patient 21454?
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE proce...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21454) AND STRFTIME('%y', labevents.charttime) >= '2102'
Below are sql tables 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 any laboratory tests been performed since 2102 on patient 21454? ### Input: CREATE TABLE transfers ( row_id number,...
what is the drug that patient 21079 was prescribed two times?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21079) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the drug that patient 21079 was prescribed two times? ### Input: CREATE TABLE outputevents ( row_id number, ...
Find the number of different products that are produced by companies at different headquarter cities.
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number )
SELECT COUNT(DISTINCT T1.name), T2.headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.headquarter
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of different products that are produced by companies at different headquarter cities. ### Input: CREATE TABL...
how many patients whose diagnoses short title is athscl extrm ntv art nos and drug route is ng?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Athscl extrm ntv art NOS" AND prescriptions.route = "NG"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose diagnoses short title is athscl extrm ntv art nos and drug route is ng? ### Input: CREATE TABLE proc...
Which Date has a Score of 0 3, and a Set 2 of 16 25?
CREATE TABLE table_5902 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
SELECT "Date" FROM table_5902 WHERE "Score" = '0–3' AND "Set 2" = '16–25'
Below are sql tables 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 Date has a Score of 0 3, and a Set 2 of 16 25? ### Input: CREATE TABLE table_5902 ( "Date" text, "Time" text, ...
what is days of hospital stay and drug route of subject name darlene martin?
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 demographic ( subject_id text, hadm_id t...
SELECT demographic.days_stay, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Darlene Martin"
Below are sql tables 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 days of hospital stay and drug route of subject name darlene martin? ### Input: CREATE TABLE procedures ( subjec...
Which team has an away score of 7.4 (46)?
CREATE TABLE table_11204 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team score" FROM table_11204 WHERE "Away team score" = '7.4 (46)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team has an away score of 7.4 (46)? ### Input: CREATE TABLE table_11204 ( "Home team" text, "Home team score" ...
list flights before 900 from CINCINNATI to TAMPA
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airport_servic...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND flight.departure_time < 900 AND flight.to_airport = AIRPORT_SERVICE_1.airport_...
Below are sql tables 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 flights before 900 from CINCINNATI to TAMPA ### Input: CREATE TABLE month ( month_number int, month_name text )...
which patients have cyclosporine (sandimmune) prescription?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "CycloSPORINE (Sandimmune)"
Below are sql tables 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 patients have cyclosporine (sandimmune) prescription? ### Input: CREATE TABLE diagnoses ( subject_id text, had...
how many patients died in or before 2168 and tested with po2 in lab?
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.dod_year <= "2168.0" AND lab.label = "pO2"
Below are sql tables 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 died in or before 2168 and tested with po2 in lab? ### Input: CREATE TABLE prescriptions ( subject_id ...
Tell me the lowest pick number for columbus crew
CREATE TABLE table_4433 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text )
SELECT MIN("Pick #") FROM table_4433 WHERE "MLS team" = 'columbus crew'
Below are sql tables 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 lowest pick number for columbus crew ### Input: CREATE TABLE table_4433 ( "Pick #" real, "MLS team" text...
Plot how many party by grouped by party as a bar graph, list bar in asc order.
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text )
SELECT Party, COUNT(Party) FROM representative GROUP BY Party ORDER BY Party
Below are sql tables 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 how many party by grouped by party as a bar graph, list bar in asc order. ### Input: CREATE TABLE election ( Electi...
how many patients aged below 31 years have the lab test category blood gas?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab."CATEGORY" = "Blood Gas"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients aged below 31 years have the lab test category blood gas? ### Input: CREATE TABLE demographic ( subjec...
Who was the away team who scored 9.7 (61)?
CREATE TABLE table_33092 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_33092 WHERE "Away team score" = '9.7 (61)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the away team who scored 9.7 (61)? ### Input: CREATE TABLE table_33092 ( "Home team" text, "Home team score"...
What rank was the country with no bronze but at least 1 silver medals?
CREATE TABLE table_60856 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Rank") FROM table_60856 WHERE "Bronze" < '1' AND "Silver" > '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 rank was the country with no bronze but at least 1 silver medals? ### Input: CREATE TABLE table_60856 ( "Rank" real...
history of any heart disease including coronary artery disease
CREATE TABLE table_dev_11 ( "id" int, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "smoking" bool, "donated_plasma" bool, "coronary_artery_disease_cad" bool, "donated_blood" bool, "hypertension" bool, ...
SELECT * FROM table_dev_11 WHERE heart_disease = 1 OR coronary_artery_disease_cad = 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: history of any heart disease including coronary artery disease ### Input: CREATE TABLE table_dev_11 ( "id" int, "pre...
how did patient 8569 get last admission to the hospital during 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8569 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 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: how did patient 8569 get last admission to the hospital during this year? ### Input: CREATE TABLE chartevents ( row_id n...
The record of 9-4 was against which opponent?
CREATE TABLE table_16065 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Vikings points" real, "Opponents" real, "Record" text, "Attendance" real )
SELECT "Opponent" FROM table_16065 WHERE "Record" = '9-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: The record of 9-4 was against which opponent? ### Input: CREATE TABLE table_16065 ( "Game" real, "Date" text, "O...
What was the record after the April 15 game?
CREATE TABLE table_name_75 ( record VARCHAR, date VARCHAR )
SELECT record FROM table_name_75 WHERE date = "april 15"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record after the April 15 game? ### Input: CREATE TABLE table_name_75 ( record VARCHAR, date VARCHAR ) ...
what is maximum days of hospital stay of patients whose year of birth is greater than 2197?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2197"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum days of hospital stay of patients whose year of birth is greater than 2197? ### Input: CREATE TABLE procedur...
What countries are the female artists who sung in the language Bangla from, and count them by a pie chart
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(5...
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country
Below are sql tables 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 countries are the female artists who sung in the language Bangla from, and count them by a pie chart ### Input: CREATE ...
how many patients were prescribed the drug cefazolin 2gm syr within 2 months after having been diagnosed with diabetes mellitus until 2104?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquep...
Below are sql tables 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 were prescribed the drug cefazolin 2gm syr within 2 months after having been diagnosed with diabetes melli...
A bar chart for what are the number of the names of races held between 2009 and 2011?
CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER ) CREATE TABLE constructorResults ( constructorResultsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, status TEXT ) CREATE TABLE qualifyi...
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the names of races held between 2009 and 2011? ### Input: CREATE TABLE lapTimes ( ...
What was the total crowd at the game where the home team score was 8.21 (69)
CREATE TABLE table_53517 ( "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_53517 WHERE "Home team score" = '8.21 (69)'
Below are sql tables 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 crowd at the game where the home team score was 8.21 (69) ### Input: CREATE TABLE table_53517 ( "Home...
Does PHYSIOL 545 offer a section after 16:30 P.M. ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '16:30' AND course.course_id = course_offering.course_id AND course.department = 'PHYSIOL' AND course.number = 545 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: Does PHYSIOL 545 offer a section after 16:30 P.M. ? ### Input: CREATE TABLE requirement ( requirement_id int, requir...
What is the highest amount of money a play from Scotland United States has?
CREATE TABLE table_69866 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
SELECT MAX("Money ( $ )") FROM table_69866 WHERE "Country" = 'scotland united states'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest amount of money a play from Scotland United States has? ### Input: CREATE TABLE table_69866 ( "Place...
On what Date did the friendly Competition take place?
CREATE TABLE table_78471 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT "Date" FROM table_78471 WHERE "Competition" = 'friendly'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what Date did the friendly Competition take place? ### Input: CREATE TABLE table_78471 ( "Date" text, "Venue" tex...
How many hosts does each nationality have? List the nationality and the count Visualize by bar chart, could you list in ascending by the y axis?
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality 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: How many hosts does each nationality have? List the nationality and the count Visualize by bar chart, could you list in asce...
how many teams won at least 4 matches ?
CREATE TABLE table_203_486 ( id number, "place" number, "team" text, "matches" number, "won" number, "drawn" number, "lost" number, "difference" text, "points" number )
SELECT COUNT("team") FROM table_203_486 WHERE "won" >= 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: how many teams won at least 4 matches ? ### Input: CREATE TABLE table_203_486 ( id number, "place" number, "team...
what was patient 022-127032 diagnosed with since 2105 for the first time?
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 treatment ( treat...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127032')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '210...
Below are sql tables 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 022-127032 diagnosed with since 2105 for the first time? ### Input: CREATE TABLE vitalperiodic ( vitalp...
how many gold medals did italy receive ?
CREATE TABLE table_203_175 ( id number, "rank" text, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "gold" FROM table_203_175 WHERE "nation" = 'italy'
Below are sql tables 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 gold medals did italy receive ? ### Input: CREATE TABLE table_203_175 ( id number, "rank" text, "nation...
When sweden is the country who is the skip?
CREATE TABLE table_29119 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
SELECT "Skip" FROM table_29119 WHERE "Country" = 'Sweden'
Below are sql tables 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 sweden is the country who is the skip? ### Input: CREATE TABLE table_29119 ( "Country" text, "Skip" text, "...
Name the number of location attendance for l 141 143 (ot)
CREATE TABLE table_17102076_10 ( location_attendance VARCHAR, score VARCHAR )
SELECT COUNT(location_attendance) FROM table_17102076_10 WHERE score = "L 141–143 (OT)"
Below are sql tables 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 location attendance for l 141 143 (ot) ### Input: CREATE TABLE table_17102076_10 ( location_attendanc...
I want a bar chart to show the average cloud cover of the dates that have the 5 highest cloud cover rates each day, list Y-axis in ascending order please.
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want a bar chart to show the average cloud cover of the dates that have the 5 highest cloud cover rates each day, list Y-a...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the job_id , rank by the Y-axis in ascending.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a...
Bin all date of transactions into the YEAR interval, and sum the share count of each bin What is the trend?, and order by the X-axis from high to low please.
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, ...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction 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: Bin all date of transactions into the YEAR interval, and sum the share count of each bin What is the trend?, and order by th...
had any tube feeding been given to patient 30509 until 11/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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( ...
SELECT COUNT(*) > 0 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 = 30509)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tube fee...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had any tube feeding been given to patient 30509 until 11/2105? ### Input: CREATE TABLE chartevents ( row_id number, ...
what were the five most frequently ordered specimen tests for patients who were previously diagnosed with adv eff antibiotics nec since 2 years ago in the same hospital encounter?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) ...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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_diagnos...
Below are sql tables 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 ordered specimen tests for patients who were previously diagnosed with adv eff antibiotic...
Which entrant has Ferrari 038 3.5 v12 engine?
CREATE TABLE table_58245 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
SELECT "Entrant" FROM table_58245 WHERE "Engine" = 'ferrari 038 3.5 v12'
Below are sql tables 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 entrant has Ferrari 038 3.5 v12 engine? ### Input: CREATE TABLE table_58245 ( "Entrant" text, "Constructor" te...
Who was the player for England when the to par is 7?
CREATE TABLE table_13138 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
SELECT "Player" FROM table_13138 WHERE "To par" = '7' AND "Country" = 'england'
Below are sql tables 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 player for England when the to par is 7? ### Input: CREATE TABLE table_13138 ( "Place" text, "Player" te...
A bar chart shows the distribution of Sex and the average of Weight , and group by attribute Sex, and could you show in ascending by the X-axis?
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, AVG(Weight) FROM people GROUP BY Sex ORDER 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 average of Weight , and group by attribute Sex, and could you show in asce...
For all employees who have the letters D or S in their first name, find hire_date and the amount of hire_date bin hire_date by weekday, and visualize them by a bar chart, and could you show in descending by the how many hire date?
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_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: For all employees who have the letters D or S in their first name, find hire_date and the amount of hire_date bin hire_date ...
how many patients stayed in hospital for more than 34 days and used the drug code adva250ih?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "34" AND prescriptions.formulary_drug_cd = "ADVA250IH"
Below are sql tables 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 stayed in hospital for more than 34 days and used the drug code adva250ih? ### Input: CREATE TABLE procedu...
Who had a qual 1 best of 1:01.704?
CREATE TABLE table_name_43 ( qual_1 VARCHAR, best VARCHAR )
SELECT qual_1 FROM table_name_43 WHERE best = "1:01.704"
Below are sql tables 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 had a qual 1 best of 1:01.704? ### Input: CREATE TABLE table_name_43 ( qual_1 VARCHAR, best VARCHAR ) ### Respon...
what is the position in round 3?
CREATE TABLE table_name_9 ( position VARCHAR, round VARCHAR )
SELECT position FROM table_name_9 WHERE round = 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 position in round 3? ### Input: CREATE TABLE table_name_9 ( position VARCHAR, round VARCHAR ) ### Respon...
give the number of patients with drug code bact2c and admitted in emergency.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "BACT2C"
Below are sql tables 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 with drug code bact2c and admitted in emergency. ### Input: CREATE TABLE diagnoses ( subject...
What is the prom with Hewitt class and a Height (m) of 715?
CREATE TABLE table_name_20 ( prom__m_ VARCHAR, class VARCHAR, height__m_ VARCHAR )
SELECT prom__m_ FROM table_name_20 WHERE class = "hewitt" AND height__m_ = 715
Below are sql tables 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 prom with Hewitt class and a Height (m) of 715? ### Input: CREATE TABLE table_name_20 ( prom__m_ VARCHAR, ...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' 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 all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the...
What is Score, when Opponent is Atlanta Hawks?
CREATE TABLE table_45432 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
SELECT "Score" FROM table_45432 WHERE "Opponent" = 'atlanta hawks'
Below are sql tables 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 Score, when Opponent is Atlanta Hawks? ### Input: CREATE TABLE table_45432 ( "Date" text, "H/A/N" text, ...
what is the lab test abnormal status for the patient name stephanie suchan?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan"
Below are sql tables 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 lab test abnormal status for the patient name stephanie suchan? ### Input: CREATE TABLE prescriptions ( subj...
Are there any KINESLGY classes that don 't meet Friday ?
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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, tes...
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 WHERE course_offering.friday = 'N' AND course.department = 'KINESLGY' 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: Are there any KINESLGY classes that don 't meet Friday ? ### Input: CREATE TABLE program_course ( program_id int, co...
Show different publishers together with the number of publications they have. Plot them as bar chart.
CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text ) CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real )
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher
Below are sql tables 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 different publishers together with the number of publications they have. Plot them as bar chart. ### Input: CREATE TABL...
count the number of patients whose ethnicity is hispanic/latino - puerto rican and drug code is lide4500i?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.formulary_drug_cd = "LIDE4500I"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose ethnicity is hispanic/latino - puerto rican and drug code is lide4500i? ### Input: CREATE...
What is the highest rank for a nation with 26 golds and over 17 silvers?
CREATE TABLE table_58468 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MAX("Rank") FROM table_58468 WHERE "Gold" = '26' AND "Silver" > '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 highest rank for a nation with 26 golds and over 17 silvers? ### Input: CREATE TABLE table_58468 ( "Rank" re...
Which competition had an opponent of Police at the Selayang Stadium?
CREATE TABLE table_5808 ( "Date" text, "Venue" text, "Opponent" text, "Score" text, "Competition" text )
SELECT "Competition" FROM table_5808 WHERE "Opponent" = 'police' AND "Venue" = 'selayang stadium'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which competition had an opponent of Police at the Selayang Stadium? ### Input: CREATE TABLE table_5808 ( "Date" text, ...
What was the Record on September 21?
CREATE TABLE table_name_78 ( record VARCHAR, date VARCHAR )
SELECT record FROM table_name_78 WHERE date = "september 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 Record on September 21? ### Input: CREATE TABLE table_name_78 ( record VARCHAR, date VARCHAR ) ### Resp...
what is the name of the top finalist of this semifinals heat ?
CREATE TABLE table_204_59 ( id number, "rank" number, "athlete" text, "nationality" text, "time" text )
SELECT "athlete" FROM table_204_59 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 is the name of the top finalist of this semifinals heat ? ### Input: CREATE TABLE table_204_59 ( id number, "ra...
Visualize a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, display X from low to high order.
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(School_ID) FROM basketball_match GROUP BY All_Home ORDER 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 a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, dis...
how many hours has it been since patient 004-64091 stayed in the ward 236 during the current hospital visit for the last time?
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 patient ( uniquep...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '004-64091' AND patient.wardid = 236 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime 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: how many hours has it been since patient 004-64091 stayed in the ward 236 during the current hospital visit for the last tim...
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' 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 all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average ...
What constructor has an engine of cosworth cr-2 and a driver of luciano burti?
CREATE TABLE table_11738 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text )
SELECT "Constructor" FROM table_11738 WHERE "Engine \u2020" = 'cosworth cr-2' AND "Driver" = 'luciano burti'
Below are sql tables 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 constructor has an engine of cosworth cr-2 and a driver of luciano burti? ### Input: CREATE TABLE table_11738 ( "En...
What candidates ran in the election with don fuqua?
CREATE TABLE table_1341690_9 ( candidates VARCHAR, incumbent VARCHAR )
SELECT candidates FROM table_1341690_9 WHERE incumbent = "Don Fuqua"
Below are sql tables 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 candidates ran in the election with don fuqua? ### Input: CREATE TABLE table_1341690_9 ( candidates VARCHAR, in...
A bar chart shows how many locations, list by the the number of location from high to low.
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY COUNT(Location) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows how many locations, list by the the number of location from high to low. ### Input: CREATE TABLE station (...
Which week was the October 17, 2004 game played?
CREATE TABLE table_33635 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
SELECT "Week" FROM table_33635 WHERE "Date" = 'october 17, 2004'
Below are sql tables 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 was the October 17, 2004 game played? ### Input: CREATE TABLE table_33635 ( "Week" real, "Date" text, ...
give me the number of patients whose age is less than 49 and days of hospital stay is greater than 3?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "49" AND demographic.days_stay > "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: give me the number of patients whose age is less than 49 and days of hospital stay is greater than 3? ### Input: CREATE TABL...
which season came in last place ?
CREATE TABLE table_204_717 ( id number, "season" text, "level" number, "division" text, "place" text )
SELECT "season" FROM table_204_717 ORDER BY "place" 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 season came in last place ? ### Input: CREATE TABLE table_204_717 ( id number, "season" text, "level" numb...
What is the date of the event with a $322,280 prize?
CREATE TABLE table_77007 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
SELECT "Date" FROM table_77007 WHERE "Prize" = '$322,280'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date of the event with a $322,280 prize? ### Input: CREATE TABLE table_77007 ( "Date" text, "City" text,...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, and could you rank total number of manager id in desc order?
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the s...
what is the average age of female patient 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 diagnoses ( ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "HOME HEALTH CARE"
Below are sql tables 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 of female patient discharged to home health care? ### Input: CREATE TABLE lab ( subject_id text,...
What driver has 22 as nor 1?
CREATE TABLE table_41639 ( "Driver" text, "NOR 1" text, "NOR 2" text, "ZAN 1" text, "ZAN 2" text, "N\u00dcR 1" text, "N\u00dcR 2" text )
SELECT "Driver" FROM table_41639 WHERE "NOR 1" = '22'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What driver has 22 as nor 1? ### Input: CREATE TABLE table_41639 ( "Driver" text, "NOR 1" text, "NOR 2" text, ...
what is patient 71559's monthly minimum glucose level until 03/2103?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 numbe...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71559) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND STRFTIME('%y-%m', labevents.charttime) <= '2103-03' 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: what is patient 71559's monthly minimum glucose level until 03/2103? ### Input: CREATE TABLE d_labitems ( row_id number,...
Show the number of all customers without an account.
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE accounts ( account_id number, customer_id number, account_name text, ot...
SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM accounts)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of all customers without an account. ### Input: CREATE TABLE customers ( customer_id number, custome...
What was the to par when the score was 69-69=138?
CREATE TABLE table_name_35 ( to_par VARCHAR, score VARCHAR )
SELECT to_par FROM table_name_35 WHERE score = 69 - 69 = 138
Below are sql tables 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 to par when the score was 69-69=138? ### Input: CREATE TABLE table_name_35 ( to_par VARCHAR, score VARC...
How many people were surveyed in the poll from June 30, 2010?
CREATE TABLE table_67346 ( "Poll source" text, "Date(s) administered" text, "Sample size" text, "Margin of error" text, "Jerry Brown (D)" text, "Meg Whitman (R)" text )
SELECT "Sample size" FROM table_67346 WHERE "Date(s) administered" = 'june 30, 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: How many people were surveyed in the poll from June 30, 2010? ### Input: CREATE TABLE table_67346 ( "Poll source" text, ...
how many patients are american indian/alaska natives with a lymphocytes lab test done?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Lymphocytes"
Below are sql tables 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 american indian/alaska natives with a lymphocytes lab test done? ### Input: CREATE TABLE prescriptions...
Name the colors for north canton
CREATE TABLE table_26466528_1 ( colors VARCHAR, location VARCHAR )
SELECT colors FROM table_26466528_1 WHERE location = "North Canton"
Below are sql tables 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 colors for north canton ### Input: CREATE TABLE table_26466528_1 ( colors VARCHAR, location VARCHAR ) ### R...
Name the w/l for czech republic
CREATE TABLE table_22825058_23 ( w_l VARCHAR, against VARCHAR )
SELECT w_l FROM table_22825058_23 WHERE against = "Czech Republic"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the w/l for czech republic ### Input: CREATE TABLE table_22825058_23 ( w_l VARCHAR, against VARCHAR ) ### Respo...
Name the party for the pennsylvania 25
CREATE TABLE table_18490 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Party" FROM table_18490 WHERE "District" = 'Pennsylvania 25'
Below are sql tables 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 party for the pennsylvania 25 ### Input: CREATE TABLE table_18490 ( "District" text, "Incumbent" text, ...
what is the maximum number of points?
CREATE TABLE table_74137 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
SELECT MAX("Points") FROM table_74137
Below are sql tables 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 maximum number of points? ### Input: CREATE TABLE table_74137 ( "Game" real, "November" real, "Oppon...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, and I want to sort Y-axis in ascending order.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
Which Points have a Year larger than 1966, and Wins larger than 1?
CREATE TABLE table_37566 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
SELECT AVG("Points") FROM table_37566 WHERE "Year" > '1966' AND "Wins" > '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 Points have a Year larger than 1966, and Wins larger than 1? ### Input: CREATE TABLE table_37566 ( "Year" real, ...
count the number of patients whose year of birth is less than 2031?
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 WHERE demographic.dob_year < "2031"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose year of birth is less than 2031? ### Input: CREATE TABLE diagnoses ( subject_id text,...
What was the final score for the August 25, 1996 match?
CREATE TABLE table_name_29 ( score_in_the_final VARCHAR, date VARCHAR )
SELECT score_in_the_final FROM table_name_29 WHERE date = "august 25, 1996"
Below are sql tables 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 final score for the August 25, 1996 match? ### Input: CREATE TABLE table_name_29 ( score_in_the_final VARCH...
how many hours does it have been since the first time patient 51858 stayed in careunit micu on the current hospital encounter?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime 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: how many hours does it have been since the first time patient 51858 stayed in careunit micu on the current hospital encounte...
Find names of trains that run through stations for the local authority Chiltern, compare the total number of name in a bar graph, sort x-axis from low to high order.
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text...
SELECT name, COUNT(name) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY name ORDER BY name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find names of trains that run through stations for the local authority Chiltern, compare the total number of name in a bar g...
what has been the last lab test given to patient 006-1634 in the last month?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-1634')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), ...
Below are sql tables 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 has been the last lab test given to patient 006-1634 in the last month? ### Input: CREATE TABLE diagnosis ( diagnos...
What is the Money of the Player with a Score of 69-71-69-72=281?
CREATE TABLE table_name_70 ( money___$__ VARCHAR, score VARCHAR )
SELECT money___$__ FROM table_name_70 WHERE score = 69 - 71 - 69 - 72 = 281
Below are sql tables 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 Money of the Player with a Score of 69-71-69-72=281? ### Input: CREATE TABLE table_name_70 ( money___$__ VAR...
what is the away team score when the home team is essendon?
CREATE TABLE table_58498 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_58498 WHERE "Home team" = 'essendon'
Below are sql tables 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 score when the home team is essendon? ### Input: CREATE TABLE table_58498 ( "Home team" text, ...
what is the number of patients whose marital status is married and admission year is less than 2105?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2105"
Below are sql tables 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 marital status is married and admission year is less than 2105? ### Input: CREATE TABLE...
What was the to par that goes with the score 68-74-69=211?
CREATE TABLE table_name_70 ( to_par VARCHAR, score VARCHAR )
SELECT to_par FROM table_name_70 WHERE score = 68 - 74 - 69 = 211
Below are sql tables 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 to par that goes with the score 68-74-69=211? ### Input: CREATE TABLE table_name_70 ( to_par VARCHAR, s...
What is the smallest crowd size for an away team that scored 7.15 (57)?
CREATE TABLE table_11200 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT MIN("Crowd") FROM table_11200 WHERE "Away team score" = '7.15 (57)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest crowd size for an away team that scored 7.15 (57)? ### Input: CREATE TABLE table_11200 ( "Home team...
What was the results against the Philadelphia Eagles?
CREATE TABLE table_43528 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Result" FROM table_43528 WHERE "Opponent" = 'philadelphia eagles'
Below are sql tables 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 results against the Philadelphia Eagles? ### Input: CREATE TABLE table_43528 ( "Week" real, "Date" text...
i need to make reservations from DENVER to BOSTON
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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i need to make reservations from DENVER to BOSTON ### Input: CREATE TABLE restriction ( restriction_code text, advan...
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and revenue , and group by attribute founder, order in ascending by the X-axis.
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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and r...
what were the three most frequently prescribed drugs that were prescribed to the intracranial injury - with subarachnoid hemorrhage male patients 40s in the same month after they had been diagnosed with intracranial injury - with subarachnoid hemorrhage until 1 year ago?
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial injury - with subarachnoid 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: what were the three most frequently prescribed drugs that were prescribed to the intracranial injury - with subarachnoid hem...
Name the film titled for marcel camus category:articles with hcards
CREATE TABLE table_1981 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
SELECT "Film title used in nomination" FROM table_1981 WHERE "Director" = 'Marcel Camus Category:Articles with hCards'
Below are sql tables 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 film titled for marcel camus category:articles with hcards ### Input: CREATE TABLE table_1981 ( "Year (Ceremony...
User List: Top N - Austria - with false positive exclusions.
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM Users WHERE (LOWER(Location) LIKE '%austria%' OR Location LIKE '%AT' OR LOWER(Location) LIKE 'dummy') AND NOT (LOWER(Location) LIKE '%dummy%') ORDER BY Location LIMIT 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: User List: Top N - Austria - with false positive exclusions. ### Input: CREATE TABLE FlagTypes ( Id number, Name tex...
What was the air date of the episode that has a production code of 5aky13?
CREATE TABLE table_26826304_1 ( original_air_date VARCHAR, production_code VARCHAR )
SELECT original_air_date FROM table_26826304_1 WHERE production_code = "5AKY13"
Below are sql tables 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 air date of the episode that has a production code of 5aky13? ### Input: CREATE TABLE table_26826304_1 ( or...
For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between code and price .
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.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.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: For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between...