instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
calculate the number of patients on elective admission who had other endoscopy of small intestine?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Other endoscopy of small intestine"
Below are sql tables 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 number of patients on elective admission who had other endoscopy of small intestine? ### Input: CREATE TABLE p...
For those employees who was hired before 2002-06-21, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart.
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-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: For those employees who was hired before 2002-06-21, find hire_date and the amount of hire_date bin hire_date by time, and v...
Show the name for regions and the number of storms for each region, rank in descending by the bars.
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name for regions and the number of storms for each region, rank in descending by the bars. ### Input: CREATE TABLE ...
How many games had a score of l 91 95 (ot)?
CREATE TABLE table_6807 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT COUNT("Game") FROM table_6807 WHERE "Score" = 'l 91–95 (ot)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games had a score of l 91 95 (ot)? ### Input: CREATE TABLE table_6807 ( "Game" real, "Date" text, "Team...
What is the total for Austria when there is less than 1 bronze?
CREATE TABLE table_64660 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Total") FROM table_64660 WHERE "Nation" = 'austria' 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: What is the total for Austria when there is less than 1 bronze? ### Input: CREATE TABLE table_64660 ( "Rank" text, "...
I want to see trend of the number of season by season, and order in descending by the X.
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( ...
SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season 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: I want to see trend of the number of season by season, and order in descending by the X. ### Input: CREATE TABLE injury_acci...
which team had the most points ?
CREATE TABLE table_203_30 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number )
SELECT "team" FROM table_203_30 ORDER BY "points" 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 had the most points ? ### Input: CREATE TABLE table_203_30 ( id number, "place" number, "team" text, ...
what was the amount of drain out #3 jackson pratt patient 18223 had since 02/25/2103?
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 time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18223)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the amount of drain out #3 jackson pratt patient 18223 had since 02/25/2103? ### Input: CREATE TABLE icustays ( ...
Name the least lane for kasey giteau and rank less than 18
CREATE TABLE table_80216 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
SELECT MIN("Lane") FROM table_80216 WHERE "Name" = 'kasey giteau' AND "Rank" < '18'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least lane for kasey giteau and rank less than 18 ### Input: CREATE TABLE table_80216 ( "Rank" real, "Heat"...
Number of questions without a single answer.
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND AnswerCount = 0
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of questions without a single answer. ### Input: CREATE TABLE Comments ( Id number, PostId number, Score ...
what is the name of the drug that was last prescribed for patient 006-36108 during the previous month?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
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 = '006-36108')) AND DATETIME(medication.drugstarttime, 'start of month...
Below are sql tables 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 was last prescribed for patient 006-36108 during the previous month? ### Input: CREATE TAB...
How many laps were there in grid 21?
CREATE TABLE table_78318 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
SELECT "Laps" FROM table_78318 WHERE "Grid" = '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: How many laps were there in grid 21? ### Input: CREATE TABLE table_78318 ( "Driver" text, "Constructor" text, "L...
provide the number of patients with drug code quet200 and hospital stay of more than 27 days.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "27" AND prescriptions.formulary_drug_cd = "QUET200"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients with drug code quet200 and hospital stay of more than 27 days. ### Input: CREATE TABLE lab ( ...
cheapest fare from NASHVILLE to SEATTLE
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: cheapest fare from NASHVILLE to SEATTLE ### Input: CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE T...
How many gold have a bronze of 1, a rank smaller than 6, and a total less than 3?
CREATE TABLE table_name_81 ( gold INTEGER, total VARCHAR, bronze VARCHAR, rank VARCHAR )
SELECT SUM(gold) FROM table_name_81 WHERE bronze = 1 AND rank < 6 AND total < 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: How many gold have a bronze of 1, a rank smaller than 6, and a total less than 3? ### Input: CREATE TABLE table_name_81 ( ...
Show the title and score of the movie with a bar chart, show X-axis in descending order.
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text )
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY title DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the title and score of the movie with a bar chart, show X-axis in descending order. ### Input: CREATE TABLE Reviewer ( ...
List the number of vacators when successors were formally installed on June 22, 1868.
CREATE TABLE table_2417340_3 ( vacator VARCHAR, date_of_successors_formal_installation VARCHAR )
SELECT COUNT(vacator) FROM table_2417340_3 WHERE date_of_successors_formal_installation = "June 22, 1868"
Below are sql tables 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 number of vacators when successors were formally installed on June 22, 1868. ### Input: CREATE TABLE table_2417340_...
What was the average size of the crowd for matches held at Corio Oval?
CREATE TABLE table_33315 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT AVG("Crowd") FROM table_33315 WHERE "Venue" = 'corio 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: What was the average size of the crowd for matches held at Corio Oval? ### Input: CREATE TABLE table_33315 ( "Home team"...
Visualize a bar chart for what is the average age for each dorm and what are the names of each dorm?, could you sort bar from high to low 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 Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREAT...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart for what is the average age for each dorm and what are the names of each dorm?, could you sort bar fro...
Who was Hawthorn's away opponent?
CREATE TABLE table_name_68 ( away_team VARCHAR, home_team VARCHAR )
SELECT away_team FROM table_name_68 WHERE home_team = "hawthorn"
Below are sql tables 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 Hawthorn's away opponent? ### Input: CREATE TABLE table_name_68 ( away_team VARCHAR, home_team VARCHAR ) ###...
What was the smallest crowd size for a home game for Richmond?
CREATE TABLE table_name_47 ( crowd INTEGER, home_team VARCHAR )
SELECT MIN(crowd) FROM table_name_47 WHERE home_team = "richmond"
Below are sql tables 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 smallest crowd size for a home game for Richmond? ### Input: CREATE TABLE table_name_47 ( crowd INTEGER, ...
until 95 months ago, had entacapone ever been prescribed to patient 7241?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241) AND prescriptions.drug = 'entacapone' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-95 month')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 95 months ago, had entacapone ever been prescribed to patient 7241? ### Input: CREATE TABLE d_labitems ( row_id nu...
If the US Open tournament had 2r in 2012, what was it in 2010?
CREATE TABLE table_name_84 ( tournament VARCHAR )
SELECT 2010 FROM table_name_84 WHERE 2012 = "2r" AND tournament = "us open"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the US Open tournament had 2r in 2012, what was it in 2010? ### Input: CREATE TABLE table_name_84 ( tournament VARCHA...
calculate the survival rate for three year among the patients who were prescribed nifedipine cr after being diagnosed with renal & ureteral dis nos.
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id numbe...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
Below are sql tables 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 survival rate for three year among the patients who were prescribed nifedipine cr after being diagnosed with r...
Who did the Jays play on August 30?
CREATE TABLE table_68574 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Opponent" FROM table_68574 WHERE "Date" = 'august 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: Who did the Jays play on August 30? ### Input: CREATE TABLE table_68574 ( "Date" text, "Opponent" text, "Score" ...
what papers are published by Liwen Xiong in 2015
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid ...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Liwen Xiong' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
Below are sql tables 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 papers are published by Liwen Xiong in 2015 ### Input: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename ...
What company made the chassis when Ferrari made the engine and there were 25 points?
CREATE TABLE table_80232 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
SELECT "Chassis" FROM table_80232 WHERE "Engine" = 'ferrari' AND "Points" = '25'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What company made the chassis when Ferrari made the engine and there were 25 points? ### Input: CREATE TABLE table_80232 ( ...
How many counties have people before profit as the party, and a borough greater than 0?
CREATE TABLE table_63503 ( "Party" text, "County" real, "City" real, "Borough" real, "Town" real, "Total" real )
SELECT SUM("County") FROM table_63503 WHERE "Party" = 'people before profit' AND "Borough" > '0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many counties have people before profit as the party, and a borough greater than 0? ### Input: CREATE TABLE table_63503 ...
I want to see trend of the average of budget in billions by creation
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
SELECT Creation, AVG(Budget_in_Billions) FROM department
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to see trend of the average of budget in billions by creation ### Input: CREATE TABLE head ( head_ID int, nam...
What type of engine does the model with model designation 97100 have?
CREATE TABLE table_20866024_3 ( engine VARCHAR, model_designation VARCHAR )
SELECT engine FROM table_20866024_3 WHERE model_designation = "97100"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of engine does the model with model designation 97100 have? ### Input: CREATE TABLE table_20866024_3 ( engine ...
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 manager_id bin hire_date by time, and order by the Y in asc.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
What average Year has Losses 4, and Wins less than 18, and Draws greater than 1?
CREATE TABLE table_80278 ( "Year" real, "Competition" text, "Wins" real, "Draws" real, "Loses" real )
SELECT AVG("Year") FROM table_80278 WHERE "Loses" = '4' AND "Wins" < '18' AND "Draws" > '1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What average Year has Losses 4, and Wins less than 18, and Draws greater than 1? ### Input: CREATE TABLE table_80278 ( "...
Which Home team has an Away team of everton?
CREATE TABLE table_76119 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Home team" FROM table_76119 WHERE "Away team" = 'everton'
Below are sql tables 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 Home team has an Away team of everton? ### Input: CREATE TABLE table_76119 ( "Tie no" text, "Home team" text, ...
What is the total number of losses Jackson, T., who had more than 27 gain, an avg/g smaller than 55.9, and a long less than 34, had?
CREATE TABLE table_69320 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
SELECT COUNT("Loss") FROM table_69320 WHERE "Gain" > '27' AND "Avg/G" < '55.9' AND "Name" = 'jackson, t.' AND "Long" < '34'
Below are sql tables 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 Jackson, T., who had more than 27 gain, an avg/g smaller than 55.9, and a long less than ...
Comments posted after your comment.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT c.UserId AS "user_link", c.Id AS "comment_link", p.Id AS "post_link" FROM Posts AS p, Comments AS c INNER JOIN Comments AS b ON c.PostId = b.PostId WHERE b.UserId = '##UserId##' AND c.UserId != '##UserId##' AND c.CreationDate > b.CreationDate AND p.Id = c.PostId ORDER BY c.CreationDate 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: Comments posted after your comment. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
Which rider had a speed of 104.630mph?
CREATE TABLE table_name_84 ( rider VARCHAR, speed VARCHAR )
SELECT rider FROM table_name_84 WHERE speed = "104.630mph"
Below are sql tables 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 rider had a speed of 104.630mph? ### Input: CREATE TABLE table_name_84 ( rider VARCHAR, speed VARCHAR ) ### Re...
What is shown on Tuesday when Thursday shows Fox Sports Tonight (ends 1 am next day)?
CREATE TABLE table_name_71 ( tuesday VARCHAR, thursday VARCHAR )
SELECT tuesday FROM table_name_71 WHERE thursday = "fox sports tonight (ends 1 am next day)"
Below are sql tables 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 shown on Tuesday when Thursday shows Fox Sports Tonight (ends 1 am next day)? ### Input: CREATE TABLE table_name_71 ...
What time/retired for grid 18?
CREATE TABLE table_77766 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Time/Retired" FROM table_77766 WHERE "Grid" = '18'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What time/retired for grid 18? ### Input: CREATE TABLE table_77766 ( "Driver" text, "Constructor" text, "Laps" r...
What is the date of the winning score 74-67-71-73=285?
CREATE TABLE table_24532 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winners share ( \u20ac )" real )
SELECT "Date" FROM table_24532 WHERE "Winning score" = '74-67-71-73=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 date of the winning score 74-67-71-73=285? ### Input: CREATE TABLE table_24532 ( "No." real, "Date" text...
what is the number of starts in 1977
CREATE TABLE table_19864214_3 ( starts VARCHAR, seasons VARCHAR )
SELECT starts FROM table_19864214_3 WHERE seasons = "1977"
Below are sql tables 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 starts in 1977 ### Input: CREATE TABLE table_19864214_3 ( starts VARCHAR, seasons VARCHAR ) ##...
Visualize the relationship between Body_Builder_ID and Snatch .
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
SELECT Body_Builder_ID, Snatch FROM body_builder
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the relationship between Body_Builder_ID and Snatch . ### Input: CREATE TABLE body_builder ( Body_Builder_ID i...
What is the highest Gold that has a Silver less than 7 and Bronze less than 0
CREATE TABLE table_7955 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MAX("Gold") FROM table_7955 WHERE "Silver" < '7' AND "Bronze" < '0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Gold that has a Silver less than 7 and Bronze less than 0 ### Input: CREATE TABLE table_7955 ( "Rank...
what types of ground transportation are available in PHILADELPHIA
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what types of ground transportation are available in PHILADELPHIA ### Input: CREATE TABLE equipment_sequence ( aircraft_...
What is the top speed of a 5-speed manual transmission produced in 2006-2009?
CREATE TABLE table_1857216_1 ( top_speed VARCHAR, production VARCHAR, transmission VARCHAR )
SELECT top_speed FROM table_1857216_1 WHERE production = "2006-2009" AND transmission = "5-speed manual"
Below are sql tables 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 top speed of a 5-speed manual transmission produced in 2006-2009? ### Input: CREATE TABLE table_1857216_1 ( ...
What game was played on December 8?
CREATE TABLE table_50648 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT AVG("Game") FROM table_50648 WHERE "Date" = 'december 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: What game was played on December 8? ### Input: CREATE TABLE table_50648 ( "Game" real, "Date" text, "Team" text,...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and manager_id , and display MANAGER_ID in descending order.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about...
What was the attendance at the game where the opponent was the denver broncos?
CREATE TABLE table_51129 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT "Attendance" FROM table_51129 WHERE "Opponent" = 'denver broncos'
Below are sql tables 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 at the game where the opponent was the denver broncos? ### Input: CREATE TABLE table_51129 ( "We...
when was the last year they placed 2nd ?
CREATE TABLE table_204_974 ( id number, "season" number, "level" text, "division" text, "section" text, "administration" text, "position" text, "movements" text )
SELECT "season" FROM table_204_974 WHERE "position" = 2 ORDER BY "season" DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last year they placed 2nd ? ### Input: CREATE TABLE table_204_974 ( id number, "season" number, "le...
For those records from the products and each product's manufacturer, a bar chart shows the distribution of founder and the sum of price , and group by attribute founder, could you sort by the total number of price in asc?
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 Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Price)
Below are sql tables 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 founder and the s...
What was the result of the game played on 17 July 2008?
CREATE TABLE table_45921 ( "Date" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text )
SELECT "Result" FROM table_45921 WHERE "Date" = '17 july 2008'
Below are sql tables 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 result of the game played on 17 July 2008? ### Input: CREATE TABLE table_45921 ( "Date" text, "Opponent...
mention the age and admission location of subject name jerry deberry.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.age, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mention the age and admission location of subject name jerry deberry. ### Input: CREATE TABLE prescriptions ( subject_id...
what team did the phillies play after august 7 ?
CREATE TABLE table_203_240 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
SELECT "opponent" FROM table_203_240 WHERE id = (SELECT id FROM table_203_240 WHERE "date" = 'august 7') + 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what team did the phillies play after august 7 ? ### Input: CREATE TABLE table_203_240 ( id number, "#" number, ...
what are the original air dates with a production code of 2394087
CREATE TABLE table_10953197_3 ( original_air_date VARCHAR, production_code VARCHAR )
SELECT original_air_date FROM table_10953197_3 WHERE production_code = "2394087"
Below are sql tables 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 original air dates with a production code of 2394087 ### Input: CREATE TABLE table_10953197_3 ( original_ai...
Which format had a United States region and a date of August 11, 2009?
CREATE TABLE table_name_92 ( format VARCHAR, region VARCHAR, date VARCHAR )
SELECT format FROM table_name_92 WHERE region = "united states" AND date = "august 11, 2009"
Below are sql tables 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 format had a United States region and a date of August 11, 2009? ### Input: CREATE TABLE table_name_92 ( format VA...
Show the names of products and the number of events they are in by a bar chart, and sort by the X in asc.
CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Agreements ( Document_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties ( Party_ID INTEGER, ...
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY Product_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: Show the names of products and the number of events they are in by a bar chart, and sort by the X in asc. ### Input: CREATE ...
What's the home record of the team with percentage of .168?
CREATE TABLE table_2754 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text )
SELECT "Home Record" FROM table_2754 WHERE "Percentage" = '.168'
Below are sql tables 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 home record of the team with percentage of .168? ### Input: CREATE TABLE table_2754 ( "Team" text, "SEC W...
count the number of patients whose admission type is urgent and procedure short title is closed bronchial biopsy?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Closed bronchial biopsy"
Below are sql tables 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 admission type is urgent and procedure short title is closed bronchial biopsy? ### Input:...
Find the first name and age of the students who are playing both Football and Lacrosse.
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city...
SELECT fname, age FROM student WHERE stuid IN (SELECT stuid FROM sportsinfo WHERE sportname = "Football" INTERSECT SELECT stuid FROM sportsinfo WHERE sportname = "Lacrosse")
Below are sql tables 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 first name and age of the students who are playing both Football and Lacrosse. ### Input: CREATE TABLE plays_games ...
What Chinese Title Ranking #7 has an Average of 32 and Peak less than 38?
CREATE TABLE table_name_3 ( chinese_title VARCHAR, rank VARCHAR, average VARCHAR, peak VARCHAR )
SELECT chinese_title FROM table_name_3 WHERE average = 32 AND peak < 38 AND rank = 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: What Chinese Title Ranking #7 has an Average of 32 and Peak less than 38? ### Input: CREATE TABLE table_name_3 ( chinese...
For those employees who do not work in departments with managers that have ids between 100 and 200, find email and salary , and visualize them by a bar chart, and could you display from high to low by the X?
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, find email and salary , ...
What was the press like in Paris for Roger Francois, and Carlo Galimberti?
CREATE TABLE table_50348 ( "World Record" text, "Press" text, "103.5" text, "Roger Fran\u00e7ois" text, "Paris ( FRA )" text )
SELECT "Paris ( FRA )" FROM table_50348 WHERE "Press" = 'press' AND "Roger Fran\u00e7ois" = 'carlo galimberti'
Below are sql tables 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 press like in Paris for Roger Francois, and Carlo Galimberti? ### Input: CREATE TABLE table_50348 ( "World ...
Draw a bar chart for what are the average prices of products, grouped by manufacturer name?, and I want to rank x-axis in ascending 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.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.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: Draw a bar chart for what are the average prices of products, grouped by manufacturer name?, and I want to rank x-axis in as...
what is the number of patients whose marital status is widowed and diagnoses short title is nb transitory tachypnea?
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.short_title = "NB transitory tachypnea"
Below are sql tables 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 widowed and diagnoses short title is nb transitory tachypnea? ### Inp...
what was the name of the first specimen test patient 031-15417 received since 116 months ago?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRE...
Below are sql tables 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 first specimen test patient 031-15417 received since 116 months ago? ### Input: CREATE TABLE lab ( ...
Return a bar chart about the number bookings for each apartment number, and could you display by the Y in descending?
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Guests ( gue...
SELECT apt_number, COUNT(apt_number) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id GROUP BY apt_number ORDER BY COUNT(apt_number) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the number bookings for each apartment number, and could you display by the Y in descending? ### In...
Draw a bar chart about the distribution of Nationality and the sum of ID , and group by attribute Nationality, order in asc by the y axis.
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY SUM(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: Draw a bar chart about the distribution of Nationality and the sum of ID , and group by attribute Nationality, order in asc ...
show me ground transportation information for PITTSBURGH
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me ground transportation information for PITTSBURGH ### Input: CREATE TABLE compartment_class ( compartment varchar...
In this semester which courses offered ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department
Below are sql tables 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 this semester which courses offered ? ### Input: CREATE TABLE student_record ( student_id int, course_id int, ...
what was the highest five diagnosis, which had the highest three year mortality rate?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.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 was the highest five diagnosis, which had the highest three year mortality rate? ### Input: CREATE TABLE chartevents ( ...
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, and sort in asc by the x-axis.
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the...
What is the lowest laps that Vittorio Iannuzzo completed?
CREATE TABLE table_name_1 ( laps INTEGER, rider VARCHAR )
SELECT MIN(laps) FROM table_name_1 WHERE rider = "vittorio iannuzzo"
Below are sql tables 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 laps that Vittorio Iannuzzo completed? ### Input: CREATE TABLE table_name_1 ( laps INTEGER, rider...
What is the number of start date of each apartment booking for each weekday? Return a bar chart, show y axis in ascending order please.
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, avail...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_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: What is the number of start date of each apartment booking for each weekday? Return a bar chart, show y axis in ascending or...
What is the medal total of Denmark?
CREATE TABLE table_47029 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Total") FROM table_47029 WHERE "Nation" = 'denmark'
Below are sql tables 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 medal total of Denmark? ### Input: CREATE TABLE table_47029 ( "Rank" text, "Nation" text, "Gold" rea...
What is Player, when Score is less than 69, and when Country is 'United States'?
CREATE TABLE table_48772 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
SELECT "Player" FROM table_48772 WHERE "Score" < '69' AND "Country" = 'united states'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Player, when Score is less than 69, and when Country is 'United States'? ### Input: CREATE TABLE table_48772 ( "...
did patient 25590 have laboratory test in 02/this year?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25590) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', labevents.charttime) = '02'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 25590 have laboratory test in 02/this year? ### Input: CREATE TABLE inputevents_cv ( row_id number, subj...
What are the names of the technicians that are assigned to repair machines with more point values than 70, and count them by a bar chart, order Y-axis in ascending order.
CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Nam...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names of the technicians that are assigned to repair machines with more point values than 70, and count them by...
How many students are affected by each allergy type Visualize by bar chart, and could you list x-axis from high to low order?
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 AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many students are affected by each allergy type Visualize by bar chart, and could you list x-axis from high to low order...
what is the number of elective hospital admission patients who were hospitalized for more than 11 days?
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.admission_type = "ELECTIVE" AND demographic.days_stay > "11"
Below are sql tables 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 elective hospital admission patients who were hospitalized for more than 11 days? ### Input: CREATE TA...
Who was the home team when VFL played at Windy Hill?
CREATE TABLE table_name_16 ( home_team VARCHAR, venue VARCHAR )
SELECT home_team FROM table_name_16 WHERE venue = "windy hill"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team when VFL played at Windy Hill? ### Input: CREATE TABLE table_name_16 ( home_team VARCHAR, venu...
Which driver was in 8 rounds with a chassis of dallara f306?
CREATE TABLE table_44017 ( "Team" text, "Driver" text, "Class" text, "Chassis" text, "Rounds" text )
SELECT "Driver" FROM table_44017 WHERE "Chassis" = 'dallara f306' AND "Rounds" = '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: Which driver was in 8 rounds with a chassis of dallara f306? ### Input: CREATE TABLE table_44017 ( "Team" text, "Dri...
what were hospital admission times of patient 006-21388 during a year before?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-21388' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were hospital admission times of patient 006-21388 during a year before? ### Input: CREATE TABLE microlab ( microla...
when was patient 433's first microbiology test done during the previous month?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiologyevents....
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 433's first microbiology test done during the previous month? ### Input: CREATE TABLE d_icd_procedures ( ...
june 10-11 when november 3 is 133?
CREATE TABLE table_25355501_2 ( june_10_11 VARCHAR, november_3 VARCHAR )
SELECT june_10_11 FROM table_25355501_2 WHERE november_3 = "133"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: june 10-11 when november 3 is 133? ### Input: CREATE TABLE table_25355501_2 ( june_10_11 VARCHAR, november_3 VARCHAR...
count the number of patients under 67 years of age who have abdominal pain primary disease.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "67"
Below are sql tables 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 under 67 years of age who have abdominal pain primary disease. ### Input: CREATE TABLE demograp...
What is the average Apps for the team Kairat with level larger than 1?
CREATE TABLE table_43035 ( "Season" text, "Team" text, "Country" text, "League" text, "Level" real, "Apps" real, "Goals" real )
SELECT AVG("Apps") FROM table_43035 WHERE "Team" = 'kairat' AND "Level" > '1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Apps for the team Kairat with level larger than 1? ### Input: CREATE TABLE table_43035 ( "Season" te...
Which round was the defensive tackle picked after 187?
CREATE TABLE table_name_8 ( round INTEGER, position VARCHAR, pick__number VARCHAR )
SELECT AVG(round) FROM table_name_8 WHERE position = "defensive tackle" AND pick__number > 187
Below are sql tables 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 round was the defensive tackle picked after 187? ### Input: CREATE TABLE table_name_8 ( round INTEGER, positio...
is the heartrate value of patient 004-75223 second measured on the last icu visit less than the value first measured on the last icu visit?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-75223') AND NOT patient.unitdischargetime IS ...
Below are sql tables 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 the heartrate value of patient 004-75223 second measured on the last icu visit less than the value first measured on the ...
Who won the womens doubles when wu jianqui won the womens singles?
CREATE TABLE table_17383 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
SELECT "Womens doubles" FROM table_17383 WHERE "Womens singles" = 'Wu Jianqui'
Below are sql tables 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 womens doubles when wu jianqui won the womens singles? ### Input: CREATE TABLE table_17383 ( "Year" real, ...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, and display the number of job id from low to high order.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id an...
What are the last names of employees who serve at most 20 customers?
CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE playlisttrack ( playlistid number, trackid number ) CREATE TABLE genre ( genreid number, name text ) CREATE TABLE invoice ( invoiceid number,...
SELECT T1.lastname FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) <= 20
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the last names of employees who serve at most 20 customers? ### Input: CREATE TABLE playlist ( playlistid numbe...
What was the tries against when they had 32 tries for?
CREATE TABLE table_name_14 ( tries_against VARCHAR, tries_for VARCHAR )
SELECT tries_against FROM table_name_14 WHERE tries_for = "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: What was the tries against when they had 32 tries for? ### Input: CREATE TABLE table_name_14 ( tries_against VARCHAR, ...
Which region is associated with the catalog value of 512335?
CREATE TABLE table_79531 ( "Region" text, "Date" text, "Label" text, "Format(s)" text, "Catalog" text )
SELECT "Region" FROM table_79531 WHERE "Catalog" = '512335'
Below are sql tables 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 region is associated with the catalog value of 512335? ### Input: CREATE TABLE table_79531 ( "Region" text, "D...
On the date of june 7 what was the score?
CREATE TABLE table_67288 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Record" FROM table_67288 WHERE "Date" = 'june 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: On the date of june 7 what was the score? ### Input: CREATE TABLE table_67288 ( "Date" text, "Opponent" text, "S...
provide the number of patients less than 59 years who have had attachment of pedicle or flap graft to other sites.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "59" AND procedures.short_title = "Attach pedicle graft NEC"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients less than 59 years who have had attachment of pedicle or flap graft to other sites. ### Input...
Where are the Buffalo Sabres from?
CREATE TABLE table_2679061_7 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
SELECT college_junior_club_team FROM table_2679061_7 WHERE nhl_team = "Buffalo Sabres"
Below are sql tables 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 are the Buffalo Sabres from? ### Input: CREATE TABLE table_2679061_7 ( college_junior_club_team VARCHAR, nhl_t...
Total smaller than 7, and a Bronze larger than 1 is what amount of average silver?
CREATE TABLE table_name_35 ( silver INTEGER, total VARCHAR, bronze VARCHAR )
SELECT AVG(silver) FROM table_name_35 WHERE total < 7 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: Total smaller than 7, and a Bronze larger than 1 is what amount of average silver? ### Input: CREATE TABLE table_name_35 ( ...
Show all locations and the total number of platforms for all train stations in each location in a bar chart, and rank by the Y-axis from low to high please.
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE t...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms)
Below are sql tables 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 locations and the total number of platforms for all train stations in each location in a bar chart, and rank by the...
What was the margin of victory in the tournament with a winning score of 3 (74-68-72-71=285)?
CREATE TABLE table_36925 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
SELECT "Margin of victory" FROM table_36925 WHERE "Winning score" = '−3 (74-68-72-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 was the margin of victory in the tournament with a winning score of 3 (74-68-72-71=285)? ### Input: CREATE TABLE table_...
which division had the larger area ?
CREATE TABLE table_204_891 ( id number, "name" text, "hanzi" text, "population (2005)" number, "area (km2)" number )
SELECT "name" FROM table_204_891 ORDER BY "area (km2)" 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 division had the larger area ? ### Input: CREATE TABLE table_204_891 ( id number, "name" text, "hanzi" tex...
What was the margin of victory for the Players Championship tournament?
CREATE TABLE table_47425 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
SELECT "Margin of victory" FROM table_47425 WHERE "Tournament" = 'the players championship'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the margin of victory for the Players Championship tournament? ### Input: CREATE TABLE table_47425 ( "Date" tex...