instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
A bar chart shows the distribution of meter_400 and ID .
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_400, ID FROM swimmer
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of meter_400 and ID . ### Input: CREATE TABLE event ( ID int, Name text, Stad...
give the number of patients whose lab test name is sodium, urine.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Sodium, Urine"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients whose lab test name is sodium, urine. ### Input: CREATE TABLE diagnoses ( subject_id text, ...
what was the last time patient 73913 got prescribed a drug?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73913) ORDER BY prescriptions.startdate DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last time patient 73913 got prescribed a drug? ### Input: CREATE TABLE microbiologyevents ( row_id number, ...
count the total number of hospital visits of patient 3535 until 2104.
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 3535 AND STRFTIME('%y', admissions.admittime) <= '2104'
Below are sql tables 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 total number of hospital visits of patient 3535 until 2104. ### Input: CREATE TABLE cost ( row_id number, ...
Show the names of members in ascending order of their rank in rounds.
CREATE TABLE round ( round_id number, member_id number, decoration_theme text, rank_in_round number ) CREATE TABLE college ( college_id number, name text, leader_name text, college_location text ) CREATE TABLE member ( member_id number, name text, country text, college_...
SELECT T1.name FROM member AS T1 JOIN round AS T2 ON T1.member_id = T2.member_id ORDER BY rank_in_round
Below are sql tables 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 members in ascending order of their rank in rounds. ### Input: CREATE TABLE round ( round_id number, ...
What channels have stations that were affiliated in 2002?
CREATE TABLE table_16479 ( "City of license/Market" text, "Station" text, "Channel TV ( DT )" text, "Year of affiliation" text, "Owned since" text )
SELECT "Channel TV ( DT )" FROM table_16479 WHERE "Year of affiliation" = '2002'
Below are sql tables 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 channels have stations that were affiliated in 2002? ### Input: CREATE TABLE table_16479 ( "City of license/Market"...
What is the title that has 14.59 u.s. viewers (millions)?
CREATE TABLE table_22078691_2 ( title VARCHAR, us_viewers__millions_ VARCHAR )
SELECT title FROM table_22078691_2 WHERE us_viewers__millions_ = "14.59"
Below are sql tables 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 title that has 14.59 u.s. viewers (millions)? ### Input: CREATE TABLE table_22078691_2 ( title VARCHAR, ...
when was the first time that arterial bp mean was measured for patient 12885 on the last icu visit?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) ...
SELECT chartevents.charttime 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 = 12885) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time that arterial bp mean was measured for patient 12885 on the last icu visit? ### Input: CREATE TABLE ...
What was the score for the away team at Glenferrie Oval?
CREATE TABLE table_53067 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_53067 WHERE "Venue" = 'glenferrie 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 score for the away team at Glenferrie Oval? ### Input: CREATE TABLE table_53067 ( "Home team" text, "Ho...
Find the maximum capacity among rooms in each building with a bar chart, list by the names in ascending please.
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE department ( dept_name...
SELECT building, MAX(capacity) FROM classroom GROUP BY building ORDER BY building
Below are sql tables 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 maximum capacity among rooms in each building with a bar chart, list by the names in ascending please. ### Input: C...
What team played on November 28?
CREATE TABLE table_77764 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Team" FROM table_77764 WHERE "Date" = 'november 28'
Below are sql tables 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 on November 28? ### Input: CREATE TABLE table_77764 ( "Game" real, "Date" text, "Team" text, ...
who was the last player in the top 10 ?
CREATE TABLE table_203_864 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
SELECT "player" FROM table_203_864 ORDER BY "place" DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the last player in the top 10 ? ### Input: CREATE TABLE table_203_864 ( id number, "place" text, "player...
What is the largest number of points they had?
CREATE TABLE table_23308178_8 ( points INTEGER )
SELECT MAX(points) FROM table_23308178_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 is the largest number of points they had? ### Input: CREATE TABLE table_23308178_8 ( points INTEGER ) ### Response:...
I want to know the proportion of the sum market value for each main industry.
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 Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to know the proportion of the sum market value for each main industry. ### Input: CREATE TABLE company ( Company_...
which dates had below 80,000 in attendance ?
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
SELECT "date" FROM table_204_55 WHERE "attendance" < 80000
Below are sql tables 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 dates had below 80,000 in attendance ? ### Input: CREATE TABLE table_204_55 ( id number, "date" text, "tim...
Visualize a pie chart with how many events are there for each party?
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, P...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a pie chart with how many events are there for each party? ### Input: CREATE TABLE party ( Party_ID int, M...
how many games did this team win this season ?
CREATE TABLE table_204_755 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
SELECT COUNT(*) FROM table_204_755 WHERE "result" = 'w'
Below are sql tables 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 did this team win this season ? ### Input: CREATE TABLE table_204_755 ( id number, "week" number, ...
what is the maximum hospital cost that involves a procedure called c v v h d in 2104.
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'c v v h d')) AND STRFTIME('%y', cost.charget...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the maximum hospital cost that involves a procedure called c v v h d in 2104. ### Input: CREATE TABLE patient ( ...
what is age and procedure icd9 code of subject id 2560?
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 demographic.age, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is age and procedure icd9 code of subject id 2560? ### Input: CREATE TABLE demographic ( subject_id text, hadm_...
what are the flights from BOSTON to ATLANTA
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, ...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
Below are sql tables 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 flights from BOSTON to ATLANTA ### Input: CREATE TABLE date_day ( month_number int, day_number int, ...
Which Away team has Away team score 5.8 (38)?
CREATE TABLE table_32989 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_32989 WHERE "Away team score" = '5.8 (38)'
Below are sql tables 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 Away team has Away team score 5.8 (38)? ### Input: CREATE TABLE table_32989 ( "Home team" text, "Home team sco...
count the number of patients whose diagnoses icd9 code is 35981 and drug type is base?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "35981" AND prescriptions.drug_type = "BASE"
Below are sql tables 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 diagnoses icd9 code is 35981 and drug type is base? ### Input: CREATE TABLE prescriptions...
Find the average age of journalists working on different role type, show the result with a pie chart.
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT Work_Type, AVG(t1.Age) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
Below are sql tables 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 average age of journalists working on different role type, show the result with a pie chart. ### Input: CREATE TABL...
count the number of patients less than 76 years who stayed in hospital for 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 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 WHERE demographic.age < "76" AND demographic.days_stay > "27"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients less than 76 years who stayed in hospital for more than 27 days. ### Input: CREATE TABLE lab ( ...
what was the insurance plan of patient 59941 on their first hospital visit?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 59941 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the insurance plan of patient 59941 on their first hospital visit? ### Input: CREATE TABLE admissions ( row_id ...
what is minimum age of patients whose admission location is trsf within this facility and discharge location is home health care?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "HOME HEALTH CARE"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose admission location is trsf within this facility and discharge location is home health ...
Bar chart x axis meter 700 y axis id, display y-axis in desc order.
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 stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT meter_700, ID FROM swimmer ORDER BY 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: Bar chart x axis meter 700 y axis id, display y-axis in desc order. ### Input: CREATE TABLE swimmer ( ID int, name t...
Which To par has a Score of 67-72-71-75=285?
CREATE TABLE table_name_40 ( to_par VARCHAR, score VARCHAR )
SELECT to_par FROM table_name_40 WHERE score = 67 - 72 - 71 - 75 = 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: Which To par has a Score of 67-72-71-75=285? ### Input: CREATE TABLE table_name_40 ( to_par VARCHAR, score VARCHAR )...
What was the home team score for the game played at MCG?
CREATE TABLE table_name_61 ( home_team VARCHAR, venue VARCHAR )
SELECT home_team AS score FROM table_name_61 WHERE venue = "mcg"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team score for the game played at MCG? ### Input: CREATE TABLE table_name_61 ( home_team VARCHAR, ...
what is minimum age of patients whose gender is f and ethnicity is black/haitian?
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/HAITIAN"
Below are sql tables 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 minimum age of patients whose gender is f and ethnicity is black/haitian? ### Input: CREATE TABLE lab ( subject_...
What was Essendon's score at the game where they were the away team and the crowd was larger than 15,130?
CREATE TABLE table_57487 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_57487 WHERE "Crowd" > '15,130' AND "Away team" = 'essendon'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Essendon's score at the game where they were the away team and the crowd was larger than 15,130? ### Input: CREATE ...
What was the score for United States when the player was Mike Reid and the To par was e?
CREATE TABLE table_43754 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Hole" text )
SELECT "Score" FROM table_43754 WHERE "Country" = 'united states' AND "To par" = 'e' AND "Player" = 'mike reid'
Below are sql tables 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 for United States when the player was Mike Reid and the To par was e? ### Input: CREATE TABLE table_43754...
list all flights from BOSTON to SAN FRANCISCO with more than 3 stops
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name t...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.stops > 3 AND flight.to_airport = AIRPORT_SERVICE_1.airport_cod...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all flights from BOSTON to SAN FRANCISCO with more than 3 stops ### Input: CREATE TABLE flight_leg ( flight_id int,...
Can you tell me the Place that has the Country of australia, and the Player of ian baker-finch?
CREATE TABLE table_12364 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
SELECT "Place" FROM table_12364 WHERE "Country" = 'australia' AND "Player" = 'ian baker-finch'
Below are sql tables 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 Place that has the Country of australia, and the Player of ian baker-finch? ### Input: CREATE TABLE tabl...
How many people watched when st kilda played at home?
CREATE TABLE table_name_79 ( crowd VARCHAR, home_team VARCHAR )
SELECT crowd FROM table_name_79 WHERE home_team = "st kilda"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people watched when st kilda played at home? ### Input: CREATE TABLE table_name_79 ( crowd VARCHAR, home_te...
Name the most first elected
CREATE TABLE table_28907 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT MAX("First elected") FROM table_28907
Below are sql tables 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 most first elected ### Input: CREATE TABLE table_28907 ( "District" text, "Incumbent" text, "Party" tex...
What is the largest Crowd number for the Home team of North Melbourne?
CREATE TABLE table_56750 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT MAX("Crowd") FROM table_56750 WHERE "Home team" = 'north melbourne'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest Crowd number for the Home team of North Melbourne? ### Input: CREATE TABLE table_56750 ( "Home team"...
Out of the upper level classes , how many have labs ?
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Out of the upper level classes , how many have labs ? ### Input: CREATE TABLE program_course ( program_id int, cours...
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 salary bin hire_date by time in a bar chart, display by the y-axis from high to low.
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(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
What is the sum of Money ($), when Score is 70-71-70-69=280?
CREATE TABLE table_name_43 ( money___ INTEGER, score VARCHAR )
SELECT SUM(money___) AS $__ FROM table_name_43 WHERE score = 70 - 71 - 70 - 69 = 280
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Money ($), when Score is 70-71-70-69=280? ### Input: CREATE TABLE table_name_43 ( money___ INTEGER, ...
Closed/Re-opened and edited questions by month.
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Rev...
SELECT TIME_TO_STR(e.CreationDate, '%M') AS "month", TIME_TO_STR(e.CreationDate, '%Y') AS "year", SUM(CASE r.PostHistoryTypeId WHEN 10 THEN 1 ELSE 0 END) AS Closed, SUM(CASE r.PostHistoryTypeId WHEN 11 THEN 1 ELSE 0 END) AS reopen FROM PostHistory AS e JOIN PostHistory AS r ON r.PostId = e.PostId WHERE e.CreationDate <...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Closed/Re-opened and edited questions by month. ### Input: CREATE TABLE FlagTypes ( Id number, Name text, Descri...
What is the location of the Moorabbin Oval stadium?
CREATE TABLE table_4134 ( "Stadium" text, "Location" text, "Opened" real, "Built for" text, "Capacity at Construction" real )
SELECT "Location" FROM table_4134 WHERE "Stadium" = 'Moorabbin 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 is the location of the Moorabbin Oval stadium? ### Input: CREATE TABLE table_4134 ( "Stadium" text, "Location" ...
how many of the patients with item id 51181 had an unobtainable religious belief?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "UNOBTAINABLE" AND lab.itemid = "51181"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the patients with item id 51181 had an unobtainable religious belief? ### Input: CREATE TABLE diagnoses ( su...
What is average age for different job title Visualize by bar chart, I want to rank by the bars from low to high.
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is average age for different job title Visualize by bar chart, I want to rank by the bars from low to high. ### Input: ...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time.
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the ...
please list the flights from DALLAS FORT WORTH to WASHINGTON BALTIMORE on 7 23
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE time_interval ( period text, begin_time in...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day, days, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: please list the flights from DALLAS FORT WORTH to WASHINGTON BALTIMORE on 7 23 ### Input: CREATE TABLE days ( days_code ...
What's the average crowd size when the venue is western oval?
CREATE TABLE table_55624 ( "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_55624 WHERE "Venue" = 'western oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the average crowd size when the venue is western oval? ### Input: CREATE TABLE table_55624 ( "Home team" text, ...
when patient 5553 until 1 year ago last received a procedure?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5553) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY procedures_icd.charttime 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 patient 5553 until 1 year ago last received a procedure? ### Input: CREATE TABLE diagnoses_icd ( row_id number, ...
count the number of patients whose drug code is neolevo5 and lab test fluid is cerebrospinal fluid (csf)?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NEOLEVO5" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose drug code is neolevo5 and lab test fluid is cerebrospinal fluid (csf)? ### Input: CREATE ...
What is the least number of extra points?
CREATE TABLE table_28069 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
SELECT MIN("Extra points") FROM table_28069
Below are sql tables 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 least number of extra points? ### Input: CREATE TABLE table_28069 ( "Player" text, "Touchdowns" real, ...
What is the election date for those politicians who left office on 1850-11-15?
CREATE TABLE table_26362472_1 ( election_date VARCHAR, left_office VARCHAR )
SELECT COUNT(election_date) FROM table_26362472_1 WHERE left_office = "1850-11-15"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the election date for those politicians who left office on 1850-11-15? ### Input: CREATE TABLE table_26362472_1 ( ...
during the last year, what were the top five most frequent specimen tests given to patients within 2 months after being diagnosed with valvular insufficiency - mitral valve.
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - mitral valve' AND D...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during the last year, what were the top five most frequent specimen tests given to patients within 2 months after being diag...
what has been the total amount of input patient 006-200601 received on 09/20/2104?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-200601')) AND intakeoutput.cellpath LIKE '%i...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what has been the total amount of input patient 006-200601 received on 09/20/2104? ### Input: CREATE TABLE diagnosis ( d...
ground SAN FRANCISCO
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' 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: ground SAN FRANCISCO ### Input: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, f...
List records for game 29.
CREATE TABLE table_29871 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Record" FROM table_29871 WHERE "Game" = '29'
Below are sql tables 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 records for game 29. ### Input: CREATE TABLE table_29871 ( "Game" real, "Date" text, "Team" text, "Scor...
how many patients below 77 years of age have undergone the procedure with short title percu endosc gastrostomy?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "77" AND procedures.short_title = "Percu endosc gastrostomy"
Below are sql tables 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 below 77 years of age have undergone the procedure with short title percu endosc gastrostomy? ### Input: C...
How many gas stations dors each manager have? Plot a bar chart, and sort from high to low by the y-axis.
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 gas_station ( Station_ID int, Open_Year int, Location text, Manager_N...
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_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: How many gas stations dors each manager have? Plot a bar chart, and sort from high to low by the y-axis. ### Input: CREATE T...
What is the value for 2010 when the value for 2006 is A and the value for 2009 is 1R?
CREATE TABLE table_32073 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2010" FROM table_32073 WHERE "2006" = 'a' AND "2009" = '1r'
Below are sql tables 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 2010 when the value for 2006 is A and the value for 2009 is 1R? ### Input: CREATE TABLE table_32073 ( ...
What is 2003 when 1999 is 2.1?
CREATE TABLE table_29324 ( "Greek national account" text, "1970" text, "1980" text, "1990" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001 1" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, ...
SELECT "2003" FROM table_29324 WHERE "1999" = '2.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 2003 when 1999 is 2.1? ### Input: CREATE TABLE table_29324 ( "Greek national account" text, "1970" text, ...
Who directed the episode that was watched by 2.67 million U.S. viewers?
CREATE TABLE table_29747178_3 ( directed_by VARCHAR, us_viewers__million_ VARCHAR )
SELECT directed_by FROM table_29747178_3 WHERE us_viewers__million_ = "2.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: Who directed the episode that was watched by 2.67 million U.S. viewers? ### Input: CREATE TABLE table_29747178_3 ( direc...
What was the attendance of the game in week 6?
CREATE TABLE table_33344 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT "Attendance" FROM table_33344 WHERE "Week" = '6'
Below are sql tables 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 of the game in week 6? ### Input: CREATE TABLE table_33344 ( "Week" real, "Date" text, "...
-- Most popular StackOverflow tags in 2013.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, E...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank2013, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId A...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: -- Most popular StackOverflow tags in 2013. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, ...
What is the production code for the episode with 8.56 million U.S. viewers?
CREATE TABLE table_22181917_2 ( production_code VARCHAR, us_viewers__millions_ VARCHAR )
SELECT production_code FROM table_22181917_2 WHERE us_viewers__millions_ = "8.56"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the production code for the episode with 8.56 million U.S. viewers? ### Input: CREATE TABLE table_22181917_2 ( p...
what is the number of patients whose discharge location is left against medical advi and lab test name is rdw?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND lab.label = "RDW"
Below are sql tables 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 discharge location is left against medical advi and lab test name is rdw? ### Input: CR...
what year did firehouse release their last single ?
CREATE TABLE table_203_723 ( id number, "year" number, "song" text, "us hot 100" number, "us msr" number, "us a.c." number, "can" number, "uk singles" number, "album" text )
SELECT MAX("year") FROM table_203_723
Below are sql tables 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 year did firehouse release their last single ? ### Input: CREATE TABLE table_203_723 ( id number, "year" number...
Who was the home side at glenferrie oval?
CREATE TABLE table_name_37 ( home_team VARCHAR, venue VARCHAR )
SELECT home_team FROM table_name_37 WHERE venue = "glenferrie oval"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home side at glenferrie oval? ### Input: CREATE TABLE table_name_37 ( home_team VARCHAR, venue VARCHAR )...
What's the home record of the team with percentage of .168?
CREATE TABLE table_22993636_2 ( home_record VARCHAR, percentage VARCHAR )
SELECT home_record FROM table_22993636_2 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_22993636_2 ( home_record VARCH...
When is the Monsters of Rock show with 12 bands?
CREATE TABLE table_name_74 ( date VARCHAR, event VARCHAR, acts VARCHAR )
SELECT date FROM table_name_74 WHERE event = "monsters of rock" AND acts = "12 bands"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When is the Monsters of Rock show with 12 bands? ### Input: CREATE TABLE table_name_74 ( date VARCHAR, event VARCHAR...
what is average age of patients whose insurance is medicare and year of death is less than 2186?
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 AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dod_year < "2186.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 average age of patients whose insurance is medicare and year of death is less than 2186? ### Input: CREATE TABLE pre...
count the number of patients whose age is less than 86?
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.age < "86"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose age is less than 86? ### Input: CREATE TABLE demographic ( subject_id text, hadm_...
Which team scored 4.11 (35) while playing away?
CREATE TABLE table_10966 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_10966 WHERE "Away team score" = '4.11 (35)'
Below are sql tables 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 scored 4.11 (35) while playing away? ### Input: CREATE TABLE table_10966 ( "Home team" text, "Home team s...
What office is Jon Huntsman a candidate for?
CREATE TABLE table_23631 ( "Candidate" text, "Office" text, "Home state" text, "Popular vote" real, "States \u2013 first place" real, "States \u2013 second place" real, "States \u2013 third place" text )
SELECT "Office" FROM table_23631 WHERE "Candidate" = 'Jon Huntsman'
Below are sql tables 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 office is Jon Huntsman a candidate for? ### Input: CREATE TABLE table_23631 ( "Candidate" text, "Office" text, ...
Show me about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home in a bar chart, and show by the x-axis in asc please.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
Below are sql tables 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 about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home in a bar chart, and show by the x-a...
show me the evening flights from BALTIMORE to ATLANTA
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL...
Below are sql tables 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 evening flights from BALTIMORE to ATLANTA ### Input: CREATE TABLE equipment_sequence ( aircraft_code_sequenc...
what is average age of patients whose marital status is single and year of birth is greater than 2097?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2097"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is average age of patients whose marital status is single and year of birth is greater than 2097? ### Input: CREATE TAB...
what was the organism found in patient 8324's first microbiology test of the sputum in 07/last year?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8324) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of ...
Below are sql tables 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 organism found in patient 8324's first microbiology test of the sputum in 07/last year? ### Input: CREATE TABLE...
what are the top three commonly prescribed drugs that patients are prescribed within 2 months after having received a resp tract intubat nec procedure since 2103?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code te...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
Below are sql tables 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 top three commonly prescribed drugs that patients are prescribed within 2 months after having received a resp t...
What is the average minimum and price of the rooms for each different decor.
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
SELECT decor, AVG(baseprice), MIN(baseprice) FROM rooms GROUP BY decor
Below are sql tables 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 minimum and price of the rooms for each different decor. ### Input: CREATE TABLE reservations ( code...
provide me with the top three diagnoses that had the highest one year mortality rate.
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_...
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: provide me with the top three diagnoses that had the highest one year mortality rate. ### Input: CREATE TABLE outputevents (...
Posts over time by tag.
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id...
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('go', 'rust', 'flutter', 'dart') AND q.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) GROUP BY DATEADD(month, DA...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Posts over time by tag. ### Input: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId n...
What was the net capacity with a gross capacity of 1,126 mw, and a Unit of tianwan-4?
CREATE TABLE table_14737 ( "Unit" text, "Reactor type" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity grid" text, "Commercial operation" text, "Shutdown" text )
SELECT "Net capacity" FROM table_14737 WHERE "Gross capacity" = '1,126 mw' AND "Unit" = 'tianwan-4'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the net capacity with a gross capacity of 1,126 mw, and a Unit of tianwan-4? ### Input: CREATE TABLE table_14737 ( ...
how many patients stayed in hospital for more than 5 days and were diagnosed with phlebitis and thrombophlebitis of superficial veins of upper extremities?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.long_title = "Phlebitis and thrombophlebitis of superficial veins of upper extremities"
Below are sql tables 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 5 days and were diagnosed with phlebitis and thrombophlebitis of superfic...
which course has most number of registered students?
CREATE TABLE student_course_registrations ( course_Id VARCHAR ) CREATE TABLE courses ( course_name VARCHAR, course_id VARCHAR )
SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_Id = T2.course_Id GROUP BY T1.course_Id ORDER BY COUNT(*) 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 course has most number of registered students? ### Input: CREATE TABLE student_course_registrations ( course_Id VA...
what is the number of patients whose admission location is phys referral/normal deli and procedure icd9 code is 5091?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "5091"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission location is phys referral/normal deli and procedure icd9 code is 5091? ### In...
When in the morning is the LAW 438 course ?
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'LAW' AND cour...
Below are sql tables 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 in the morning is the LAW 438 course ? ### Input: CREATE TABLE program_requirement ( program_id int, category v...
I 'd like to take a 400 -level course , but do n't want to do a lab , what are my options ?
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400
Below are sql tables 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 'd like to take a 400 -level course , but do n't want to do a lab , what are my options ? ### Input: CREATE TABLE offering...
What was the method of the bout lasting 4:15?
CREATE TABLE table_36508 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
SELECT "Method" FROM table_36508 WHERE "Time" = '4:15'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the method of the bout lasting 4:15? ### Input: CREATE TABLE table_36508 ( "Res." text, "Record" text, ...
What prerequisite courses fall before MCDB 415 ?
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
Below are sql tables 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 prerequisite courses fall before MCDB 415 ? ### Input: CREATE TABLE course ( course_id int, name varchar, d...
what is the date for game 3?
CREATE TABLE table_68415 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
SELECT "Date" FROM table_68415 WHERE "Game" = '3'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the date for game 3? ### Input: CREATE TABLE table_68415 ( "Game" real, "Date" text, "Location" text, ...
How much Gold has a Silver smaller than 3, and a Total of 9, and a Bronze smaller than 1?
CREATE TABLE table_name_26 ( gold VARCHAR, bronze VARCHAR, silver VARCHAR, total VARCHAR )
SELECT COUNT(gold) FROM table_name_26 WHERE silver < 3 AND total = 9 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: How much Gold has a Silver smaller than 3, and a Total of 9, and a Bronze smaller than 1? ### Input: CREATE TABLE table_name...
Will there be an The Arab-Israeli Middle Eastern Literature colloquium this year ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%colloquium%' OR course.name LIKE '%colloquium%') AND (course.description LIKE '%The Arab-Israeli Middle Eastern Literature%' OR course.name LIKE '%The Arab-Israeli Middle Eastern Literature%') AND course.course_id = course_offer...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Will there be an The Arab-Israeli Middle Eastern Literature colloquium this year ? ### Input: CREATE TABLE semester ( se...
what was the name of the drug that patient 006-76924 was prescribed within 2 days after having been diagnosed with a acute respiratory failure - drug related during this month?
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924') AND diagnosis.diagnos...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the drug that patient 006-76924 was prescribed within 2 days after having been diagnosed with a acute r...
What Country's content is Televendite?
CREATE TABLE table_40677 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
SELECT "Country" FROM table_40677 WHERE "Content" = 'televendite'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Country's content is Televendite? ### Input: CREATE TABLE table_40677 ( "Television service" text, "Country" te...
What is the number of bronze that silver is smaller than 1 and gold bigger than 0?
CREATE TABLE table_53670 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Bronze") FROM table_53670 WHERE "Silver" < '1' AND "Gold" > '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 number of bronze that silver is smaller than 1 and gold bigger than 0? ### Input: CREATE TABLE table_53670 ( ...
count the number of patients whose diagnoses short title is benign neo skin face nec and lab test abnormal status is 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Benign neo skin face NEC" AND lab.flag = "delta"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses short title is benign neo skin face nec and lab test abnormal status is delta? ...
Show party names and the number of events for each party in a bar chart, and list by the X-axis in asc.
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID in...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show party names and the number of events for each party in a bar chart, and list by the X-axis in asc. ### Input: CREATE TA...
when did patient 006-2586 have the maximum respiration the first time during a day before?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND NOT vitalperiodic.respiration IS NU...
Below are sql tables 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 did patient 006-2586 have the maximum respiration the first time during a day before? ### Input: CREATE TABLE lab ( ...
what would be the maximum daily number of patients diagnosed with fall from chair in this year?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall from chair') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
Below are sql tables 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 would be the maximum daily number of patients diagnosed with fall from chair in this year? ### Input: CREATE TABLE d_it...
What was the Attendance on Week 9?
CREATE TABLE table_46134 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT MAX("Attendance") FROM table_46134 WHERE "Week" = '9'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Attendance on Week 9? ### Input: CREATE TABLE table_46134 ( "Week" real, "Date" text, "Opponent" te...
What is the number of silver when the total is more than 2, and bronze is less than 3, with a rank of 7?
CREATE TABLE table_name_44 ( silver VARCHAR, rank VARCHAR, total VARCHAR, bronze VARCHAR )
SELECT COUNT(silver) FROM table_name_44 WHERE total > 2 AND bronze < 3 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 is the number of silver when the total is more than 2, and bronze is less than 3, with a rank of 7? ### Input: CREATE T...