instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Find the number of male students (with sex M) from each city in a bar chart, display from high to low by the X.
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ci...
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' 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: Find the number of male students (with sex M) from each city in a bar chart, display from high to low by the X. ### Input: C...
calculate patient 95470's stay length of the first stay in the icu.
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_i...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95470) AND NOT icustays.outtime IS NULL ORDER BY icustays.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: calculate patient 95470's stay length of the first stay in the icu. ### Input: CREATE TABLE procedures_icd ( row_id numb...
How many patients with item id 50804 had an abnormal delta lab test status?
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 lab.itemid = "50804" AND lab.flag = "delta"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients with item id 50804 had an abnormal delta lab test status? ### Input: CREATE TABLE demographic ( subjec...
Which class would be easiest for me to fill the MDE requirement ?
CREATE TABLE area ( course_id int, area varchar ) 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 ( program_id int, name varchar, college varc...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
Below are sql tables 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 class would be easiest for me to fill the MDE requirement ? ### Input: CREATE TABLE area ( course_id int, area...
What is the place of Mark O'Meara?
CREATE TABLE table_43746 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Place" FROM table_43746 WHERE "Player" = 'mark o''meara'
Below are sql tables 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 place of Mark O'Meara? ### Input: CREATE TABLE table_43746 ( "Place" text, "Player" text, "Country" ...
Bar graph to show how many asset make from different asset make, show total number in asc order.
CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY COUNT(asset_make)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show how many asset make from different asset make, show total number in asc order. ### Input: CREATE TABLE Fau...
What is the status where the notes are possible jr synonym of sapeornis?
CREATE TABLE table_42613 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Unit" text, "Location" text, "Notes" text )
SELECT "Status" FROM table_42613 WHERE "Notes" = 'possible jr synonym of sapeornis'
Below are sql tables 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 status where the notes are possible jr synonym of sapeornis? ### Input: CREATE TABLE table_42613 ( "Name" te...
what is the name of the drug that has been prescribed two times since 02/2102 to patient 7476?
CREATE TABLE procedures_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 d_icd_diagnoses ( row_id number, icd9_code text, ...
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 = 7476) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-02' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1...
Below are sql tables 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 drug that has been prescribed two times since 02/2102 to patient 7476? ### Input: CREATE TABLE proce...
What is Score, when Team is '@ Memphis'?
CREATE TABLE table_76592 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Score" FROM table_76592 WHERE "Team" = '@ memphis'
Below are sql tables 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 Team is '@ Memphis'? ### Input: CREATE TABLE table_76592 ( "Game" real, "Date" text, "Team" ...
list all flights from BOSTON to SAN FRANCISCO with at least 3 stops
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE restriction ...
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, flight_stop WHERE ((flight.flight_id = flight_stop.flight_id AND flight.stops >= 3) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
Below are sql tables 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 all flights from BOSTON to SAN FRANCISCO with at least 3 stops ### Input: CREATE TABLE flight_stop ( flight_id int,...
What was the score in game 51?
CREATE TABLE table_20355 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Score" FROM table_20355 WHERE "Game" = '51'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score in game 51? ### Input: CREATE TABLE table_20355 ( "Game" real, "Date" text, "Team" text, ...
How many people attended the Week 8 game when Denver played Buffalo?
CREATE TABLE table_17778417_1 ( attendance VARCHAR, week VARCHAR )
SELECT attendance FROM table_17778417_1 WHERE week = 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: How many people attended the Week 8 game when Denver played Buffalo? ### Input: CREATE TABLE table_17778417_1 ( attendan...
what is the minimum age of patients with marital status as widowed and aged in or above 43?
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "43"
Below are sql tables 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 minimum age of patients with marital status as widowed and aged in or above 43? ### Input: CREATE TABLE procedur...
give me the number of patients whose ethnicity is black/african american and lab test name is urobilinogen?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND lab.label = "Urobilinogen"
Below are sql tables 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 ethnicity is black/african american and lab test name is urobilinogen? ### Input: CREAT...
Find employee with ID and name of the country presently where (s)he is working. Visualize by bar chart.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_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 employee with ID and name of the country presently where (s)he is working. Visualize by bar chart. ### Input: CREATE TA...
what is the number of patients whose marital status is married and drug route is im?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "MARRIED" AND prescriptions.route = "IM"
Below are sql tables 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 drug route is im? ### Input: CREATE TABLE demographic ( ...
have terazosin ever been prescribed to patient 16572 until 2100?
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, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572) AND prescriptions.drug = 'terazosin' AND STRFTIME('%y', prescriptions.startdate) <= '2100'
Below are sql tables 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 terazosin ever been prescribed to patient 16572 until 2100? ### Input: CREATE TABLE microbiologyevents ( row_id num...
When was the Attendance larger than 74,382?
CREATE TABLE table_60360 ( "Date" text, "Opponents" text, "H / A" text, "Result F\u2013A" text, "Attendance" real, "Group position" text )
SELECT "Date" FROM table_60360 WHERE "Attendance" > '74,382'
Below are sql tables 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 Attendance larger than 74,382? ### Input: CREATE TABLE table_60360 ( "Date" text, "Opponents" text, ...
Can you tell me the Record that has the Visitor of vancouver?
CREATE TABLE table_46214 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real )
SELECT "Record" FROM table_46214 WHERE "Visitor" = 'vancouver'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the Record that has the Visitor of vancouver? ### Input: CREATE TABLE table_46214 ( "Date" text, "Vi...
What is average round of Auburn College?
CREATE TABLE table_name_46 ( round INTEGER, college VARCHAR )
SELECT AVG(round) FROM table_name_46 WHERE college = "auburn"
Below are sql tables 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 round of Auburn College? ### Input: CREATE TABLE table_name_46 ( round INTEGER, college VARCHAR ) ##...
how many patients since 4 years ago were discharged from the hospital?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-4 year')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients since 4 years ago were discharged from the hospital? ### Input: CREATE TABLE labevents ( row_id number...
Name the division for detroit diesel series 50egr allison wb-400r
CREATE TABLE table_26668 ( "Order Year" real, "Fleet Series (Qty.)" text, "Manufacturer" text, "Model" text, "Powertrain (Engine/Transmission)" text, "Fuel or Propulsion" text, "Division" text )
SELECT "Division" FROM table_26668 WHERE "Powertrain (Engine/Transmission)" = 'Detroit Diesel Series 50EGR Allison WB-400R'
Below are sql tables 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 division for detroit diesel series 50egr allison wb-400r ### Input: CREATE TABLE table_26668 ( "Order Year" rea...
what is the name of the drug that patient 002-41391 was first prescribed via an intravenou route in 04/last year?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41391')) AND medication.routeadmin = 'intravenou' AND DATETIME(...
Below are sql tables 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 drug that patient 002-41391 was first prescribed via an intravenou route in 04/last year? ### Input:...
What is the minimum area id the 2011 population is 3067549?
CREATE TABLE table_2168295_1 ( area__km²_ INTEGER, population__2011_ VARCHAR )
SELECT MIN(area__km²_) FROM table_2168295_1 WHERE population__2011_ = 3067549
Below are sql tables 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 minimum area id the 2011 population is 3067549? ### Input: CREATE TABLE table_2168295_1 ( area__km²_ INTEGER...
For the attribute All_Neutral and School_ID, show their proportion by a pie chart.
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, School_ID 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: For the attribute All_Neutral and School_ID, show their proportion by a pie chart. ### Input: CREATE TABLE university ( ...
With the Republican ticket of Frank M. Williams who was the Progressive ticket?
CREATE TABLE table_40132 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Socialist ticket" text, "Prohibition ticket" text, "Progressive ticket" text, "Independence League ticket" text )
SELECT "Progressive ticket" FROM table_40132 WHERE "Republican ticket" = 'frank m. williams'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With the Republican ticket of Frank M. Williams who was the Progressive ticket? ### Input: CREATE TABLE table_40132 ( "O...
For directors who had more than one movie, bin the dates of release into Year interval and them compute the total number of movies in each year bucket. Show me the result using a line chart.
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For directors who had more than one movie, bin the dates of release into Year interval and them compute the total number of ...
what is the date when the home team is st kilda?
CREATE TABLE table_name_26 ( date VARCHAR, home_team VARCHAR )
SELECT date FROM table_name_26 WHERE home_team = "st kilda"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the date when the home team is st kilda? ### Input: CREATE TABLE table_name_26 ( date VARCHAR, home_team VAR...
Visualize a pie chart with how many workshops did each author submit to? Return the author name and the number of workshops.
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text )
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_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: Visualize a pie chart with how many workshops did each author submit to? Return the author name and the number of workshops....
Who made the latest order?
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_address_from time, address_type text, date_address_to time ) CREATE TABLE a...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date 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: Who made the latest order? ### Input: CREATE TABLE customer_orders ( order_id number, customer_id number, order_...
What is the amount of apperances of the person who had 36 goals?
CREATE TABLE table_name_5 ( appearances VARCHAR, goals VARCHAR )
SELECT appearances FROM table_name_5 WHERE goals = 36
Below are sql tables 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 apperances of the person who had 36 goals? ### Input: CREATE TABLE table_name_5 ( appearances VARC...
What was the lowest Attendance on 8 October 1986?
CREATE TABLE table_name_1 ( attendance INTEGER, date VARCHAR )
SELECT MIN(attendance) FROM table_name_1 WHERE date = "8 october 1986"
Below are sql tables 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 lowest Attendance on 8 October 1986? ### Input: CREATE TABLE table_name_1 ( attendance INTEGER, date VA...
What is the score from the 21-27 Record?
CREATE TABLE table_name_96 ( score VARCHAR, record VARCHAR )
SELECT score FROM table_name_96 WHERE record = "21-27"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score from the 21-27 Record? ### Input: CREATE TABLE table_name_96 ( score VARCHAR, record VARCHAR ) ###...
What were S bastien Bourdais' lowest points when there were less than 63 laps?
CREATE TABLE table_name_16 ( points INTEGER, driver VARCHAR, laps VARCHAR )
SELECT MIN(points) FROM table_name_16 WHERE driver = "sébastien bourdais" AND laps < 63
Below are sql tables 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 S bastien Bourdais' lowest points when there were less than 63 laps? ### Input: CREATE TABLE table_name_16 ( p...
how much did patient 8562 weigh last measured in the previous month?
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 chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8562)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much did patient 8562 weigh last measured in the previous month? ### Input: CREATE TABLE admissions ( row_id number,...
Name the least rank when silver is less than 1 and bronze is less than 1 with total more than 1
CREATE TABLE table_name_5 ( rank INTEGER, bronze VARCHAR, silver VARCHAR, total VARCHAR )
SELECT MIN(rank) FROM table_name_5 WHERE silver < 1 AND total > 1 AND bronze < 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: Name the least rank when silver is less than 1 and bronze is less than 1 with total more than 1 ### Input: CREATE TABLE tabl...
Show all sport name and the number of students. Show bar chart.
CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fn...
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all sport name and the number of students. Show bar chart. ### Input: CREATE TABLE Plays_Games ( StuID INTEGER, ...
when was the first time that patient 027-10308 was given a albumin lab test?
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 lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-10308')) AND lab.labname = 'albumin' ORDER BY lab.labresulttime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time that patient 027-10308 was given a albumin lab test? ### Input: CREATE TABLE cost ( costid numbe...
What is the Country of the Player with a Score of 73-70-71-71=285?
CREATE TABLE table_name_19 ( country VARCHAR, score VARCHAR )
SELECT country FROM table_name_19 WHERE score = 73 - 70 - 71 - 71 = 285
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Country of the Player with a Score of 73-70-71-71=285? ### Input: CREATE TABLE table_name_19 ( country VARCH...
what team lost on july 30
CREATE TABLE table_37357 ( "Date" text, "Time" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Loss" FROM table_37357 WHERE "Date" = 'july 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: what team lost on july 30 ### Input: CREATE TABLE table_37357 ( "Date" text, "Time" text, "Opponent" text, "...
What is Opponent, when Record is 17-44?
CREATE TABLE table_10028 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
SELECT "Opponent" FROM table_10028 WHERE "Record" = '17-44'
Below are sql tables 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 Opponent, when Record is 17-44? ### Input: CREATE TABLE table_10028 ( "Date" text, "H/A/N" text, "Oppone...
hba1c levels less than 7 % ( normal range 4 _ 6 % ) .
CREATE TABLE table_train_156 ( "id" int, "anemia" bool, "abnormal_bilirubin" bool, "hemoglobin_a1c_hba1c" float, "body_mass_index_bmi" float, "bilirubin" float, "NOUSE" float )
SELECT * FROM table_train_156 WHERE hemoglobin_a1c_hba1c < 7
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: hba1c levels less than 7 % ( normal range 4 _ 6 % ) . ### Input: CREATE TABLE table_train_156 ( "id" int, "anemia" b...
when is the last time that patient 029-30149 has received a wbc x 1000 lab test since 45 months ago?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-30149')) AND lab.labname = 'wbc x 1000' AND DATETIME(lab.labresulttime) >= DATE...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when is the last time that patient 029-30149 has received a wbc x 1000 lab test since 45 months ago? ### Input: CREATE TABLE...
What is the lowest season #?
CREATE TABLE table_3428 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text )
SELECT MIN("Season #") FROM table_3428
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest season #? ### Input: CREATE TABLE table_3428 ( "Series #" real, "Season #" real, "Title" text...
List the studios of each film and the number of films produced by that studio by a bar chart, and order from low to high by the Y.
CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Stud...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio 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: List the studios of each film and the number of films produced by that studio by a bar chart, and order from low to high by ...
What was the Score on March 15?
CREATE TABLE table_name_8 ( score VARCHAR, date VARCHAR )
SELECT score FROM table_name_8 WHERE date = "march 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 Score on March 15? ### Input: CREATE TABLE table_name_8 ( score VARCHAR, date VARCHAR ) ### Response: S...
give me the number of patients whose gender is f and drug code is acet1000i?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "ACET1000I"
Below are sql tables 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 gender is f and drug code is acet1000i? ### Input: CREATE TABLE diagnoses ( subject...
A bar chart shows the distribution of Date_of_Birth and Weight , show Weight from low to high order.
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Date_of_Birth, Weight FROM people ORDER BY Weight
Below are sql tables 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 Date_of_Birth and Weight , show Weight from low to high order. ### Input: CREATE TABLE...
In 1994 what tournament held a ATP masters series
CREATE TABLE table_69877 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "Career SR" text )
SELECT "1994" FROM table_69877 WHERE "Tournament" = 'atp masters series'
Below are sql tables 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 1994 what tournament held a ATP masters series ### Input: CREATE TABLE table_69877 ( "Tournament" text, "1990" te...
What is the most draws when goals against are more than 33, losses are 13 and goals for is less than 51?
CREATE TABLE table_name_1 ( draws INTEGER, goals_for VARCHAR, goals_against VARCHAR, losses VARCHAR )
SELECT MAX(draws) FROM table_name_1 WHERE goals_against > 33 AND losses = 13 AND goals_for < 51
Below are sql tables 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 most draws when goals against are more than 33, losses are 13 and goals for is less than 51? ### Input: CREATE T...
Name the clas AAAA of school year 2000-01
CREATE TABLE table_37445 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
SELECT "Class AAAA" FROM table_37445 WHERE "School Year" = '2000-01'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the clas AAAA of school year 2000-01 ### Input: CREATE TABLE table_37445 ( "School Year" text, "Class A" text, ...
Which Incumbent has a District of massachusetts 2?
CREATE TABLE table_name_62 ( incumbent VARCHAR, district VARCHAR )
SELECT incumbent FROM table_name_62 WHERE district = "massachusetts 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: Which Incumbent has a District of massachusetts 2? ### Input: CREATE TABLE table_name_62 ( incumbent VARCHAR, distri...
Where was the game that had an attendance of 39,889?
CREATE TABLE table_name_64 ( game_site VARCHAR, attendance VARCHAR )
SELECT game_site FROM table_name_64 WHERE attendance = "39,889"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the game that had an attendance of 39,889? ### Input: CREATE TABLE table_name_64 ( game_site VARCHAR, atte...
How many products are there for each manufacturer Visualize by bar chart, and rank by the total number in ascending.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name 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 products are there for each manufacturer Visualize by bar chart, and rank by the total number in ascending. ### Inp...
What is Melbourne's home venue?
CREATE TABLE table_name_32 ( venue VARCHAR, home_team VARCHAR )
SELECT venue FROM table_name_32 WHERE home_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: What is Melbourne's home venue? ### Input: CREATE TABLE table_name_32 ( venue VARCHAR, home_team VARCHAR ) ### Respo...
Name the written by for 16.32 million viewers
CREATE TABLE table_19601 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production Code" real, "U.S. viewers (millions)" text )
SELECT "Written by" FROM table_19601 WHERE "U.S. viewers (millions)" = '16.32'
Below are sql tables 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 written by for 16.32 million viewers ### Input: CREATE TABLE table_19601 ( "Series #" real, "Season #" real...
What score has a record of 21-25-7-4?
CREATE TABLE table_39035 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text )
SELECT "Score" FROM table_39035 WHERE "Record" = '21-25-7-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 score has a record of 21-25-7-4? ### Input: CREATE TABLE table_39035 ( "Game" real, "February" real, "Oppon...
how many days have elapsed since patient 73713's last metoprolol succinate xl drug prescription in their current hospital visit?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_care...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'metoprolol succinate xl' ORDER BY prescriptio...
Below are sql tables 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 days have elapsed since patient 73713's last metoprolol succinate xl drug prescription in their current hospital vi...
What upper-level PORTUG courses are available this Spring-Summer ?
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PORTUG' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri...
Below are sql tables 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 upper-level PORTUG courses are available this Spring-Summer ? ### Input: CREATE TABLE student ( student_id int, ...
A bar chart about how many classes are held in each department?
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE...
SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_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: A bar chart about how many classes are held in each department? ### Input: CREATE TABLE COURSE ( CRS_CODE varchar(10), ...
For all employees who have the letters D or S in their first name, give me the comparison about the average of salary over the hire_date bin hire_date by time, I want to display from low to high by the Y-axis.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 job_history ( EMPLOYEE...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, give me the comparison about the average of salary over t...
what is the monthly average of arterial bp [diastolic] for patient 13528 in the first 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 AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13528 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent...
Below are sql tables 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 monthly average of arterial bp [diastolic] for patient 13528 in the first hospital visit? ### Input: CREATE TABL...
which team has the most wins ?
CREATE TABLE table_204_448 ( id number, "team" text, "winners" number, "runners-up" number, "years won" text, "years runner-up" text )
SELECT "team" FROM table_204_448 ORDER BY "winners" 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 team has the most wins ? ### Input: CREATE TABLE table_204_448 ( id number, "team" text, "winners" number,...
List the name and the number of enrolled student for each course. Show bar chart.
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80),...
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_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: List the name and the number of enrolled student for each course. Show bar chart. ### Input: CREATE TABLE Subjects ( sub...
how many hours have elapsed since patient 40707's last stay in the ward 33 during this hospital encounter?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, item...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40707 AND admissions.dischtime IS NULL)) AND transfers...
Below are sql tables 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 elapsed since patient 40707's last stay in the ward 33 during this hospital encounter? ### Input: CREATE...
count the number of patients whose ethnicity is black/african american and age is less than 82?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age < "82"
Below are sql tables 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 black/african american and age is less than 82? ### Input: CREATE TABLE proc...
How many elections are there?
CREATE TABLE election ( Id VARCHAR )
SELECT COUNT(*) FROM election
Below are sql tables 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 elections are there? ### Input: CREATE TABLE election ( Id VARCHAR ) ### Response: SELECT COUNT(*) FROM electio...
how many days has passed since the first time patient 006-80884 has had enteral fibersource hn intake on the current icu visit?
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.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: how many days has passed since the first time patient 006-80884 has had enteral fibersource hn intake on the current icu vis...
Name the number of high rebounds for april 21
CREATE TABLE table_17621978_11 ( high_rebounds VARCHAR, date VARCHAR )
SELECT COUNT(high_rebounds) FROM table_17621978_11 WHERE date = "April 21"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of high rebounds for april 21 ### Input: CREATE TABLE table_17621978_11 ( high_rebounds VARCHAR, dat...
what was the four most frequent specimen tests that patients had during the same month after they had been diagnosed with cerv spondyl w myelopath?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
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 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 was the four most frequent specimen tests that patients had during the same month after they had been diagnosed with ce...
What is the smallest crowd for a game when Melbourne is the home team?
CREATE TABLE table_name_38 ( crowd INTEGER, home_team VARCHAR )
SELECT MIN(crowd) FROM table_name_38 WHERE home_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: What is the smallest crowd for a game when Melbourne is the home team? ### Input: CREATE TABLE table_name_38 ( crowd INT...
When 27,822 (72.3) is the percentage for how many electorate measurements are there?
CREATE TABLE table_2276 ( "Constituency" text, "Electorate" real, "s Spoilt vote" real, "Total poll (%)" text, "For (%)" text, "Against (%)" text, "\u00b1 Yes side 2008 (%)" text )
SELECT COUNT("Electorate") FROM table_2276 WHERE "For (%)" = '27,822 (72.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: When 27,822 (72.3) is the percentage for how many electorate measurements are there? ### Input: CREATE TABLE table_2276 ( ...
Name the number of numbers for howard clark
CREATE TABLE table_20271 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
SELECT COUNT("No.") FROM table_20271 WHERE "Runner(s)-up" = 'Howard Clark'
Below are sql tables 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 numbers for howard clark ### Input: CREATE TABLE table_20271 ( "No." real, "Date" text, "Tour...
Which team plays their home matches at the mcg Venue?
CREATE TABLE table_51761 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_51761 WHERE "Venue" = 'mcg'
Below are sql tables 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 plays their home matches at the mcg Venue? ### Input: CREATE TABLE table_51761 ( "Home team" text, "Home ...
give me the number of english speaking patients who had alkaline phosphatase lab test.
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 demographic.language = "ENGL" AND lab.label = "Alkaline Phosphatase"
Below are sql tables 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 english speaking patients who had alkaline phosphatase lab test. ### Input: CREATE TABLE prescriptions...
Player Craig Parry of Australia is in what place number?
CREATE TABLE table_78622 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Place" FROM table_78622 WHERE "Country" = 'australia' AND "Player" = 'craig parry'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Player Craig Parry of Australia is in what place number? ### Input: CREATE TABLE table_78622 ( "Place" text, "Player...
On what date was Stauffer Chemical Company (Lemoyne Plant), which was listed on 09/21/1984, deleted?
CREATE TABLE table_55865 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text )
SELECT "Deleted" FROM table_55865 WHERE "Listed" = '09/21/1984' AND "Name" = 'stauffer chemical company (lemoyne plant)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date was Stauffer Chemical Company (Lemoyne Plant), which was listed on 09/21/1984, deleted? ### Input: CREATE TABLE...
Who was the Home team at the Western Oval location?
CREATE TABLE table_58234 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_58234 WHERE "Venue" = 'western oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the Home team at the Western Oval location? ### Input: CREATE TABLE table_58234 ( "Home team" text, "Home te...
what is religion and date of death of subject id 74032?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT demographic.religion, demographic.dod FROM demographic WHERE demographic.subject_id = "74032"
Below are sql tables 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 religion and date of death of subject id 74032? ### Input: CREATE TABLE procedures ( subject_id text, hadm_i...
since 2103 how many patients were diagnosed with hypertension nos in the same month after they had previously been diagnosed with hyperlipidemia nec/nos?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos')...
Below are sql tables 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 how many patients were diagnosed with hypertension nos in the same month after they had previously been diagnosed...
who is after will power
CREATE TABLE table_204_175 ( id number, "pos" text, "no." number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "laps led" number, "points" number )
SELECT "driver" FROM table_204_175 WHERE "pos" = (SELECT "pos" FROM table_204_175 WHERE "driver" = 'will power') + 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is after will power ### Input: CREATE TABLE table_204_175 ( id number, "pos" text, "no." number, "driver...
what's the number of patients who have had family hx-breast malig diagnosed until 2 years ago?
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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'family hx-breast malig') AND DATETIME(diagnoses_icd.chartt...
Below are sql tables 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 number of patients who have had family hx-breast malig diagnosed until 2 years ago? ### Input: CREATE TABLE trans...
Posts made CW after their creation.
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
SELECT a.Id AS "post_link", a.Score FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.CreationDate != a.CommunityOwnedDate AND q.CommunityOwnedDate IS NULL AND NOT a.CommunityOwnedDate IS NULL AND q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY a.Score
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Posts made CW after their creation. ### Input: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
What is the lowest round for the player whose position is guard and had a pick number smaller than 144?
CREATE TABLE table_38336 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text )
SELECT MIN("Round") FROM table_38336 WHERE "Position" = 'guard' AND "Pick" < '144'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest round for the player whose position is guard and had a pick number smaller than 144? ### Input: CREATE TA...
Which city has a frequency of 104.5 fm?
CREATE TABLE table_38626 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
SELECT "City of license" FROM table_38626 WHERE "Frequency MHz" = '104.5 fm'
Below are sql tables 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 city has a frequency of 104.5 fm? ### Input: CREATE TABLE table_38626 ( "Call sign" text, "Frequency MHz" text...
give the number of patients whose admission year is 2107 and procedure title is cont inv mec ven<96hrs.
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2107" AND procedures.short_title = "Cont inv mec ven <96 hrs"
Below are sql tables 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 whose admission year is 2107 and procedure title is cont inv mec ven<96hrs. ### Input: CREATE TA...
what is the number of patients whose admission location is transfer from hosp/extram with the procedure spinal tap?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Spinal tap"
Below are sql tables 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 location is transfer from hosp/extram with the procedure spinal tap? ### Inpu...
Who won the regular season when Maryland won the tournament?
CREATE TABLE table_73438 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
SELECT "Regular Season Winner" FROM table_73438 WHERE "Tournament Winner" = 'Maryland'
Below are sql tables 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 won the regular season when Maryland won the tournament? ### Input: CREATE TABLE table_73438 ( "Conference" text, ...
In the afternoon of Fall 2006 , is 692 available ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 692 AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2006
Below are sql tables 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 the afternoon of Fall 2006 , is 692 available ? ### Input: CREATE TABLE semester ( semester_id int, semester varc...
Which Other has a Green of 0, and an Independent of 1, and a Labour smaller than 45, and a Control of labour lose to no overall control?
CREATE TABLE table_39089 ( "Election" real, "Labour" real, "Conservative" real, "Liberal" real, "Social Democratic Party" real, "Social and Liberal Democrats/ Liberal Democrats" real, "Independent" real, "Green" real, "Other" text, "Control" text )
SELECT "Other" FROM table_39089 WHERE "Green" = '0' AND "Independent" = '1' AND "Labour" < '45' AND "Control" = 'labour lose to no overall control'
Below are sql tables 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 Other has a Green of 0, and an Independent of 1, and a Labour smaller than 45, and a Control of labour lose to no over...
what is the number of patients whose marital status is single and ethnicity is american indian/alaska native?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose marital status is single and ethnicity is american indian/alaska native? ### Input: CRE...
What is the rating of the episode with a rating/share of 0.9/4?
CREATE TABLE table_17525955_2 ( rating VARCHAR )
SELECT rating FROM table_17525955_2 WHERE rating / SHARE(18 AS –49) = 0.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: What is the rating of the episode with a rating/share of 0.9/4? ### Input: CREATE TABLE table_17525955_2 ( rating VARCHA...
what are the four commonly ordered drugs for patients diagnosed with acute respiratory failure previously within the same month, until 4 years ago?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
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 = 'acute respiratory failure' AND DATETIME(diagnosis....
Below are sql tables 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 four commonly ordered drugs for patients diagnosed with acute respiratory failure previously within the same mo...
count the number of patients whose drug code is ketr30i and lab test fluid is joint fluid?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "KETR30I" AND lab.fluid = "Joint Fluid"
Below are sql tables 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 drug code is ketr30i and lab test fluid is joint fluid? ### Input: CREATE TABLE prescript...
how many patients whose age is less than 41 and lab test fluid is joint fluid?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Joint Fluid"
Below are sql tables 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 age is less than 41 and lab test fluid is joint fluid? ### Input: CREATE TABLE procedures ( subj...
tell me the average hospital cost if there is a fracture two ribs-closed until 4 years ago?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fracture two ribs-closed')) AND DATETIME(cost.chargetime) <= DA...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the average hospital cost if there is a fracture two ribs-closed until 4 years ago? ### Input: CREATE TABLE patients...
What country has a score of 71-66-72-72=281?
CREATE TABLE table_name_79 ( country VARCHAR, score VARCHAR )
SELECT country FROM table_name_79 WHERE score = 71 - 66 - 72 - 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 country has a score of 71-66-72-72=281? ### Input: CREATE TABLE table_name_79 ( country VARCHAR, score VARCHAR ...
What is the production code of the episode that was watched by 3.81 million U.S. viewers?
CREATE TABLE table_29054902_1 ( production_code VARCHAR, us_viewers__million_ VARCHAR )
SELECT production_code FROM table_29054902_1 WHERE us_viewers__million_ = "3.81"
Below are sql tables 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 production code of the episode that was watched by 3.81 million U.S. viewers? ### Input: CREATE TABLE table_2905...
Give a bar chart showing how many shops in each carrier, display in asc by the y axis.
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier ORDER BY COUNT(Carrier)
Below are sql tables 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 a bar chart showing how many shops in each carrier, display in asc by the y axis. ### Input: CREATE TABLE shop ( Sh...
How many patients who had a potassium lab test stayed in hospital for more than 11 days?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.label = "Potassium"
Below are sql tables 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 who had a potassium lab test stayed in hospital for more than 11 days? ### Input: CREATE TABLE diagnoses (...