instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Show the race class and number of races in each class with a bar chart, could you show in ascending by the total number?
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the race class and number of races in each class with a bar chart, could you show in ascending by the total number? ###...
how many current patients was there.
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL
Below are sql tables 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 current patients was there. ### Input: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid numbe...
What skip has denmark as the country?
CREATE TABLE table_75429 ( "Country" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
SELECT "Skip" FROM table_75429 WHERE "Country" = 'denmark'
Below are sql tables 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 skip has denmark as the country? ### Input: CREATE TABLE table_75429 ( "Country" text, "Skip" text, "Third"...
Bar chart x axis software platform y axis the total number, sort by the Software_Platform in desc.
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, ...
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY Software_Platform DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis software platform y axis the total number, sort by the Software_Platform in desc. ### Input: CREATE TABLE s...
had patient 030-47098 been treated since 4 years ago in other hospitals with a administration of electrolytes - intravenous procedure?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-47098' 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: had patient 030-47098 been treated since 4 years ago in other hospitals with a administration of electrolytes - intravenous ...
Which song lasts 3:34?
CREATE TABLE table_name_59 ( song VARCHAR, length VARCHAR )
SELECT song FROM table_name_59 WHERE length = "3:34"
Below are sql tables 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 song lasts 3:34? ### Input: CREATE TABLE table_name_59 ( song VARCHAR, length VARCHAR ) ### Response: SELECT s...
How many documents are there of each type. Show bar chart.
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_I...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many documents are there of each type. Show bar chart. ### Input: CREATE TABLE Projects ( Project_ID INTEGER, Pr...
What was the production in 2004-05 for the commodity that produced 1,725 in 2001-02?
CREATE TABLE table_4573 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text )
SELECT "2004-05" FROM table_4573 WHERE "2001-02" = '1,725'
Below are sql tables 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 production in 2004-05 for the commodity that produced 1,725 in 2001-02? ### Input: CREATE TABLE table_4573 ( ...
What United States player holds the place of t8?`
CREATE TABLE table_name_57 ( player VARCHAR, place VARCHAR, country VARCHAR )
SELECT player FROM table_name_57 WHERE place = "t8" AND country = "united states"
Below are sql tables 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 United States player holds the place of t8?` ### Input: CREATE TABLE table_name_57 ( player VARCHAR, place VARC...
A pie chart shows the proportion of All_Road and School_ID.
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_Road, School_ID FROM basketball_match
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A pie chart shows the proportion of All_Road and School_ID. ### Input: CREATE TABLE university ( School_ID int, Scho...
what was the name of the drug, which patient 016-1459 was first prescribed via intraven route 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 diagnosis ( diagn...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459')) AND medication.routeadmin = 'intraven' AND DATETIME(med...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the drug, which patient 016-1459 was first prescribed via intraven route until 4 months ago? ### Input:...
What is the number of patients who were ordered an albumin body fluid lab test and stayed in hospital for more than 13 days?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "13" AND lab.label = "Albumin, Body 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 who were ordered an albumin body fluid lab test and stayed in hospital for more than 13 days?...
what are the FIRST class fares from DALLAS to BALTIMORE
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
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, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_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: what are the FIRST class fares from DALLAS to BALTIMORE ### Input: CREATE TABLE time_interval ( period text, begin_t...
who had the high assists when the game was less than 13 and the score was w 75-66?
CREATE TABLE table_name_41 ( high_assists VARCHAR, game VARCHAR, score VARCHAR )
SELECT high_assists FROM table_name_41 WHERE game < 13 AND score = "w 75-66"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who had the high assists when the game was less than 13 and the score was w 75-66? ### Input: CREATE TABLE table_name_41 ( ...
tell me short title of both diagnoses and procedure for patient with patient id 25167.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "25167"
Below are sql tables 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 short title of both diagnoses and procedure for patient with patient id 25167. ### Input: CREATE TABLE diagnoses ( ...
until 303 days ago, was patient 030-31704's heartrate ever less than 61.0?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalpe...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-31704')) AND vitalperiodic.heartrate < 61.0 AND NOT vitalperiodi...
Below are sql tables 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 303 days ago, was patient 030-31704's heartrate ever less than 61.0? ### Input: CREATE TABLE microlab ( microlabid...
What round had a record of 4-1?
CREATE TABLE table_43819 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text )
SELECT "Round" FROM table_43819 WHERE "Record" = '4-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 round had a record of 4-1? ### Input: CREATE TABLE table_43819 ( "Res." text, "Record" text, "Opponent" tex...
For days had a minimum dew point smaller than any day in zip code 94107, show the total number of such days using a bar chart.
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) GROUP BY date
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For days had a minimum dew point smaller than any day in zip code 94107, show the total number of such days using a bar char...
What is the 1st leg when club is a.c. libertas?
CREATE TABLE table_500 ( "Season" text, "Competition" text, "Round" text, "Club" text, "1st leg" text, "2nd leg" text, "Aggregate" text )
SELECT "1st leg" FROM table_500 WHERE "Club" = 'A.C. Libertas'
Below are sql tables 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 1st leg when club is a.c. libertas? ### Input: CREATE TABLE table_500 ( "Season" text, "Competition" tex...
What is the sum of the pick of the guard position player?
CREATE TABLE table_59350 ( "Player" text, "Round" real, "Pick" real, "Position" text, "NFL Club" text )
SELECT SUM("Pick") FROM table_59350 WHERE "Position" = 'guard'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of the pick of the guard position player? ### Input: CREATE TABLE table_59350 ( "Player" text, "Roun...
What is the average amount of gold medals for a country with more than 12 total medals?
CREATE TABLE table_name_45 ( gold INTEGER, total INTEGER )
SELECT AVG(gold) FROM table_name_45 WHERE total > 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: What is the average amount of gold medals for a country with more than 12 total medals? ### Input: CREATE TABLE table_name_4...
what is the number of patients whose primary disease is coronary artery disease and days of hospital stay is greater than 3?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.days_stay > "3"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose primary disease is coronary artery disease and days of hospital stay is greater than 3?...
provide the number of patients whose days of hospital stay is greater than 13 and drug name is caphosol?
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.days_stay > "13" AND prescriptions.drug = "Caphosol"
Below are sql tables 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 13 and drug name is caphosol? ### Input: CREATE T...
Name the average apps for smederevo
CREATE TABLE table_69722 ( "Season" text, "Team" text, "Country" text, "Division" real, "Apps" real, "Goals" real )
SELECT AVG("Apps") FROM table_69722 WHERE "Team" = 'smederevo'
Below are sql tables 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 average apps for smederevo ### Input: CREATE TABLE table_69722 ( "Season" text, "Team" text, "Country" ...
What's the score at Olympic Stadium Tokyo, Japan?
CREATE TABLE table_63868 ( "Date" text, "Venue" text, "Score" text, "Comp" text, "Report" text )
SELECT "Score" FROM table_63868 WHERE "Venue" = 'olympic stadium tokyo, japan'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the score at Olympic Stadium Tokyo, Japan? ### Input: CREATE TABLE table_63868 ( "Date" text, "Venue" text, ...
When during the week will 683 be offered ?
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 course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
Below are sql tables 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 during the week will 683 be offered ? ### Input: CREATE TABLE student_record ( student_id int, course_id int, ...
Show the number of teams in elimination in a bar chart, I want to show in asc by the X-axis.
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY Team
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of teams in elimination in a bar chart, I want to show in asc by the X-axis. ### Input: CREATE TABLE wrestle...
Return a histogram on what is average age of male for different job title?, sort bar in asc order.
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on what is average age of male for different job title?, sort bar in asc order. ### Input: CREATE TABLE P...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id, and display in desc by the bar please.
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 job_history ( EMPLO...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the average of em...
how many days have elapsed since the last time patient 022-187132 had an intake of po reg diet on the current icu visit?
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
Below are sql tables 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 have elapsed since the last time patient 022-187132 had an intake of po reg diet on the current icu visit? ###...
What was the score against san antonio?
CREATE TABLE table_72456 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Score" FROM table_72456 WHERE "Team" = 'San Antonio'
Below are sql tables 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 against san antonio? ### Input: CREATE TABLE table_72456 ( "Game" real, "Date" text, "Team" t...
What is Score, when Attendance is 2,444?
CREATE TABLE table_name_33 ( score VARCHAR, attendance VARCHAR )
SELECT score FROM table_name_33 WHERE attendance = "2,444"
Below are sql tables 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 Score, when Attendance is 2,444? ### Input: CREATE TABLE table_name_33 ( score VARCHAR, attendance VARCHAR )...
how many patients were admitted?
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL
Below are sql tables 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 admitted? ### Input: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id n...
Bar chart x axis carrier y axis the number of carrier, and rank by the Y in ascending.
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY COUNT(Carrier)
Below are sql tables 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 carrier y axis the number of carrier, and rank by the Y in ascending. ### Input: CREATE TABLE phone_market ...
Which series has a season prior to 2009?
CREATE TABLE table_9256 ( "Season" real, "Conference" text, "Champion" text, "Format" text, "Series" text, "Runner-Up" text )
SELECT "Series" FROM table_9256 WHERE "Season" < '2009'
Below are sql tables 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 series has a season prior to 2009? ### Input: CREATE TABLE table_9256 ( "Season" real, "Conference" text, ...
did patient 30826 receive any tests for free calcium in this month?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id n...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'free calcium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_...
Below are sql tables 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 patient 30826 receive any tests for free calcium in this month? ### Input: CREATE TABLE d_icd_procedures ( row_id nu...
Are there upper elective classes next semester that do not meet on Friday ?
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ...
Below are sql tables 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 upper elective classes next semester that do not meet on Friday ? ### Input: CREATE TABLE program_course ( pro...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about department_id over the email , show by the EMAIL in descending.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varch...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a...
provide the number of patients whose insurance is private and age is less than 89?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.age < "89"
Below are sql tables 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 insurance is private and age is less than 89? ### Input: CREATE TABLE diagnoses ( s...
Give me the best restaurant in san francisco for french food ?
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 = 'san francisco' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM location AS LOCATIONalias1, restaurant AS RESTAURANTalias1 W...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the best restaurant in san francisco for french food ? ### Input: CREATE TABLE restaurant ( id int, name var...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time by a bar chart, and list Y-axis from high to low order.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
what is the daily average amount of magnesium patient 23070 has in this year?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_i...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(C...
Below are sql tables 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 daily average amount of magnesium patient 23070 has in this year? ### Input: CREATE TABLE procedures_icd ( r...
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, sort from high to low by the x-axis.
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, sort from high ...
What was the attendance when they played at Dallas Cowboys?
CREATE TABLE table_name_69 ( attendance VARCHAR, opponent VARCHAR )
SELECT attendance FROM table_name_69 WHERE opponent = "at dallas cowboys"
Below are sql tables 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 when they played at Dallas Cowboys? ### Input: CREATE TABLE table_name_69 ( attendance 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 job_id and manager_id , list by the Y from high to low.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart ab...
how many patients admitted to the hospital before year 2180 had the diagnosis icd9 code 3671?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2180" AND diagnoses.icd9_code = "3671"
Below are sql tables 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 admitted to the hospital before year 2180 had the diagnosis icd9 code 3671? ### Input: CREATE TABLE diagno...
Which courses can I take which provide 13 credits ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
SELECT DISTINCT name, number FROM course WHERE credits = 13 AND department = 'EECS'
Below are sql tables 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 courses can I take which provide 13 credits ? ### Input: CREATE TABLE requirement ( requirement_id int, requir...
how many patients of white-russian ethnicity were suggested the drug route ou?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "OU"
Below are sql tables 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 of white-russian ethnicity were suggested the drug route ou? ### Input: CREATE TABLE diagnoses ( subje...
body mass index ( bmi ) between 18 and 32 kilograms per square meter ( kg / m^2 )
CREATE TABLE table_train_87 ( "id" int, "gender" string, "mini_mental_state_examination_mmse" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
SELECT * FROM table_train_87 WHERE body_mass_index_bmi > 18 AND body_mass_index_bmi < 32
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: body mass index ( bmi ) between 18 and 32 kilograms per square meter ( kg / m^2 ) ### Input: CREATE TABLE table_train_87 ( ...
What is the production code for Episode 153 in the series?
CREATE TABLE table_23097214_1 ( production_code INTEGER, series__number VARCHAR )
SELECT MIN(production_code) FROM table_23097214_1 WHERE series__number = 153
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the production code for Episode 153 in the series? ### Input: CREATE TABLE table_23097214_1 ( production_code IN...
count the number of patients who had had a oth cerv fusion ant/ant during the last year.
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth cerv fusion ant/ant') AND DATETIME(procedures_ic...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who had had a oth cerv fusion ant/ant during the last year. ### Input: CREATE TABLE d_icd_diagn...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, display in ascending by the y-axis.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and t...
Name the date for week 9
CREATE TABLE table_20178 ( "Week" real, "Date" text, "Result" text, "Record" text, "Opponent" text, "Points For" real, "Points Against" real, "First Downs" real, "Attendance" real )
SELECT "Date" FROM table_20178 WHERE "Week" = '9'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the date for week 9 ### Input: CREATE TABLE table_20178 ( "Week" real, "Date" text, "Result" text, "Rec...
what was the last hospital discharge time of patient 75170 until 2104.
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( row_id number, s...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 75170 AND STRFTIME('%y', admissions.dischtime) <= '2104' ORDER BY admissions.dischtime DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last hospital discharge time of patient 75170 until 2104. ### Input: CREATE TABLE d_items ( row_id number, ...
provide the number of patients whose primary disease is congestive heart failure and drug route is pb?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND prescriptions.route = "PB"
Below are sql tables 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 congestive heart failure and drug route is pb? ### Input: CREATE TAB...
Show the number of courses each instructor taught with a bar chart grouping by course code.
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE DE...
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of courses each instructor taught with a bar chart grouping by course code. ### Input: CREATE TABLE STUDENT ...
what is the number of patients whose primary disease is abdominal pain and age is less than 59?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "59"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose primary disease is abdominal pain and age is less than 59? ### Input: CREATE TABLE proc...
Find the number of medications prescribed for each brand.
CREATE TABLE nurse ( employeeid number, name text, position text, registered boolean, ssn number ) CREATE TABLE appointment ( appointmentid number, patient number, prepnurse number, physician number, start time, end time, examinationroom text ) CREATE TABLE on_call ( ...
SELECT COUNT(*), T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Below are sql tables 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 medications prescribed for each brand. ### Input: CREATE TABLE nurse ( employeeid number, name te...
Which Name has a Years Played of 2004 2008, and a Date and Opponent of 2/17/07 vs. purdue?
CREATE TABLE table_48077 ( "Total Points" real, "Name" text, "Career Games" text, "Position" text, "Years Played" text, "Scored 1,500 Points" text, "Date and Opponent" text )
SELECT "Name" FROM table_48077 WHERE "Years Played" = '2004–2008' AND "Date and Opponent" = '2/17/07 vs. purdue'
Below are sql tables 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 Name has a Years Played of 2004 2008, and a Date and Opponent of 2/17/07 vs. purdue? ### Input: CREATE TABLE table_480...
How many students are from each city, and which cities have more than one cities Plot them as bar chart, and display by the the total number in desc.
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 Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, ...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many students are from each city, and which cities have more than one cities Plot them as bar chart, and display by the ...
what is the number of drugs patient 76332 has been prescribed 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 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: what is the number of drugs patient 76332 has been prescribed in this year? ### Input: CREATE TABLE transfers ( row_id n...
what drug is patient 006-245995 allergic to in 07/last year?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-245995')) AND DATETIME(allergy.allergytime, 'start of year') = 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: what drug is patient 006-245995 allergic to in 07/last year? ### Input: CREATE TABLE microlab ( microlabid number, p...
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the sum of revenue , and group by attribute headquarter, I want to display in ascending by the x 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 Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER 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, visualize a bar chart about the distribution of headqua...
which month were the most championships played ?
CREATE TABLE table_203_60 ( id number, "outcome" text, "no." number, "date" text, "championship" text, "surface" text, "opponent in the final" text, "score in the final" text )
SELECT "date" FROM table_203_60 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which month were the most championships played ? ### Input: CREATE TABLE table_203_60 ( id number, "outcome" text, ...
how many patients whose admission type is newborn and year of birth is less than 2197?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2197"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is newborn and year of birth is less than 2197? ### Input: CREATE TABLE diagnoses ( ...
Which date has a Record of 4-5?
CREATE TABLE table_71037 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Date" FROM table_71037 WHERE "Record" = '4-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: Which date has a Record of 4-5? ### Input: CREATE TABLE table_71037 ( "Date" text, "Opponent" text, "Score" text...
give me the top four most common diagnostics during the last year?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id ...
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, 'start of year') = DATETIME(CURRENT_TIME(), 'start of 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: give me the top four most common diagnostics during the last year? ### Input: CREATE TABLE d_icd_procedures ( row_id num...
how many patients were admitted in the emergency room for the procedure titled percutan aspiration gb?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Percutan aspiration gb"
Below are sql tables 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 admitted in the emergency room for the procedure titled percutan aspiration gb? ### Input: CREATE TAB...
Show how many carrriers for each shops in a bar chart, and list in descending by the y-axis please.
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
SELECT Shop_Name, COUNT(Shop_Name) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Shop_Name ORDER BY COUNT(Shop_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 how many carrriers for each shops in a bar chart, and list in descending by the y-axis please. ### Input: CREATE TABLE ...
Who is the race caller when jim mckay and al michaels were s hosts in the year 1987?
CREATE TABLE table_25080 ( "Year" real, "Network" text, "Race caller" text, "s Host" text, "s Analyst" text, "Reporters" text, "Trophy presentation" text )
SELECT "Race caller" FROM table_25080 WHERE "s Host" = 'Jim McKay and Al Michaels' AND "Year" = '1987'
Below are sql tables 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 race caller when jim mckay and al michaels were s hosts in the year 1987? ### Input: CREATE TABLE table_25080 ( ...
What Date did the Home team play in essendon?
CREATE TABLE table_name_48 ( date VARCHAR, home_team VARCHAR )
SELECT date FROM table_name_48 WHERE home_team = "essendon"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Date did the Home team play in essendon? ### Input: CREATE TABLE table_name_48 ( date VARCHAR, home_team VARCHA...
what are the three most frequently ordered medications until 2 years ago?
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 text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the three most frequently ordered medications until 2 years ago? ### Input: CREATE TABLE d_icd_diagnoses ( row_...
What opponent has euro '84 qualifying as the type and split as the city?
CREATE TABLE table_name_54 ( opponent VARCHAR, type_of_game VARCHAR, city VARCHAR )
SELECT opponent FROM table_name_54 WHERE type_of_game = "euro '84 qualifying" AND city = "split"
Below are sql tables 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 opponent has euro '84 qualifying as the type and split as the city? ### Input: CREATE TABLE table_name_54 ( opponen...
What are the names of all the playlists, and count them by a bar chart, and could you rank in descending by the the number of name?
CREATE TABLE tracks ( id INTEGER, name VARCHAR(200), album_id INTEGER, media_type_id INTEGER, genre_id INTEGER, composer VARCHAR(220), milliseconds INTEGER, bytes INTEGER, unit_price NUMERIC(10,2) ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name V...
SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY COUNT(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: What are the names of all the playlists, and count them by a bar chart, and could you rank in descending by the the number o...
Which money is the highest one that has a To par of 1, and a Score of 73-70-73-71=287?
CREATE TABLE table_8917 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
SELECT MAX("Money ( $ )") FROM table_8917 WHERE "To par" = '–1' AND "Score" = '73-70-73-71=287'
Below are sql tables 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 money is the highest one that has a To par of 1, and a Score of 73-70-73-71=287? ### Input: CREATE TABLE table_8917 ( ...
Give me a bar chart to show the names and revenue of the company that earns the highest revenue in each headquarter city, list in asc 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 Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue)
Below are sql tables 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 names and revenue of the company that earns the highest revenue in each headquarter city, li...
what is the last care unit of patient 74159 in this year?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid numbe...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime DESC LIM...
Below are sql tables 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 care unit of patient 74159 in this year? ### Input: CREATE TABLE microbiologyevents ( row_id number, ...
What is the voter registration that has a BYut of 48.2?
CREATE TABLE table_51995 ( "Region" text, "Voter registration" real, "Voter turnout" real, "BYuT" real, "OU-PSD" real )
SELECT COUNT("Voter registration") FROM table_51995 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_51995 ( "Region" text, "Voter ...
count how many times patient 25523 has been to the intensive care unit in 2103.
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate ti...
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523) AND STRFTIME('%y', icustays.intime) = '2103'
Below are sql tables 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 how many times patient 25523 has been to the intensive care unit in 2103. ### Input: CREATE TABLE patients ( row_i...
what drugs are being added to patient 015-23047's today compared to those yesterday?
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 medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '015-23047') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
Below are sql tables 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 drugs are being added to patient 015-23047's today compared to those yesterday? ### Input: CREATE TABLE treatment ( ...
give me the number of patients whose age is less than 58 and drug code is maal30l?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "58" AND prescriptions.formulary_drug_cd = "MAAL30L"
Below are sql tables 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 age is less than 58 and drug code is maal30l? ### Input: CREATE TABLE diagnoses ( s...
Name the mens singles for 1989
CREATE TABLE table_19665 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
SELECT "Mens singles" FROM table_19665 WHERE "Year" = '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: Name the mens singles for 1989 ### Input: CREATE TABLE table_19665 ( "Year" real, "Mens singles" text, "Womens s...
how much different is patient 006-195541's weight last measured on the last hospital visit compared to the value first measured on the last hospital visit?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195541' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS 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: how much different is patient 006-195541's weight last measured on the last hospital visit compared to the value first measu...
when did patient 15209 take his d5w for the first time on 09/21/this year?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT 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 = 15209)) 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 did patient 15209 take his d5w for the first time on 09/21/this year? ### Input: CREATE TABLE diagnoses_icd ( row_i...
For races with an average speed of 113.835 mph, what are the winning race times?
CREATE TABLE table_17801022_1 ( race_time VARCHAR, average_speed__mph_ VARCHAR )
SELECT race_time FROM table_17801022_1 WHERE average_speed__mph_ = "113.835"
Below are sql tables 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 races with an average speed of 113.835 mph, what are the winning race times? ### Input: CREATE TABLE table_17801022_1 ( ...
how many have an area of at least 20 km ?
CREATE TABLE table_204_851 ( id number, "serial number" number, "river" text, "name" text, "area (km2)" number, "district" text, "co-ordinate" text, "altitude (m)" number )
SELECT COUNT(*) FROM table_204_851 WHERE "area (km2)" >= 20
Below are sql tables 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 have an area of at least 20 km ? ### Input: CREATE TABLE table_204_851 ( id number, "serial number" number,...
List all the services in the alphabetical order.
CREATE TABLE first_notification_of_loss ( fnol_id number, customer_id number, policy_id number, service_id number ) CREATE TABLE services ( service_id number, service_name text ) CREATE TABLE available_policies ( policy_id number, policy_type_code text, customer_phone text ) CREAT...
SELECT service_name FROM services ORDER BY service_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all the services in the alphabetical order. ### Input: CREATE TABLE first_notification_of_loss ( fnol_id number, ...
how many patients in this year had a bone marrow microbiology test taken?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'bone marrow' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients in this year had a bone marrow microbiology test taken? ### Input: CREATE TABLE inputevents_cv ( row_i...
Which date has a Opponent of juan m naco, and a Score of 6 2, 4 6, 7 6 (7 3)?
CREATE TABLE table_name_60 ( date VARCHAR, opponent VARCHAR, score VARCHAR )
SELECT date FROM table_name_60 WHERE opponent = "juan mónaco" AND score = "6–2, 4–6, 7–6 (7–3)"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which date has a Opponent of juan m naco, and a Score of 6 2, 4 6, 7 6 (7 3)? ### Input: CREATE TABLE table_name_60 ( da...
when did patient 70234 receive the first microbiological blood culture test since 02/2105?
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_icd_procedures ( row_id number, icd9_code text, s...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70234) AND microbiologyevents.spec_type_desc = 'blood culture' AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2105-02' ORDER BY microbiologyev...
Below are sql tables 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 70234 receive the first microbiological blood culture test since 02/2105? ### Input: CREATE TABLE icustays ...
subjects should have fpg in the range of 6 to 11 mmol / l at screening and hba1c less than 10 % ( hba1c value according to international dcct standard ) .
CREATE TABLE table_train_280 ( "id" int, "fpg" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "hba1c" float, "body_mass_index_bmi" float, "NOUSE" float )
SELECT * FROM table_train_280 WHERE fpg >= 6 AND fpg <= 11 AND hemoglobin_a1c_hba1c < 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: subjects should have fpg in the range of 6 to 11 mmol / l at screening and hba1c less than 10 % ( hba1c value according to i...
When using a .375 Remington Ultra Magnum, what is the muzzle velocity?
CREATE TABLE table_20466 ( "Cartridge" text, "Bullet weight" text, "Muzzle velocity" text, "Muzzle energy" text, "Source" text )
SELECT "Muzzle velocity" FROM table_20466 WHERE "Cartridge" = '.375 Remington Ultra Magnum'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When using a .375 Remington Ultra Magnum, what is the muzzle velocity? ### Input: CREATE TABLE table_20466 ( "Cartridge"...
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the job_id , and group by attribute job_id by a bar chart.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT JOB_ID, AVG(EMPLOYEE_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 average of employee_id over the job_id...
how many countries have at least one gold medal ?
CREATE TABLE table_203_608 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT("nation") FROM table_203_608 WHERE "gold" >= 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 countries have at least one gold medal ? ### Input: CREATE TABLE table_203_608 ( id number, "rank" number, ...
Show the names of journalists and the number of events they reported in a bar chart.
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names of journalists and the number of events they reported in a bar chart. ### Input: CREATE TABLE event ( Eve...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and department_id , and visualize them by a bar chart, and rank by the y axis from high to low please.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and depar...
A bar chart about what are the nationalities and their average ages of journalists?
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality
Below are sql tables 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 about what are the nationalities and their average ages of journalists? ### Input: CREATE TABLE event ( Even...
what was the average sao2 for patient 027-211129.
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT AVG(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-211129')) AND NOT vitalperiodic.sao2 IS NULL
Below are sql tables 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 sao2 for patient 027-211129. ### Input: CREATE TABLE treatment ( treatmentid number, patientuni...
first flights from PITTSBURGH to ATLANTA on a THURSDAY
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code 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: first flights from PITTSBURGH to ATLANTA on a THURSDAY ### Input: CREATE TABLE flight ( aircraft_code_sequence text, ...
What was the competition in 2003?
CREATE TABLE table_name_43 ( competition VARCHAR, year VARCHAR )
SELECT competition FROM table_name_43 WHERE year = 2003
Below are sql tables 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 competition in 2003? ### Input: CREATE TABLE table_name_43 ( competition VARCHAR, year VARCHAR ) ### Re...