instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
How many times a week does AERO 202 meet ? | CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT (SELECT SUM(CASE WHEN DERIVED_TABLEalias0.FRIDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.MONDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.SATURDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.SUNDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalia... | Below are sql tables 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 a week does AERO 202 meet ? ### Input: CREATE TABLE course_offering (
offering_id int,
course_id int,... |
when is patient 13841's tpn d5.0 intake the first time until 386 days ago? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT 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 = 13841)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when is patient 13841's tpn d5.0 intake the first time until 386 days ago? ### Input: CREATE TABLE diagnoses_icd (
row_i... |
Show me about the distribution of date_address_to and the amount of date_address_to bin date_address_to by weekday in a bar chart. | CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
date_first_rental DATETIME,
date_left_university DATETIME,
other_student_details VARC... | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental 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 about the distribution of date_address_to and the amount of date_address_to bin date_address_to by weekday in a bar ... |
For all employees who have the letters D or S in their first name, find hire_date and the sum of salary bin hire_date by weekday, 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | SELECT HIRE_DATE, SUM(SALARY) 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, find hire_date and the sum of salary bin hire_date by wee... |
How many employees does each role have? Plot a pie chart. | CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15),
document_type_description VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Document_Drafts (
document_id INTEGER,
draft_number INTEGER,
draft_details VARCHAR(255)
)
CREATE... | SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_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: How many employees does each role have? Plot a pie chart. ### Input: CREATE TABLE Ref_Document_Types (
document_type_cod... |
what is the number of patients whose ethnicity is black/african american and drug type is base? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug_type = "BASE" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose ethnicity is black/african american and drug type is base? ### Input: CREATE TABLE pres... |
Are there any 400 -level courses available in the Fall or Winter ? | CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREAT... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any 400 -level courses available in the Fall or Winter ? ### Input: CREATE TABLE offering_instructor (
offerin... |
How many accounts are opened in each day for all accounts by the customer with first name 'Meaghan' ? Bin the account open day by weekday in a bar chart, and order y-axis in descending order. | CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Financial_Transactions (
... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY COUNT(date_account_opened) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many accounts are opened in each day for all accounts by the customer with first name 'Meaghan' ? Bin the account open d... |
what is the amount of profits in billions for companies with a market value of 204.9 billion? | CREATE TABLE table_72826 (
"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_72826 WHERE "Market Value (billion $)" = '204.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 is the amount of profits in billions for companies with a market value of 204.9 billion? ### Input: CREATE TABLE table_... |
Which Country has a Score of 79-68-74=212? | CREATE TABLE table_name_49 (
country VARCHAR,
score VARCHAR
) | SELECT country FROM table_name_49 WHERE score = 79 - 68 - 74 = 212 | Below are sql tables 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 Country has a Score of 79-68-74=212? ### Input: CREATE TABLE table_name_49 (
country VARCHAR,
score VARCHAR
) ... |
Show all posts based on User ID. | CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT * FROM Posts WHERE OwnerUserId = '##userid##' | Below are sql tables 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 posts based on User ID. ### Input: CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Comm... |
What is Designation, when Launch Date/Time ( GMT ) is 29 June 1972, 03:47? | CREATE TABLE table_12860 (
"Designation" text,
"Launch date/time ( GMT )" text,
"Mass" text,
"Apogee" text,
"Inclination" text
) | SELECT "Designation" FROM table_12860 WHERE "Launch date/time ( GMT )" = '29 june 1972, 03:47' | Below are sql tables 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 Designation, when Launch Date/Time ( GMT ) is 29 June 1972, 03:47? ### Input: CREATE TABLE table_12860 (
"Design... |
how many times did they participate in the olympic games ? | CREATE TABLE table_203_28 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | SELECT COUNT(*) FROM table_203_28 WHERE "competition" = 'olympic games' | Below are sql tables 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 they participate in the olympic games ? ### Input: CREATE TABLE table_203_28 (
id number,
"year" ... |
has there been any organism found until 2103 during the first other microbiology test of patient 031-22988? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND microlab.culturesite = 'other' AND STRFTIME('%y', microlab.cu... | Below are sql tables 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 been any organism found until 2103 during the first other microbiology test of patient 031-22988? ### Input: CREAT... |
what were the four most frequent drugs that were prescribed to male patients of the age 30s in the same month after they had been diagnosed with nb obsrv suspct infect since 6 years ago? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the four most frequent drugs that were prescribed to male patients of the age 30s in the same month after they had... |
What is the last year that someone is first elected? | CREATE TABLE table_1342359_2 (
first_elected INTEGER
) | SELECT MAX(first_elected) FROM table_1342359_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 last year that someone is first elected? ### Input: CREATE TABLE table_1342359_2 (
first_elected INTEGER
) #... |
In which venue did the home team score 11.13 (79)? | CREATE TABLE table_10814 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_10814 WHERE "Home team score" = '11.13 (79)' | Below are sql tables 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 which venue did the home team score 11.13 (79)? ### Input: CREATE TABLE table_10814 (
"Home team" text,
"Home tea... |
Which player went to Emporia State? | CREATE TABLE table_16078 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
) | SELECT "Player name" FROM table_16078 WHERE "College" = 'Emporia State' | Below are sql tables 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 went to Emporia State? ### Input: CREATE TABLE table_16078 (
"Round" real,
"Choice" real,
"Overall"... |
What was the press like in Paris for Roger Francois, and Carlo Galimberti? | CREATE TABLE table_name_67 (
paris___fra__ VARCHAR,
roger_françois VARCHAR
) | SELECT paris___fra__ FROM table_name_67 WHERE "press" = "press" AND roger_françois = "carlo galimberti" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the press like in Paris for Roger Francois, and Carlo Galimberti? ### Input: CREATE TABLE table_name_67 (
paris... |
Give me the comparison about ACC_Percent over the ACC_Regular_Season . | 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 ACC_Regular_Season, ACC_Percent FROM basketball_match | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about ACC_Percent over the ACC_Regular_Season . ### Input: CREATE TABLE basketball_match (
Team_I... |
What round pick was pick number 101 who plays defensive back? | CREATE TABLE table_name_92 (
round VARCHAR,
position VARCHAR,
pick__number VARCHAR
) | SELECT round FROM table_name_92 WHERE position = "defensive back" AND pick__number = "101" | Below are sql tables 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 round pick was pick number 101 who plays defensive back? ### Input: CREATE TABLE table_name_92 (
round VARCHAR,
... |
Who is the incumbent in district Massachusetts7? | CREATE TABLE table_18206 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
) | SELECT "Incumbent" FROM table_18206 WHERE "District" = 'Massachusetts7' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the incumbent in district Massachusetts7? ### Input: CREATE TABLE table_18206 (
"District" text,
"Incumbent" ... |
What safari has 2012 q4 as the period? | CREATE TABLE table_79299 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other" text
) | SELECT "Safari" FROM table_79299 WHERE "Period" = '2012 q4' | Below are sql tables 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 safari has 2012 q4 as the period? ### Input: CREATE TABLE table_79299 (
"Period" text,
"Internet Explorer" text... |
Which Tie #has an Attendance of 54,591? | CREATE TABLE table_36003 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | SELECT "Tie no" FROM table_36003 WHERE "Attendance" = '54,591' | Below are sql tables 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 Tie #has an Attendance of 54,591? ### Input: CREATE TABLE table_36003 (
"Tie no" text,
"Home team" text,
"... |
Visualize a bar chart about the distribution of Team_Name and Team_ID , and list X-axis in descending order. | 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_Name, Team_ID FROM basketball_match ORDER BY Team_Name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of Team_Name and Team_ID , and list X-axis in descending order. ### Input: CREA... |
has patient 033-32465 received administration of electrolytes - oral in other hospitals, since 6 years ago? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitaldischargetime IS NULL)) AND tr... | Below are sql tables 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 patient 033-32465 received administration of electrolytes - oral in other hospitals, since 6 years ago? ### Input: CREAT... |
What are the names of the directors who made exactly one movie excluding director NULL? | CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | SELECT director FROM movie WHERE director <> "null" 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 excluding director NULL? ### Input: CREATE TABLE reviewer (
... |
Display a bar chart for how many counties correspond to each police force?, and rank X in asc order. | CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force | Below are sql tables 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 how many counties correspond to each police force?, and rank X in asc order. ### Input: CREATE TABLE... |
For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter in a bar chart. | 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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the s... |
A bar chart for showing the number of the countries that have managers of age above 50 or below 46, I want to rank by the total number in ascending. | CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage ... | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY COUNT(Country) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for showing the number of the countries that have managers of age above 50 or below 46, I want to rank by the to... |
Group and count the move in date in a bar chart, could you display X-axis from low to high order? | 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 Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY date_moved_in | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Group and count the move in date in a bar chart, could you display X-axis from low to high order? ### Input: CREATE TABLE Re... |
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id by a bar chart. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id ,... |
Which parts have more than 2 faults? Show the part name and id Plot them as bar chart, and could you sort in desc by the y axis? | CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DATETIME,
other_visit_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
faul... | SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_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: Which parts have more than 2 faults? Show the part name and id Plot them as bar chart, and could you sort in desc by the y a... |
Which candidates ran in the Alabama 6 district? | CREATE TABLE table_1341973_3 (
candidates VARCHAR,
district VARCHAR
) | SELECT candidates FROM table_1341973_3 WHERE district = "Alabama 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 candidates ran in the Alabama 6 district? ### Input: CREATE TABLE table_1341973_3 (
candidates VARCHAR,
distri... |
give me the five most common output events since 2 years ago? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 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: give me the five most common output events since 2 years ago? ### Input: CREATE TABLE patients (
row_id number,
subj... |
what is the number of patients whose age is less than 68 and lab test fluid is joint fluid? | 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.age < "68" 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: what is the number of patients whose age is less than 68 and lab test fluid is joint fluid? ### Input: CREATE TABLE diagnose... |
What is the lowest Frequency where the Hemholtz pitch is d? | CREATE TABLE table_77930 (
"String" text,
"Scientific pitch" text,
"Helmholtz pitch" text,
"Interval from middle C" text,
"Frequency ( Hz )" real
) | SELECT MIN("Frequency ( Hz )") FROM table_77930 WHERE "Helmholtz pitch" = '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: What is the lowest Frequency where the Hemholtz pitch is d? ### Input: CREATE TABLE table_77930 (
"String" text,
"Sc... |
how many patients whose marital status is widowed and lab test fluid is urine? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Urine" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose marital status is widowed and lab test fluid is urine? ### Input: CREATE TABLE procedures (
subj... |
What was the attendance of the game where fitzroy was the away team? | CREATE TABLE table_52235 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT COUNT("Crowd") FROM table_52235 WHERE "Away team" = 'fitzroy' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the attendance of the game where fitzroy was the away team? ### Input: CREATE TABLE table_52235 (
"Home team" t... |
list all the takeoffs and landings at MKE | CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE') | Below are sql tables 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 takeoffs and landings at MKE ### Input: CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREA... |
give me patient 027-135249's yearly minimum sao2 until 4 months ago. | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-135249')) AND NOT vitalperiodic.sao2 IS NULL AND DATE... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me patient 027-135249's yearly minimum sao2 until 4 months ago. ### Input: CREATE TABLE vitalperiodic (
vitalperiod... |
retrieve the patients ids who had been diagnosed with ischemic optic neuropthy in this year. | 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ischemic optic neuropthy') AND DATETIME(diagnoses_icd.charttime, 'start of... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: retrieve the patients ids who had been diagnosed with ischemic optic neuropthy in this year. ### Input: CREATE TABLE transfe... |
What was the average attendance when the record was 17-18? | CREATE TABLE table_68635 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT AVG("Attendance") FROM table_68635 WHERE "Record" = '17-18' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the average attendance when the record was 17-18? ### Input: CREATE TABLE table_68635 (
"Date" text,
"Oppon... |
tell me the sex of patient 028-40370. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '028-40370' | Below are sql tables 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 sex of patient 028-40370. ### Input: CREATE TABLE cost (
costid number,
uniquepid text,
patienthealt... |
how many patients whose marital status is single 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 diagnoses (
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" 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: how many patients whose marital status is single and diagnoses long title is late effects of cerebrovascular disease, hemipl... |
count the number of drugs that have been prescribed patient 002-77945 until 3 years ago. | 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(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-77945')) AND DATETIME(medication.drugstarttime) <= 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: count the number of drugs that have been prescribed patient 002-77945 until 3 years ago. ### Input: CREATE TABLE patient (
... |
What is the Attendance when Vida is the Away team? | CREATE TABLE table_8371 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | SELECT AVG("Attendance") FROM table_8371 WHERE "Away" = 'vida' | Below are sql tables 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 Attendance when Vida is the Away team? ### Input: CREATE TABLE table_8371 (
"Date" text,
"Home" text,
... |
Top users from Saarbr cken, Germany. | CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%saarbr%cken%' 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 Saarbr cken, Germany. ### Input: CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
C... |
Name the MDE classes . | CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_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: Name the MDE classes . ### Input: CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE ... |
When was the incident in Pol-E Khomri? | CREATE TABLE table_71249 (
"Date" text,
"Location" text,
"Nature of incident" text,
"Circumstances" text,
"Casualties" text
) | SELECT "Date" FROM table_71249 WHERE "Location" = 'pol-e khomri' | Below are sql tables 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 incident in Pol-E Khomri? ### Input: CREATE TABLE table_71249 (
"Date" text,
"Location" text,
"Natu... |
since 6 years ago, when did patient 006-185446 last visit the hospital? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-185446' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY patient.hospitaladmittime 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: since 6 years ago, when did patient 006-185446 last visit the hospital? ### Input: CREATE TABLE diagnosis (
diagnosisid ... |
Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending order. | CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Products (
product_id INTEGER,
color_code VARCHAR(15),
product_category_code VARCHAR(15),
product_name VARCHAR(80),
typical_buyin... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending ... |
how many patients whose ethnicity is asian and year of birth is less than 1850? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "1850" | Below are sql tables 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 ethnicity is asian and year of birth is less than 1850? ### Input: CREATE TABLE prescriptions (
... |
what is the total urine output amount for patient 009-8833? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-8833')) AND intakeoutput.celllabel = 'urine'... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total urine output amount for patient 009-8833? ### Input: CREATE TABLE cost (
costid number,
uniquepid ... |
What is the average in 2010 of the team with a code of (IATA/ICAO) or cra/lrcv? | CREATE TABLE table_67116 (
"Rank" real,
"Airport" text,
"City" text,
"Code (IATA/ICAO)" text,
"2008" real,
"2009" real,
"2010" real
) | SELECT "2010" FROM table_67116 WHERE "Code (IATA/ICAO)" = 'cra/lrcv' | Below are sql tables 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 in 2010 of the team with a code of (IATA/ICAO) or cra/lrcv? ### Input: CREATE TABLE table_67116 (
"R... |
What is the highest week of the game on November 9, 1997? | CREATE TABLE table_name_1 (
week INTEGER,
date VARCHAR
) | SELECT MAX(week) FROM table_name_1 WHERE date = "november 9, 1997" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest week of the game on November 9, 1997? ### Input: CREATE TABLE table_name_1 (
week INTEGER,
date ... |
How many apartment bookings in each year? Show me a bar chart binning booking end date by year, rank in ascending by the Y. | CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_F... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_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: How many apartment bookings in each year? Show me a bar chart binning booking end date by year, rank in ascending by the Y. ... |
What is the largest number of points they had? | CREATE TABLE table_2868 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | SELECT MAX("Points") FROM table_2868 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest number of points they had? ### Input: CREATE TABLE table_2868 (
"Game" real,
"Date" text,
"O... |
Can you show me the requirements for a CS-LSA degree ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_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: Can you show me the requirements for a CS-LSA degree ? ### Input: CREATE TABLE course_prerequisite (
pre_course_id int,
... |
What is the lowest pick for the Buffalo Bills? | CREATE TABLE table_66592 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | SELECT MIN("Pick") FROM table_66592 WHERE "Team" = 'buffalo bills' | Below are sql tables 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 pick for the Buffalo Bills? ### Input: CREATE TABLE table_66592 (
"Pick" real,
"Team" text,
"... |
What is the most straightforward class I can take to satisfy the Core ? | CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' 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 is the most straightforward class I can take to satisfy the Core ? ### Input: CREATE TABLE offering_instructor (
of... |
Which Game has a Record of 27-11-10? | CREATE TABLE table_38452 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | SELECT AVG("Game") FROM table_38452 WHERE "Record" = '27-11-10' | Below are sql tables 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 Game has a Record of 27-11-10? ### Input: CREATE TABLE table_38452 (
"Game" real,
"March" real,
"Opponent"... |
calculate the minimum age of black/cape verdean ethnic background patients who had 8 days of stay in hospital. | 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 MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay = "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: calculate the minimum age of black/cape verdean ethnic background patients who had 8 days of stay in hospital. ### Input: CR... |
What is top speed of a petrol engine at ps (kw; bhp)@5250-6250? | CREATE TABLE table_24181 (
"Model" text,
"Years" text,
"Type/code" text,
"Transmission" text,
"max. power" text,
"Torque" text,
"0-km/h (mph) (sec)" text,
"top speed" text
) | SELECT "top speed" FROM table_24181 WHERE "max. power" = 'PS (kW; bhp)@5250-6250' | Below are sql tables 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 top speed of a petrol engine at ps (kw; bhp)@5250-6250? ### Input: CREATE TABLE table_24181 (
"Model" text,
... |
what is the meaning of restriction ap80 | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
... | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/80' | Below are sql tables 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 meaning of restriction ap80 ### Input: CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
... |
Who is the highest paid player since 2010? | CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots text,
needed text,
votes text,
inducted text,
category text,
needed... | SELECT player_id FROM salary WHERE year >= 2010 ORDER BY salary DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the highest paid player since 2010? ### Input: CREATE TABLE player_award (
player_id text,
award_id text,
... |
which township has his population as 834 ? | CREATE TABLE table_203_459 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
) | SELECT "township" FROM table_203_459 WHERE "population" = 834 | Below are sql tables 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 township has his population as 834 ? ### Input: CREATE TABLE table_203_459 (
id number,
"township" text,
"... |
what were the five procedures that were the most frequent in 2101? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inpute... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2101' GROUP BY procedures_icd.icd9_code) AS t1 ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five procedures that were the most frequent in 2101? ### Input: CREATE TABLE labevents (
row_id number,
... |
Name the record for attendance location of palace of auburn hills 15,210 | CREATE TABLE table_21310 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | SELECT "Record" FROM table_21310 WHERE "Location/Attendance" = 'Palace of Auburn Hills 15,210' | Below are sql tables 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 record for attendance location of palace of auburn hills 15,210 ### Input: CREATE TABLE table_21310 (
"Game" re... |
For those employees who was hired before 2002-06-21, a scatter chart shows the correlation between salary and manager_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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | SELECT SALARY, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, a scatter chart shows the correlation between salary and manager_id . #... |
what was the first measured value of sao2 of patient 013-11660 on 12/27/this year? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE v... | SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-11660')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(v... | Below are sql tables 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 first measured value of sao2 of patient 013-11660 on 12/27/this year? ### Input: CREATE TABLE cost (
costid... |
When did South Melbourne play as the away team? | CREATE TABLE table_33590 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_33590 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: When did South Melbourne play as the away team? ### Input: CREATE TABLE table_33590 (
"Home team" text,
"Home team s... |
What are the original air date(s) for episodes with production code ipea345a? | CREATE TABLE table_2501754_2 (
original_airdate VARCHAR,
prod_code VARCHAR
) | SELECT original_airdate FROM table_2501754_2 WHERE prod_code = "IPEA345A" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the original air date(s) for episodes with production code ipea345a? ### Input: CREATE TABLE table_2501754_2 (
... |
Who wrote 'episode 4'? | CREATE TABLE table_22286 (
"No. overall" real,
"No. in series" real,
"Title" text,
"Director" text,
"Writer" text,
"Original air date" text,
"Production code" real
) | SELECT "Writer" FROM table_22286 WHERE "Title" = 'Episode 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: Who wrote 'episode 4'? ### Input: CREATE TABLE table_22286 (
"No. overall" real,
"No. in series" real,
"Title" t... |
provide the number of patients whose days of hospital stay is greater than 8 and drug name is trazodone? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.drug = "traZODONE" | Below are sql tables 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 days of hospital stay is greater than 8 and drug name is trazodone? ### Input: CREATE T... |
What is Result, when Opponent is Cincinnati Bengals? | CREATE TABLE table_50144 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) | SELECT "Result" FROM table_50144 WHERE "Opponent" = 'cincinnati bengals' | Below are sql tables 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 Result, when Opponent is Cincinnati Bengals? ### Input: CREATE TABLE table_50144 (
"Week" real,
"Date" text,... |
how many patients were administered drug via both eyes and have been admitted on an urgent basis? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "BOTH EYES" | Below are sql tables 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 were administered drug via both eyes and have been admitted on an urgent basis? ### Input: CREATE TABLE pr... |
Which round did the bout against Jonatas Novaes end in? | CREATE TABLE table_68411 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) | SELECT "Round" FROM table_68411 WHERE "Opponent" = 'jonatas novaes' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which round did the bout against Jonatas Novaes end in? ### Input: CREATE TABLE table_68411 (
"Res." text,
"Record" ... |
provide the number of patients whose primary disease is cerebral aneurysm/sda and lab test fluid is urine? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" AND lab.fluid = "Urine" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose primary disease is cerebral aneurysm/sda and lab test fluid is urine? ### Input: CREATE... |
Visualize a bar chart about the distribution of Team_Name and Team_ID , could you rank in ascending by the bar please? | 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_Name, Team_ID FROM basketball_match ORDER BY Team_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: Visualize a bar chart about the distribution of Team_Name and Team_ID , could you rank in ascending by the bar please? ### I... |
what is the five most frequently ordered lab test until 4 years ago for patients whose age is 40s? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY lab.labname) AS t1 WHER... | Below are sql tables 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 five most frequently ordered lab test until 4 years ago for patients whose age is 40s? ### Input: CREATE TABLE i... |
what was the name of procedure that patient 015-96048 were last received until 2104? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND STRFTIME('%y', treatment.treatmenttime) <= '2104... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of procedure that patient 015-96048 were last received until 2104? ### Input: CREATE TABLE allergy (
a... |
what is the name of the oldest map/catalog ? | CREATE TABLE table_204_281 (
id number,
"map or catalog" text,
"creator" text,
"time created" text,
"contets" text,
"links" text
) | SELECT "map or catalog" FROM table_204_281 ORDER BY id LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the oldest map/catalog ? ### Input: CREATE TABLE table_204_281 (
id number,
"map or catalog" tex... |
did any organisms were found in patient 53863's first staph aureus screen microbiology test until 03/2101? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 ti... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53863) AND microbiologyevents.spec_type_desc = 'staph aureus screen' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) <=... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did any organisms were found in patient 53863's first staph aureus screen microbiology test until 03/2101? ### Input: CREATE... |
when was the first time patient 2425 had a lab test, until 35 months ago? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2425) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-35 month') ORDER BY labevents.charttime 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 time patient 2425 had a lab test, until 35 months ago? ### Input: CREATE TABLE diagnoses_icd (
row_id... |
between BOSTON and DENVER i'd like a flight that takes the least amount of stops to get to BOSTON | CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: between BOSTON and DENVER i'd like a flight that takes the least amount of stops to get to BOSTON ### Input: CREATE TABLE re... |
What was the high assist total on May 11? | CREATE TABLE table_11963536_11 (
high_assists VARCHAR,
date VARCHAR
) | SELECT high_assists FROM table_11963536_11 WHERE date = "May 11" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the high assist total on May 11? ### Input: CREATE TABLE table_11963536_11 (
high_assists VARCHAR,
date VAR... |
give me the number of patients whose admission year is less than 2129 and diagnoses icd9 code is 5718? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2129" AND diagnoses.icd9_code = "5718" | Below are sql tables 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 year is less than 2129 and diagnoses icd9 code is 5718? ### Input: CREATE TAB... |
give me a good arabic restaurant in mountain view ? | CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.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: give me a good arabic restaurant in mountain view ? ### Input: CREATE TABLE restaurant (
id int,
name varchar,
f... |
How many lost when goals for is 43 and the position number is higher than 15? | CREATE TABLE table_48814 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | SELECT AVG("Lost") FROM table_48814 WHERE "Goals For" = '43' AND "Position" > '15' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many lost when goals for is 43 and the position number is higher than 15? ### Input: CREATE TABLE table_48814 (
"Pos... |
Show all branch names with the number of members in each branch registered after 2015 with a bar chart, and could you show Name from high to low order? | CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int
)
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
Total_pounds real... | SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID 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: Show all branch names with the number of members in each branch registered after 2015 with a bar chart, and could you show N... |
Sfax has a total ordered number of? | CREATE TABLE table_5170 (
"Name" text,
"Pennant number" text,
"Ordered" real,
"Builder" text,
"Commissioned" text,
"Fate" text
) | SELECT COUNT("Ordered") FROM table_5170 WHERE "Name" = 'sfax' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Sfax has a total ordered number of? ### Input: CREATE TABLE table_5170 (
"Name" text,
"Pennant number" text,
"Or... |
Find the physician who was trained in the most expensive procedure? | CREATE TABLE trained_in (
physician VARCHAR,
treatment VARCHAR
)
CREATE TABLE physician (
name VARCHAR,
employeeid VARCHAR
)
CREATE TABLE procedures (
code VARCHAR,
cost VARCHAR
) | 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 ORDER BY T3.cost 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: Find the physician who was trained in the most expensive procedure? ### Input: CREATE TABLE trained_in (
physician VARCH... |
A bar chart for what are the number of the names of the technicians that are assigned to repair machines with more point values than 70?, and could you sort how many name from low to high order? | CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machin... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the names of the technicians that are assigned to repair machines with more point val... |
What are the total freights in metric tonnes when the total transit passengers is 147791? | CREATE TABLE table_19006 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2007/2008" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight ( Metric Tonnes )" real
) | SELECT "Freight ( Metric Tonnes )" FROM table_19006 WHERE "Transit Passengers" = '147791' | Below are sql tables 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 total freights in metric tonnes when the total transit passengers is 147791? ### Input: CREATE TABLE table_1900... |
How many lecture sections are available for EARTH 148 next semester ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EARTH' AND course.number = 148 AND semester.semester = 'FA' 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: How many lecture sections are available for EARTH 148 next semester ? ### Input: CREATE TABLE course_prerequisite (
pre_... |
Tell me the long title of diagnoses for the patient with patient id 18077. | 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 diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18077" | Below are sql tables 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 long title of diagnoses for the patient with patient id 18077. ### Input: CREATE TABLE demographic (
subject... |
How many total numbers of attendance are there during the game in October 27? | CREATE TABLE table_22057 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | SELECT COUNT("Attendance") FROM table_22057 WHERE "Date" = 'October 27' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many total numbers of attendance are there during the game in October 27? ### Input: CREATE TABLE table_22057 (
"Wee... |
what was patient 86929's last ward identification when they came to the hospital last time? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_i... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86929 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.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: what was patient 86929's last ward identification when they came to the hospital last time? ### Input: CREATE TABLE patients... |
what is the number of patients whose diagnoses short title is ulcer of heel & midfoot and drug type is base? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ulcer of heel & midfoot" AND prescriptions.drug_type = "BASE" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose diagnoses short title is ulcer of heel & midfoot and drug type is base? ### Input: CREA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.