instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
Give me the comparison about author_id over the middle_name by a bar chart.
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Subject...
SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
Below are sql tables 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 author_id over the middle_name by a bar chart. ### Input: CREATE TABLE Course_Authors_and_Tutor...
WOMENSTD 323 has how many lecture sections next semester ?
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WOMENSTD' AND course.number = 323 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WOMENSTD 323 has how many lecture sections next semester ? ### Input: CREATE TABLE program ( program_id int, name va...
what is fare code Y mean
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE restriction ( restriction_c...
SELECT DISTINCT booking_class FROM class_of_service WHERE booking_class = 'Y'
atis
Below are sql tables 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 fare code Y mean ### Input: CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
Get post with popular tags.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, Dele...
SELECT Count, TagName FROM Tags WHERE Count > 50000 ORDER BY Count
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Get post with popular tags. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) ...
Name the word with pronunciation b of *s ks
CREATE TABLE table_35735 ( "Word" text, "Pronunciation a" text, "Meaning a" text, "Pronunciation b" text, "Meaning b" text )
SELECT "Word" FROM table_35735 WHERE "Pronunciation b" = '*sɨks'
wikisql
Below are sql tables 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 word with pronunciation b of *s ks ### Input: CREATE TABLE table_35735 ( "Word" text, "Pronunciation a" tex...
what is france and germany 's deficit combined ?
CREATE TABLE table_204_466 ( id number, "rank" number, "bib" number, "country" text, "time" text, "penalties (p+s)" text, "deficit" text )
SELECT SUM("deficit") FROM table_204_466 WHERE "country" IN ('france', 'germany')
squall
Below are sql tables 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 france and germany 's deficit combined ? ### Input: CREATE TABLE table_204_466 ( id number, "rank" number, ...
Car number 15 earned what time?
CREATE TABLE table_17244483_1 ( time_retired VARCHAR, car_no VARCHAR )
SELECT time_retired FROM table_17244483_1 WHERE car_no = 15
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Car number 15 earned what time? ### Input: CREATE TABLE table_17244483_1 ( time_retired VARCHAR, car_no VARCHAR ) ##...
when did patient 90165 enter the hospital first time until 4 years ago via the emergency room admit?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 90165 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
Below are sql tables 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 90165 enter the hospital first time until 4 years ago via the emergency room admit? ### Input: CREATE TABLE...
For each payment method, return how many customers use it.
CREATE TABLE customers ( payment_method_code VARCHAR )
SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code
sql_create_context
Below are sql tables 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 payment method, return how many customers use it. ### Input: CREATE TABLE customers ( payment_method_code VARCH...
Name the french title for english title of 'inventor bunnies
CREATE TABLE table_1452 ( "Official #" real, "TF1 #" real, "French title" text, "English title" text, "Air date (France)" text, "Original Beechwood Bunny Tale / Source material" text )
SELECT "French title" FROM table_1452 WHERE "English title" = 'Inventor Bunnies'
wikisql
Below are sql tables 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 french title for english title of 'inventor bunnies ### Input: CREATE TABLE table_1452 ( "Official #" real, ...
What is Result, when Venue is G tzis , Austria?
CREATE TABLE table_48395 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
SELECT "Result" FROM table_48395 WHERE "Venue" = 'götzis , austria'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Result, when Venue is G tzis , Austria? ### Input: CREATE TABLE table_48395 ( "Year" real, "Tournament" text...
What is the total number of Bronze, when Gold is greater than 0, when Rank is 4, and when Total is greater than 4?
CREATE TABLE table_50300 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Bronze") FROM table_50300 WHERE "Gold" > '0' AND "Rank" = '4' AND "Total" > '4'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Bronze, when Gold is greater than 0, when Rank is 4, and when Total is greater than 4? ### Input...
Give me a bar chart that bins the payment date into the Year interval and then shows the amount of each payment categorized by the payment method code, and then sort the bars in ascending order of date.
CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGE...
SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments GROUP BY Payment_Method_Code ORDER BY Date_Payment_Made
nvbench
Below are sql tables 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 that bins the payment date into the Year interval and then shows the amount of each payment categorized ...
Who is the representative with a presentation of credentials date on February 23, 1854?
CREATE TABLE table_71880 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text )
SELECT "Representative" FROM table_71880 WHERE "Presentation of Credentials" = 'february 23, 1854'
wikisql
Below are sql tables 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 representative with a presentation of credentials date on February 23, 1854? ### Input: CREATE TABLE table_71880 ...
did patient 18866 have a respiratory rate that was greater than 12.0 in 12/2105?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(*) > 0 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 = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'...
mimic_iii
Below are sql tables 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 18866 have a respiratory rate that was greater than 12.0 in 12/2105? ### Input: CREATE TABLE outputevents ( ...
indicate the monthly minimum heart rate of patient 6196 since 164 months ago.
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, ...
SELECT MIN(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 = 6196)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart...
mimic_iii
Below are sql tables 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 monthly minimum heart rate of patient 6196 since 164 months ago. ### Input: CREATE TABLE patients ( row_id ...
what was the total majority that the dobell seat had ?
CREATE TABLE table_204_659 ( id number, "seat" text, "state" text, "majority" number, "member" text, "party" text )
SELECT "majority" FROM table_204_659 WHERE "seat" = 'dobell'
squall
Below are sql tables 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 total majority that the dobell seat had ? ### Input: CREATE TABLE table_204_659 ( id number, "seat" tex...
What country is Yerevan located in?
CREATE TABLE table_name_21 ( country VARCHAR, city VARCHAR )
SELECT country FROM table_name_21 WHERE city = "yerevan"
sql_create_context
Below are sql tables 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 country is Yerevan located in? ### Input: CREATE TABLE table_name_21 ( country VARCHAR, city VARCHAR ) ### Resp...
Which class's call sign is wokg?
CREATE TABLE table_69481 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
SELECT "Class" FROM table_69481 WHERE "Call sign" = 'wokg'
wikisql
Below are sql tables 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 class's call sign is wokg? ### Input: CREATE TABLE table_69481 ( "Call sign" text, "Frequency MHz" real, "...
Bar chart x axis time y axis id, and order by the x axis in asc.
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT Time, ID FROM swimmer ORDER BY Time
nvbench
Below are sql tables 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 time y axis id, and order by the x axis in asc. ### Input: CREATE TABLE stadium ( ID int, name text...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and manager_id , list by the Y from high to low.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT PHONE_NUMBER, 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
nvbench
Below are sql tables 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, draw a bar chart about t...
What average gold has China (chn) as the nation with a bronze greater than 1?
CREATE TABLE table_61298 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Gold") FROM table_61298 WHERE "Nation" = 'china (chn)' AND "Bronze" > '1'
wikisql
Below are sql tables 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 average gold has China (chn) as the nation with a bronze greater than 1? ### Input: CREATE TABLE table_61298 ( "Ran...
calculate the total or urine production for patient 6705 on the last icu visit.
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6705) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the total or urine production for patient 6705 on the last icu visit. ### Input: CREATE TABLE labevents ( row_...
what is the highest clean & jerk when total (kg) is 200.0 and snatch is more than 87.5?
CREATE TABLE table_name_92 ( _jerk VARCHAR, clean_ INTEGER, total__kg_ VARCHAR, snatch VARCHAR )
SELECT MAX(clean_) & _jerk FROM table_name_92 WHERE total__kg_ = "200.0" AND snatch > 87.5
sql_create_context
Below are sql tables 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 clean & jerk when total (kg) is 200.0 and snatch is more than 87.5? ### Input: CREATE TABLE table_name_9...
count the number of patients whose diagnoses long title is cyst and pseudocyst of pancreas and drug type is main?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cyst and pseudocyst of pancreas" AND prescriptions.drug_type = "MAIN"
mimicsql_data
Below are sql tables 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 diagnoses long title is cyst and pseudocyst of pancreas and drug type is main? ### Input:...
provide the number of patients whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of oddi and lab test category is chemistry?
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter o...
what drugs are being added to patient 021-80293 today as compared to those yesterday?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-80293') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
Below are sql tables 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 021-80293 today as compared to those yesterday? ### Input: CREATE TABLE microlab ( ...
What is the highest games Played where the Place is 10 and Points are less than 17?
CREATE TABLE table_7305 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
SELECT MAX("Played") FROM table_7305 WHERE "Place" = '10' AND "Points" < '17'
wikisql
Below are sql tables 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 games Played where the Place is 10 and Points are less than 17? ### Input: CREATE TABLE table_7305 ( ...
Who played against Hapoel tel aviv when they were team #1?
CREATE TABLE table_name_89 ( team__number2 VARCHAR, team__number1 VARCHAR )
SELECT team__number2 FROM table_name_89 WHERE team__number1 = "hapoel tel aviv"
sql_create_context
Below are sql tables 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 played against Hapoel tel aviv when they were team #1? ### Input: CREATE TABLE table_name_89 ( team__number2 VARCHAR...
How many cars does Gregg Mixon own?
CREATE TABLE table_2182170_1 ( car_s_ VARCHAR, listed_owner_s_ VARCHAR )
SELECT COUNT(car_s_) FROM table_2182170_1 WHERE listed_owner_s_ = "Gregg Mixon"
sql_create_context
Below are sql tables 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 cars does Gregg Mixon own? ### Input: CREATE TABLE table_2182170_1 ( car_s_ VARCHAR, listed_owner_s_ VARCHA...
What is the car number driven by Darren Manning?
CREATE TABLE table_21436 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text )
SELECT "Car No." FROM table_21436 WHERE "Driver" = 'Darren Manning'
wikisql
Below are sql tables 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 car number driven by Darren Manning? ### Input: CREATE TABLE table_21436 ( "Fin. Pos" real, "Car No." re...
what is the difference in attendance for week 5 and 9
CREATE TABLE table_204_670 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "attendance" number )
SELECT ABS((SELECT "attendance" FROM table_204_670 WHERE "week" = 5) - (SELECT "attendance" FROM table_204_670 WHERE "week" = 9))
squall
Below are sql tables 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 difference in attendance for week 5 and 9 ### Input: CREATE TABLE table_204_670 ( id number, "week" numb...
What was the attendance on September 19, 1971, after week 1?
CREATE TABLE table_61688 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT AVG("Attendance") FROM table_61688 WHERE "Date" = 'september 19, 1971' AND "Week" > '1'
wikisql
Below are sql tables 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 on September 19, 1971, after week 1? ### Input: CREATE TABLE table_61688 ( "Week" real, "Dat...
What is the lowest win% in the 1999-2013 season?
CREATE TABLE table_57570 ( "Coach" text, "Season" text, "Record" text, "Home" text, "Away" text, "Win %" real, "Average (Total) Home Attendance" text )
SELECT MIN("Win %") FROM table_57570 WHERE "Season" = '1999-2013'
wikisql
Below are sql tables 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 win% in the 1999-2013 season? ### Input: CREATE TABLE table_57570 ( "Coach" text, "Season" text, ...
calculate the maximum days for which patients who died before 2164 stayed in hospital.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2164.0"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the maximum days for which patients who died before 2164 stayed in hospital. ### Input: CREATE TABLE lab ( sub...
Whatis the total number of half marathon (mens) that represented kazakhstan?
CREATE TABLE table_11391954_3 ( Half VARCHAR, country VARCHAR )
SELECT COUNT(Half) AS marathon__mens_ FROM table_11391954_3 WHERE country = "Kazakhstan"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Whatis the total number of half marathon (mens) that represented kazakhstan? ### Input: CREATE TABLE table_11391954_3 ( ...
Show all locations and the number of gas stations in each location ordered by the count.
CREATE TABLE gas_station ( LOCATION VARCHAR )
SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*)
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all locations and the number of gas stations in each location ordered by the count. ### Input: CREATE TABLE gas_station...
what is the maximum game where high points is micka l gelabale (21)
CREATE TABLE table_11964154_9 ( game INTEGER, high_points VARCHAR )
SELECT MAX(game) FROM table_11964154_9 WHERE high_points = "Mickaël Gelabale (21)"
sql_create_context
Below are sql tables 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 game where high points is micka l gelabale (21) ### Input: CREATE TABLE table_11964154_9 ( game INTE...
what is average age of patients whose insurance is private and discharge location is rehab/distinct part hosp?
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 AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP"
mimicsql_data
Below are sql tables 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 average age of patients whose insurance is private and discharge location is rehab/distinct part hosp? ### Input: CR...
How many positions does building Costanera Center Torre 1 have?
CREATE TABLE table_29283 ( "Position" real, "Building" text, "City" text, "Height" text, "Number of floors" real, "Completion" real )
SELECT COUNT("Position") FROM table_29283 WHERE "Building" = 'Costanera Center Torre 1'
wikisql
Below are sql tables 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 positions does building Costanera Center Torre 1 have? ### Input: CREATE TABLE table_29283 ( "Position" real, ...
Name the record for cotton bowl classic
CREATE TABLE table_2517159_1 ( record VARCHAR, name_of_bowl VARCHAR )
SELECT record FROM table_2517159_1 WHERE name_of_bowl = "Cotton Bowl Classic"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the record for cotton bowl classic ### Input: CREATE TABLE table_2517159_1 ( record VARCHAR, name_of_bowl VARCH...
the total number of helipads at hama military airport ?
CREATE TABLE table_204_102 ( id number, "name" text, "location served" text, "governorate" text, "utilization" text, "helipads" number, "runways" number, "shelters" number, "squadrons" text, "coordinates" text )
SELECT "helipads" FROM table_204_102 WHERE "name" = 'hama military airport'
squall
Below are sql tables 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 total number of helipads at hama military airport ? ### Input: CREATE TABLE table_204_102 ( id number, "name" te...
What is the name of the race in the Modena circuit?
CREATE TABLE table_16767 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
SELECT "Race Name" FROM table_16767 WHERE "Circuit" = 'Modena'
wikisql
Below are sql tables 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 race in the Modena circuit? ### Input: CREATE TABLE table_16767 ( "Race Name" text, "Circuit...
What race has a distance of 1200 m?
CREATE TABLE table_2062148_3 ( race VARCHAR, distance VARCHAR )
SELECT race FROM table_2062148_3 WHERE distance = "1200 m"
sql_create_context
Below are sql tables 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 race has a distance of 1200 m? ### Input: CREATE TABLE table_2062148_3 ( race VARCHAR, distance VARCHAR ) ### R...
How many Losses have Draws larger than 0?
CREATE TABLE table_66431 ( "Millewa" text, "Wins" real, "Forfeits" real, "Losses" real, "Draws" real, "Against" real )
SELECT MAX("Losses") FROM table_66431 WHERE "Draws" > '0'
wikisql
Below are sql tables 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 Losses have Draws larger than 0? ### Input: CREATE TABLE table_66431 ( "Millewa" text, "Wins" real, "Fo...
How many directors were there for season 3 episode 1?
CREATE TABLE table_28453 ( "Episode #" text, "Season Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text )
SELECT COUNT("Directed by") FROM table_28453 WHERE "Season Episode #" = '1'
wikisql
Below are sql tables 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 directors were there for season 3 episode 1? ### Input: CREATE TABLE table_28453 ( "Episode #" text, "Seaso...
when did patient 010-32698 have his or her last surgical procedure?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698')) ORDER BY treatment.treatmenttime DESC LIMIT 1
eicu
Below are sql tables 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 010-32698 have his or her last surgical procedure? ### Input: CREATE TABLE cost ( costid number, un...
Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and I want to display by the Y in desc.
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_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
Below are sql tables 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 All_Games_Percent over the ACC_Regular_Season , and I want to display by the Y in desc. ### Inp...
Fastest users to get to X rep. Fastest user to reach a certain rep score.
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT * FROM VoteTypes
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Fastest users to get to X rep. Fastest user to reach a certain rep score. ### Input: CREATE TABLE Votes ( Id number, ...
Which city has the ICAO of LIRF?
CREATE TABLE table_51595 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
SELECT "City" FROM table_51595 WHERE "ICAO" = 'lirf'
wikisql
Below are sql tables 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 city has the ICAO of LIRF? ### Input: CREATE TABLE table_51595 ( "City" text, "Country" text, "IATA" text,...
What is Owner, when Finished is less than 15, when Trainer is 'Steve Asmussen', and when Horse is 'Z Fortune'?
CREATE TABLE table_46426 ( "Finished" real, "Time/ Behind" text, "Post" real, "Horse" text, "Jockey" text, "Trainer" text, "Owner" text )
SELECT "Owner" FROM table_46426 WHERE "Finished" < '15' AND "Trainer" = 'steve asmussen' AND "Horse" = 'z fortune'
wikisql
Below are sql tables 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 Owner, when Finished is less than 15, when Trainer is 'Steve Asmussen', and when Horse is 'Z Fortune'? ### Input: CR...
find out the number of greek orthodox religious background patients with lab test item id 51288.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND lab.itemid = "51288"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find out the number of greek orthodox religious background patients with lab test item id 51288. ### Input: CREATE TABLE pre...
i would like to book an early morning flight from TAMPA to CHARLOTTE on 4 6
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ...
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 = 'CHARLOTTE' AND date_day.day_number = 6 AND date_day.month_number = 4 AND...
atis
Below are sql tables 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 would like to book an early morning flight from TAMPA to CHARLOTTE on 4 6 ### Input: CREATE TABLE equipment_sequence ( ...
Which Puchat Ligi has a UEFA Cup smaller than 2, and a Player of takesure chinyama?
CREATE TABLE table_60820 ( "Player" text, "Position" text, "Ekstraklasa" real, "Polish Cup" real, "Puchat Ligi" real, "UEFA Cup" real, "Total" real )
SELECT MIN("Puchat Ligi") FROM table_60820 WHERE "UEFA Cup" < '2' AND "Player" = 'takesure chinyama'
wikisql
Below are sql tables 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 Puchat Ligi has a UEFA Cup smaller than 2, and a Player of takesure chinyama? ### Input: CREATE TABLE table_60820 ( ...
What is the total number of losses of the team with games less than 14, wins less than 3, in the Maac Conference at Fairfield School?
CREATE TABLE table_44082 ( "School" text, "Conference" text, "Games" real, "Wins" real, "Losses" real, "Winning Pct." real )
SELECT COUNT("Losses") FROM table_44082 WHERE "Games" < '14' AND "Wins" < '3' AND "Conference" = 'maac' AND "School" = 'fairfield'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of losses of the team with games less than 14, wins less than 3, in the Maac Conference at Fairfiel...
Give me a histogram for what are the different parties of representative? Show the party name and the number of representatives in each party.
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text )
SELECT Party, COUNT(*) FROM representative GROUP BY Party
nvbench
Below are sql tables 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 histogram for what are the different parties of representative? Show the party name and the number of representati...
is the heart rate in patient 22973 last measured on the first icu visit less than first measured on the first icu visit?
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (SELECT 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 = 22973) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the heart rate in patient 22973 last measured on the first icu visit less than first measured on the first icu visit? ###...
What was the standing when goal against were 279?
CREATE TABLE table_2259285_1 ( standing VARCHAR, goals_against VARCHAR )
SELECT standing FROM table_2259285_1 WHERE goals_against = 279
sql_create_context
Below are sql tables 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 standing when goal against were 279? ### Input: CREATE TABLE table_2259285_1 ( standing VARCHAR, goals_...
What game was played at Philadelphia?
CREATE TABLE table_name_36 ( game INTEGER, team VARCHAR )
SELECT AVG(game) FROM table_name_36 WHERE team = "philadelphia"
sql_create_context
Below are sql tables 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 was played at Philadelphia? ### Input: CREATE TABLE table_name_36 ( game INTEGER, team VARCHAR ) ### Respo...
A bar chart for what are the number of the completion dates of all the tests that have result 'Fail'?, and list from high to low by the Y-axis.
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the completion dates of all the tests that have result 'Fail'?, and list from high to...
Name the host for prime
CREATE TABLE table_21143 ( "Country" text, "Name" text, "Network" text, "Premiere" text, "Host(s)" text, "Judges" text, "Seasons and Winners" text )
SELECT "Host(s)" FROM table_21143 WHERE "Network" = 'Prime'
wikisql
Below are sql tables 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 host for prime ### Input: CREATE TABLE table_21143 ( "Country" text, "Name" text, "Network" text, "...
What is the most number of families in regions where average family size is 2.7?
CREATE TABLE table_20508 ( "Region of USSR" text, "Number of families" real, "Number of people" real, "Average family size" text, "% of total deportees" text )
SELECT MAX("Number of families") FROM table_20508 WHERE "Average family size" = '2.7'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the most number of families in regions where average family size is 2.7? ### Input: CREATE TABLE table_20508 ( "...
Follow-up edits to my contributions. Shows all posts that I've contributed to, that have also been edited by someone else since my last contribution. Includes only certain types of edits (title/body/tag edits/rollbacks), and excludes edits by the Community user (which are mostly inserting/removing duplicate links and s...
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
SELECT ph.PostId AS "post_link", ph.CreationDate AS LastEditDate, u.DisplayName AS LastEditor, pht.Name AS LastEditType, ph.Comment FROM PostHistory AS ph JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId JOIN Posts AS p ON p.Id = ph.PostId AND p.LastEditDate = ph.CreationDate JOIN Users AS u ON u.Id = ph.U...
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Follow-up edits to my contributions. Shows all posts that I've contributed to, that have also been edited by someone else si...
When John Mcenroe won at Montreal, what was the score?
CREATE TABLE table_12794 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text )
SELECT "Score" FROM table_12794 WHERE "Location" = 'montreal' AND "Champion" = 'john mcenroe'
wikisql
Below are sql tables 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 John Mcenroe won at Montreal, what was the score? ### Input: CREATE TABLE table_12794 ( "Location" text, "Year"...
Let institution types as the X-axis and the number of institutions for each type as Y-axis, the visualization type is bar chart, could you order in desc by the Y-axis?
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Pri...
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY COUNT(*) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Let institution types as the X-axis and the number of institutions for each type as Y-axis, the visualization type is bar ch...
What week was the finalist Martina Hingis?
CREATE TABLE table_76540 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text )
SELECT "Week" FROM table_76540 WHERE "Finalist" = 'martina hingis'
wikisql
Below are sql tables 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 week was the finalist Martina Hingis? ### Input: CREATE TABLE table_76540 ( "Tournament" text, "Surface" text, ...
what was the total number of wins ?
CREATE TABLE table_203_689 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text )
SELECT COUNT(*) FROM table_203_689 WHERE "result" = 'win'
squall
Below are sql tables 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 total number of wins ? ### Input: CREATE TABLE table_203_689 ( id number, "date" text, "opponent" t...
What dates had matches at the venue Sabina Park?
CREATE TABLE table_79760 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
SELECT "Date" FROM table_79760 WHERE "Venue" = 'sabina park'
wikisql
Below are sql tables 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 dates had matches at the venue Sabina Park? ### Input: CREATE TABLE table_79760 ( "Date" text, "Home captain" t...
What is the broadcast date with 7.0 million viewers?
CREATE TABLE table_59775 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
SELECT "Broadcast date" FROM table_59775 WHERE "Viewers (in millions)" = '7.0'
wikisql
Below are sql tables 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 broadcast date with 7.0 million viewers? ### Input: CREATE TABLE table_59775 ( "Episode" text, "Broadcas...
How many tries for did the club with a 3 losing bonus and 45 points have?
CREATE TABLE table_36645 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
SELECT "Tries for" FROM table_36645 WHERE "Losing bonus" = '3' AND "Points" = '45'
wikisql
Below are sql tables 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 tries for did the club with a 3 losing bonus and 45 points have? ### Input: CREATE TABLE table_36645 ( "Club" t...
how many patients admitted to emergency were aged below 71?
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "71"
mimicsql_data
Below are sql tables 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 emergency were aged below 71? ### Input: CREATE TABLE diagnoses ( subject_id text, had...
List the name for storms and the number of affected regions for each storm, order bars from high to low order.
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name DESC
nvbench
Below are sql tables 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 name for storms and the number of affected regions for each storm, order bars from high to low order. ### Input: CR...
Show me a bar chart for how many students are advised by each rank of faculty? List the rank and the number of students.
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for how many students are advised by each rank of faculty? List the rank and the number of students. ###...
What is the % of points possible of the winner from Penn State?
CREATE TABLE table_42499 ( "Year" real, "Winner" text, "School" text, "Position" text, "Points" text, "% of Points Possible" text )
SELECT "% of Points Possible" FROM table_42499 WHERE "School" = 'penn state'
wikisql
Below are sql tables 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 % of points possible of the winner from Penn State? ### Input: CREATE TABLE table_42499 ( "Year" real, "...
What is the Hadeda Ibis when the Ostrich is Dark Chanting Goshawk?
CREATE TABLE table_23493 ( "Ostrich" text, "Hamerkop" text, "Hadeda Ibis" text, "African Spoonbill" text, "Whitefaced Duck" text, "Knobbilled Duck" text )
SELECT "Hadeda Ibis" FROM table_23493 WHERE "Ostrich" = 'Dark Chanting Goshawk'
wikisql
Below are sql tables 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 Hadeda Ibis when the Ostrich is Dark Chanting Goshawk? ### Input: CREATE TABLE table_23493 ( "Ostrich" text,...
What is the best time of the team that had a qualifying 1 time of 1:01.043?
CREATE TABLE table_5198 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
SELECT "Best" FROM table_5198 WHERE "Qual 1" = '1:01.043'
wikisql
Below are sql tables 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 best time of the team that had a qualifying 1 time of 1:01.043? ### Input: CREATE TABLE table_5198 ( "Name" ...
What is the number of patients who underwent (Aorto)coronary bypass of one coronary artery and died in or before 2138?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.short_title = "Aortocor bypas-1 cor art"
mimicsql_data
Below are sql tables 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 underwent (Aorto)coronary bypass of one coronary artery and died in or before 2138? ### I...
count the number of patients who since 4 years ago have been prescribed 1 ml vial : heparin sodium (porcine) 5000 unit/ml ij soln.
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '1 ml vial : heparin sodium (porcine) 5000 unit/ml ij soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year'))
eicu
Below are sql tables 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 since 4 years ago have been prescribed 1 ml vial : heparin sodium (porcine) 5000 unit/ml ij...
calculate the average age of patients who were admitted in emergency room for s/p hanging.
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "S/P HANGING"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the average age of patients who were admitted in emergency room for s/p hanging. ### Input: CREATE TABLE procedure...
Name the traditional for area 544
CREATE TABLE table_23563 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Foochow" text, "Area" real, "Population" real, "Density" real )
SELECT "Traditional" FROM table_23563 WHERE "Area" = '544'
wikisql
Below are sql tables 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 traditional for area 544 ### Input: CREATE TABLE table_23563 ( "English Name" text, "Simplified" text, ...
Which Week 14 Nov 30 has a Week 6 Oct 5 of michigan state (5-1)?
CREATE TABLE table_5694 ( "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 9 Oct 26" text, "Week 10 Nov 2" text, "Week 11 Nov 9" text, "Week 13 Nov 23" text, "Week 14 Nov 30" text, "Week 15 (Final) Dec 7" text )
SELECT "Week 14 Nov 30" FROM table_5694 WHERE "Week 6 Oct 5" = 'michigan state (5-1)'
wikisql
Below are sql tables 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 Week 14 Nov 30 has a Week 6 Oct 5 of michigan state (5-1)? ### Input: CREATE TABLE table_5694 ( "Week 6 Oct 5" tex...
what were the three most frequently ordered microbiology tests for patients that had previous fiber-optic bronchoscopy during the same month in 2104?
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
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...
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the three most frequently ordered microbiology tests for patients that had previous fiber-optic bronchoscopy durin...
How many submissions are there?
CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text )
SELECT COUNT(*) FROM submission
spider
Below are sql tables 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 submissions are there? ### Input: CREATE TABLE acceptance ( submission_id number, workshop_id number, r...
What are all the episodes with an episode run time of 24:01?
CREATE TABLE table_1429629_1 ( episode VARCHAR, run_time VARCHAR )
SELECT episode FROM table_1429629_1 WHERE run_time = "24:01"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the episodes with an episode run time of 24:01? ### Input: CREATE TABLE table_1429629_1 ( episode VARCHAR, ...
show me the flights that leave on THURSDAY mornings from ATLANTA to WASHINGTON and include whether meals are offered and what the prices are
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE T...
SELECT DISTINCT fare.fare_id, flight.flight_id, flight.meal_code FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_n...
atis
Below are sql tables 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 the flights that leave on THURSDAY mornings from ATLANTA to WASHINGTON and include whether meals are offered and wha...
Return a line on what are all the calendar dates and day Numbers?, and rank in descending by the X-axis.
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Des...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC
nvbench
Below are sql tables 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 line on what are all the calendar dates and day Numbers?, and rank in descending by the X-axis. ### Input: CREATE T...
What is the lowest rank that has goals per match less than 1.237, real madrid as the club, goals less than 53, with apps greater than 40?
CREATE TABLE table_62326 ( "Rank" real, "Name" text, "Season" text, "Club" text, "Goals" real, "Apps" real, "Goals per Match" real )
SELECT MIN("Rank") FROM table_62326 WHERE "Goals per Match" < '1.237' AND "Club" = 'real madrid' AND "Goals" < '53' AND "Apps" > '40'
wikisql
Below are sql tables 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 rank that has goals per match less than 1.237, real madrid as the club, goals less than 53, with apps gre...
X reoccurs with Tag, post count.
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLic...
SELECT reoccurs.TagName AS reoccurs, 'WITH' AS presence, '##occurs:string##' AS occurs, COUNT(DISTINCT Posts.Id) AS nposts FROM Tags AS reoccurs, Posts, PostTags AS ptri WHERE Posts.Id = ptri.PostId AND ptri.TagId = reoccurs.Id AND '##occurs:string##' IN (SELECT TagName FROM Tags AS occurs, PostTags AS pti WHERE occurs...
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: X reoccurs with Tag, post count. ### Input: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, ...
what is the number of patients whose primary disease is complete heart block and year of birth is less than 2200?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dob_year < "2200"
mimicsql_data
Below are sql tables 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 complete heart block and year of birth is less than 2200? ### Input:...
Bar graph to show the number of last name from different last name, and I want to order in ascending by the bar.
CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE People_Addresses ( person_address_id INTEGER, person_id I...
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name
nvbench
Below are sql tables 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 graph to show the number of last name from different last name, and I want to order in ascending by the bar. ### Input: ...
Which opponent has a Club of essendon, and a Score of 13.4.82?
CREATE TABLE table_67050 ( "Quarter" text, "Score" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text )
SELECT "Opponent" FROM table_67050 WHERE "Club" = 'essendon' AND "Score" = '13.4.82'
wikisql
Below are sql tables 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 opponent has a Club of essendon, and a Score of 13.4.82? ### Input: CREATE TABLE table_67050 ( "Quarter" text, ...
Display a pie chart for how many hosts does each nationality have? List the nationality and the count.
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a pie chart for how many hosts does each nationality have? List the nationality and the count. ### Input: CREATE TAB...
If the location is Yangon, Myanmar, what is the opponent total number?
CREATE TABLE table_25428629_1 ( opponent VARCHAR, location VARCHAR )
SELECT COUNT(opponent) FROM table_25428629_1 WHERE location = "Yangon, Myanmar"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the location is Yangon, Myanmar, what is the opponent total number? ### Input: CREATE TABLE table_25428629_1 ( oppone...
What is the total teams during the 2012-13 season?
CREATE TABLE table_13696 ( "Season" text, "Teams" real, "Minor Ladder Position" text, "Finals Qualification" text, "Final Ladder Position" text, "ACL Qualification" text, "ACL Placing" text )
SELECT SUM("Teams") FROM table_13696 WHERE "Season" = '2012-13'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total teams during the 2012-13 season? ### Input: CREATE TABLE table_13696 ( "Season" text, "Teams" real...
Draw a bar chart for what are the destinations and number of flights to each one?, I want to list from high to low by the Y-axis.
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( ei...
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for what are the destinations and number of flights to each one?, I want to list from high to low by the Y-...
What score has south africa as the country?
CREATE TABLE table_name_92 ( score VARCHAR, country VARCHAR )
SELECT score FROM table_name_92 WHERE country = "south africa"
sql_create_context
Below are sql tables 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 score has south africa as the country? ### Input: CREATE TABLE table_name_92 ( score VARCHAR, country VARCHAR )...
how many commissioners served under calvin coolidge ?
CREATE TABLE table_203_559 ( id number, "no." number, "name" text, "took office" text, "left office" text, "president served under" text, "notable for" text )
SELECT COUNT("name") FROM table_203_559 WHERE "president served under" = 'calvin coolidge'
squall
Below are sql tables 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 commissioners served under calvin coolidge ? ### Input: CREATE TABLE table_203_559 ( id number, "no." numbe...
For how long did Bolivia have a lane greater than 6?
CREATE TABLE table_31968 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text )
SELECT COUNT("Time") FROM table_31968 WHERE "Country" = 'bolivia' AND "Lane" > '6'
wikisql
Below are sql tables 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 how long did Bolivia have a lane greater than 6? ### Input: CREATE TABLE table_31968 ( "Heat Rank" real, "Lane" ...
What is the try bonus for ynysybwl rfc?
CREATE TABLE table_name_12 ( try_bonus VARCHAR, club VARCHAR )
SELECT try_bonus FROM table_name_12 WHERE club = "ynysybwl rfc"
sql_create_context
Below are sql tables 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 try bonus for ynysybwl rfc? ### Input: CREATE TABLE table_name_12 ( try_bonus VARCHAR, club VARCHAR ) ##...
Which Game has a Score of 4 1?
CREATE TABLE table_75443 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT SUM("Game") FROM table_75443 WHERE "Score" = '4–1'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Game has a Score of 4 1? ### Input: CREATE TABLE table_75443 ( "Game" real, "December" real, "Opponent" te...