instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
what is the yearly maximum output (ml)-nephrostomy right 10 fr. output that patient 015-16479 has had since 32 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 allergy ( allergy...
SELECT MAX(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 = '015-16479')) AND intakeoutput.celllabel = 'outpu...
Below are sql tables 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 yearly maximum output (ml)-nephrostomy right 10 fr. output that patient 015-16479 has had since 32 months ago? #...
Favorite questions asked since 1 Jan 2013.
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TA...
SELECT Id AS "post_link", CreationDate, FavoriteCount FROM Posts WHERE PostTypeId = 1 AND TIME_TO_STR(CreationDate, '%Y') >= 2013 AND FavoriteCount >= 25 ORDER BY CreationDate 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: Favorite questions asked since 1 Jan 2013. ### Input: CREATE TABLE PostNotices ( Id number, PostId number, PostN...
where is a good arabic 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: where is a good arabic in mountain view ? ### Input: CREATE TABLE restaurant ( id int, name varchar, food_type v...
give me the number of patients whose gender is m and primary disease is guillain barre syndrome?
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.gender = "M" AND demographic.diagnosis = "GUILLAIN BARRE SYNDROME"
Below are sql tables 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 gender is m and primary disease is guillain barre syndrome? ### Input: CREATE TABLE pro...
all right give me the flight times in the morning on 9 20 from PITTSBURGH to SAN FRANCISCO
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 20 AND date_day.month_number = 9 AND date_day.year = 1991 AND days.day_nam...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: all right give me the flight times in the morning on 9 20 from PITTSBURGH to SAN FRANCISCO ### Input: CREATE TABLE equipment...
How many of the patients with aortic valve insuffiency/aortic valve replacement /sda as their primary disease were born before the year 2071?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.dob_year < "2071"
Below are sql tables 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 of the patients with aortic valve insuffiency/aortic valve replacement /sda as their primary disease were born befo...
Create a bar chart showing the total number across bedtype, show by the total number in desc.
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType 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: Create a bar chart showing the total number across bedtype, show by the total number in desc. ### Input: CREATE TABLE Rooms ...
Which team did they play on September 19?
CREATE TABLE table_name_66 ( opponent VARCHAR, date VARCHAR )
SELECT opponent FROM table_name_66 WHERE date = "september 19"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team did they play on September 19? ### Input: CREATE TABLE table_name_66 ( opponent VARCHAR, date VARCHAR ) #...
just give me the top three most common diagnosis since 3 years ago?
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) 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: just give me the top three most common diagnosis since 3 years ago? ### Input: CREATE TABLE cost ( costid number, un...
Which Winter courses are only offered then ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EECS' AND semester.semester = 'Winter' AND (SELECT COUNT(DISTINCT SEMESTE...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Winter courses are only offered then ? ### Input: CREATE TABLE instructor ( instructor_id int, name varchar, ...
When the game was played at the Venue of Lake Oval, what was the home team score?
CREATE TABLE table_name_58 ( home_team VARCHAR, venue VARCHAR )
SELECT home_team AS score FROM table_name_58 WHERE venue = "lake oval"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the game was played at the Venue of Lake Oval, what was the home team score? ### Input: CREATE TABLE table_name_58 ( ...
Which home team was playing on January 13?
CREATE TABLE table_name_87 ( home VARCHAR, date VARCHAR )
SELECT home FROM table_name_87 WHERE date = "january 13"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which home team was playing on January 13? ### Input: CREATE TABLE table_name_87 ( home VARCHAR, date VARCHAR ) ### ...
What is the production code that had 24.8 million u.s. viewers?
CREATE TABLE table_27713890_1 ( production_code INTEGER, us_viewers__millions_ VARCHAR )
SELECT MAX(production_code) FROM table_27713890_1 WHERE us_viewers__millions_ = "24.8"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the production code that had 24.8 million u.s. viewers? ### Input: CREATE TABLE table_27713890_1 ( production_co...
count the number of patients whose primary disease is left internal jugular vein thrombosis;left arm edema and admission year is less than 2148?
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 WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.admityear < "2148"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose primary disease is left internal jugular vein thrombosis;left arm edema and admission yea...
provide the number of patients whose admission type is elective and admission year is less than 2105?
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.admission_type = "ELECTIVE" AND demographic.admityear < "2105"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission type is elective and admission year is less than 2105? ### Input: CREATE TABL...
among patients diagnosed with esophageal varices in diseases classified elsewhere, with bleeding, how many of them belonged to white ethnic origin?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Esophageal varices in diseases classified elsewhere, with bleeding"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients diagnosed with esophageal varices in diseases classified elsewhere, with bleeding, how many of them belonged ...
display flights from DALLAS to ATLANTA which depart between 1400 and 1800
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fligh...
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 ((flight.departure_time <= 1800 AND flight.departure_time >= 1400) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight...
Below are sql tables 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 flights from DALLAS to ATLANTA which depart between 1400 and 1800 ### Input: CREATE TABLE airline ( airline_code...
Which team played their first leg at home with an aggregate score of 3-4?
CREATE TABLE table_name_70 ( home__1st_leg_ VARCHAR, aggregate VARCHAR )
SELECT home__1st_leg_ FROM table_name_70 WHERE aggregate = "3-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: Which team played their first leg at home with an aggregate score of 3-4? ### Input: CREATE TABLE table_name_70 ( home__...
What is the average rating of songs for each language Plot them as bar chart, I want to sort languages in ascending order.
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating nu...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages
Below are sql tables 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 rating of songs for each language Plot them as bar chart, I want to sort languages in ascending order. #...
how many patients whose drug route is pr?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PR"
Below are sql tables 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 drug route is pr? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, ic...
What is the Date of the game with a Record of 2 3 1?
CREATE TABLE table_60377 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
SELECT "Date" FROM table_60377 WHERE "Record" = '2–3–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 Date of the game with a Record of 2 3 1? ### Input: CREATE TABLE table_60377 ( "Week" real, "Date" text,...
Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14
CREATE TABLE table_name_95 ( rider VARCHAR, grid VARCHAR, laps VARCHAR, manufacturer VARCHAR )
SELECT rider FROM table_name_95 WHERE laps > 23 AND manufacturer = "aprilia" AND grid = 14
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14 ### Input: CREATE TABLE table_name_95 ( r...
Which venue has a Result of 1 2?
CREATE TABLE table_52484 ( "Date" text, "Venue" text, "Result" text, "Scored" real, "Competition" text )
SELECT "Venue" FROM table_52484 WHERE "Result" = '1–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: Which venue has a Result of 1 2? ### Input: CREATE TABLE table_52484 ( "Date" text, "Venue" text, "Result" text,...
What is the mean number of wins for the norton team in 1966, when there are 8 points?
CREATE TABLE table_35458 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
SELECT AVG("Wins") FROM table_35458 WHERE "Team" = 'norton' AND "Year" = '1966' AND "Points" = '8'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mean number of wins for the norton team in 1966, when there are 8 points? ### Input: CREATE TABLE table_35458 ( ...
Count the hometown by hometown, display x axis in descending order.
CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text,...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY Hometown 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: Count the hometown by hometown, display x axis in descending order. ### Input: CREATE TABLE member ( Member_ID int, ...
the previous year, what are the top five most frequently taken specimens for patients within 2 months after receiving ins drug-elut coronry st?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subj...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: the previous year, what are the top five most frequently taken specimens for patients within 2 months after receiving ins dr...
on the first intensive care unit visit, when was the last time that patient 021-198501 had a output y (ml)-chest tube y - a #1 right lateral b #4 left lateral output?
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 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 = '021-198501') AND NOT patient.unitdischargetime IS NUL...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on the first intensive care unit visit, when was the last time that patient 021-198501 had a output y (ml)-chest tube y - a ...
Scatter plot to show gender on x axis and the total number on y axis.
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
SELECT gender, COUNT(*) FROM Customers GROUP BY gender
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Scatter plot to show gender on x axis and the total number on y axis. ### Input: CREATE TABLE Invoice_Line_Items ( order...
what flights do you have from BALTIMORE to SAN FRANCISCO
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ...
Below are sql tables 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 flights do you have from BALTIMORE to SAN FRANCISCO ### Input: CREATE TABLE fare_basis ( fare_basis_code text, ...
select count(*) from posts.
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, C...
SELECT COUNT(*) FROM Users
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: select count(*) from posts. ### Input: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPos...
Bar chart x axis nationality y axis the total number, could you list in ascending by the y axis?
CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality 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: Bar chart x axis nationality y axis the total number, could you list in ascending by the y axis? ### Input: CREATE TABLE par...
give me the number of patients whose ethnicity is hispanic or latino and days of hospital stay is greater than 17?
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "17"
Below are sql tables 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 ethnicity is hispanic or latino and days of hospital stay is greater than 17? ### Input...
What's the Time/Retired of 80 laps with a Grid larger than 2?
CREATE TABLE table_57729 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Time/Retired" FROM table_57729 WHERE "Laps" = '80' AND "Grid" > '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's the Time/Retired of 80 laps with a Grid larger than 2? ### Input: CREATE TABLE table_57729 ( "Driver" text, "...
What class is easier if the choice is between EECS 555 and EECS 651 ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 555 OR course.number = 651) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What class is easier if the choice is between EECS 555 and EECS 651 ? ### Input: CREATE TABLE gsi ( course_offering_id i...
In the game with an away team score of 16.10 (106), what is the home team score?
CREATE TABLE table_10385 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team score" FROM table_10385 WHERE "Away team score" = '16.10 (106)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game with an away team score of 16.10 (106), what is the home team score? ### Input: CREATE TABLE table_10385 ( "...
What is every original air date for the number in season of 7?
CREATE TABLE table_26748314_1 ( original_air_date VARCHAR, no_in_season VARCHAR )
SELECT original_air_date FROM table_26748314_1 WHERE no_in_season = 7
Below are sql tables 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 every original air date for the number in season of 7? ### Input: CREATE TABLE table_26748314_1 ( original_air_d...
what is the drug that in the last month patient 11362 has been prescribed two or more times?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-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 drug that in the last month patient 11362 has been prescribed two or more times? ### Input: CREATE TABLE inputev...
what procedure did patient 028-22327 receive the last time since 5 years ago.
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 cost ( costid number, ...
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 = '028-22327')) AND DATETIME(treatment.treatmenttime) >= DATETIME(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: what procedure did patient 028-22327 receive the last time since 5 years ago. ### Input: CREATE TABLE microlab ( microla...
Show me about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home in a bar chart, and show Y-axis in descending order.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_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: Show me about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home in a bar chart, and show Y-axis i...
How many games were held on March 12?
CREATE TABLE table_29787 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT COUNT("Game") FROM table_29787 WHERE "Date" = 'March 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: How many games were held on March 12? ### Input: CREATE TABLE table_29787 ( "Game" real, "Date" text, "Team" tex...
Who is the opponent on May 7?
CREATE TABLE table_56815 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
SELECT "Opponent" FROM table_56815 WHERE "Date" = 'may 7'
Below are sql tables 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 opponent on May 7? ### Input: CREATE TABLE table_56815 ( "Date" text, "Opponent" text, "Score" text, ...
A bar chart shows the venue for each workshop, sort how many venue in desc order.
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text )
SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY COUNT(Venue) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the venue for each workshop, sort how many venue in desc order. ### Input: CREATE TABLE submission ( S...
list datasets for video segmentation
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numc...
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'video segmentation' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list datasets for video segmentation ### Input: CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TAB...
where was the last game of the season held ?
CREATE TABLE table_204_282 ( id number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text, "#" number )
SELECT "venue" FROM table_204_282 ORDER BY "date" 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: where was the last game of the season held ? ### Input: CREATE TABLE table_204_282 ( id number, "date" text, "ve...
Which MCDB classes don 't meet on Friday ?
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, ins...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'MCDB' AND semester.semester = 'WN' AND 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: Which MCDB classes don 't meet on Friday ? ### Input: CREATE TABLE program_requirement ( program_id int, category va...
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by time, list in descending by the y-axis.
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 ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) 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 who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of man...
What is the Home team of tie no 2?
CREATE TABLE table_name_36 ( home_team VARCHAR, tie_no VARCHAR )
SELECT home_team FROM table_name_36 WHERE tie_no = "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 Home team of tie no 2? ### Input: CREATE TABLE table_name_36 ( home_team VARCHAR, tie_no VARCHAR ) ### R...
provide the number of patients whose ethnicity is asian and lab test name is gentamicin?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "ASIAN" AND lab.label = "Gentamicin"
Below are sql tables 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 ethnicity is asian and lab test name is gentamicin? ### Input: CREATE TABLE lab ( s...
What was the release date of the feature with a production number of 1018, BR 1352?
CREATE TABLE table_name_14 ( release_date VARCHAR, production_number VARCHAR )
SELECT release_date FROM table_name_14 WHERE production_number = "1018, br 1352"
Below are sql tables 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 release date of the feature with a production number of 1018, BR 1352? ### Input: CREATE TABLE table_name_14 ( ...
among patients in the 40s until 2103 what were the top four most frequent diagnoses?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ) ...
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 diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients in the 40s until 2103 what were the top four most frequent diagnoses? ### Input: CREATE TABLE d_icd_procedure...
what is the highest laps when the grid is 1?
CREATE TABLE table_57142 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT MAX("Laps") FROM table_57142 WHERE "Grid" = '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 highest laps when the grid is 1? ### Input: CREATE TABLE table_57142 ( "Driver" text, "Constructor" text...
What is the lowest 2013 population estimate of the province with a 23.7 percentage?
CREATE TABLE table_name_57 ( population_estimate__2013_ INTEGER, percentage VARCHAR )
SELECT MIN(population_estimate__2013_) FROM table_name_57 WHERE percentage = 23.7
Below are sql tables 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 2013 population estimate of the province with a 23.7 percentage? ### Input: CREATE TABLE table_name_57 ( ...
In the game where Collingwood is the home team what is the score of the away team?
CREATE TABLE table_55560 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_55560 WHERE "Home team" = 'collingwood'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game where Collingwood is the home team what is the score of the away team? ### Input: CREATE TABLE table_55560 ( ...
give me the flights for AA from DALLAS to SAN FRANCISCO
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_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: give me the flights for AA from DALLAS to SAN FRANCISCO ### Input: CREATE TABLE fare_basis ( fare_basis_code text, b...
what is lab test name and lab test category of subject id 3343?
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 lab.label, lab."CATEGORY" FROM lab WHERE lab.subject_id = "3343"
Below are sql tables 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 lab test name and lab test category of subject id 3343? ### Input: CREATE TABLE diagnoses ( subject_id text, ...
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of commission_pct over hire_date
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the c...
since 12/2104, what was the daily minimum value of the pt of patient 31854?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND STRFTIME('%y-%m', labevents.charttime) >= '2104-12' GROUP BY STRFT...
Below are sql tables 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 12/2104, what was the daily minimum value of the pt of patient 31854? ### Input: CREATE TABLE labevents ( row_id n...
A bar chart for returning the number of the date of birth for all the guests with gender code 'Male', and show Y in descending order.
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 Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_star...
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for returning the number of the date of birth for all the guests with gender code 'Male', and show Y in descendi...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, list total number of manager id in ascending order please.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(MANAGER_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, visualize a bar chart about the distribution of job_id and the sum of m...
what are the four most frequent intakes in 2100?
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_i...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2100' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequent intakes in 2100? ### Input: CREATE TABLE prescriptions ( row_id number, subject_id n...
what was the top five most frequent drugs that patients were prescribed during the same hospital encounter after having been prescribed sodium bicarb?
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 admissions ( row_id number, subject_id number, hadm...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'sodium bicarb') AS t1 JOIN (SELECT admissions...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the top five most frequent drugs that patients were prescribed during the same hospital encounter after having been...
Show me about the distribution of Team_Name and ACC_Percent in a bar chart, and could you rank Y-axis in ascending order?
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
Below are sql tables 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 Team_Name and ACC_Percent in a bar chart, and could you rank Y-axis in ascending order? ##...
what is gender of subject id 6983?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.gender FROM demographic WHERE demographic.subject_id = "6983"
Below are sql tables 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 gender of subject id 6983? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code...
For week of top 9, what were the results?
CREATE TABLE table_25266 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
SELECT "Result" FROM table_25266 WHERE "Week #" = 'Top 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: For week of top 9, what were the results? ### Input: CREATE TABLE table_25266 ( "Week #" text, "Theme" text, "So...
Show me a pie chart for how many hosts does each nationality have? List the nationality and the count.
CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
SELECT Nationality, COUNT(*) FROM host 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: Show me a pie chart for how many hosts does each nationality have? List the nationality and the count. ### Input: CREATE TAB...
Are there classes on Friday in 344 when Prof. Mercedez Dunn teaches ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, ...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.number = 344 AND 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: Are there classes on Friday in 344 when Prof. Mercedez Dunn teaches ? ### Input: CREATE TABLE jobs ( job_id int, job...
When did the earliest tournament happened?
CREATE TABLE table_29656 ( "Outcome" text, "Year" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
SELECT MIN("Year") FROM table_29656
Below are sql tables 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 the earliest tournament happened? ### Input: CREATE TABLE table_29656 ( "Outcome" text, "Year" real, "T...
What is the engine for the Machinists Union Racing team?
CREATE TABLE table_32427 ( "Team" text, "Chassis" text, "Engine" text, "Tires" text, "Drivers" text )
SELECT "Engine" FROM table_32427 WHERE "Team" = 'machinists union racing'
Below are sql tables 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 engine for the Machinists Union Racing team? ### Input: CREATE TABLE table_32427 ( "Team" text, "Chassis...
When the attendance was 3188 what was the score?
CREATE TABLE table_50435 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
SELECT "Score" FROM table_50435 WHERE "Attendance" = '3188'
Below are sql tables 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 the attendance was 3188 what was the score? ### Input: CREATE TABLE table_50435 ( "Date" text, "Home" text, ...
what is the maximum total cost of a hospital that includes a procedure called a arthrocentesis?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_ty...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.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 = 'arthrocentesis')) GROUP BY cost.hadm_id) 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 is the maximum total cost of a hospital that includes a procedure called a arthrocentesis? ### Input: CREATE TABLE char...
Which driver set the Qualifying record with a time of 24.761 seconds?
CREATE TABLE table_name_61 ( driver VARCHAR, record VARCHAR, time VARCHAR )
SELECT driver FROM table_name_61 WHERE record = "qualifying" AND time = "24.761"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which driver set the Qualifying record with a time of 24.761 seconds? ### Input: CREATE TABLE table_name_61 ( driver VAR...
When was the first season?
CREATE TABLE table_16857_2 ( season INTEGER )
SELECT MIN(season) FROM table_16857_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: When was the first season? ### Input: CREATE TABLE table_16857_2 ( season INTEGER ) ### Response: SELECT MIN(season) FRO...
a score of 5 or more on the hashinski ischemic scale ( rosen modification.
CREATE TABLE table_train_112 ( "id" int, "systolic_blood_pressure_sbp" int, "modified_geriatric_depression_scale_gds" int, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float )
SELECT * FROM table_train_112 WHERE rosen_modified_hachinski_ischemic_score >= 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: a score of 5 or more on the hashinski ischemic scale ( rosen modification. ### Input: CREATE TABLE table_train_112 ( "id...
Which team has an away score of 7.9 (51)?
CREATE TABLE table_55681 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_55681 WHERE "Home team score" = '7.9 (51)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team has an away score of 7.9 (51)? ### Input: CREATE TABLE table_55681 ( "Home team" text, "Home team score" ...
How many were in the crowd when North Melbourne was the home team?
CREATE TABLE table_name_24 ( crowd VARCHAR, home_team VARCHAR )
SELECT crowd FROM table_name_24 WHERE home_team = "north 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: How many were in the crowd when North Melbourne was the home team? ### Input: CREATE TABLE table_name_24 ( crowd VARCHAR...
Plot date claim settled by the number of date claim settled as a line chart
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Settlements ( Settlement_ID INTEGER,...
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Plot date claim settled by the number of date claim settled as a line chart ### Input: CREATE TABLE Claims ( Claim_ID IN...
What game date had a record of 17-7?
CREATE TABLE table_25552 ( "Date" text, "Location" text, "Opponent" text, "Sooners Points" real, "Opp. Points" real, "Record" text )
SELECT "Date" FROM table_25552 WHERE "Record" = '17-7'
Below are sql tables 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 game date had a record of 17-7? ### Input: CREATE TABLE table_25552 ( "Date" text, "Location" text, "Oppone...
How many bookings did each customer make? Show the customer id as the Y-axis and the first name as the X-axis in a bar chart, and could you sort by the X-axis from low to high?
CREATE TABLE Discount_Coupons ( coupon_id INTEGER, date_issued DATETIME, coupon_amount DECIMAL(19,4) ) CREATE TABLE Payments ( payment_id INTEGER, booking_id INTEGER, customer_id INTEGER, payment_type_code VARCHAR(15), amount_paid_in_full_yn VARCHAR(1), payment_date DATETIME, am...
SELECT T1.first_name, T1.customer_id FROM Customers AS T1 JOIN Bookings AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.first_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many bookings did each customer make? Show the customer id as the Y-axis and the first name as the X-axis in a bar chart...
what procedure is provided to patient 25965 two times until 40 months ago?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9...
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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 259...
Below are sql tables 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 procedure is provided to patient 25965 two times until 40 months ago? ### Input: CREATE TABLE cost ( row_id number,...
i want to fly DALLAS to SAN FRANCISCO on monday 7 8
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 8 AND date_day.month_number = 7 ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i want to fly DALLAS to SAN FRANCISCO on monday 7 8 ### Input: CREATE TABLE state ( state_code text, state_name text...
List the number of items by the details of the organization that owns it using a bar chart.
CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved...
SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the number of items by the details of the organization that owns it using a bar chart. ### Input: CREATE TABLE Timed_Lo...
What is the name of the integrated where allied-related is shared?
CREATE TABLE table_11944282_1 ( component VARCHAR, allied_related VARCHAR )
SELECT component FROM table_11944282_1 WHERE allied_related = "Shared"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the integrated where allied-related is shared? ### Input: CREATE TABLE table_11944282_1 ( component ...
what are the three most frequent drugs that were prescribed to female patients of the 50s within 2 months after having been diagnosed with drug-induced delirium?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text,...
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 are the three most frequent drugs that were prescribed to female patients of the 50s within 2 months after having been ...
Top tags related to Java and SSH.
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT t.TagName, COUNT(*) AS count FROM PostTags AS pt, Tags AS t, PostTags AS ptjs WHERE pt.TagId = t.Id AND pt.PostId = ptjs.PostId AND ptjs.TagId = (SELECT Id FROM Tags WHERE LOWER(TagName) = 'javascript') GROUP BY t.TagName 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: Top tags related to Java and SSH. ### Input: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDat...
For those employees who was hired before 2002-06-21, find job_id and the sum of manager_id , and group by attribute job_id, and visualize them by a bar chart, and sort in descending by the bars.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' 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 was hired before 2002-06-21, find job_id and the sum of manager_id , and group by attribute job_id, ...
Show me about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home in a bar chart.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home in a bar chart. ### ...
What time was game 7?
CREATE TABLE table_11470 ( "Game" real, "Date" text, "Score" text, "Location" text, "Time" text, "Attendance" real )
SELECT "Time" FROM table_11470 WHERE "Game" = '7'
Below are sql tables 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 time was game 7? ### Input: CREATE TABLE table_11470 ( "Game" real, "Date" text, "Score" text, "Locatio...
What is the name of the golfer that has the score of 73-65=138?
CREATE TABLE table_76232 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Player" FROM table_76232 WHERE "Score" = '73-65=138'
Below are sql tables 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 golfer that has the score of 73-65=138? ### Input: CREATE TABLE table_76232 ( "Place" text, ...
indicate the daily maximum arterial bp [diastolic] of patient 25628 until 270 days ago.
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25628)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the daily maximum arterial bp [diastolic] of patient 25628 until 270 days ago. ### Input: CREATE TABLE diagnoses_ic...
Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.
CREATE TABLE employees ( department_id VARCHAR, manager_id INTEGER ) CREATE TABLE departments ( department_id VARCHAR, manager_id INTEGER )
SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the ids of the employees who does not work in those departments where some employees works whose manager id within the ...
Which Touchdowns is the lowest one that has Extra points smaller than 14, and a Player of white, and Points smaller than 5?
CREATE TABLE table_name_98 ( touchdowns INTEGER, points VARCHAR, extra_points VARCHAR, player VARCHAR )
SELECT MIN(touchdowns) FROM table_name_98 WHERE extra_points < 14 AND player = "white" AND points < 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 Touchdowns is the lowest one that has Extra points smaller than 14, and a Player of white, and Points smaller than 5? ...
what are the top four commonly taken lab tests for patients 20s?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) GROUP BY labevents.itemid) AS ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top four commonly taken lab tests for patients 20s? ### Input: CREATE TABLE d_icd_procedures ( row_id numbe...
who directed and produced 176452?
CREATE TABLE table_26561498_1 ( directed_by VARCHAR, production_code VARCHAR )
SELECT directed_by FROM table_26561498_1 WHERE production_code = 176452
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who directed and produced 176452? ### Input: CREATE TABLE table_26561498_1 ( directed_by VARCHAR, production_code VA...
A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of activities they participated in, and sort in descending by the Y-axis.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, c...
SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID 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: A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of...
For each classroom, report the classroom number and the number of grades using it.
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each classroom, report the classroom number and the number of grades using it. ### Input: CREATE TABLE teachers ( la...
After Round 5, which player was drafted for Defensive Tackle?
CREATE TABLE table_41358 ( "Round" real, "Pick" text, "Player" text, "Position" text, "Team" text )
SELECT "Player" FROM table_41358 WHERE "Round" > '5' AND "Position" = 'defensive tackle'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: After Round 5, which player was drafted for Defensive Tackle? ### Input: CREATE TABLE table_41358 ( "Round" real, "P...
What was the retired time for someone who was on grid 18?
CREATE TABLE table_51463 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
SELECT "Time/Retired" FROM table_51463 WHERE "Grid" = '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 retired time for someone who was on grid 18? ### Input: CREATE TABLE table_51463 ( "Driver" text, "Cons...
List all characteristics of product named 'sesame' with type code 'Grade'.
CREATE TABLE CHARACTERISTICS ( characteristic_name VARCHAR, characteristic_id VARCHAR, characteristic_type_code VARCHAR ) CREATE TABLE products ( product_id VARCHAR, product_name VARCHAR ) CREATE TABLE product_characteristics ( product_id VARCHAR, characteristic_id VARCHAR )
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" AND t3.characteristic_type_code = "Grade"
Below are sql tables 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 characteristics of product named 'sesame' with type code 'Grade'. ### Input: CREATE TABLE CHARACTERISTICS ( cha...
What is the President with a Location of justus lipsius building, brussels, and a Type with scheduled, and a Year larger than 2011, and a Date with 18 19 october?
CREATE TABLE table_54600 ( "Year" real, "Date" text, "Type" text, "President" text, "Location" text )
SELECT "President" FROM table_54600 WHERE "Location" = 'justus lipsius building, brussels' AND "Type" = 'scheduled' AND "Year" > '2011' AND "Date" = '18–19 october'
Below are sql tables 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 President with a Location of justus lipsius building, brussels, and a Type with scheduled, and a Year larger tha...
Which Venue has an Away team of south melbourne?
CREATE TABLE table_name_89 ( venue VARCHAR, away_team VARCHAR )
SELECT venue FROM table_name_89 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: Which Venue has an Away team of south melbourne? ### Input: CREATE TABLE table_name_89 ( venue VARCHAR, away_team VA...