instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
what is the number of patients whose admission type is elective and diagnoses long title is drug induced neutropenia?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Drug induced neutropenia"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is elective and diagnoses long title is drug induced neutropenia? ### In...
Which Place has a Country of united states, and Money ($) larger than 145,000, and a To par of 2, and a Score of 70-66-73-69=278?
CREATE TABLE table_47467 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
SELECT "Place" FROM table_47467 WHERE "Country" = 'united states' AND "Money ( $ )" > '145,000' AND "To par" = '–2' AND "Score" = '70-66-73-69=278'
wikisql
Below are sql tables 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 Place has a Country of united states, and Money ($) larger than 145,000, and a To par of 2, and a Score of 70-66-73-69...
Show different locations and the number of performances at each location Visualize by bar chart, and sort x axis in desc order.
CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int )
SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY Location DESC
nvbench
Below are sql tables 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 locations and the number of performances at each location Visualize by bar chart, and sort x axis in desc ord...
What team played against Al-Ismaily (team 1)?
CREATE TABLE table_80411 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
SELECT "Team 2" FROM table_80411 WHERE "Team 1" = 'al-ismaily'
wikisql
Below are sql tables 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 played against Al-Ismaily (team 1)? ### Input: CREATE TABLE table_80411 ( "Team 1" text, "Agg." text, ...
Among patients with alzheimer's disease, how many of them had a lab test for abnormal status of delta?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Alzheimer's disease" AND lab.flag = "delta"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Among patients with alzheimer's disease, how many of them had a lab test for abnormal status of delta? ### Input: CREATE TAB...
Which chassis did Aguri Suzuki drive with an entrant of Larrousse F1?
CREATE TABLE table_name_41 ( chassis VARCHAR, entrant VARCHAR, driver VARCHAR )
SELECT chassis FROM table_name_41 WHERE entrant = "larrousse f1" AND driver = "aguri suzuki"
sql_create_context
Below are sql tables 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 chassis did Aguri Suzuki drive with an entrant of Larrousse F1? ### Input: CREATE TABLE table_name_41 ( chassis VA...
Visualize a bar chart for how many students are in each department?, and could you sort y axis in descending order?
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), ...
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC
nvbench
Below are sql tables 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 for how many students are in each department?, and could you sort y axis in descending order? ### Inpu...
What is Venue, when Extra is Pentathlon?
CREATE TABLE table_name_39 ( venue VARCHAR, extra VARCHAR )
SELECT venue FROM table_name_39 WHERE extra = "pentathlon"
sql_create_context
Below are sql tables 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 Venue, when Extra is Pentathlon? ### Input: CREATE TABLE table_name_39 ( venue VARCHAR, extra VARCHAR ) ### ...
what was the name of the lab test that patient 20801 last got in 04/last 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20801) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the lab test that patient 20801 last got in 04/last year. ### Input: CREATE TABLE chartevents ( row...
How much Frequency MHz has a Call sign of w264bg?
CREATE TABLE table_name_95 ( frequency_mhz VARCHAR, call_sign VARCHAR )
SELECT COUNT(frequency_mhz) FROM table_name_95 WHERE call_sign = "w264bg"
sql_create_context
Below are sql tables 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 Frequency MHz has a Call sign of w264bg? ### Input: CREATE TABLE table_name_95 ( frequency_mhz VARCHAR, cal...
How many counties have people before profit as the party, and a borough greater than 0?
CREATE TABLE table_name_16 ( county INTEGER, party VARCHAR, borough VARCHAR )
SELECT SUM(county) FROM table_name_16 WHERE party = "people before profit" AND borough > 0
sql_create_context
Below are sql tables 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 counties have people before profit as the party, and a borough greater than 0? ### Input: CREATE TABLE table_name_1...
What are the ground where the crowd totals 19929?
CREATE TABLE table_14312471_4 ( ground VARCHAR, crowd VARCHAR )
SELECT ground FROM table_14312471_4 WHERE crowd = 19929
sql_create_context
Below are sql tables 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 ground where the crowd totals 19929? ### Input: CREATE TABLE table_14312471_4 ( ground VARCHAR, crowd V...
Create a pie chart showing how many headquarters across headquarters.
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a pie chart showing how many headquarters across headquarters. ### Input: CREATE TABLE company ( Company_ID int, ...
Which rounds did the team Walther participate in?
CREATE TABLE table_33761 ( "Team" text, "Chassis" text, "Engine" text, "Driver(s)" text, "Sponsor(s)" text, "Rounds" text )
SELECT "Rounds" FROM table_33761 WHERE "Team" = 'walther'
wikisql
Below are sql tables 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 rounds did the team Walther participate in? ### Input: CREATE TABLE table_33761 ( "Team" text, "Chassis" text,...
How much did the away team score at Victoria park?
CREATE TABLE table_name_84 ( away_team VARCHAR, venue VARCHAR )
SELECT away_team AS score FROM table_name_84 WHERE venue = "victoria park"
sql_create_context
Below are sql tables 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 the away team score at Victoria park? ### Input: CREATE TABLE table_name_84 ( away_team VARCHAR, venue ...
which is the only year they went 1-1 at home ?
CREATE TABLE table_203_741 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "aggregate" text )
SELECT "season" FROM table_203_741 WHERE "home" = '1-1'
squall
Below are sql tables 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 is the only year they went 1-1 at home ? ### Input: CREATE TABLE table_203_741 ( id number, "season" text, ...
what is the number of days that have passed since the last time patient 28443 received a d5w intake on the current intensive care unit visit?
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_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 28443) AND icustays.outtime IS NULL) ...
mimic_iii
Below are sql tables 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 days that have passed since the last time patient 28443 received a d5w intake on the current intensive...
What was the score in the year 2004?
CREATE TABLE table_name_72 ( score VARCHAR, year VARCHAR )
SELECT score FROM table_name_72 WHERE year = "2004"
sql_create_context
Below are sql tables 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 the year 2004? ### Input: CREATE TABLE table_name_72 ( score VARCHAR, year VARCHAR ) ### Respo...
Which Country has a Top Team of jam, and an Edition of 31st?
CREATE TABLE table_65795 ( "Edition" text, "Year" text, "City" text, "Country" text, "Date" text, "No. of Events" real, "Top Team" text )
SELECT "Country" FROM table_65795 WHERE "Top Team" = 'jam' AND "Edition" = '31st'
wikisql
Below are sql tables 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 Country has a Top Team of jam, and an Edition of 31st? ### Input: CREATE TABLE table_65795 ( "Edition" text, "...
What is the score for the match that had a home team of Kidderminster Harriers?
CREATE TABLE table_47393 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Score" FROM table_47393 WHERE "Home team" = 'kidderminster harriers'
wikisql
Below are sql tables 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 for the match that had a home team of Kidderminster Harriers? ### Input: CREATE TABLE table_47393 ( "T...
What is the imed/avicenna listed for a medical school offshore in saint kitts and nevis which was established before 2000 and will give you an MD?
CREATE TABLE table_63242 ( "Country/Territory" text, "Established" real, "Degree" text, "Regional/Offshore" text, "IMED/Avicenna Listed" text )
SELECT "IMED/Avicenna Listed" FROM table_63242 WHERE "Regional/Offshore" = 'offshore' AND "Country/Territory" = 'saint kitts and nevis' AND "Degree" = 'md' AND "Established" < '2000'
wikisql
Below are sql tables 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 imed/avicenna listed for a medical school offshore in saint kitts and nevis which was established before 2000 an...
What is the Attendance when Vida is the Away team?
CREATE TABLE table_8371 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
SELECT AVG("Attendance") FROM table_8371 WHERE "Away" = 'vida'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Attendance when Vida is the Away team? ### Input: CREATE TABLE table_8371 ( "Date" text, "Home" text, ...
which nation had the same total number of gold medals as japan ?
CREATE TABLE table_203_653 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "nation" FROM table_203_653 WHERE "nation" <> 'japan' AND "gold" = (SELECT "gold" FROM table_203_653 WHERE "nation" = 'japan')
squall
Below are sql tables 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 nation had the same total number of gold medals as japan ? ### Input: CREATE TABLE table_203_653 ( id number, ...
what is the number of home health care discharge patients who were admitted before 2197?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2197"
mimicsql_data
Below are sql tables 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 home health care discharge patients who were admitted before 2197? ### Input: CREATE TABLE demographic...
what is the difference of population in easton and reno ?
CREATE TABLE table_204_616 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text )
SELECT ABS((SELECT "population" FROM table_204_616 WHERE "township" = 'easton') - (SELECT "population" FROM table_204_616 WHERE "township" = 'reno'))
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the difference of population in easton and reno ? ### Input: CREATE TABLE table_204_616 ( id number, "townsh...
Name the 2010 for 2007 of a and 2012 of a
CREATE TABLE table_15199 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2010" FROM table_15199 WHERE "2007" = 'a' AND "2012" = 'a'
wikisql
Below are sql tables 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 2010 for 2007 of a and 2012 of a ### Input: CREATE TABLE table_15199 ( "Tournament" text, "2007" text, ...
What was the location when the opponent was Seattle Supersonics?
CREATE TABLE table_79061 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text )
SELECT "Location/Attendance" FROM table_79061 WHERE "Opponent" = 'seattle supersonics'
wikisql
Below are sql tables 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 location when the opponent was Seattle Supersonics? ### Input: CREATE TABLE table_79061 ( "Game" real, ...
What is the to par for the player with fewer than 148 total points?
CREATE TABLE table_name_53 ( to_par INTEGER, total INTEGER )
SELECT SUM(to_par) FROM table_name_53 WHERE total < 148
sql_create_context
Below are sql tables 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 to par for the player with fewer than 148 total points? ### Input: CREATE TABLE table_name_53 ( to_par INTEG...
What is the phone number of the station located at 53 Dayton Road?
CREATE TABLE table_56724 ( "Station" text, "Engine Company" text, "Ambulance" text, "Address" text, "Phone" text )
SELECT "Phone" FROM table_56724 WHERE "Address" = '53 dayton road'
wikisql
Below are sql tables 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 phone number of the station located at 53 Dayton Road? ### Input: CREATE TABLE table_56724 ( "Station" text,...
What was the method of resolution when Mikhail Ilyukhin's record was 4-0?
CREATE TABLE table_name_92 ( method VARCHAR, record VARCHAR )
SELECT method FROM table_name_92 WHERE record = "4-0"
sql_create_context
Below are sql tables 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 method of resolution when Mikhail Ilyukhin's record was 4-0? ### Input: CREATE TABLE table_name_92 ( method...
Who was the opponent at the game attended by 45,000?
CREATE TABLE table_name_73 ( opponent_number VARCHAR, attendance VARCHAR )
SELECT opponent_number FROM table_name_73 WHERE attendance = "45,000"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent at the game attended by 45,000? ### Input: CREATE TABLE table_name_73 ( opponent_number VARCHAR, ...
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the founder , and group by attribute founder, and show Founder in desc order.
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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
nvbench
Below are sql tables 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, give me the comparison about the average of code over t...
Parsing papers using Jeopardy! Questions published at ACL 2014
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ...
SELECT DISTINCT paper.paperid FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase, venue WHERE dataset.datasetname = 'Jeopardy! Questions' AND keyphrase.keyphrasename = 'Parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = p...
scholar
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Parsing papers using Jeopardy! Questions published at ACL 2014 ### Input: CREATE TABLE writes ( paperid int, authori...
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, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday, and order in desc by the the average of department id.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
Below are sql tables 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 ...
What is the release Date of Catalog RR 8655-2?
CREATE TABLE table_name_39 ( date VARCHAR, catalog VARCHAR )
SELECT date FROM table_name_39 WHERE catalog = "rr 8655-2"
sql_create_context
Below are sql tables 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 release Date of Catalog RR 8655-2? ### Input: CREATE TABLE table_name_39 ( date VARCHAR, catalog VARCHAR...
how many patients stayed in hospital for more than 1 day and were procedured with spinal tap?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.short_title = "Spinal tap"
mimicsql_data
Below are sql tables 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 1 day and were procedured with spinal tap? ### Input: CREATE TABLE prescr...
Users with at least one post in a reputation bracket.
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
SELECT 'site://users/' + CAST(u.Id AS VARCHAR) + '|' + CAST(u.DisplayName AS VARCHAR) AS "user", SUM(p.Score) AS "Total Score", u.Reputation, u.LastAccessDate FROM Users AS u, Posts AS p WHERE u.Reputation >= @Repmin AND u.Reputation <= @Repmax AND u.Id = p.OwnerUserId AND p.PostTypeId = 1 AND DATEDIFF(day, u.LastAcces...
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users with at least one post in a reputation bracket. ### Input: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTyp...
tell me the age and lab test abnormal status for patient with patient id 2560.
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 demographic.age, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
Below are sql tables 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 age and lab test abnormal status for patient with patient id 2560. ### Input: CREATE TABLE diagnoses ( subje...
what are the three most commonly prescribed drugs that were prescribed to the patients 40s within the same month after having been diagnosed with prim cardiomyopathy nec until 2 years ago?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime ...
SELECT t3.drug FROM (SELECT t2.drug, 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_icd_diagnoses WHERE ...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the three most commonly prescribed drugs that were prescribed to the patients 40s within the same month after havin...
on 07/16/2105, patient 3918 has had any enfamiladdedrice po intake?
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
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 = 3918)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'enfamilad...
mimic_iii
Below are sql tables 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 07/16/2105, patient 3918 has had any enfamiladdedrice po intake? ### Input: CREATE TABLE transfers ( row_id number, ...
What was Olin Dutra's score?
CREATE TABLE table_name_88 ( score VARCHAR, player VARCHAR )
SELECT score FROM table_name_88 WHERE player = "olin dutra"
sql_create_context
Below are sql tables 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 Olin Dutra's score? ### Input: CREATE TABLE table_name_88 ( score VARCHAR, player VARCHAR ) ### Response: S...
What is the 2004 value for the 2009 Grand slam tournaments?
CREATE TABLE table_name_86 ( Id VARCHAR )
SELECT 2004 FROM table_name_86 WHERE 2009 = "grand slam tournaments"
sql_create_context
Below are sql tables 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 2004 value for the 2009 Grand slam tournaments? ### Input: CREATE TABLE table_name_86 ( Id VARCHAR ) ### Res...
Name the least overall for tony baker
CREATE TABLE table_36892 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT MIN("Overall") FROM table_36892 WHERE "Name" = 'tony baker'
wikisql
Below are sql tables 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 overall for tony baker ### Input: CREATE TABLE table_36892 ( "Round" real, "Pick #" real, "Overal...
What is the total number of Losses, when Last Appearance is 2003, and when Wins is greater than 2?
CREATE TABLE table_name_85 ( losses VARCHAR, last_appearance VARCHAR, wins VARCHAR )
SELECT COUNT(losses) FROM table_name_85 WHERE last_appearance = "2003" AND wins > 2
sql_create_context
Below are sql tables 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 total number of Losses, when Last Appearance is 2003, and when Wins is greater than 2? ### Input: CREATE TABLE t...
What is Mark Henry's brand?
CREATE TABLE table_name_28 ( brand VARCHAR, entrant VARCHAR )
SELECT brand FROM table_name_28 WHERE entrant = "mark henry"
sql_create_context
Below are sql tables 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 Mark Henry's brand? ### Input: CREATE TABLE table_name_28 ( brand VARCHAR, entrant VARCHAR ) ### Response: S...
what is the yearly minimum dose of tube feeding flush (ml) that patient 016-17204 has taken until 11/2105?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17204')) AND intakeoutput.celllabel = 'tube ...
eicu
Below are sql tables 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 yearly minimum dose of tube feeding flush (ml) that patient 016-17204 has taken until 11/2105? ### Input: CREATE...
Which Top-25 has a Top-5 larger than 9, and Wins smaller than 11?
CREATE TABLE table_35980 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
SELECT SUM("Top-25") FROM table_35980 WHERE "Top-5" > '9' AND "Wins" < '11'
wikisql
Below are sql tables 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 Top-25 has a Top-5 larger than 9, and Wins smaller than 11? ### Input: CREATE TABLE table_35980 ( "Tournament" tex...
is patient 15945's arterial bp [diastolic] last measured on the last icu visit greater than first measured on the last icu visit?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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...
SELECT (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 = 15945) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is patient 15945's arterial bp [diastolic] last measured on the last icu visit greater than first measured on the last icu v...
How many dates do the dolphins have 6 points?
CREATE TABLE table_22648 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Dolphins points" real, "Opponents" real, "Record" text, "Attendance" real )
SELECT "Date" FROM table_22648 WHERE "Dolphins points" = '6'
wikisql
Below are sql tables 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 dates do the dolphins have 6 points? ### Input: CREATE TABLE table_22648 ( "Game" real, "Date" text, "O...
what's the name of the procedure that patient 005-26011 got two times in 01/last year?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
Below are sql tables 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 name of the procedure that patient 005-26011 got two times in 01/last year? ### Input: CREATE TABLE intakeoutput ...
Which is the latest year that has an engine of Offenhauser l4, a chassis of Kurtis Kraft 500c, and the entrant of Federal Engineering?
CREATE TABLE table_name_82 ( year INTEGER, entrant VARCHAR, engine VARCHAR, chassis VARCHAR )
SELECT MAX(year) FROM table_name_82 WHERE engine = "offenhauser l4" AND chassis = "kurtis kraft 500c" AND entrant = "federal engineering"
sql_create_context
Below are sql tables 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 is the latest year that has an engine of Offenhauser l4, a chassis of Kurtis Kraft 500c, and the entrant of Federal En...
What surface has 2 as a cage dive?
CREATE TABLE table_70261 ( "1-person dive" text, "2-person dive" text, "3-person dive" text, "Surface" text, "Cage dive" text, "Seal/turtle decoy" text, "Catch release" text, "Attached camera" text, "Remote camera" text )
SELECT "Surface" FROM table_70261 WHERE "Cage dive" = '2'
wikisql
Below are sql tables 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 surface has 2 as a cage dive? ### Input: CREATE TABLE table_70261 ( "1-person dive" text, "2-person dive" text,...
Which spike has a 2008 club Karava?
CREATE TABLE table_62736 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
SELECT "Spike" FROM table_62736 WHERE "2008 club" = 'karava'
wikisql
Below are sql tables 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 spike has a 2008 club Karava? ### Input: CREATE TABLE table_62736 ( "Name" text, "Height" text, "Weight" t...
What is the content of la7 television service?
CREATE TABLE table_15887683_1 ( content VARCHAR, television_service VARCHAR )
SELECT content FROM table_15887683_1 WHERE television_service = "LA7"
sql_create_context
Below are sql tables 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 content of la7 television service? ### Input: CREATE TABLE table_15887683_1 ( content VARCHAR, televisio...
was the the score when the tries was 743
CREATE TABLE table_14070062_4 ( points_against VARCHAR, points_for VARCHAR )
SELECT points_against FROM table_14070062_4 WHERE points_for = "743"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the the score when the tries was 743 ### Input: CREATE TABLE table_14070062_4 ( points_against VARCHAR, points_f...
Show the average age for all female students and group them by first name in a bar chart, and display x axis in desc order please.
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Fname, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname DESC
nvbench
Below are sql tables 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 average age for all female students and group them by first name in a bar chart, and display x axis in desc order p...
Which player is featured for 2001-2002?
CREATE TABLE table_name_28 ( player VARCHAR, year VARCHAR )
SELECT player FROM table_name_28 WHERE year = "2001-2002"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player is featured for 2001-2002? ### Input: CREATE TABLE table_name_28 ( player VARCHAR, year VARCHAR ) ### R...
what was the difference , in years between the founding of st. agnes and the founding of good shepherd ?
CREATE TABLE table_204_540 ( id number, "name" text, "town" text, "deanery" text, "vicariate" text, "founded" number, "original ethnic community" text )
SELECT ABS((SELECT "founded" FROM table_204_540 WHERE "name" = 'st. agnes') - (SELECT "founded" FROM table_204_540 WHERE "name" = 'good shepherd'))
squall
Below are sql tables 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 difference , in years between the founding of st. agnes and the founding of good shepherd ? ### Input: CREATE T...
Jimmie Lee Sloas was the composer for what album?
CREATE TABLE table_name_44 ( album VARCHAR, composer_s_ VARCHAR )
SELECT album FROM table_name_44 WHERE composer_s_ = "jimmie lee sloas"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Jimmie Lee Sloas was the composer for what album? ### Input: CREATE TABLE table_name_44 ( album VARCHAR, composer_s_...
What's the top year with the Chassis ats hs1?
CREATE TABLE table_name_33 ( year INTEGER, chassis VARCHAR )
SELECT MAX(year) FROM table_name_33 WHERE chassis = "ats hs1"
sql_create_context
Below are sql tables 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 top year with the Chassis ats hs1? ### Input: CREATE TABLE table_name_33 ( year INTEGER, chassis VARCHAR ...
What is the total point count of the youngest gymnast?
CREATE TABLE gymnast ( Total_Points VARCHAR, Gymnast_ID VARCHAR ) CREATE TABLE people ( People_ID VARCHAR, Age VARCHAR )
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age LIMIT 1
sql_create_context
Below are sql tables 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 total point count of the youngest gymnast? ### Input: CREATE TABLE gymnast ( Total_Points VARCHAR, Gymna...
If winner is alejandro Valverde and the points Classification is by Erik Zabel, who is the mountain classification?
CREATE TABLE table_19834 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text )
SELECT "Mountains classification" FROM table_19834 WHERE "Winner" = 'Alejandro Valverde' AND "Points classification" = 'Erik Zabel'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If winner is alejandro Valverde and the points Classification is by Erik Zabel, who is the mountain classification? ### Inpu...
What was the to par at the T5 for the player with a score of 74-69-66=209?
CREATE TABLE table_name_39 ( to_par VARCHAR, place VARCHAR, score VARCHAR )
SELECT to_par FROM table_name_39 WHERE place = "t5" AND score = 74 - 69 - 66 = 209
sql_create_context
Below are sql tables 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 at the T5 for the player with a score of 74-69-66=209? ### Input: CREATE TABLE table_name_39 ( to_pa...
On which date was the score 0 - 0?
CREATE TABLE table_75946 ( "Round" text, "Date" text, "Home team" text, "Score" text, "Away team" text )
SELECT "Date" FROM table_75946 WHERE "Score" = '0 - 0'
wikisql
Below are sql tables 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 which date was the score 0 - 0? ### Input: CREATE TABLE table_75946 ( "Round" text, "Date" text, "Home team" ...
What is Television Service, when Content is Presentazione?
CREATE TABLE table_name_90 ( television_service VARCHAR, content VARCHAR )
SELECT television_service FROM table_name_90 WHERE content = "presentazione"
sql_create_context
Below are sql tables 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 Television Service, when Content is Presentazione? ### Input: CREATE TABLE table_name_90 ( television_service VA...
Which championship after 1985 had a winning score of 8 (68-72-69-71=280)?
CREATE TABLE table_name_17 ( championship VARCHAR, year VARCHAR, winning_score VARCHAR )
SELECT championship FROM table_name_17 WHERE year > 1985 AND winning_score = –8(68 - 72 - 69 - 71 = 280)
sql_create_context
Below are sql tables 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 championship after 1985 had a winning score of 8 (68-72-69-71=280)? ### Input: CREATE TABLE table_name_17 ( champi...
Which Opponent has Attendances of 60,594?
CREATE TABLE table_name_34 ( opponent VARCHAR, attendance VARCHAR )
SELECT opponent FROM table_name_34 WHERE attendance = "60,594"
sql_create_context
Below are sql tables 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 Opponent has Attendances of 60,594? ### Input: CREATE TABLE table_name_34 ( opponent VARCHAR, attendance VARCH...
how many patients are married and diagnosed with depressive disorder, not elsewhere classified?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Depressive disorder, not elsewhere classified"
mimicsql_data
Below are sql tables 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 married and diagnosed with depressive disorder, not elsewhere classified? ### Input: CREATE TABLE lab ...
The season premiere aired on September 11, 2000 aired on how many networks?
CREATE TABLE table_15923 ( "Season" text, "Network" text, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" text, "Viewers (in millions)" text )
SELECT COUNT("Network") FROM table_15923 WHERE "Season premiere" = 'September 11, 2000'
wikisql
Below are sql tables 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 season premiere aired on September 11, 2000 aired on how many networks? ### Input: CREATE TABLE table_15923 ( "Seaso...
calculate the total number of female patients whose ethnic origin is unspecified/unknown
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "UNKNOWN/NOT SPECIFIED"
mimicsql_data
Below are sql tables 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 the total number of female patients whose ethnic origin is unspecified/unknown ### Input: CREATE TABLE procedures ...
A bar chart for what are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, list in asc by the x-axis.
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_len...
SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name
nvbench
Below are sql tables 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 photos taken with the lens brand 'Sigma' or 'Olympus'?, list in asc by t...
What is the value for model if processor is Kentsfield and brand name is Xeon?
CREATE TABLE table_2467150_2 ( model__list_ VARCHAR, processor VARCHAR, brand_name VARCHAR )
SELECT model__list_ FROM table_2467150_2 WHERE processor = "Kentsfield" AND brand_name = "Xeon"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the value for model if processor is Kentsfield and brand name is Xeon? ### Input: CREATE TABLE table_2467150_2 ( ...
How many million U.S. viewers wtched episode 69 of the series?
CREATE TABLE table_27832075_2 ( us_viewers__millions_ VARCHAR, series__number VARCHAR )
SELECT us_viewers__millions_ FROM table_27832075_2 WHERE series__number = 69
sql_create_context
Below are sql tables 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 million U.S. viewers wtched episode 69 of the series? ### Input: CREATE TABLE table_27832075_2 ( us_viewers__mi...
Name the % yes for yes votes for 78961
CREATE TABLE table_3352 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
SELECT "% YES" FROM table_3352 WHERE "YES votes" = '78961'
wikisql
Below are sql tables 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 % yes for yes votes for 78961 ### Input: CREATE TABLE table_3352 ( "meas. num" real, "passed" text, "YE...
Percentage of questions with high-scoring unaccepted answers by tag.
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, Pos...
SELECT t.TagName, COUNT(*) AS "total_questions", SUM(CASE WHEN p.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS "no_accepted_answer", SUM(CASE WHEN p.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS "%_unaccepted" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id ...
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Percentage of questions with high-scoring unaccepted answers by tag. ### Input: CREATE TABLE ReviewTaskStates ( Id numbe...
Which Tie is from birmingham city?
CREATE TABLE table_name_97 ( tie_no VARCHAR, home_team VARCHAR )
SELECT tie_no FROM table_name_97 WHERE home_team = "birmingham city"
sql_create_context
Below are sql tables 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 Tie is from birmingham city? ### Input: CREATE TABLE table_name_97 ( tie_no VARCHAR, home_team VARCHAR ) ### R...
how many contestants were from thailand ?
CREATE TABLE table_204_910 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text )
SELECT COUNT(*) FROM table_204_910 WHERE "nationality" = 'thailand'
squall
Below are sql tables 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 contestants were from thailand ? ### Input: CREATE TABLE table_204_910 ( id number, "rank" number, "nam...
What is the total number of byes that are associated with 1 draw, 5 wins, and fewer than 12 losses?
CREATE TABLE table_36426 ( "NTFA Div 1" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
SELECT SUM("Byes") FROM table_36426 WHERE "Draws" = '1' AND "Wins" = '5' AND "Losses" < '12'
wikisql
Below are sql tables 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 total number of byes that are associated with 1 draw, 5 wins, and fewer than 12 losses? ### Input: CREATE TABLE ...
What is the name of the Player that shows the NHL team of new york rangers, and a Pick # of 31?
CREATE TABLE table_36656 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
SELECT "Player" FROM table_36656 WHERE "NHL team" = 'new york rangers' AND "Pick #" = '31'
wikisql
Below are sql tables 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 Player that shows the NHL team of new york rangers, and a Pick # of 31? ### Input: CREATE TABLE tabl...
What identities do the genus/species arabidopsis thaliana have?
CREATE TABLE table_20073 ( "Genus/Species" text, "Common Name" text, "Accession Number" text, "Length" text, "Similarity" text, "Identity" text )
SELECT "Identity" FROM table_20073 WHERE "Genus/Species" = 'Arabidopsis thaliana'
wikisql
Below are sql tables 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 identities do the genus/species arabidopsis thaliana have? ### Input: CREATE TABLE table_20073 ( "Genus/Species" te...
Show the minimum, maximum, average price for all products.
CREATE TABLE products ( product_price INTEGER )
SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products
sql_create_context
Below are sql tables 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 minimum, maximum, average price for all products. ### Input: CREATE TABLE products ( product_price INTEGER ) ##...
How many object dates does episode #16 have?
CREATE TABLE table_29635868_1 ( object_date VARCHAR, episode_number VARCHAR )
SELECT COUNT(object_date) FROM table_29635868_1 WHERE episode_number = 16
sql_create_context
Below are sql tables 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 object dates does episode #16 have? ### Input: CREATE TABLE table_29635868_1 ( object_date VARCHAR, episode...
Draw a bar chart for what are the ids and names of the architects who built at least 3 bridges ?, rank in desc by the x-axis.
CREATE TABLE mill ( architect_id int, id int, location text, name text, type text, built_year int, notes text ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE bridge ( architect_id int, id int, name text, location t...
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for what are the ids and names of the architects who built at least 3 bridges ?, rank in desc by the x-axis...
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, show me about the distribution of hire_date and the average of manager_id bin hire_date by weekday in a bar chart, and show by the the average of manager id from high to low.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCAT...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC
nvbench
Below are sql tables 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 ...
Distribution of id's in the user table.
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
SELECT Id / 10000, COUNT(*) FROM Users GROUP BY Id / 10000 ORDER BY Id / 10000
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Distribution of id's in the user table. ### Input: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ...
Tell me the lowest gold for rank of 6 and total less than 2
CREATE TABLE table_name_16 ( gold INTEGER, rank VARCHAR, total VARCHAR )
SELECT MIN(gold) FROM table_name_16 WHERE rank = "6" AND total < 2
sql_create_context
Below are sql tables 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 gold for rank of 6 and total less than 2 ### Input: CREATE TABLE table_name_16 ( gold INTEGER, ra...
What is the Unami Delaware value for a Thomas value of nacha?
CREATE TABLE table_name_18 ( unami_delaware VARCHAR, thomas__1698_ VARCHAR )
SELECT unami_delaware FROM table_name_18 WHERE thomas__1698_ = "nacha"
sql_create_context
Below are sql tables 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 Unami Delaware value for a Thomas value of nacha? ### Input: CREATE TABLE table_name_18 ( unami_delaware VAR...
When was satsuki dd-27 completed?
CREATE TABLE table_64457 ( "Kanji" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text )
SELECT "Completed" FROM table_64457 WHERE "Name" = 'satsuki dd-27'
wikisql
Below are sql tables 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 satsuki dd-27 completed? ### Input: CREATE TABLE table_64457 ( "Kanji" text, "Name" text, "Builder" tex...
How many projects are there?
CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details tex...
SELECT COUNT(*) FROM projects
spider
Below are sql tables 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 projects are there? ### Input: CREATE TABLE documents_with_expenses ( document_id number, budget_type_code ...
What date has yani tseng as the runner (s)-up?
CREATE TABLE table_name_91 ( date VARCHAR, runner_s__up VARCHAR )
SELECT date FROM table_name_91 WHERE runner_s__up = "yani tseng"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date has yani tseng as the runner (s)-up? ### Input: CREATE TABLE table_name_91 ( date VARCHAR, runner_s__up VA...
What time was the race for the country of france?
CREATE TABLE table_66483 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
SELECT "Time" FROM table_66483 WHERE "Country" = 'france'
wikisql
Below are sql tables 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 time was the race for the country of france? ### Input: CREATE TABLE table_66483 ( "Rank" real, "Athlete" text,...
which location is listed previous to march 22 ?
CREATE TABLE table_203_704 ( id number, "rnd" number, "date" text, "location" text, "laps" number, "distance" text, "time" text, "speed\n(km/h)" number, "winner" text, "pole position" text, "most leading laps" text, "fastest race lap" text )
SELECT "location" FROM table_203_704 WHERE id = (SELECT id FROM table_203_704 WHERE "date" = 'march 22') - 1
squall
Below are sql tables 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 location is listed previous to march 22 ? ### Input: CREATE TABLE table_203_704 ( id number, "rnd" number, ...
How many headquarters are there listed for HSBC?
CREATE TABLE table_21118 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text )
SELECT COUNT("Headquarters") FROM table_21118 WHERE "Company" = 'HSBC'
wikisql
Below are sql tables 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 headquarters are there listed for HSBC? ### Input: CREATE TABLE table_21118 ( "Rank" real, "Company" text, ...
list all nonstop flights from LOS ANGELES to PITTSBURGH which arrive before 1700 on tuesday
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 22 AND d...
atis
Below are sql tables 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 nonstop flights from LOS ANGELES to PITTSBURGH which arrive before 1700 on tuesday ### Input: CREATE TABLE dual_car...
What was the attendance on September 28?
CREATE TABLE table_75502 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT MAX("Attendance") FROM table_75502 WHERE "Date" = 'september 28'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the attendance on September 28? ### Input: CREATE TABLE table_75502 ( "Date" text, "Opponent" text, "Sc...
show me the earliest flight from NEWARK to SEATTLE
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
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 = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL...
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the earliest flight from NEWARK to SEATTLE ### Input: CREATE TABLE compartment_class ( compartment varchar, ...
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of manufacturer , and group by attribute name, and list Y in descending order.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC
nvbench
Below are sql tables 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, a bar chart shows the distribution of name and the sum ...
Can you tell me the sum of Goals against that has the Goals for larger than 10, and the Position of 3, and the Wins smaller than 6?
CREATE TABLE table_76289 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
SELECT SUM("Goals against") FROM table_76289 WHERE "Goals for" > '10' AND "Position" = '3' AND "Wins" < '6'
wikisql
Below are sql tables 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 sum of Goals against that has the Goals for larger than 10, and the Position of 3, and the Wins smaller ...
Which nation finished with a time of 47.049?
CREATE TABLE table_75224 ( "Sport" text, "Record" text, "Nation" text, "Date" text, "Time (sec.)" real )
SELECT "Nation" FROM table_75224 WHERE "Time (sec.)" = '47.049'
wikisql
Below are sql tables 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 nation finished with a time of 47.049? ### Input: CREATE TABLE table_75224 ( "Sport" text, "Record" text, ...
Name the total number of played when points of is 31-7, position is 16 and goals for is less than 35
CREATE TABLE table_name_67 ( played VARCHAR, goals_for VARCHAR, points VARCHAR, position VARCHAR )
SELECT COUNT(played) FROM table_name_67 WHERE points = "31-7" AND position = 16 AND goals_for < 35
sql_create_context
Below are sql tables 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 total number of played when points of is 31-7, position is 16 and goals for is less than 35 ### Input: CREATE TABLE...