instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What total has a position smaller than 4, a B score higher than 9.125, and an A score less than 6.6? | CREATE TABLE table_name_89 (
total INTEGER,
a_score VARCHAR,
position VARCHAR,
b_score VARCHAR
) | SELECT AVG(total) FROM table_name_89 WHERE position < 4 AND b_score > 9.125 AND a_score < 6.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 total has a position smaller than 4, a B score higher than 9.125, and an A score less than 6.6? ### Input: CREATE TABLE... |
provide the number of patients whose procedure icd9 code is 5732 and drug route is im? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5732" AND prescriptions.route = "IM" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose procedure icd9 code is 5732 and drug route is im? ### Input: CREATE TABLE demographic (... |
On what date was Tie #13 played? | CREATE TABLE table_79185 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | SELECT "Date" FROM table_79185 WHERE "Tie no" = '13' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date was Tie #13 played? ### Input: CREATE TABLE table_79185 (
"Tie no" text,
"Home team" text,
"Score" ... |
If 2006 is 13% and 2001 is greater than 12.1%, what is the greatest number of seats for 2001? | CREATE TABLE table_70959 (
"Parties and voter communities" text,
"% 2006" real,
"seats 2006" real,
"% 2001" real,
"seats 2001" real
) | SELECT MAX("seats 2001") FROM table_70959 WHERE "% 2006" = '13' AND "% 2001" > '12.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: If 2006 is 13% and 2001 is greater than 12.1%, what is the greatest number of seats for 2001? ### Input: CREATE TABLE table_... |
give me the number of patients whose item id is 51218 and lab test abnormal status is delta? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51218" 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: give me the number of patients whose item id is 51218 and lab test abnormal status is delta? ### Input: CREATE TABLE diagnos... |
What is the number of start dates for incidents with incident type code 'NOISE'? Bin by year and return a bar chart, and I want to order in descending by the Y-axis. | CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary V... | SELECT date_incident_start, COUNT(date_incident_start) FROM Behavior_Incident WHERE incident_type_code = "NOISE" ORDER BY COUNT(date_incident_start) 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: What is the number of start dates for incidents with incident type code 'NOISE'? Bin by year and return a bar chart, and I w... |
Show the name of the customer who has the most orders. | CREATE TABLE customer_orders (
customer_id VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
) | SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_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: Show the name of the customer who has the most orders. ### Input: CREATE TABLE customer_orders (
customer_id VARCHAR
)
... |
body mass index < 30 kg / m^2 | CREATE TABLE table_train_218 (
"id" int,
"plasma_glucose_concentration" int,
"c_peptide_level" float,
"body_weight" float,
"diabetic" string,
"single_antigen_b_sab" int,
"low_density_lipoprotein_ldl_cholesterol" int,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"NOUSE" f... | SELECT * FROM table_train_218 WHERE body_mass_index_bmi < 30 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: body mass index < 30 kg / m^2 ### Input: CREATE TABLE table_train_218 (
"id" int,
"plasma_glucose_concentration" int... |
how many patients less than 27 years of age have been diagnosed with hypoxemia? | 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.age < "27" AND diagnoses.long_title = "Hypoxemia" | Below are sql tables 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 less than 27 years of age have been diagnosed with hypoxemia? ### Input: CREATE TABLE prescriptions (
... |
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of department_id bin hire_date by weekday in a bar chart, could you order from low to high by the sum department id? | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of departm... |
A bar chart showing the number of different competition types, display from high to low by the x axis. | CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
... | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type ORDER BY Competition_type 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: A bar chart showing the number of different competition types, display from high to low by the x axis. ### Input: CREATE TAB... |
what are the four most commonly given microbiology tests for patients who have previously had their tracheal suctioning done in the same hospital encounter until 2 years ago? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'tracheal ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most commonly given microbiology tests for patients who have previously had their tracheal suctioning done... |
What is the 2003 value with 1r in 2009 at the Australian Open? | CREATE TABLE table_name_16 (
tournament VARCHAR
) | SELECT 2003 FROM table_name_16 WHERE 2009 = "1r" AND tournament = "australian open" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2003 value with 1r in 2009 at the Australian Open? ### Input: CREATE TABLE table_name_16 (
tournament VARCHA... |
For those employees who do not work in departments with managers that have ids between 100 and 200, find email and department_id , and visualize them by a bar chart. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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),
FIRST_NAME varcha... | SELECT EMAIL, DEPARTMENT_ID 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, find email and departmen... |
What are the number of the names of catalog entries with level number 8? | CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
catalog_entry_name VARCHAR(80),
product_stock_number VARCHAR(50),
price_in_dollars DOUBLE,
price_in_euros DOUBLE,
pri... | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of the names of catalog entries with level number 8? ### Input: CREATE TABLE Catalog_Contents (
cata... |
calculate the number of patients who had icd9 code 8960 and got discharged to snf. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "8960" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of patients who had icd9 code 8960 and got discharged to snf. ### Input: CREATE TABLE lab (
subject... |
show me all flights from SAN FRANCISCO to BOSTON on 11 10 | CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departu... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 10 AND date_day.month_number = 11 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: show me all flights from SAN FRANCISCO to BOSTON on 11 10 ### Input: CREATE TABLE dual_carrier (
main_airline varchar,
... |
Return the name of each physician and the number of patients he or she treats in a bar chart, list by the total number from low to high. | CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom TEXT
)
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Physician (
EmployeeID INTEGER,
... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the name of each physician and the number of patients he or she treats in a bar chart, list by the total number from ... |
how many times until 1 year ago patient 006-47961 had visited the intensive care unit? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47961') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-1 year') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times until 1 year ago patient 006-47961 had visited the intensive care unit? ### Input: CREATE TABLE allergy (
... |
Top users from Minsk, Belarus. | CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%minsk%' OR UPPER(Location) LIKE '%MINSK%' OR Location LIKE '%Minsk%' AND Reputation >= 1000 ORDER BY Reputation 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: Top users from Minsk, Belarus. ### Input: CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
Accepted... |
For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between commission_pct and manager_id . | 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),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | SELECT COMMISSION_PCT, MANAGER_ID 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, return a scatter chart about the correlation between comm... |
Visualize a pie chart with how many faculty members do we have for each faculty rank? | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank | Below are sql tables 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 faculty members do we have for each faculty rank? ### Input: CREATE TABLE Student (
... |
Show the names of clubs that have players with position 'Right Wing'. | CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
... | SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.club_id = T2.club_id WHERE T2.position = "Right Wing" | Below are sql tables 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 clubs that have players with position 'Right Wing'. ### Input: CREATE TABLE club (
club_id number,
... |
What is the away team score at princes park with a Crowd larger than 27,455? | CREATE TABLE table_11409 (
"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_11409 WHERE "Crowd" > '27,455' AND "Venue" = 'princes park' | Below are sql tables 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 away team score at princes park with a Crowd larger than 27,455? ### Input: CREATE TABLE table_11409 (
"Home... |
A bar chart showing the number of tourist attractions for each attraction name. | CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Hotels (
hotel_id INTEGER,
star_rating_code CHAR(15),
pets_allowed_yn CHAR(1),
price_range real,
other_hotel_details VARCHAR(255)
)
CREATE TABLE Tourist_Attractions (
Tourist_Attraction_ID INTEGER,
Attra... | SELECT Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_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: A bar chart showing the number of tourist attractions for each attraction name. ### Input: CREATE TABLE Shops (
Shop_ID ... |
Draw a bar chart of name versus age, and I want to list in desc by the x axis. | CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
) | SELECT Name, Age FROM editor ORDER BY 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: Draw a bar chart of name versus age, and I want to list in desc by the x axis. ### Input: CREATE TABLE journal (
Journal... |
What team has 4 points and a Chassis of march 82/83c? | CREATE TABLE table_70584 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Rank" text,
"Points" real
) | SELECT "Team" FROM table_70584 WHERE "Points" = '4' AND "Chassis" = 'march 82/83c' | Below are sql tables 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 has 4 points and a Chassis of march 82/83c? ### Input: CREATE TABLE table_70584 (
"Year" real,
"Team" text... |
A bar chart for giveing me the number of the dates when the max temperature was higher than 85, and could you show by the y axis in desc? | CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) 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: A bar chart for giveing me the number of the dates when the max temperature was higher than 85, and could you show by the y ... |
how did patient 96344 last entered hospital since 2103? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 96344 AND STRFTIME('%y', admissions.admittime) >= '2103' ORDER BY admissions.admittime 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: how did patient 96344 last entered hospital since 2103? ### Input: CREATE TABLE procedures_icd (
row_id number,
subj... |
What was the record at week 9? | CREATE TABLE table_60498 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | SELECT "Record" FROM table_60498 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 record at week 9? ### Input: CREATE TABLE table_60498 (
"Week" text,
"Date" text,
"Opponent" text,
... |
shawn gifford was pick number 25 , who was picked next ? | CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
) | SELECT "player" FROM table_203_676 WHERE "pick #" = 25 + 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: shawn gifford was pick number 25 , who was picked next ? ### Input: CREATE TABLE table_203_676 (
id number,
"pick #"... |
Who was the home team on 27 march 2008? | CREATE TABLE table_11520 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | SELECT "Home" FROM table_11520 WHERE "Date" = '27 march 2008' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team on 27 march 2008? ### Input: CREATE TABLE table_11520 (
"Date" text,
"Visitor" text,
"Scor... |
Please visualize a bar chart, that the X-axis is the director and the Y-axis is thier corresponding lowest rating among all movies. | CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director | Below are sql tables 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 visualize a bar chart, that the X-axis is the director and the Y-axis is thier corresponding lowest rating among all ... |
For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between employee_id and commission_pct . | 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(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT EMPLOYEE_ID, COMMISSION_PCT 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, return a scatter chart about the correlation between empl... |
how many films were released ? | CREATE TABLE table_204_961 (
id number,
"title" text,
"director" text,
"production" text,
"music" text,
"cast" text,
"release date" text
) | SELECT COUNT("title") FROM table_204_961 | Below are sql tables 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 films were released ? ### Input: CREATE TABLE table_204_961 (
id number,
"title" text,
"director" text,... |
find out how many patients were discharged from the hospital in 2100. | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '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: find out how many patients were discharged from the hospital in 2100. ### Input: CREATE TABLE labevents (
row_id number,... |
what's the estimated value where cover date is august 1962 | CREATE TABLE table_451 (
"Character(s)" text,
"First Appearance" text,
"Cover Date" text,
"Publisher" text,
"Estimated Value" text
) | SELECT "Estimated Value" FROM table_451 WHERE "Cover Date" = 'August 1962' | Below are sql tables 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 estimated value where cover date is august 1962 ### Input: CREATE TABLE table_451 (
"Character(s)" text,
... |
What alumni were in rw: cancun as their original season? | CREATE TABLE table_28677 (
"Alumni" text,
"Original season" text,
"Fresh Meat Partner" text,
"Age" real,
"Hometown" text,
"Finish" text
) | SELECT "Alumni" FROM table_28677 WHERE "Original season" = 'RW: Cancun' | Below are sql tables 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 alumni were in rw: cancun as their original season? ### Input: CREATE TABLE table_28677 (
"Alumni" text,
"Origi... |
Who had the high assists on the date December 12? | CREATE TABLE table_17312 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "High assists" FROM table_17312 WHERE "Date" = 'December 12' | Below are sql tables 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 had the high assists on the date December 12? ### Input: CREATE TABLE table_17312 (
"Game" real,
"Date" text,
... |
What upper-level courses are 9 credits ? | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
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... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 9 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: What upper-level courses are 9 credits ? ### Input: CREATE TABLE requirement (
requirement_id int,
requirement varch... |
Return a bar chart on how many eliminations did each team have?, and sort by the bars in desc. | CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on how many eliminations did each team have?, and sort by the bars in desc. ### Input: CREATE TABLE Elimi... |
Show the relation between team id and acc_percent for each All_Home using a scatter chart | 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 Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Home | Below are sql tables 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 relation between team id and acc_percent for each All_Home using a scatter chart ### Input: CREATE TABLE basketball... |
What was the record following game 67? | CREATE TABLE table_50085 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
) | SELECT "Record" FROM table_50085 WHERE "Game" = '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: What was the record following game 67? ### Input: CREATE TABLE table_50085 (
"Game" real,
"Date" text,
"Team" te... |
Who directed episodes that had 2.61 million U.S. viewers? | CREATE TABLE table_11111116_7 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
) | SELECT directed_by FROM table_11111116_7 WHERE us_viewers__million_ = "2.61" | Below are sql tables 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 episodes that had 2.61 million U.S. viewers? ### Input: CREATE TABLE table_11111116_7 (
directed_by VARCHAR... |
give me the number of patients whose year of birth is less than 2056 and lab test fluid is joint fluid? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Joint Fluid" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose year of birth is less than 2056 and lab test fluid is joint fluid? ### Input: CREATE TA... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the amount of founder , and group by attribute founder. | 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 Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | Below are sql tables 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, return a bar chart about the distribution of founder an... |
find the number of female patients whose year of birth is before 2197. | 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 WHERE demographic.gender = "F" AND demographic.dob_year < "2197" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of female patients whose year of birth is before 2197. ### Input: CREATE TABLE lab (
subject_id text,
... |
Where did they play and how many attended game number 75? | CREATE TABLE table_27704187_11 (
location_attendance VARCHAR,
game VARCHAR
) | SELECT location_attendance FROM table_27704187_11 WHERE game = 75 | Below are sql tables 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 they play and how many attended game number 75? ### Input: CREATE TABLE table_27704187_11 (
location_attendanc... |
Which date has a Score of 4 6, 2 6? | CREATE TABLE table_name_92 (
date VARCHAR,
score VARCHAR
) | SELECT date FROM table_name_92 WHERE score = "4–6, 2–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: Which date has a Score of 4 6, 2 6? ### Input: CREATE TABLE table_name_92 (
date VARCHAR,
score VARCHAR
) ### Respon... |
What is the days held the champion with a reign larger than 3 and 1 defense has? | CREATE TABLE table_72024 (
"Name" text,
"Reign" real,
"Days held" text,
"Location" text,
"Defenses" real
) | SELECT "Days held" FROM table_72024 WHERE "Reign" > '3' AND "Defenses" = '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 days held the champion with a reign larger than 3 and 1 defense has? ### Input: CREATE TABLE table_72024 (
"... |
what was patient 51577's first time of the removal fb/dev from skin procedure until 2 years ago? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'removal fb/dev from skin') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51577) AND... | Below are sql tables 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 patient 51577's first time of the removal fb/dev from skin procedure until 2 years ago? ### Input: CREATE TABLE inp... |
on the last hospital visit, how many times did patient 22973 visit the icu? | 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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22973 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime 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: on the last hospital visit, how many times did patient 22973 visit the icu? ### Input: CREATE TABLE cost (
row_id number... |
Bin all date of transactions into the YEAR interval, and sum the share count of each bin What is the trend?, and list in asc by the x axis please. | CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
oth... | SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bin all date of transactions into the YEAR interval, and sum the share count of each bin What is the trend?, and list in asc... |
What is T4 Place Player Nick Price's Score? | CREATE TABLE table_name_15 (
score VARCHAR,
place VARCHAR,
player VARCHAR
) | SELECT score FROM table_name_15 WHERE place = "t4" AND player = "nick price" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is T4 Place Player Nick Price's Score? ### Input: CREATE TABLE table_name_15 (
score VARCHAR,
place VARCHAR,
... |
Which classes are available as PreMajor next semester ? | CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = co... | Below are sql tables 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 are available as PreMajor next semester ? ### Input: CREATE TABLE gsi (
course_offering_id int,
studen... |
How many workshops did each author submit to? Return the author name and the number of workshops in a bar chart, rank Y-axis from low to high order. | CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_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: How many workshops did each author submit to? Return the author name and the number of workshops in a bar chart, rank Y-axis... |
In what state was the electorate fowler? | CREATE TABLE table_78071 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | SELECT "State" FROM table_78071 WHERE "Electorate" = 'fowler' | Below are sql tables 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 what state was the electorate fowler? ### Input: CREATE TABLE table_78071 (
"Member" text,
"Party" text,
"Ele... |
Which nominee was nominated in the Outstanding Director of a Musical category? | CREATE TABLE table_name_17 (
nominee VARCHAR,
category VARCHAR
) | SELECT nominee FROM table_name_17 WHERE category = "outstanding director of a musical" | Below are sql tables 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 nominee was nominated in the Outstanding Director of a Musical category? ### Input: CREATE TABLE table_name_17 (
n... |
For the top 3 days with the largest max gust speeds, just show the average temperature and mean humidity using a scatter chart. | CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | SELECT mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 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: For the top 3 days with the largest max gust speeds, just show the average temperature and mean humidity using a scatter cha... |
What is the total points when the horse is Chippison? | CREATE TABLE table_53379 (
"Rider" text,
"Horse" text,
"Time ( s )" text,
"Faults" text,
"Total time ( s )" text,
"Points" real
) | SELECT COUNT("Points") FROM table_53379 WHERE "Horse" = 'chippison' | Below are sql tables 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 points when the horse is Chippison? ### Input: CREATE TABLE table_53379 (
"Rider" text,
"Horse" te... |
What is the largest gold number when the total is less than 3, the rank is 5, and the silver is more than 1? | CREATE TABLE table_7056 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MAX("Gold") FROM table_7056 WHERE "Total" < '3' AND "Rank" = '5' AND "Silver" > '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 largest gold number when the total is less than 3, the rank is 5, and the silver is more than 1? ### Input: CREA... |
what title was given to the episode with production code 6ajn08? | CREATE TABLE table_28673 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | SELECT "Title" FROM table_28673 WHERE "Production code" = '6AJN08' | Below are sql tables 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 title was given to the episode with production code 6ajn08? ### Input: CREATE TABLE table_28673 (
"No. in series" r... |
Who was South Melbourne's away opponents? | CREATE TABLE table_78552 (
"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_78552 WHERE "Home team" = 'south 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: Who was South Melbourne's away opponents? ### Input: CREATE TABLE table_78552 (
"Home team" text,
"Home team score" ... |
Bar chart of maximal product price from each product type code, and I want to list in ascending by the bars please. | CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_assig... | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_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 maximal product price from each product type code, and I want to list in ascending by the bars please. ### Inpu... |
how many total districts are there in this area ? | CREATE TABLE table_204_579 (
id number,
"code" text,
"district" text,
"headquarters" text,
"population (as of 2011)" number,
"area (km2)" number,
"density (/km2)" number
) | SELECT COUNT("district") FROM table_204_579 | Below are sql tables 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 total districts are there in this area ? ### Input: CREATE TABLE table_204_579 (
id number,
"code" text,
... |
when last did patient 31482 have the minimum arterial bp mean during a day before? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
ro... | 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 = 31482)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | Below are sql tables 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 last did patient 31482 have the minimum arterial bp mean during a day before? ### Input: CREATE TABLE d_icd_diagnoses (... |
please list the flights from CINCINNATI to BURBANK on AA | CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,... | 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 = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCI... | Below are sql tables 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 CINCINNATI to BURBANK on AA ### Input: CREATE TABLE class_of_service (
booking_class varcha... |
how many patients speak ptun and were born before 2065? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PTUN" AND demographic.dob_year < "2065" | Below are sql tables 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 speak ptun and were born before 2065? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id... |
what are the four most frequently prescribed drugs for patients also prescribed with amlodipine besylate at the same time, in 2105? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'amlodipine besylate' AND STRFTIME('%y', prescriptions.startdate) ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequently prescribed drugs for patients also prescribed with amlodipine besylate at the same time, i... |
how many patients whose year of birth is less than 1882 and lab test abnormal status is abnormal? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" 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: how many patients whose year of birth is less than 1882 and lab test abnormal status is abnormal? ### Input: CREATE TABLE pr... |
Find the number of patients whose is age less than 80 years and diagnoses long title is late effects of cerebrovascular disease hemiplegia affecting unspecified side. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of patients whose is age less than 80 years and diagnoses long title is late effects of cerebrovascular dise... |
How much did the away team Geelong score? | CREATE TABLE table_name_53 (
away_team VARCHAR
) | SELECT away_team AS score FROM table_name_53 WHERE away_team = "geelong" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much did the away team Geelong score? ### Input: CREATE TABLE table_name_53 (
away_team VARCHAR
) ### Response: SELE... |
how many patients aged below 36 years have stayed in the hospital for more than 14 days? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "36" AND demographic.days_stay > "14" | Below are sql tables 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 aged below 36 years have stayed in the hospital for more than 14 days? ### Input: CREATE TABLE procedures ... |
List the number of enginners in a stacked bar chart The x-axis is last name and group by skill description, rank bars from low to high order. | CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
... | SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, last_name ORDER BY last_name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the number of enginners in a stacked bar chart The x-axis is last name and group by skill description, rank bars from l... |
Tell me the region for catalog of 576 096-2 | CREATE TABLE table_75092 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
) | SELECT "Region" FROM table_75092 WHERE "Catalog" = '576 096-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: Tell me the region for catalog of 576 096-2 ### Input: CREATE TABLE table_75092 (
"Date" text,
"Label" text,
"Re... |
What is the average of credit value of courses with more than one prerequisite for each title? Return a bar chart, display Y in asc order. | CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_... | SELECT title, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY AVG(credits) | Below are sql tables 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 of credit value of courses with more than one prerequisite for each title? Return a bar chart, display Y... |
What city did an event have a prize of 288,180? | CREATE TABLE table_79947 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
) | SELECT "City" FROM table_79947 WHERE "Prize" = '€288,180' | Below are sql tables 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 city did an event have a prize of 288,180? ### Input: CREATE TABLE table_79947 (
"Date" text,
"City" text,
... |
find the number of patients who are less than 49 years of age had stayed for more than 23 days in the hospital. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "49" AND demographic.days_stay > "23" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients who are less than 49 years of age had stayed for more than 23 days in the hospital. ### Input: C... |
How many documents for each document type name? Visualize by a ar chart, show how many document type name in asc order. | CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),... | SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY COUNT(Document_Type_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: How many documents for each document type name? Visualize by a ar chart, show how many document type name in asc order. ### ... |
What is the Class when Wessex Trains Pink is the Livery? | CREATE TABLE table_name_90 (
class VARCHAR,
livery VARCHAR
) | SELECT class FROM table_name_90 WHERE livery = "wessex trains pink" | Below are sql tables 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 Class when Wessex Trains Pink is the Livery? ### Input: CREATE TABLE table_name_90 (
class VARCHAR,
live... |
Total answers for a question. | CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
N... | SELECT COUNT(Id) AS "total_posts", AnswerCount AS "number_of_answers" FROM Posts WHERE PostTypeId = 1 GROUP BY AnswerCount ORDER BY AnswerCount 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: Total answers for a question. ### Input: CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName... |
Which customer status code has least number of customers? | CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
... | SELECT customer_status_code FROM customers GROUP BY customer_status_code ORDER BY COUNT(*) 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 customer status code has least number of customers? ### Input: CREATE TABLE lessons (
lesson_id number,
custom... |
What is the height in ft for the rockets from 1973-78? | CREATE TABLE table_11734041_16 (
height_in_ft VARCHAR,
years_for_rockets VARCHAR
) | SELECT height_in_ft FROM table_11734041_16 WHERE years_for_rockets = "1973-78" | Below are sql tables 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 height in ft for the rockets from 1973-78? ### Input: CREATE TABLE table_11734041_16 (
height_in_ft VARCHAR,... |
in this year, how many patients were prescribed with hydrochlorothiazide within 2 months after receiving appl ext fix-tib/fibula? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT COUNT(DISTINCT t1.subject_id) 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 WHERE d_icd_procedures.short_title = 'appl ext fi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in this year, how many patients were prescribed with hydrochlorothiazide within 2 months after receiving appl ext fix-tib/fi... |
When using a .375 Remington Ultra Magnum, what is the muzzle velocity? | CREATE TABLE table_16010376_1 (
muzzle_velocity VARCHAR,
cartridge VARCHAR
) | SELECT muzzle_velocity FROM table_16010376_1 WHERE cartridge = ".375 Remington Ultra Magnum" | Below are sql tables 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 using a .375 Remington Ultra Magnum, what is the muzzle velocity? ### Input: CREATE TABLE table_16010376_1 (
muzzle... |
what number of patients are staying in the csru careunit? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru') | Below are sql tables 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 number of patients are staying in the csru careunit? ### Input: CREATE TABLE labevents (
row_id number,
subject... |
which tournament is the last one of the year ? | CREATE TABLE table_203_444 (
id number,
"week" number,
"start date" text,
"type" text,
"tournament" text,
"surface" text,
"town" text,
"country" text,
"continent" text,
"prize money" text
) | SELECT "tournament" FROM table_203_444 ORDER BY id 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 tournament is the last one of the year ? ### Input: CREATE TABLE table_203_444 (
id number,
"week" number,
... |
what type of ground transportation is available in WASHINGTON | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABL... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WASHINGTON' AND ground_service.city_code = city.city_code | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what type of ground transportation is available in WASHINGTON ### Input: CREATE TABLE airport_service (
city_code varcha... |
What is the away team that features a home team of south melbourne? | CREATE TABLE table_name_53 (
away_team VARCHAR,
home_team VARCHAR
) | SELECT away_team AS score FROM table_name_53 WHERE home_team = "south 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 away team that features a home team of south melbourne? ### Input: CREATE TABLE table_name_53 (
away_team VA... |
What courses are available for theory for Winter or Fall 2002 ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREA... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%theor... | Below are sql tables 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 courses are available for theory for Winter or Fall 2002 ? ### Input: CREATE TABLE instructor (
instructor_id int,
... |
how many titles do not have an album ? | CREATE TABLE table_204_613 (
id number,
"title" text,
"year" number,
"peak chart positions\nus" number,
"peak chart positions\nus\nr&b" number,
"peak chart positions\nus\nrap" number,
"album" text
) | SELECT COUNT("title") FROM table_204_613 WHERE "album" = 'non-album singles' | Below are sql tables 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 titles do not have an album ? ### Input: CREATE TABLE table_204_613 (
id number,
"title" text,
"year" n... |
what is the amount of sump #1 patient 52898 has since 01/12/2100? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sum... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the amount of sump #1 patient 52898 has since 01/12/2100? ### Input: CREATE TABLE d_icd_diagnoses (
row_id numbe... |
what was the venue that hosted Carlton as the away team? | CREATE TABLE table_56324 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_56324 WHERE "Away 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: what was the venue that hosted Carlton as the away team? ### Input: CREATE TABLE table_56324 (
"Home team" text,
"Ho... |
Who was the opponent in week 14? | CREATE TABLE table_51049 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | SELECT "Opponent" FROM table_51049 WHERE "Week" = '14' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent in week 14? ### Input: CREATE TABLE table_51049 (
"Week" real,
"Date" text,
"Opponent" text... |
When 21' 18.87 106.209mph is Tuesday August 24th what is Monday August 23rd? | CREATE TABLE table_29190 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 29 Aug" text
) | SELECT "Mon 23 Aug" FROM table_29190 WHERE "Tues 24 Aug" = '21'' 18.87 106.209mph' | Below are sql tables 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 21' 18.87 106.209mph is Tuesday August 24th what is Monday August 23rd? ### Input: CREATE TABLE table_29190 (
"Rank... |
Which Player has a To par of 2, and a Country of wales? | CREATE TABLE table_60735 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | SELECT "Player" FROM table_60735 WHERE "To par" = '–2' AND "Country" = 'wales' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Player has a To par of 2, and a Country of wales? ### Input: CREATE TABLE table_60735 (
"Place" text,
"Player"... |
What engine was in the year of 1961? | CREATE TABLE table_79883 (
"Year" real,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" text
) | SELECT "Engine" FROM table_79883 WHERE "Year" = '1961' | Below are sql tables 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 engine was in the year of 1961? ### Input: CREATE TABLE table_79883 (
"Year" real,
"Chassis" text,
"Engine"... |
What class fulfills the ULCS requirement the easiest ? | CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | Below are sql tables 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 class fulfills the ULCS requirement the easiest ? ### Input: CREATE TABLE program_course (
program_id int,
cour... |
What player is from Chula Vista, Ca? | CREATE TABLE table_58031 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | SELECT "Player" FROM table_58031 WHERE "Hometown" = 'chula vista, ca' | Below are sql tables 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 player is from Chula Vista, Ca? ### Input: CREATE TABLE table_58031 (
"Player" text,
"Position" text,
"Scho... |
Display a bar chart for what are the names and budgets of departments with budgets greater than the average?, and I want to order from low to high by the x-axis please. | CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
bud... | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY dept_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: Display a bar chart for what are the names and budgets of departments with budgets greater than the average?, and I want to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.