instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
what are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnosed with poison-medicinal agt nos? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
su... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnose... |
What is the name of the integrated where allied-related is shared? | CREATE TABLE table_389 (
"Component" text,
"Integrated" text,
"Allied-Related" text,
"Allied-Unrelated" text,
"Holding" text
) | SELECT "Component" FROM table_389 WHERE "Allied-Related" = 'Shared' | Below are sql tables 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 integrated where allied-related is shared? ### Input: CREATE TABLE table_389 (
"Component" text,... |
Compare the total enrollment in each county with a bar chart, and list by the names from low to high please. | CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested int,
total_budget_percent_invested real,
Budget_invested_percent text
)
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREAT... | SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY County | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Compare the total enrollment in each county with a bar chart, and list by the names from low to high please. ### Input: CREA... |
How many attended on march 1? | CREATE TABLE table_69818 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | SELECT AVG("Attendance") FROM table_69818 WHERE "Date" = 'march 1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many attended on march 1? ### Input: CREATE TABLE table_69818 (
"Date" text,
"Visitor" text,
"Score" text,
... |
Give me a bar chart for the total number of each position, rank from high to low by the Y-axis. | CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) 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: Give me a bar chart for the total number of each position, rank from high to low by the Y-axis. ### Input: CREATE TABLE coun... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and salary . | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATIO... | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | Below are sql tables 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, a bar chart shows the di... |
For those ships that do not have a captain, tell me the total number of their classes using a pie chart, display from low to high by the bars please. | CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class ORDER BY Class | Below are sql tables 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 ships that do not have a captain, tell me the total number of their classes using a pie chart, display from low to... |
What is the Country of the Player with a To par of +1 and a Score of 74-70-70=214? | CREATE TABLE table_name_12 (
country VARCHAR,
to_par VARCHAR,
score VARCHAR
) | SELECT country FROM table_name_12 WHERE to_par = "+1" AND score = 74 - 70 - 70 = 214 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Country of the Player with a To par of +1 and a Score of 74-70-70=214? ### Input: CREATE TABLE table_name_12 (
... |
Name the class AA with class A of rule and school year of 1995-96 | CREATE TABLE table_37442 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | SELECT "Class AA" FROM table_37442 WHERE "Class A" = 'rule' AND "School Year" = '1995-96' | Below are sql tables 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 class AA with class A of rule and school year of 1995-96 ### Input: CREATE TABLE table_37442 (
"School Year" te... |
count the number of patients diagnosed with angioneurotic edema who had abnormal lab test status. | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Angioneurotic edema" AND lab.flag = "abnormal" | Below are sql tables 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 diagnosed with angioneurotic edema who had abnormal lab test status. ### Input: CREATE TABLE pr... |
How many opponents were there in a game higher than 20 on January 28? | CREATE TABLE table_77091 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Nets points" real,
"Opponents" real,
"Record" text,
"Streak" text
) | SELECT "Opponents" FROM table_77091 WHERE "Game" > '20' AND "Date" = 'january 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: How many opponents were there in a game higher than 20 on January 28? ### Input: CREATE TABLE table_77091 (
"Game" real,... |
Give me a bar chart showing the total number of each minister, display by the bars in desc please. | 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,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Fo... | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY Minister 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: Give me a bar chart showing the total number of each minister, display by the bars in desc please. ### Input: CREATE TABLE m... |
A bar chart shows the distribution of meter_700 and meter_100 , list from low to high by the x-axis. | CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 | Below are sql tables 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_700 and meter_100 , list from low to high by the x-axis. ### Input: CREATE TABLE... |
number of patients who were admitted to the hospital until 3 years ago. | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 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: number of patients who were admitted to the hospital until 3 years ago. ### Input: CREATE TABLE diagnosis (
diagnosisid ... |
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. Plot them as bar chart. | CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE... | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME | Below are sql tables 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 gpa of the students whose gpa is lower than the average gpa of all students. Plot them as bar chart.... |
had a peep lab test patient 017-13959 received since 06/2104? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-13959')) AND lab.labname = 'peep' AND STRFTIME('%y-%m', lab.labresulttime) >= '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: had a peep lab test patient 017-13959 received since 06/2104? ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid nu... |
What is the Set 3 with a Score of 3 1, and has a Set 2 of 13 15? | CREATE TABLE table_name_7 (
set_3 VARCHAR,
score VARCHAR,
set_2 VARCHAR
) | SELECT set_3 FROM table_name_7 WHERE score = "3–1" AND set_2 = "13–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 Set 3 with a Score of 3 1, and has a Set 2 of 13 15? ### Input: CREATE TABLE table_name_7 (
set_3 VARCHAR,
... |
provide the number of patients whose admission year is less than 2155 and diagnoses short title is other lung disease nec? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2155" AND diagnoses.short_title = "Other lung disease 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 whose admission year is less than 2155 and diagnoses short title is other lung disease nec? #... |
provide the number of patients whose procedure icd9 code is 4576 and drug route is iv bolus | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4576" AND prescriptions.route = "IV BOLUS" | Below are sql tables 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 whose procedure icd9 code is 4576 and drug route is iv bolus ### Input: CREATE TABLE procedur... |
What To par has a Country of united states, and a Score of 67-66-78-77=288? | CREATE TABLE table_59842 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | SELECT "To par" FROM table_59842 WHERE "Country" = 'united states' AND "Score" = '67-66-78-77=288' | Below are sql tables 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 To par has a Country of united states, and a Score of 67-66-78-77=288? ### Input: CREATE TABLE table_59842 (
"Place... |
what is admission type of subject id 9271? | 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 demographic.admission_type FROM demographic WHERE demographic.subject_id = "9271" | Below are sql tables 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 admission type of subject id 9271? ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
... |
which artist has the least highest position ? | CREATE TABLE table_203_249 (
id number,
"position" number,
"song title" text,
"artist" text,
"sales" number,
"highest position" number
) | SELECT "artist" FROM table_203_249 ORDER BY "position" 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 artist has the least highest position ? ### Input: CREATE TABLE table_203_249 (
id number,
"position" number,
... |
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart, and order bars in desc order. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home 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: Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart, and order bars in d... |
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of code , and group by attribute name in a bar chart, could you order x axis in asc 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 T1.Name, T1.Code 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, show me about the distribution of name and the average ... |
Who was the home team on April 13, 2008 when Itabuna was the away team? | CREATE TABLE table_75942 (
"Round" text,
"Date" text,
"Home team" text,
"Score" text,
"Away team" text
) | SELECT "Home team" FROM table_75942 WHERE "Date" = 'april 13, 2008' AND "Away team" = 'itabuna' | Below are sql tables 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 on April 13, 2008 when Itabuna was the away team? ### Input: CREATE TABLE table_75942 (
"Round" te... |
Name the series for game 5 | CREATE TABLE table_38817 (
"Game" text,
"Date" text,
"Result" text,
"Site" text,
"Series" text
) | SELECT "Series" FROM table_38817 WHERE "Game" = 'game 5' | Below are sql tables 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 series for game 5 ### Input: CREATE TABLE table_38817 (
"Game" text,
"Date" text,
"Result" text,
"S... |
Give me a histogram for how many drama workshop groups are there in each city? Return both the city and the count, display by the Y-axis from high to low. | CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR(15),
... | SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*) 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: Give me a histogram for how many drama workshop groups are there in each city? Return both the city and the count, display b... |
what were the four most common prescription drugs for patients who had been diagnosed with septic shock previously within 2 months, since 2105? | 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.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock' AND STRFTIME('%y', 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 were the four most common prescription drugs for patients who had been diagnosed with septic shock previously within 2 ... |
What year is the event in athens, greece? | CREATE TABLE table_11121 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | SELECT MAX("Year") FROM table_11121 WHERE "Venue" = 'athens, greece' | Below are sql tables 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 is the event in athens, greece? ### Input: CREATE TABLE table_11121 (
"Year" real,
"Tournament" text,
... |
For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart, rank in desc by the Y. | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(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 all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the sum o... |
had patient 53673 been at an er since 2100? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 num... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 53673 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) >= '2100' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 53673 been at an er since 2100? ### Input: CREATE TABLE d_items (
row_id number,
itemid number,
labe... |
what is the score on march 8? | CREATE TABLE table_48673 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "Score" FROM table_48673 WHERE "Date" = 'march 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 score on march 8? ### Input: CREATE TABLE table_48673 (
"Game" real,
"Date" text,
"Team" text,
"... |
what is the country when the score is 72-68-67=207? | CREATE TABLE table_44175 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Country" FROM table_44175 WHERE "Score" = '72-68-67=207' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the country when the score is 72-68-67=207? ### Input: CREATE TABLE table_44175 (
"Place" text,
"Player" tex... |
what is the number of patients who had (aorto)coronary bypass of two coronary arteries and were less than 89 years of age? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "89" AND procedures.short_title = "Aortocor bypas-2 cor art" | Below are sql tables 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 who had (aorto)coronary bypass of two coronary arteries and were less than 89 years of age? #... |
What is the best top-5 when top-10 is 1 and there are more than 0 wins? | CREATE TABLE table_62301 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT MAX("Top-5") FROM table_62301 WHERE "Top-10" = '1' AND "Wins" > '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 best top-5 when top-10 is 1 and there are more than 0 wins? ### Input: CREATE TABLE table_62301 (
"Tournamen... |
Are there any classes that do n't have lab sessions ? | 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' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any classes that do n't have lab sessions ? ### Input: CREATE TABLE offering_instructor (
offering_instructor_... |
Which opponent is friendly and played on 15-08-2012? | CREATE TABLE table_10233 (
"Date" text,
"Venue" text,
"Opponent" text,
"Result" text,
"Competition" text
) | SELECT "Opponent" FROM table_10233 WHERE "Competition" = 'friendly' AND "Date" = '15-08-2012' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which opponent is friendly and played on 15-08-2012? ### Input: CREATE TABLE table_10233 (
"Date" text,
"Venue" text... |
For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the amount of hire_date bin hire_date by time in a bar chart. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%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: For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the amoun... |
What was the result when he went 1 round against jeremy beck? | CREATE TABLE table_32920 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) | SELECT "Res." FROM table_32920 WHERE "Round" = '1' AND "Opponent" = 'jeremy beck' | Below are sql tables 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 when he went 1 round against jeremy beck? ### Input: CREATE TABLE table_32920 (
"Res." text,
"Re... |
Which classes of Other occur in the Winter ? | CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_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: Which classes of Other occur in the Winter ? ### Input: CREATE TABLE comment_instructor (
instructor_id int,
student... |
Which Third has a Lead of zanda bik e? | CREATE TABLE table_name_78 (
third VARCHAR,
lead VARCHAR
) | SELECT third FROM table_name_78 WHERE lead = "zanda bikše" | Below are sql tables 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 Third has a Lead of zanda bik e? ### Input: CREATE TABLE table_name_78 (
third VARCHAR,
lead VARCHAR
) ### Res... |
What is the game number when the score was l 90 104 (ot)? | CREATE TABLE table_7557 (
"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_7557 WHERE "Score" = 'l 90–104 (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: What is the game number when the score was l 90 104 (ot)? ### Input: CREATE TABLE table_7557 (
"Game" real,
"Date" t... |
what was the name of the last medication that was prescribed to patient 003-42706 when they visited the hospital last time? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid 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 = '003-42706' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p... | Below are sql tables 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 last medication that was prescribed to patient 003-42706 when they visited the hospital last time? ... |
what were the five most frequently prescribed medications for patients who have previously been diagnosed with sepsis - severe within 2 months since 1 year ago? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis - severe' AND DATETIME(diagnosis.diagnosist... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most frequently prescribed medications for patients who have previously been diagnosed with sepsis - seve... |
Which IHSAA Football Class has a Location of wabash, and a School of wabash? | CREATE TABLE table_64858 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | SELECT "IHSAA Football Class" FROM table_64858 WHERE "Location" = 'wabash' AND "School" = 'wabash' | Below are sql tables 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 IHSAA Football Class has a Location of wabash, and a School of wabash? ### Input: CREATE TABLE table_64858 (
"Scho... |
how many times patient 19473 has received the cv cath plcmt w guidance until 1 year ago? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cv cath plcmt w guidance') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19473) AND DATETIME(proced... | Below are sql tables 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 times patient 19473 has received the cv cath plcmt w guidance until 1 year ago? ### Input: CREATE TABLE outputevent... |
what was the name of the specimen test that patient 031-24513 had received the first time until 20 months ago? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | 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-24513')) 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 specimen test that patient 031-24513 had received the first time until 20 months ago? ### Input: CR... |
Name the largest ethnic group for 24112 | CREATE TABLE table_3330 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT "Largest ethnic group (2002)" FROM table_3330 WHERE "Population (2011)" = '24112' | Below are sql tables 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 largest ethnic group for 24112 ### Input: CREATE TABLE table_3330 (
"Settlement" text,
"Cyrillic Name Other... |
What publishers were involved with product number SCUS-97265? | CREATE TABLE table_10875694_11 (
publisher VARCHAR,
product_no VARCHAR
) | SELECT publisher FROM table_10875694_11 WHERE product_no = "SCUS-97265" | Below are sql tables 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 publishers were involved with product number SCUS-97265? ### Input: CREATE TABLE table_10875694_11 (
publisher VARC... |
When was the game with a record of 54-69? | CREATE TABLE table_name_28 (
date VARCHAR,
record VARCHAR
) | SELECT date FROM table_name_28 WHERE record = "54-69" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the game with a record of 54-69? ### Input: CREATE TABLE table_name_28 (
date VARCHAR,
record VARCHAR
) ###... |
Bar chart of sum crs credit from each dept code, I want to order from low to high by the bars. | CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE COURSE (
CRS_CODE... | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart of sum crs credit from each dept code, I want to order from low to high by the bars. ### Input: CREATE TABLE ENROL... |
What team was the home team when Richmond was the away team? | CREATE TABLE table_4735 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team" FROM table_4735 WHERE "Away 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 team was the home team when Richmond was the away team? ### Input: CREATE TABLE table_4735 (
"Home team" text,
... |
What is the country of origin of the artist who is female and produced a song in Bangla, and count them by a bar chart, I want to display by the bars in asc please. | CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(5... | SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country of origin of the artist who is female and produced a song in Bangla, and count them by a bar chart, I wa... |
In the Winter term , are there any PreMajor or MDE courses offered ? | CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Win... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the Winter term , are there any PreMajor or MDE courses offered ? ### Input: CREATE TABLE semester (
semester_id int,... |
What rank has a Time of 4:00.191? | CREATE TABLE table_name_94 (
rank VARCHAR,
time VARCHAR
) | SELECT rank FROM table_name_94 WHERE time = "4:00.191" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What rank has a Time of 4:00.191? ### Input: CREATE TABLE table_name_94 (
rank VARCHAR,
time VARCHAR
) ### Response:... |
count the number of patients who are dead after being diagnosed with acq coagul factor defic during the same month. | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid n... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | Below are sql tables 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 who are dead after being diagnosed with acq coagul factor defic during the same month. ### Inpu... |
Who was the away team at Brunswick Street Oval? | CREATE TABLE table_name_89 (
away_team VARCHAR,
venue VARCHAR
) | SELECT away_team AS score FROM table_name_89 WHERE venue = "brunswick street 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 away team at Brunswick Street Oval? ### Input: CREATE TABLE table_name_89 (
away_team VARCHAR,
venue VAR... |
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, AVG(DEPARTMENT_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, a bar chart shows the distribution of hire_date and the average of... |
flights from WESTCHESTER COUNTY to ST. PAUL | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport 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 = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from WESTCHESTER COUNTY to ST. PAUL ### Input: CREATE TABLE city (
city_code varchar,
city_name varchar,
... |
When was the incumbent from the south carolina 1 district first elected? | CREATE TABLE table_name_56 (
first_elected VARCHAR,
district VARCHAR
) | SELECT first_elected FROM table_name_56 WHERE district = "south carolina 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 incumbent from the south carolina 1 district first elected? ### Input: CREATE TABLE table_name_56 (
first_e... |
What is the total number of each ship type? Give me a pie chart. | CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | SELECT Type, COUNT(Type) FROM ship GROUP BY 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: What is the total number of each ship type? Give me a pie chart. ### Input: CREATE TABLE ship (
Ship_ID int,
Name te... |
count the number of patients whose primary disease is s/p hanging and drug type is main. | 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.diagnosis = "S/P HANGING" AND prescriptions.drug_type = "MAIN" | Below are sql tables 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 primary disease is s/p hanging and drug type is main. ### Input: CREATE TABLE lab (
s... |
What is the To par of the Player with a Score of 71-74-72-72=289? | CREATE TABLE table_name_25 (
to_par VARCHAR,
score VARCHAR
) | SELECT to_par FROM table_name_25 WHERE score = 71 - 74 - 72 - 72 = 289 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the To par of the Player with a Score of 71-74-72-72=289? ### Input: CREATE TABLE table_name_25 (
to_par VARCHAR... |
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of department_id bin hire_date by weekday, and visualize them by a bar chart, and show Y in descending order. | CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the s... |
Give me the dates when the max temperature was higher than 85, and count them by a line chart | CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY 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: Give me the dates when the max temperature was higher than 85, and count them by a line chart ### Input: CREATE TABLE weathe... |
Bar graph to show the number of nationality from different nationality, and rank by the Y from high to low. | CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY COUNT(Nationality) 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 graph to show the number of nationality from different nationality, and rank by the Y from high to low. ### Input: CREAT... |
What is the original air date of the episode with production code is 319? | CREATE TABLE table_29436059_1 (
original_air_date VARCHAR,
production_code VARCHAR
) | SELECT original_air_date FROM table_29436059_1 WHERE production_code = 319 | Below are sql tables 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 original air date of the episode with production code is 319? ### Input: CREATE TABLE table_29436059_1 (
ori... |
What is the last season? | CREATE TABLE table_24337 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | SELECT MAX("Season") FROM table_24337 | Below are sql tables 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 last season? ### Input: CREATE TABLE table_24337 (
"Season" real,
"Episode" real,
"Episode Summary" ... |
show me about the ground transportation in BOSTON | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hig... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' 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 about the ground transportation in BOSTON ### Input: CREATE TABLE city (
city_code varchar,
city_name varcha... |
name the nation with the most appearances . | CREATE TABLE table_204_159 (
id number,
"name" text,
"nation" text,
"position" text,
"league apps" number,
"league goals" number,
"fa cup apps" number,
"fa cup goals" number,
"total apps" number,
"total goals" number
) | SELECT "nation" FROM table_204_159 ORDER BY "total apps" 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: name the nation with the most appearances . ### Input: CREATE TABLE table_204_159 (
id number,
"name" text,
"nat... |
calculate the average age of emergency hospital admission patients who died before 2148. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2148.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: calculate the average age of emergency hospital admission patients who died before 2148. ### Input: CREATE TABLE diagnoses (... |
What is the hioghest amount of silver medals for a nation ranked higher than 19 and less than 2 gold medals? | CREATE TABLE table_66028 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MAX("Silver") FROM table_66028 WHERE "Rank" = '19' AND "Gold" < '2' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the hioghest amount of silver medals for a nation ranked higher than 19 and less than 2 gold medals? ### Input: CREA... |
What is the lowest number of blocks for players with height of 206 and more than 356 spikes? | CREATE TABLE table_42949 (
"Name" text,
"Date of Birth" text,
"Height" real,
"Weight" real,
"Spike" real,
"Block" real
) | SELECT MIN("Block") FROM table_42949 WHERE "Height" = '206' AND "Spike" > '356' | Below are sql tables 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 number of blocks for players with height of 206 and more than 356 spikes? ### Input: CREATE TABLE table_4... |
What is the title of the episode with the production code 624? | CREATE TABLE table_72209 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | SELECT "Title" FROM table_72209 WHERE "Production code" = '624' | Below are sql tables 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 of the episode with the production code 624? ### Input: CREATE TABLE table_72209 (
"Series #" real,
... |
who is the athlete with the time 6:02.46? | CREATE TABLE table_66135 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | SELECT "Athlete" FROM table_66135 WHERE "Time" = '6:02.46' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the athlete with the time 6:02.46? ### Input: CREATE TABLE table_66135 (
"Rank" real,
"Athlete" text,
"Co... |
Game of game 5 had what result? | CREATE TABLE table_name_83 (
result VARCHAR,
game VARCHAR
) | SELECT result FROM table_name_83 WHERE game = "game 5" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Game of game 5 had what result? ### Input: CREATE TABLE table_name_83 (
result VARCHAR,
game VARCHAR
) ### Response:... |
in DALLAS FORT WORTH i would like information on ground transportation | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_stop (
flight_id in... | SELECT DISTINCT ground_service.transport_type FROM city AS CITY_0, city AS CITY_1, ground_service WHERE (ground_service.city_code = CITY_0.city_code AND CITY_0.city_name = 'DALLAS') OR (ground_service.city_code = CITY_1.city_code AND CITY_1.city_name = 'FORT WORTH') | Below are sql tables 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 DALLAS FORT WORTH i would like information on ground transportation ### Input: CREATE TABLE time_zone (
time_zone_cod... |
Opponent of at new york giants had what venue? | CREATE TABLE table_5210 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Venue" text,
"Attendance" text
) | SELECT "Venue" FROM table_5210 WHERE "Opponent" = 'at new york giants' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Opponent of at new york giants had what venue? ### Input: CREATE TABLE table_5210 (
"Week" real,
"Date" text,
"O... |
Where did Carlton play as the home team? | CREATE TABLE table_52552 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_52552 WHERE "Home team" = 'carlton' | Below are sql tables 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 did Carlton play as the home team? ### Input: CREATE TABLE table_52552 (
"Home team" text,
"Home team score" t... |
Get number of Answered questions. | CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
... | SELECT COUNT(Id) AS Posts, COUNT(AnswerCount) AS Ans 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: Get number of Answered questions. ### Input: CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
... |
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 first_name and department_id , sort by the bar in descending please. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_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: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about... |
how many hours have elapsed since the last time that patient 2957 stayed during their current hospital visit in ward 57? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime t... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2957 AND admissions.dischtime IS NULL)) AND transfers.... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours have elapsed since the last time that patient 2957 stayed during their current hospital visit in ward 57? ###... |
How many courses for each course description? Show me a bar chart, list names in ascending order. | CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
... | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION | Below are sql tables 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 courses for each course description? Show me a bar chart, list names in ascending order. ### Input: CREATE TABLE CO... |
Who vacated the Pennsylvania 6th district? | CREATE TABLE table_225098_4 (
vacator VARCHAR,
district VARCHAR
) | SELECT vacator FROM table_225098_4 WHERE district = "Pennsylvania 6th" | Below are sql tables 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 vacated the Pennsylvania 6th district? ### Input: CREATE TABLE table_225098_4 (
vacator VARCHAR,
district VARCHA... |
What was the result in the election in the Kentucky 1 district? | CREATE TABLE table_2668367_7 (
result VARCHAR,
district VARCHAR
) | SELECT result FROM table_2668367_7 WHERE district = "Kentucky 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 result in the election in the Kentucky 1 district? ### Input: CREATE TABLE table_2668367_7 (
result VARCHAR... |
how many patients are admitted under elective type and diagnosed with icd9 code 70703? | 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 WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "70703" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are admitted under elective type and diagnosed with icd9 code 70703? ### Input: CREATE TABLE lab (
sub... |
whats patient 12775 minimum arterial bp [systolic] during yesterday? | 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 outputevents (
row_id number,
subject_id number,
... | SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: whats patient 12775 minimum arterial bp [systolic] during yesterday? ### Input: CREATE TABLE cost (
row_id number,
s... |
how many days ago was the first time patient 030-34260 was diagnosed with acute respiratory failure - due to neurological process in their current hospital visit? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260'... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days ago was the first time patient 030-34260 was diagnosed with acute respiratory failure - due to neurological pr... |
Please compare the total enrollment for each type using a bar chart, and could you list in asc by the total number of enrollment please? | CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest... | SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY SUM(Enrollment) | Below are sql tables 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 compare the total enrollment for each type using a bar chart, and could you list in asc by the total number of enroll... |
What is the Draw for skra warszawa? | CREATE TABLE table_name_5 (
draw VARCHAR,
team VARCHAR
) | SELECT draw FROM table_name_5 WHERE team = "skra warszawa" | Below are sql tables 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 Draw for skra warszawa? ### Input: CREATE TABLE table_name_5 (
draw VARCHAR,
team VARCHAR
) ### Response... |
Number of questions per tag. | CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT SUM(ViewCount) AS Views FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Questions.PostTypeId = 1 AND Tags.TagName = '##tagname##' | Below are sql tables 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 per tag. ### Input: CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId n... |
What is the average overall that has a pick less than 20, North Carolina as the college, with a round less than 8? | CREATE TABLE table_76922 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | SELECT AVG("Overall") FROM table_76922 WHERE "Pick" < '20' AND "College" = 'north carolina' AND "Round" < '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 average overall that has a pick less than 20, North Carolina as the college, with a round less than 8? ### Input... |
what is the number of draws for ali said gouled? | CREATE TABLE table_name_12 (
draws VARCHAR,
name VARCHAR
) | SELECT COUNT(draws) FROM table_name_12 WHERE name = "ali said gouled" | Below are sql tables 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 draws for ali said gouled? ### Input: CREATE TABLE table_name_12 (
draws VARCHAR,
name VARCHAR... |
Which venue has a Result of 1 0? | CREATE TABLE table_52483 (
"Date" text,
"Venue" text,
"Result" text,
"Scored" real,
"Competition" text
) | SELECT "Venue" FROM table_52483 WHERE "Result" = '1–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: Which venue has a Result of 1 0? ### Input: CREATE TABLE table_52483 (
"Date" text,
"Venue" text,
"Result" text,... |
What is the production code for the episode that had 18.07 million viewers? | CREATE TABLE table_26198709_1 (
production_code VARCHAR,
us_viewers__million_ VARCHAR
) | SELECT production_code FROM table_26198709_1 WHERE us_viewers__million_ = "18.07" | Below are sql tables 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 that had 18.07 million viewers? ### Input: CREATE TABLE table_26198709_1 (
p... |
What is the Enterprise for teh memory modules: hot replacement Feature that has a Datacenter of Yes? | CREATE TABLE table_76106 (
"Features" text,
"Foundation" text,
"Standard" text,
"Enterprise" text,
"Datacenter" text,
"Itanium" text
) | SELECT "Enterprise" FROM table_76106 WHERE "Datacenter" = 'yes' AND "Features" = 'memory modules: hot replacement' | Below are sql tables 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 Enterprise for teh memory modules: hot replacement Feature that has a Datacenter of Yes? ### Input: CREATE TABLE... |
what is the longest song ? | CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"length" text
) | SELECT "title" FROM table_204_184 ORDER BY "length" 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 is the longest song ? ### Input: CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"pro... |
What year has a Top 25 of 0, and a Earnings ($) larger than 0? | CREATE TABLE table_name_26 (
year VARCHAR,
top_25 VARCHAR,
earnings__$_ VARCHAR
) | SELECT year FROM table_name_26 WHERE top_25 = 0 AND earnings__$_ > 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 year has a Top 25 of 0, and a Earnings ($) larger than 0? ### Input: CREATE TABLE table_name_26 (
year VARCHAR,
... |
I want to know the proportion of school id for each all games. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Games, School_ID FROM basketball_match | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to know the proportion of school id for each all games. ### Input: CREATE TABLE basketball_match (
Team_ID int,
... |
looking for a flight from CLEVELAND to DALLAS | CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: looking for a flight from CLEVELAND to DALLAS ### Input: CREATE TABLE restriction (
restriction_code text,
advance_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.