instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What are the names of the directors who made exactly one movie? | CREATE TABLE Movie (
director VARCHAR
) | SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 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 are the names of the directors who made exactly one movie? ### Input: CREATE TABLE Movie (
director VARCHAR
) ### R... |
What are the profits (in billions) of the company with a market value of 172.9 billion? | CREATE TABLE table_21112 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
) | SELECT "Profits (billion $)" FROM table_21112 WHERE "Market Value (billion $)" = '172.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 are the profits (in billions) of the company with a market value of 172.9 billion? ### Input: CREATE TABLE table_21112 ... |
tell me the length of stay of patient 99661's last stay at the icu. | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code tex... | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99661) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime 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: tell me the length of stay of patient 99661's last stay at the icu. ### Input: CREATE TABLE d_items (
row_id number,
... |
What is the time/retired when the grid is 19? | CREATE TABLE table_name_42 (
time_retired VARCHAR,
grid VARCHAR
) | SELECT time_retired FROM table_name_42 WHERE grid = "19" | Below are sql tables 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 time/retired when the grid is 19? ### Input: CREATE TABLE table_name_42 (
time_retired VARCHAR,
grid VAR... |
Are there many sections of AUTO 590 after 10 A.M. ? | CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'AUTO' AND course.number = 590 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | Below are sql tables 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 many sections of AUTO 590 after 10 A.M. ? ### Input: CREATE TABLE student_record (
student_id int,
course_... |
Create a bar chart showing the total number across city code, and could you show by the bars in asc? | CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHA... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY 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: Create a bar chart showing the total number across city code, and could you show by the bars in asc? ### Input: CREATE TABLE... |
is there a flight from DENVER to SAN FRANCISCO on CO leaving after 1200 o'clock in the afternoon | CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1200 AND flight.to_airport = AIRPORT_SERVICE_... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is there a flight from DENVER to SAN FRANCISCO on CO leaving after 1200 o'clock in the afternoon ### Input: CREATE TABLE gro... |
give me the number of patients whose admission type is newborn and item id is 50801? | 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 demographic.admission_type = "NEWBORN" AND lab.itemid = "50801" | Below are sql tables 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 admission type is newborn and item id is 50801? ### Input: CREATE TABLE diagnoses (
... |
What was the opponent on December 16, 1989? | CREATE TABLE table_name_14 (
opponent VARCHAR,
date VARCHAR
) | SELECT opponent FROM table_name_14 WHERE date = "december 16, 1989" | Below are sql tables 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 opponent on December 16, 1989? ### Input: CREATE TABLE table_name_14 (
opponent VARCHAR,
date VARCHAR
)... |
when for the first time in the previous month was patient 73693 prescribed bupropion (sustained release) and amiodarone at the same time? | CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'bupropion (sustained release)' AND admissions.subject_id = 73693 AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME... | Below are sql tables 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 for the first time in the previous month was patient 73693 prescribed bupropion (sustained release) and amiodarone at t... |
Show all allergy type with number of students affected. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all allergy type with number of students affected. ### Input: CREATE TABLE Student (
StuID INTEGER,
LName VARCH... |
how many days has passed since the last time patient 739 on the current intensive care unit visit took a .9% normal saline intake? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739) AND icustays.outtime IS NULL) AN... | Below are sql tables 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 has passed since the last time patient 739 on the current intensive care unit visit took a .9% normal saline i... |
What date did South Melbourne play as the Away team? | CREATE TABLE table_33328 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_33328 WHERE "Away 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 date did South Melbourne play as the Away team? ### Input: CREATE TABLE table_33328 (
"Home team" text,
"Home t... |
How many staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's first name, and could you list in asc by the X? | CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Part_Faults (
part_fault_id I... | SELECT first_name, COUNT(first_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY first_name ORDER BY first_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 staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's first name, and could you... |
give me the number of patients whose year of birth is less than 2182 and procedure short title is coronar arteriogr-1 cath? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath" | Below are sql tables 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 2182 and procedure short title is coronar arteriogr-1 cath? ... |
Name the total number of points for beta team march 1975 and chassis of march 751 | CREATE TABLE table_name_86 (
points VARCHAR,
chassis VARCHAR,
entrant VARCHAR,
year VARCHAR
) | SELECT COUNT(points) FROM table_name_86 WHERE entrant = "beta team march" AND year = 1975 AND chassis = "march 751" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of points for beta team march 1975 and chassis of march 751 ### Input: CREATE TABLE table_name_86 (
... |
what transportation is available from the DALLAS airport to downtown | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
C... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor... | Below are sql tables 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 transportation is available from the DALLAS airport to downtown ### Input: CREATE TABLE city (
city_code varchar,
... |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of email and employee_id , sort in ascending by the EMAIL. | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | Below are sql tables 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, visualize a bar chart ab... |
Am I able to take 100 -level classes in Spring or Summer term ? | CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Am I able to take 100 -level classes in Spring or Summer term ? ### Input: CREATE TABLE course (
course_id int,
name... |
Find the organisation ids and details of the organisations which are involved i Plot them as bar chart, rank total number in desc order please. | CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Project_Staff (
staff_id DOUBLE,
project_id INTEGER,
role_code VARCHAR(10),
date_from DATETIME,
date_to DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Researc... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_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: Find the organisation ids and details of the organisations which are involved i Plot them as bar chart, rank total number in... |
when was the first year the team qualified for the playoffs ? | CREATE TABLE table_203_462 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | SELECT MIN("year") FROM table_203_462 WHERE "playoffs" <> 'did not qualify' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first year the team qualified for the playoffs ? ### Input: CREATE TABLE table_203_462 (
id number,
"ye... |
what is the death status and number of days the subject id 28588 has stayed in the hospital? | 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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "28588" | Below are sql tables 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 death status and number of days the subject id 28588 has stayed in the hospital? ### Input: CREATE TABLE procedu... |
provide the number of patients whose gender is f and lab test name is creatine kinase (ck)? | 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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Creatine Kinase (CK)" | Below are sql tables 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 gender is f and lab test name is creatine kinase (ck)? ### Input: CREATE TABLE procedur... |
what were the three most frequent lab tests that patients had in the same month after receiving a removal of thoracostomy tube procedure during the previous year? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'removal of thoracostomy tube' AND DATETIME(treatment... | Below are sql tables 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 three most frequent lab tests that patients had in the same month after receiving a removal of thoracostomy tu... |
What is Date From, when Moving To is 'Birmingham City'? | CREATE TABLE table_49812 (
"Date From" text,
"Date To" text,
"Pos." text,
"Name" text,
"Moving To" text
) | SELECT "Date From" FROM table_49812 WHERE "Moving To" = 'birmingham city' | Below are sql tables 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 Date From, when Moving To is 'Birmingham City'? ### Input: CREATE TABLE table_49812 (
"Date From" text,
"Dat... |
list all flights going from BOSTON to ATLANTA before 700 on thursday | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | 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 ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all flights going from BOSTON to ATLANTA before 700 on thursday ### Input: CREATE TABLE airport_service (
city_code... |
this year, what are the top three most frequently prescribed drugs for patients in the 50s? | 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 t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: this year, what are the top three most frequently prescribed drugs for patients in the 50s? ### Input: CREATE TABLE treatmen... |
What is the status where the notes are possible jr synonym of sapeornis? | CREATE TABLE table_name_60 (
status VARCHAR,
notes VARCHAR
) | SELECT status FROM table_name_60 WHERE notes = "possible jr synonym of sapeornis" | Below are sql tables 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 status where the notes are possible jr synonym of sapeornis? ### Input: CREATE TABLE table_name_60 (
status ... |
Name the number of lost where tries for is 109 | CREATE TABLE table_21841 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | SELECT COUNT("Lost") FROM table_21841 WHERE "Tries for" = '109' | Below are sql tables 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 number of lost where tries for is 109 ### Input: CREATE TABLE table_21841 (
"Club" text,
"Played" text,
... |
give me the number of patients less than 41 years who have delta abnormal lab test status. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" 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 less than 41 years who have delta abnormal lab test status. ### Input: CREATE TABLE lab (
... |
I want the constructor for grid less than 20 and Laps of 6 | CREATE TABLE table_56354 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT "Constructor" FROM table_56354 WHERE "Grid" < '20' AND "Laps" = '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: I want the constructor for grid less than 20 and Laps of 6 ### Input: CREATE TABLE table_56354 (
"Driver" text,
"Con... |
What is the lowest 2009 value with a 2010 value of 141 and a 1985 value bigger than 165? | CREATE TABLE table_53212 (
"Year" text,
"2010" real,
"2009" real,
"2008" real,
"2005" real,
"2000" real,
"1995" real,
"1990" real,
"1985" real
) | SELECT MIN("2009") FROM table_53212 WHERE "2010" = '141' AND "1985" > '165' | Below are sql tables 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 2009 value with a 2010 value of 141 and a 1985 value bigger than 165? ### Input: CREATE TABLE table_53212... |
What date had a CD format, under Columbia/Legacy from the UK? | CREATE TABLE table_name_77 (
date VARCHAR,
country VARCHAR,
format VARCHAR,
label VARCHAR
) | SELECT date FROM table_name_77 WHERE format = "cd" AND label = "columbia/legacy" AND country = "uk" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date had a CD format, under Columbia/Legacy from the UK? ### Input: CREATE TABLE table_name_77 (
date VARCHAR,
... |
Which driver set the Qualifying record with a time of 24.761 seconds? | CREATE TABLE table_54207 (
"Record" text,
"Date" text,
"Driver" text,
"Time" text,
"Speed/Avg. Speed" text
) | SELECT "Driver" FROM table_54207 WHERE "Record" = 'qualifying' AND "Time" = '24.761' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which driver set the Qualifying record with a time of 24.761 seconds? ### Input: CREATE TABLE table_54207 (
"Record" tex... |
when patient 031-17834 got a microbiology test for the first time in 10/this year? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND DATETIME(microlab.culturetakentime, 'start of ye... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when patient 031-17834 got a microbiology test for the first time in 10/this year? ### Input: CREATE TABLE allergy (
all... |
calculate the number of times patient 94757 had received a albumin, urine laboratory test since 03/2104. | 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 d_labitems (
row_id number,
itemid... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'albumin, urine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94757) AND STRFTIME('%y-%m', labevents.charttime) >= '2104-03' | Below are sql tables 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 times patient 94757 had received a albumin, urine laboratory test since 03/2104. ### Input: CREATE T... |
What is the surface on 21 june 1993? | CREATE TABLE table_77181 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | SELECT "Surface" FROM table_77181 WHERE "Date" = '21 june 1993' | Below are sql tables 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 surface on 21 june 1993? ### Input: CREATE TABLE table_77181 (
"Outcome" text,
"Date" text,
"Champio... |
What is the score for set 1 when the score for set 3 is 22 25? | CREATE TABLE table_9150 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | SELECT "Set 1" FROM table_9150 WHERE "Set 3" = '22–25' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for set 1 when the score for set 3 is 22 25? ### Input: CREATE TABLE table_9150 (
"Date" text,
"Ti... |
when did patient 005-64055 until 1 year ago leave the hospital for the last time? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '005-64055' AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 005-64055 until 1 year ago leave the hospital for the last time? ### Input: CREATE TABLE intakeoutput (
... |
what is the death status of subject id 83678? | 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 demographic.expire_flag FROM demographic WHERE demographic.subject_id = "83678" | Below are sql tables 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 death status of subject id 83678? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id text,
... |
since 2100 how many patients have undergone closed bronchial biopsy within 2 months after the diagnosis of cataract extract status? | CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row... | SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'cataract extract 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: since 2100 how many patients have undergone closed bronchial biopsy within 2 months after the diagnosis of cataract extract ... |
What was the earliest year that T rlea took 7th place? | CREATE TABLE table_4625 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | SELECT MIN("Year") FROM table_4625 WHERE "Position" = '7th' | Below are sql tables 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 earliest year that T rlea took 7th place? ### Input: CREATE TABLE table_4625 (
"Year" real,
"Competitio... |
Who was the home team that played against Manchester United? | CREATE TABLE table_name_86 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team FROM table_name_86 WHERE away_team = "manchester united" | Below are sql tables 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 that played against Manchester United? ### Input: CREATE TABLE table_name_86 (
home_team VARCHAR,
... |
What is the total points for the tean with 8 losses? | CREATE TABLE table_13015539_1 (
points VARCHAR,
lost VARCHAR
) | SELECT COUNT(points) FROM table_13015539_1 WHERE lost = 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 total points for the tean with 8 losses? ### Input: CREATE TABLE table_13015539_1 (
points VARCHAR,
lost... |
when did patient 6170's arterial bp mean first measure today? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | 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 = 6170)) 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 did patient 6170's arterial bp mean first measure today? ### Input: CREATE TABLE outputevents (
row_id number,
... |
how many patients this year have received glucocorticoids two times? | 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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'glucocorticoids' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start ... | Below are sql tables 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 this year have received glucocorticoids two times? ### Input: CREATE TABLE patient (
uniquepid text,
... |
What is the low lap total for henri pescarolo with a grad larger than 6? | CREATE TABLE table_name_20 (
laps INTEGER,
grid VARCHAR,
driver VARCHAR
) | SELECT MIN(laps) FROM table_name_20 WHERE grid > 6 AND driver = "henri pescarolo" | Below are sql tables 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 low lap total for henri pescarolo with a grad larger than 6? ### Input: CREATE TABLE table_name_20 (
laps IN... |
What home team played at western oval? | CREATE TABLE table_74764 (
"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_74764 WHERE "Venue" = 'western oval' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What home team played at western oval? ### Input: CREATE TABLE table_74764 (
"Home team" text,
"Home team score" tex... |
Find the average age of journalists working on different role type, show the result with a bar chart, sort y axis in ascending order. | CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | SELECT Work_Type, AVG(t1.Age) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(t1.Age) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the average age of journalists working on different role type, show the result with a bar chart, sort y axis in ascendi... |
i am interested in a flight from CINCINNATI to BURBANK the flight should be AA and leave in the afternoon i need to know the aircraft and flight number | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
da... | SELECT DISTINCT aircraft.aircraft_code, flight.flight_number FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CINCINNATI' AND CITY_1.city_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: i am interested in a flight from CINCINNATI to BURBANK the flight should be AA and leave in the afternoon i need to know the... |
Create a bar chart showing the number of meter 200 across meter 200 | CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_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: Create a bar chart showing the number of meter 200 across meter 200 ### Input: CREATE TABLE stadium (
ID int,
name t... |
Show me a bar chart for how many total credits are offered by each department?, sort by the bar in desc. | CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE adv... | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY dept_name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for how many total credits are offered by each department?, sort by the bar in desc. ### Input: CREATE T... |
what were the top three most common diagnosis until 2104? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE ... | Below are sql tables 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 top three most common diagnosis until 2104? ### Input: CREATE TABLE d_icd_diagnoses (
row_id number,
i... |
Which physicians are trained in procedures that are more expensive than 5000? | CREATE TABLE block (
blockfloor number,
blockcode number
)
CREATE TABLE appointment (
appointmentid number,
patient number,
prepnurse number,
physician number,
start time,
end time,
examinationroom text
)
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor ... | SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000 | Below are sql tables 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 physicians are trained in procedures that are more expensive than 5000? ### Input: CREATE TABLE block (
blockfloor... |
For each zip code, how many times has the maximum wind speed reached 25 mph. Visualize by scatter 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 zip_code, COUNT(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_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: For each zip code, how many times has the maximum wind speed reached 25 mph. Visualize by scatter chart. ### Input: CREATE T... |
how many tournaments has jane o'donoghue competed in ? | CREATE TABLE table_204_94 (
id number,
"outcome" text,
"date" text,
"tournament" text,
"surface" text,
"partnering" text,
"opponent in the final" text,
"score in the final" text
) | SELECT COUNT("tournament") FROM table_204_94 | Below are sql tables 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 tournaments has jane o'donoghue competed in ? ### Input: CREATE TABLE table_204_94 (
id number,
"outcome" t... |
Plot meter_100 by grouped by meter 300 as a bar graph | CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | SELECT meter_300, meter_100 FROM swimmer | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot meter_100 by grouped by meter 300 as a bar graph ### Input: CREATE TABLE event (
ID int,
Name text,
Stadium... |
A bar chart shows the distribution of All_Games and ACC_Percent , could you list from high to low by the names? | 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_Games, ACC_Percent FROM basketball_match ORDER BY All_Games 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 shows the distribution of All_Games and ACC_Percent , could you list from high to low by the names? ### Input: C... |
What is the voter registration that has a BYut of 48.2? | CREATE TABLE table_name_78 (
voter_registration VARCHAR,
byut VARCHAR
) | SELECT COUNT(voter_registration) FROM table_name_78 WHERE byut = 48.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 voter registration that has a BYut of 48.2? ### Input: CREATE TABLE table_name_78 (
voter_registration VARCH... |
What are the least losses of Warrnambool with more than 6 wins and less than 630 against? | CREATE TABLE table_name_18 (
losses INTEGER,
wins VARCHAR,
against VARCHAR,
club VARCHAR
) | SELECT MIN(losses) FROM table_name_18 WHERE against < 630 AND club = "warrnambool" AND wins > 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 are the least losses of Warrnambool with more than 6 wins and less than 630 against? ### Input: CREATE TABLE table_name... |
List all the possible ways to get to attractions, together with the number of attractions accessible by these methods in a bar chart, rank from high to low by the bars please. | CREATE TABLE Locations (
Location_ID INTEGER,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Museums (
Museum_ID INTEGER,
Museum_Details VARCHAR(255)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40... | SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY How_to_Get_There 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: List all the possible ways to get to attractions, together with the number of attractions accessible by these methods in a b... |
what was the name of the organism found in the first microbiological examination of patient 031-3355's other in this month? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other' AND DATETIME(microlab.cult... | Below are sql tables 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 organism found in the first microbiological examination of patient 031-3355's other in this month? ... |
Give me a bar chart to show the number of event details of events that have more than one participant, and list from high to low by the total number. | CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREA... | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY COUNT(Event_Details) 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 to show the number of event details of events that have more than one participant, and list from high to... |
what are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?, and order in descending by the Y-axis. | 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varc... | SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY MAX_SALARY - MIN_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: what are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?, and order in descendin... |
What is the date when the opponent in the final is gast n etlis mart n rodr guez? | CREATE TABLE table_33658 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | SELECT "Date" FROM table_33658 WHERE "Opponents in the final" = 'gastón etlis martín rodríguez' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date when the opponent in the final is gast n etlis mart n rodr guez? ### Input: CREATE TABLE table_33658 (
... |
Find the first names of all the teachers that teach in classroom 110. | CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
) | SELECT firstname FROM teachers WHERE classroom = 110 | Below are sql tables 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 names of all the teachers that teach in classroom 110. ### Input: CREATE TABLE teachers (
lastname text,
... |
object recognition papers | CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
autho... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'object recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: object recognition papers ### Input: CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphra... |
Are any 100 -level classes being offered in the Spring or Summer term ? | 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, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou... | Below are sql tables 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 any 100 -level classes being offered in the Spring or Summer term ? ### Input: CREATE TABLE gsi (
course_offering_id... |
What was the 2nd leg score when atl tico tucum n played at home? | CREATE TABLE table_name_84 (
home__2nd_leg_ VARCHAR
) | SELECT 2 AS nd_leg FROM table_name_84 WHERE home__2nd_leg_ = "atlético tucumá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: What was the 2nd leg score when atl tico tucum n played at home? ### Input: CREATE TABLE table_name_84 (
home__2nd_leg_ ... |
how many times did patient 030-42006 this month receive d5lr ivf? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | Below are sql tables 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 did patient 030-42006 this month receive d5lr ivf? ### Input: CREATE TABLE medication (
medicationid numb... |
What is the lowest attendance for week 2? | CREATE TABLE table_name_50 (
attendance INTEGER,
week VARCHAR
) | SELECT MIN(attendance) FROM table_name_50 WHERE week = 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 lowest attendance for week 2? ### Input: CREATE TABLE table_name_50 (
attendance INTEGER,
week VARCHAR
)... |
What is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits? | CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE gas_station (
station_id number,
open_year number,
location... | SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion | Below are sql tables 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 rank, company, and market value of every comapny in the banking industry ordered by sales and profits? ### Input... |
What was the record on the date of december 1, 1968? | CREATE TABLE table_44147 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | SELECT "Record" FROM table_44147 WHERE "Date" = 'december 1, 1968' | Below are sql tables 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 on the date of december 1, 1968? ### Input: CREATE TABLE table_44147 (
"Week" real,
"Date" text,... |
get me the top four most frequent lab tests until 2104? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) <= '2104' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 4) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the top four most frequent lab tests until 2104? ### Input: CREATE TABLE d_icd_procedures (
row_id number,
ic... |
How many product # have episode 1? | CREATE TABLE table_2289806_1 (
prod__number INTEGER,
episode__number VARCHAR
) | SELECT MAX(prod__number) FROM table_2289806_1 WHERE episode__number = 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 product # have episode 1? ### Input: CREATE TABLE table_2289806_1 (
prod__number INTEGER,
episode__number V... |
What was the guage of the concessionaire ferrosur roca? | CREATE TABLE table_45436 (
"Concessionaire" text,
"FA Division(s)" text,
"Gauge" text,
"Length, km" real,
"Takeover Date" text
) | SELECT "Gauge" FROM table_45436 WHERE "Concessionaire" = 'ferrosur roca' | Below are sql tables 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 guage of the concessionaire ferrosur roca? ### Input: CREATE TABLE table_45436 (
"Concessionaire" text,
... |
What college did the player whose position was RB go to? | CREATE TABLE table_30266 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | SELECT "College" FROM table_30266 WHERE "Position" = 'RB' | Below are sql tables 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 college did the player whose position was RB go to? ### Input: CREATE TABLE table_30266 (
"Pick #" real,
"CFL T... |
List the 1st air date for season 12. | CREATE TABLE table_27437601_2 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | SELECT original_air_date FROM table_27437601_2 WHERE no_in_season = 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: List the 1st air date for season 12. ### Input: CREATE TABLE table_27437601_2 (
original_air_date VARCHAR,
no_in_sea... |
What was the score when the loss was hideo nomo (3 5)? | CREATE TABLE table_6614 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text,
"Attendance" real,
"Record" text
) | SELECT "Score" FROM table_6614 WHERE "Loss" = 'hideo nomo (3–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: What was the score when the loss was hideo nomo (3 5)? ### Input: CREATE TABLE table_6614 (
"Date" text,
"Opponent" ... |
For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the headquarter , and group by attribute headquarter, order from high to low by the Y-axis. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code 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 records from the products and each product's manufacturer, give me the comparison about the sum of code over the h... |
until 4 years ago has patient 13473 received any medication? | 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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_i... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 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: until 4 years ago has patient 13473 received any medication? ### Input: CREATE TABLE cost (
row_id number,
subject_i... |
has there ever been any 3% citrate given to patient 18866 in their first hospital visit? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptio... | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inputevents_cv.it... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has there ever been any 3% citrate given to patient 18866 in their first hospital visit? ### Input: CREATE TABLE microbiolog... |
show me one way flights from TAMPA to ST. LOUIS departing before 1000 FIRST class | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
... | 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, fare, fare_basis, flight, flight_fare WHERE (((fare.round_trip_required = 'NO') AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code 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: show me one way flights from TAMPA to ST. LOUIS departing before 1000 FIRST class ### Input: CREATE TABLE month (
month_... |
How many companies that have ever operated a flight for each type? Draw a pie chart. | CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equity_Shareholding real
)
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABLE flight (
id int,
... | SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id 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: How many companies that have ever operated a flight for each type? Draw a pie chart. ### Input: CREATE TABLE operate_company... |
the number of patients in ward 14? | CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 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: the number of patients in ward 14? ### Input: CREATE TABLE prescriptions (
row_id number,
subject_id number,
had... |
What is the Surface of the Tournament on June 11, 2006? | CREATE TABLE table_13958 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in final" text,
"Score" text,
"Prize Money" text
) | SELECT "Surface" FROM table_13958 WHERE "Date" = 'june 11, 2006' | Below are sql tables 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 Surface of the Tournament on June 11, 2006? ### Input: CREATE TABLE table_13958 (
"Date" text,
"Tourname... |
Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment, rank by the Y in ascending. | CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) | Below are sql tables 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, the-axis is the state, and the Y axis is each state's the smallest enrollment, rank by the Y in ascending. ### In... |
what are the round trip fares for flights from DENVER to PHILADELPHIA arriving after 1700 on CO | CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time > 1700 AND flight.to_airport = AIRP... | Below are sql tables 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 round trip fares for flights from DENVER to PHILADELPHIA arriving after 1700 on CO ### Input: CREATE TABLE grou... |
What are all the characteristic names of product 'sesame'? | CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE products (
product_id number,
color_code text,
product_category_code text,
product_name text,
typical_buying_price text,
typical_selling_price text,
product_description text,
other_product_details t... | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" | Below are sql tables 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 all the characteristic names of product 'sesame'? ### Input: CREATE TABLE ref_colors (
color_code text,
col... |
when was the first hospital discharge time until 3 years ago for patient 30763? | CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
d... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 30763 AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.dischtime LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first hospital discharge time until 3 years ago for patient 30763? ### Input: CREATE TABLE prescriptions (
... |
provide the number of patients whose age is less than 74 and drug code is neut? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.formulary_drug_cd = "NEUT" | Below are sql tables 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 age is less than 74 and drug code is neut? ### Input: CREATE TABLE demographic (
su... |
For those employees who was hired before 2002-06-21, give me the trend about employee_id over hire_date , and I want to order X in asc order. | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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(25... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_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: For those employees who was hired before 2002-06-21, give me the trend about employee_id over hire_date , and I want to orde... |
A bar chart for what are the number of the dates when customers with ids between 10 and 20 became customers?, display by the y-axis in descending. | CREATE TABLE Addresses (
address_id INTEGER,
address_content VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
product_details VARCHAR(255)... | SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) 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 what are the number of the dates when customers with ids between 10 and 20 became customers?, display by the... |
Which teams used Wally Rogers as their crew chief? | CREATE TABLE table_1266602_2 (
team VARCHAR,
crew_chief VARCHAR
) | SELECT team FROM table_1266602_2 WHERE crew_chief = "Wally Rogers" | Below are sql tables 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 teams used Wally Rogers as their crew chief? ### Input: CREATE TABLE table_1266602_2 (
team VARCHAR,
crew_chie... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the job_id . | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | SELECT JOB_ID, COMMISSION_PCT 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, give me the comparison a... |
Bar chart x axis other details y axis resident_id, sort by the bars from low to high please. | CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in ... | SELECT other_details, resident_id FROM Residents ORDER BY other_details | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis other details y axis resident_id, sort by the bars from low to high please. ### Input: CREATE TABLE Residen... |
what was the top three most frequent diagnoses until 3 years ago? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
h... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnoses_icd.... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the top three most frequent diagnoses until 3 years ago? ### Input: CREATE TABLE diagnoses_icd (
row_id number,... |
The 51 points against, how many are for? | CREATE TABLE table_31879 (
"Played in" text,
"Matches" text,
"Lost" text,
"Drawn" text,
"Points for" text,
"Points against" text
) | SELECT "Points for" FROM table_31879 WHERE "Points against" = '51' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The 51 points against, how many are for? ### Input: CREATE TABLE table_31879 (
"Played in" text,
"Matches" text,
... |
For those records from the products and each product's manufacturer, a scatter chart shows the correlation between price and revenue , and group by attribute name. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T1.Price, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY 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, a scatter chart shows the correlation between price and... |
When can I take 421 ? | CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varc... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 421 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste... | Below are sql tables 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 can I take 421 ? ### Input: CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.