instruction
stringlengths
20
309
input
stringlengths
45
7.14k
response
stringlengths
24
2.22k
source
stringclasses
15 values
text
stringlengths
337
7.52k
what are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnosed with poison-medicinal agt nos?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos...
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 are the top three most frequently used specimen tests given to patients in the same hospital visit after being diagnose...
what are the five most frequently prescribed drugs since 5 years ago for patients prescribed with atropine 0.1 mg/ml inj syringe at the same time?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atropine 0.1 mg/ml inj syringe' AND DATETIME(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 are the five most frequently prescribed drugs since 5 years ago for patients prescribed with atropine 0.1 mg/ml inj syr...
When was the date of death for the person married to Charles II?
CREATE TABLE table_name_86 ( death VARCHAR, spouse VARCHAR )
SELECT death FROM table_name_86 WHERE spouse = "charles ii"
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: When was the date of death for the person married to Charles II? ### Input: CREATE TABLE table_name_86 ( death VARCHAR, ...
count the number of patients whose gender is f and procedure icd9 code is 4610?
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.gender = "F" AND procedures.icd9_code = "4610"
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 gender is f and procedure icd9 code is 4610? ### Input: CREATE TABLE demographic ( su...
How many points did Carlin have when they had 3 wins?
CREATE TABLE table_name_90 ( points VARCHAR, wins VARCHAR, team VARCHAR )
SELECT points FROM table_name_90 WHERE wins = "3" AND team = "carlin"
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 points did Carlin have when they had 3 wins? ### Input: CREATE TABLE table_name_90 ( points VARCHAR, wins V...
In the final, who are the opponents of partner Simon Aspelin?
CREATE TABLE table_35942 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
SELECT "Opponents in the final" FROM table_35942 WHERE "Partner" = 'simon aspelin'
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: In the final, who are the opponents of partner Simon Aspelin? ### Input: CREATE TABLE table_35942 ( "Outcome" text, ...
how much does the arterial bp [systolic] of patient 8116 vary second measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
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 = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_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: how much does the arterial bp [systolic] of patient 8116 vary second measured on the current intensive care unit visit compa...
Name the representative for party of whig
CREATE TABLE table_69618 ( "Representative" text, "Years" text, "State" text, "Party" text, "Lifespan" text )
SELECT "Representative" FROM table_69618 WHERE "Party" = 'whig'
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 representative for party of whig ### Input: CREATE TABLE table_69618 ( "Representative" text, "Years" text,...
What is the status of the district where the result is 63% 37%?
CREATE TABLE table_16185956_1 ( status VARCHAR, results VARCHAR )
SELECT status FROM table_16185956_1 WHERE results = "63% 37%"
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 status of the district where the result is 63% 37%? ### Input: CREATE TABLE table_16185956_1 ( status VARCHA...
What is the Kashmiri word for the Indonesian word senin?
CREATE TABLE table_name_90 ( kashmiri VARCHAR, indonesian VARCHAR )
SELECT kashmiri FROM table_name_90 WHERE indonesian = "senin"
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 Kashmiri word for the Indonesian word senin? ### Input: CREATE TABLE table_name_90 ( kashmiri VARCHAR, i...
how many female patients followed the procedure ven cath renal dialysis?
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.gender = "F" AND procedures.short_title = "Ven cath renal dialysis"
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 female patients followed the procedure ven cath renal dialysis? ### Input: CREATE TABLE demographic ( subject_i...
Which City of license has a Call sign of k241an?
CREATE TABLE table_name_68 ( city_of_license VARCHAR, call_sign VARCHAR )
SELECT city_of_license FROM table_name_68 WHERE call_sign = "k241an"
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: Which City of license has a Call sign of k241an? ### Input: CREATE TABLE table_name_68 ( city_of_license VARCHAR, ca...
Where is the orchestra when the year of recording is 1934?
CREATE TABLE table_73366 ( "Piano" text, "Conductor" text, "Orchestra" text, "Record Company" text, "Year of Recording" real, "Format" text )
SELECT "Orchestra" FROM table_73366 WHERE "Year of Recording" = '1934'
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: Where is the orchestra when the year of recording is 1934? ### Input: CREATE TABLE table_73366 ( "Piano" text, "Cond...
How many number of site have May 1, 2004 as the date?
CREATE TABLE table_22098274_1 ( site VARCHAR, date VARCHAR )
SELECT COUNT(site) FROM table_22098274_1 WHERE date = "May 1, 2004"
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 number of site have May 1, 2004 as the date? ### Input: CREATE TABLE table_22098274_1 ( site VARCHAR, date ...
how many times has patient 015-56390 recieved a enteral tube intake: nasoduodenal nostril, r 10f intake in 12/last year?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56390')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
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: how many times has patient 015-56390 recieved a enteral tube intake: nasoduodenal nostril, r 10f intake in 12/last year? ###...
What is Current Rank, when Ring Name is Kimurayama Mamoru?
CREATE TABLE table_40076 ( "Ring name" text, "Current rank" text, "Debut" text, "Stable" text, "Birthplace" text )
SELECT "Current rank" FROM table_40076 WHERE "Ring name" = 'kimurayama mamoru'
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 Current Rank, when Ring Name is Kimurayama Mamoru? ### Input: CREATE TABLE table_40076 ( "Ring name" text, "...
What was the nationality of the skater with 108.8 points?
CREATE TABLE table_name_52 ( nation VARCHAR, points VARCHAR )
SELECT nation FROM table_name_52 WHERE points = 108.8
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 nationality of the skater with 108.8 points? ### Input: CREATE TABLE table_name_52 ( nation VARCHAR, po...
what are the top four most frequently diagnosed diagnoses among the patients in the 20s since 1 year ago?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-1 yea...
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 are the top four most frequently diagnosed diagnoses among the patients in the 20s since 1 year ago? ### Input: CREATE ...
What is the total number of To Par, when Score is '70-75-76=221'?
CREATE TABLE table_45574 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
SELECT COUNT("To par") FROM table_45574 WHERE "Score" = '70-75-76=221'
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 To Par, when Score is '70-75-76=221'? ### Input: CREATE TABLE table_45574 ( "Place" text, ...
For CS , are there any upper elective courses offered ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
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: For CS , are there any upper elective courses offered ? ### Input: CREATE TABLE gsi ( course_offering_id int, studen...
Number of unanswered question (zero answers) per month.
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
SELECT LAST_DATE_OF_MONTH(q.CreationDate), COUNT(q.Id) AS Count FROM Posts AS q WHERE (q.PostTypeId = 1) AND (q.AnswerCount = 0) GROUP BY LAST_DATE_OF_MONTH(q.CreationDate) ORDER BY LAST_DATE_OF_MONTH(q.CreationDate)
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: Number of unanswered question (zero answers) per month. ### Input: CREATE TABLE PostHistoryTypes ( Id number, Name t...
flights from KANSAS CITY to CLEVELAND on wednesday before 1700
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
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: flights from KANSAS CITY to CLEVELAND on wednesday before 1700 ### Input: CREATE TABLE fare ( fare_id int, from_airp...
What is the total number of 2012 Employees (Total) when 2007 Employees (Total) is 8,985, and rank (2010) is smaller than 9?
CREATE TABLE table_63078 ( "Rank (2012)" real, "Rank (2010)" real, "Employer" text, "Industry" text, "2012 Employees (Total)" real, "2010 Employees (Total)" real, "2007 Employees (Total)" text, "Head office" text )
SELECT COUNT("2012 Employees (Total)") FROM table_63078 WHERE "2007 Employees (Total)" = '8,985' AND "Rank (2010)" < '9'
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 2012 Employees (Total) when 2007 Employees (Total) is 8,985, and rank (2010) is smaller than 9? ...
With a rank of 2 what is the second quarter?
CREATE TABLE table_36998 ( "Rank" real, "First quarter" text, "Second quarter" text, "Third quarter" text, "Fourth quarter" text )
SELECT "Second quarter" FROM table_36998 WHERE "Rank" = '2'
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: With a rank of 2 what is the second quarter? ### Input: CREATE TABLE table_36998 ( "Rank" real, "First quarter" text...
What party did hilda solis represent?
CREATE TABLE table_22126 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
SELECT "Party" FROM table_22126 WHERE "Incumbent" = 'Hilda Solis'
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 party did hilda solis represent? ### Input: CREATE TABLE table_22126 ( "District" text, "Incumbent" text, "...
what was the last height of patient 005-73237 in the last month.
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ...
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 was the last height of patient 005-73237 in the last month. ### Input: CREATE TABLE allergy ( allergyid number, ...
how old was patient 035-18528's age during the first hospital visit?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT patient.age FROM patient WHERE patient.uniquepid = '035-18528' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime 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: how old was patient 035-18528's age during the first hospital visit? ### Input: CREATE TABLE treatment ( treatmentid num...
What is the score for Greg Norman
CREATE TABLE table_12721 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Score" FROM table_12721 WHERE "Player" = 'greg norman'
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 score for Greg Norman ### Input: CREATE TABLE table_12721 ( "Place" text, "Player" text, "Country" t...
What is the Artist with a Date that is june 1979?
CREATE TABLE table_40579 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text )
SELECT "Artist" FROM table_40579 WHERE "Date" = 'june 1979'
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 Artist with a Date that is june 1979? ### Input: CREATE TABLE table_40579 ( "Spoofed Title" text, "Actua...
how many married patients have lab test item id 51214?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51214"
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 married patients have lab test item id 51214? ### Input: CREATE TABLE demographic ( subject_id text, hadm_i...
Name the total number of series for march 19, 2000
CREATE TABLE table_22590 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
SELECT COUNT("No. in series") FROM table_22590 WHERE "Original air date" = 'March 19, 2000'
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 total number of series for march 19, 2000 ### Input: CREATE TABLE table_22590 ( "No. in series" real, "Titl...
What is the line of the station in Toolamba that is currently demolished and closed in the late 1970s?
CREATE TABLE table_14710 ( "Name" text, "Line" text, "Location" text, "Closed" text, "Current Status" text )
SELECT "Line" FROM table_14710 WHERE "Current Status" = 'demolished' AND "Closed" = 'late 1970s' AND "Location" = 'toolamba'
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 line of the station in Toolamba that is currently demolished and closed in the late 1970s? ### Input: CREATE TAB...
What is every value on Thursday August 25 for rank 3?
CREATE TABLE table_30058355_3 ( thurs_25_aug VARCHAR, rank VARCHAR )
SELECT thurs_25_aug FROM table_30058355_3 WHERE rank = 3
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 every value on Thursday August 25 for rank 3? ### Input: CREATE TABLE table_30058355_3 ( thurs_25_aug VARCHAR, ...
what diagnosis did patient 025-53910 receive last?
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 diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53910')) ORDER BY diagnosis.diagnosistime 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: what diagnosis did patient 025-53910 receive last? ### Input: CREATE TABLE patient ( uniquepid text, patienthealthsy...
What is the location for the club trophy?
CREATE TABLE table_name_69 ( location VARCHAR, type VARCHAR )
SELECT location FROM table_name_69 WHERE type = "club trophy"
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 location for the club trophy? ### Input: CREATE TABLE table_name_69 ( location VARCHAR, type VARCHAR ) #...
How many values of total top 3 placements does Taiwan have?
CREATE TABLE table_2876467_3 ( total_top_3_placements VARCHAR, region_represented VARCHAR )
SELECT COUNT(total_top_3_placements) FROM table_2876467_3 WHERE region_represented = "Taiwan"
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 values of total top 3 placements does Taiwan have? ### Input: CREATE TABLE table_2876467_3 ( total_top_3_placem...
What are the names of the airports in the city of Goroka?
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE ...
SELECT name FROM airports WHERE city = 'Goroka'
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: What are the names of the airports in the city of Goroka? ### Input: CREATE TABLE airlines ( alid number, name text,...
Questions by date - backwards.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
SELECT Id, Score, ViewCount, Title, Tags, LastActivityDate, CreationDate FROM Posts WHERE PostTypeId = 1 ORDER BY CreationDate LIMIT 50
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: Questions by date - backwards. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ...
What is the Date for the game at michie stadium west point, ny?
CREATE TABLE table_name_80 ( date VARCHAR, location VARCHAR )
SELECT date FROM table_name_80 WHERE location = "michie stadium • west point, ny"
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 Date for the game at michie stadium west point, ny? ### Input: CREATE TABLE table_name_80 ( date VARCHAR, ...
Can you tell me the highest Against that has the Losses larger than 9, and the Byes of 2, and the Draws larger than 0?
CREATE TABLE table_name_56 ( against INTEGER, draws VARCHAR, losses VARCHAR, byes VARCHAR )
SELECT MAX(against) FROM table_name_56 WHERE losses > 9 AND byes = 2 AND draws > 0
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: Can you tell me the highest Against that has the Losses larger than 9, and the Byes of 2, and the Draws larger than 0? ### I...
When is a Type of tko, and an Opponent of jesse brinkley
CREATE TABLE table_name_53 ( date VARCHAR, type VARCHAR, opponent VARCHAR )
SELECT date FROM table_name_53 WHERE type = "tko" AND opponent = "jesse brinkley"
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: When is a Type of tko, and an Opponent of jesse brinkley ### Input: CREATE TABLE table_name_53 ( date VARCHAR, type ...
What was Shaun Murphy's outcome in the Premier League Snooker championship held before 2010?
CREATE TABLE table_name_1 ( outcome VARCHAR, championship VARCHAR, year VARCHAR )
SELECT outcome FROM table_name_1 WHERE championship = "premier league snooker" AND year < 2010
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 Shaun Murphy's outcome in the Premier League Snooker championship held before 2010? ### Input: CREATE TABLE table_n...
Which commission was launched 28 june 1934, and has a Pennant number of h.78?
CREATE TABLE table_name_40 ( commissioned VARCHAR, launched VARCHAR, pennant_number VARCHAR )
SELECT commissioned FROM table_name_40 WHERE launched = "28 june 1934" AND pennant_number = "h.78"
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: Which commission was launched 28 june 1934, and has a Pennant number of h.78? ### Input: CREATE TABLE table_name_40 ( co...
Which Total Pts have a 2001 02 Pts smaller than 38?
CREATE TABLE table_78639 ( "Team" text, "2003\u201304 Pts" text, "2004\u201305 Pts" text, "2001\u201302 Pts" real, "Total Pts" real, "Total Pld" real )
SELECT MIN("Total Pts") FROM table_78639 WHERE "2001\u201302 Pts" < '38'
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 Total Pts have a 2001 02 Pts smaller than 38? ### Input: CREATE TABLE table_78639 ( "Team" text, "2003\u201304...
give me the difference between the total of the input and the output of patient 26057 on 12/27/this year.
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT...
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: give me the difference between the total of the input and the output of patient 26057 on 12/27/this year. ### Input: CREATE ...
Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a line chart.
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREA...
SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs
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: Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and...
What is the acronym for the name Malay of Kolej Komuniti Sungai Petani?
CREATE TABLE table_61910 ( "Name in English" text, "Name in Malay" text, "Acronym" text, "Foundation" text, "Location" text )
SELECT "Acronym" FROM table_61910 WHERE "Name in Malay" = 'kolej komuniti sungai petani'
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 acronym for the name Malay of Kolej Komuniti Sungai Petani? ### Input: CREATE TABLE table_61910 ( "Name in E...
What year has earnings of $557,158?
CREATE TABLE table_35365 ( "Year" real, "Wins" real, "Earnings ($)" text, "Rank" real, "Scoring average" real )
SELECT MAX("Year") FROM table_35365 WHERE "Earnings ($)" = '557,158'
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 year has earnings of $557,158? ### Input: CREATE TABLE table_35365 ( "Year" real, "Wins" real, "Earnings ($...
what's the points against with won being 11
CREATE TABLE table_14058433_4 ( points_against VARCHAR, won VARCHAR )
SELECT points_against FROM table_14058433_4 WHERE won = "11"
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's the points against with won being 11 ### Input: CREATE TABLE table_14058433_4 ( points_against VARCHAR, won V...
What was the team score when Tim Duncan (12) got the high rebounds?
CREATE TABLE table_29788 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Score" FROM table_29788 WHERE "High rebounds" = 'Tim Duncan (12)'
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 team score when Tim Duncan (12) got the high rebounds? ### Input: CREATE TABLE table_29788 ( "Game" real, ...
what was the name of the drug that patient 433 had been prescribed two or more times?
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
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 = 433) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2
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 was the name of the drug that patient 433 had been prescribed two or more times? ### Input: CREATE TABLE chartevents ( ...
did patient 027-151154 receive angiogram - with coiling at other hospitals?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-151154' AND patient.hospitaldischargetime IS NULL)) AND ...
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: did patient 027-151154 receive angiogram - with coiling at other hospitals? ### Input: CREATE TABLE diagnosis ( diagnosi...
Which Constellation has an Apparent magnitude larger that 7.7, and an NGC number of 7777
CREATE TABLE table_name_60 ( constellation VARCHAR, apparent_magnitude VARCHAR, ngc_number VARCHAR )
SELECT constellation FROM table_name_60 WHERE apparent_magnitude > 7.7 AND ngc_number = 7777
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: Which Constellation has an Apparent magnitude larger that 7.7, and an NGC number of 7777 ### Input: CREATE TABLE table_name_...
until 95 months ago, had entacapone ever been prescribed to patient 7241?
CREATE TABLE d_labitems ( row_id number, itemid number, label 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 ) CREATE TABLE inputevents_cv ( ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241) AND prescriptions.drug = 'entacapone' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-95 month')
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: until 95 months ago, had entacapone ever been prescribed to patient 7241? ### Input: CREATE TABLE d_labitems ( row_id nu...
what was last value of heart rate of patient 14467 today?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
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 = 14467)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
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 was last value of heart rate of patient 14467 today? ### Input: CREATE TABLE inputevents_cv ( row_id number, su...
What is the place of the Pinyin transcription Xi Wangri?
CREATE TABLE table_1805919_1 ( standard_order INTEGER, transcription__based_on_pinyin_ VARCHAR )
SELECT MAX(standard_order) FROM table_1805919_1 WHERE transcription__based_on_pinyin_ = "Xi Wangri"
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 place of the Pinyin transcription Xi Wangri? ### Input: CREATE TABLE table_1805919_1 ( standard_order INTEGE...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by weekday.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
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, a bar chart shows the di...
Count the number of patients on a main drug type prescription with diagnoses icd9 code 41512.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "41512" 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 on a main drug type prescription with diagnoses icd9 code 41512. ### Input: CREATE TABLE prescr...
Name the least game for score of l 93 109 (ot)
CREATE TABLE table_23186738_9 ( game INTEGER, score VARCHAR )
SELECT MIN(game) FROM table_23186738_9 WHERE score = "L 93–109 (OT)"
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 least game for score of l 93 109 (ot) ### Input: CREATE TABLE table_23186738_9 ( game INTEGER, score VARCHA...
Top 10 Users from India by Reputation.
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 100
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: Top 10 Users from India by Reputation. ### Input: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ...
Show me about the distribution of meter_300 and meter_100 in a bar chart, and I want to show Y from low to high order.
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100
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 about the distribution of meter_300 and meter_100 in a bar chart, and I want to show Y from low to high order. ### I...
How many completion students in each day? Return a bar chart binning date of completion by weekday, and I want to sort y-axis in asc order.
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Students ( student_id INTEGER, date...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion)
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: How many completion students in each day? Return a bar chart binning date of completion by weekday, and I want to sort y-axi...
had patient 016-9636 excreted output amt-chest tube a in 12/this year?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput...
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: had patient 016-9636 excreted output amt-chest tube a in 12/this year? ### Input: CREATE TABLE intakeoutput ( intakeoutp...
Count the names of all the products in the store and return me a bar chart, could you order Name in asc order?
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY 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: Count the names of all the products in the store and return me a bar chart, could you order Name in asc order? ### Input: CR...
who was the pitcher in seasons 1982, 1984, 1985, 1987, 1988, 1989
CREATE TABLE table_19864214_3 ( pitcher VARCHAR, seasons VARCHAR )
SELECT pitcher FROM table_19864214_3 WHERE seasons = "1982, 1984, 1985, 1987, 1988, 1989"
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 was the pitcher in seasons 1982, 1984, 1985, 1987, 1988, 1989 ### Input: CREATE TABLE table_19864214_3 ( pitcher VAR...
List first name and last name of customers that have more than 2 payments.
CREATE TABLE Customers ( first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR ) CREATE TABLE Customer_Payments ( customer_id VARCHAR )
SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2
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: List first name and last name of customers that have more than 2 payments. ### Input: CREATE TABLE Customers ( first_nam...
what was the number of patients that were tested since 5 years ago for sputum, tracheal specimen microbiology?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, tracheal specimen' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-5 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: what was the number of patients that were tested since 5 years ago for sputum, tracheal specimen microbiology? ### Input: CR...
What is the player listed when the score is 68-70-68-69=275
CREATE TABLE table_28498999_5 ( player VARCHAR, score VARCHAR )
SELECT player FROM table_28498999_5 WHERE score = 68 - 70 - 68 - 69 = 275
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 player listed when the score is 68-70-68-69=275 ### Input: CREATE TABLE table_28498999_5 ( player VARCHAR, ...
what's the name of the specimen test that was first given to patient 40967 during the last hospital encounter?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, ...
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40967 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime 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: what's the name of the specimen test that was first given to patient 40967 during the last hospital encounter? ### Input: CR...
What is the Loan Club from Eng that ended on 22 February?
CREATE TABLE table_name_57 ( loan_club VARCHAR, country VARCHAR, ended VARCHAR )
SELECT loan_club FROM table_name_57 WHERE country = "eng" AND ended = "22 february"
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 Loan Club from Eng that ended on 22 February? ### Input: CREATE TABLE table_name_57 ( loan_club VARCHAR, ...
What is the maximum renewable energy (gw h) for the state of Delaware?
CREATE TABLE table_25244412_1 ( renewable_electricity__gw INTEGER, state VARCHAR )
SELECT MAX(renewable_electricity__gw) AS •h_ FROM table_25244412_1 WHERE state = "Delaware"
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 renewable energy (gw h) for the state of Delaware? ### Input: CREATE TABLE table_25244412_1 ( renewa...
How many competitions in each competition type? And split them by country, show in desc by the x-axis.
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Tota...
SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country 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: How many competitions in each competition type? And split them by country, show in desc by the x-axis. ### Input: CREATE TAB...
Which game had a result of 126-95?
CREATE TABLE table_75338 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
SELECT "Game" FROM table_75338 WHERE "Result" = '126-95'
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 had a result of 126-95? ### Input: CREATE TABLE table_75338 ( "Game" text, "Date" text, "Home Team" t...
All posts of a user.
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
SELECT OwnerUserId AS "user_link", u.DisplayName, p.Id AS "post_link", ParentId AS "post_link", Title FROM Posts AS p LEFT OUTER JOIN Users AS u ON u.Id = OwnerUserId WHERE OwnerUserId = 65889
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: All posts of a user. ### Input: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId num...
In which club is Ledley King a captain?
CREATE TABLE table_name_3 ( club VARCHAR, captain VARCHAR )
SELECT club FROM table_name_3 WHERE captain = "ledley king"
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: In which club is Ledley King a captain? ### Input: CREATE TABLE table_name_3 ( club VARCHAR, captain VARCHAR ) ### R...
Which team had 21 points?
CREATE TABLE table_20007 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text )
SELECT "Team" FROM table_20007 WHERE "Points" = '21'
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 team had 21 points? ### Input: CREATE TABLE table_20007 ( "Position" real, "Team" text, "Points" real, ...
With Round 3 and Pick # over 10, what is the higher Overall number?
CREATE TABLE table_name_38 ( overall INTEGER, round VARCHAR, pick__number VARCHAR )
SELECT MAX(overall) FROM table_name_38 WHERE round = 3 AND pick__number > 10
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: With Round 3 and Pick # over 10, what is the higher Overall number? ### Input: CREATE TABLE table_name_38 ( overall INTE...
Who is the tournament winner in the Atlantic Coast Conference?
CREATE TABLE table_22779004_1 ( tournament_winner VARCHAR, conference VARCHAR )
SELECT tournament_winner FROM table_22779004_1 WHERE conference = "Atlantic Coast conference"
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 is the tournament winner in the Atlantic Coast Conference? ### Input: CREATE TABLE table_22779004_1 ( tournament_win...
what is the latest FIRST class flight of the day leaving DALLAS for SAN FRANCISCO
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND fa...
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 the latest FIRST class flight of the day leaving DALLAS for SAN FRANCISCO ### Input: CREATE TABLE fare ( fare_id...
has patient 030-8973 had any enteral osmolte 1.5 intake since 66 months ago.
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput...
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: has patient 030-8973 had any enteral osmolte 1.5 intake since 66 months ago. ### Input: CREATE TABLE diagnosis ( diagnos...
which district has the greatest total number of electorates ?
CREATE TABLE table_204_255 ( id number, "constituency number" number, "name" text, "reserved for (sc/st/none)" text, "district" text, "number of electorates (2009)" number )
SELECT "district" FROM table_204_255 GROUP BY "district" ORDER BY SUM("number of electorates (2009)") DESC LIMIT 1
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: which district has the greatest total number of electorates ? ### Input: CREATE TABLE table_204_255 ( id number, "co...
What is the title and source for the game developed by Hydravision Entertainment?
CREATE TABLE table_3580 ( "Title and source" text, "Developer" text, "Publisher" text, "First released" text, "Japan" text, "Europe" text, "North America" text, "Exclusive" text, "Move-only" text )
SELECT "Title and source" FROM table_3580 WHERE "Developer" = 'Hydravision Entertainment'
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 title and source for the game developed by Hydravision Entertainment? ### Input: CREATE TABLE table_3580 ( "...
give me the number of patients whose year of death is less than or equal to 2158 and procedure icd9 code is 3615?
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 WHERE demographic.dod_year <= "2158.0" AND procedures.icd9_code = "3615"
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: give me the number of patients whose year of death is less than or equal to 2158 and procedure icd9 code is 3615? ### Input:...
Which college has fewer than 2 rounds?
CREATE TABLE table_35540 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT "College" FROM table_35540 WHERE "Round" < '2'
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 college has fewer than 2 rounds? ### Input: CREATE TABLE table_35540 ( "Round" real, "Pick #" real, "Overa...
What was the score for a game with the odds of p + 2 after 1847?
CREATE TABLE table_name_36 ( score VARCHAR, odds VARCHAR, date VARCHAR )
SELECT score FROM table_name_36 WHERE odds = "p + 2" AND date > 1847
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 score for a game with the odds of p + 2 after 1847? ### Input: CREATE TABLE table_name_36 ( score VARCHAR, ...
What is the district with the result mac collins (r) unopposed?
CREATE TABLE table_27021001_1 ( district VARCHAR, result VARCHAR )
SELECT district FROM table_27021001_1 WHERE result = "Mac Collins (R) unopposed"
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 district with the result mac collins (r) unopposed? ### Input: CREATE TABLE table_27021001_1 ( district VARC...
what are the four most commonly prescribed drugs for patients who are prescribed cefepime at the same time?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'cefepime') AS t1 JOIN (SELECT admissions.subject_id, prescription...
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 are the four most commonly prescribed drugs for patients who are prescribed cefepime at the same time? ### Input: CREAT...
Name the least world rank for south american rank 3
CREATE TABLE table_2249087_1 ( world_rank INTEGER, south_american_rank VARCHAR )
SELECT MIN(world_rank) FROM table_2249087_1 WHERE south_american_rank = 3
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 least world rank for south american rank 3 ### Input: CREATE TABLE table_2249087_1 ( world_rank INTEGER, so...
what is the color quality when the proxy is x, the encryption is x, the webclient is x and authentication is ?
CREATE TABLE table_65068 ( "Project" text, "License" text, "Date" text, "Protocol" text, "Technology" text, "Server" text, "Client" text, "Web Client" text, "Multiple Sessions" text, "Encryption" text, "Authentication" text, "Data Compression" text, "Image Quality" te...
SELECT "Color Quality" FROM table_65068 WHERE "Proxy" = 'x' AND "Encryption" = 'x' AND "Web Client" = 'x' AND "Authentication" = '✓'
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 color quality when the proxy is x, the encryption is x, the webclient is x and authentication is ? ### Input: CR...
Which Advanced Portuguese courses have 8 credits , can you show me ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Portuguese%' OR name LIKE '%Advanced Portuguese%') AND credits = 8
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: Which Advanced Portuguese courses have 8 credits , can you show me ? ### Input: CREATE TABLE student_record ( student_id...
select Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId from Posts inner join PostLinks O.
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId n...
SELECT Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId FROM Posts INNER JOIN PostLinks ON PostLinks.LinkTypeId = 3 AND (Posts.Id = PostLinks.PostId OR Posts.Id = PostLinks.RelatedPostId)
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: select Title, Posts.Id, PostLinks.RelatedPostId, PostLinks.PostId from Posts inner join PostLinks O. ### Input: CREATE TABLE...
How many faculty members did the university that conferred the most degrees in 2002 have?
CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay numb...
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1
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 faculty members did the university that conferred the most degrees in 2002 have? ### Input: CREATE TABLE discipline...
which was the first state to be formed ?
CREATE TABLE table_203_190 ( id number, "name" text, "type" text, "circle" text, "bench" text, "formed" number, "notes" text )
SELECT "name" FROM table_203_190 ORDER BY "formed" LIMIT 1
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: which was the first state to be formed ? ### Input: CREATE TABLE table_203_190 ( id number, "name" text, "type" ...
what was the number of winners from spain ?
CREATE TABLE table_203_600 ( id number, "rank" text, "country" text, "winners" number, "runners-up" number, "finals total" number )
SELECT "winners" FROM table_203_600 WHERE "country" = 'spain'
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 number of winners from spain ? ### Input: CREATE TABLE table_203_600 ( id number, "rank" text, "cou...
how many patients were diagnosed as having transaminase elevation within 2 months after being diagnosed with hypoglycemia?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'transaminase elevation') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN p...
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: how many patients were diagnosed as having transaminase elevation within 2 months after being diagnosed with hypoglycemia? #...
Calculate the total number of patients admitted before the year 2174
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2174"
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 total number of patients admitted before the year 2174 ### Input: CREATE TABLE lab ( subject_id text, ...
What is the for the f136fb engine?
CREATE TABLE table_14101 ( "Engine" text, "Displacement" text, "Years" text, "Usage" text, "Power" text )
SELECT "Usage" FROM table_14101 WHERE "Engine" = 'f136fb'
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 for the f136fb engine? ### Input: CREATE TABLE table_14101 ( "Engine" text, "Displacement" text, "Ye...
When middle assyrian empire is the ubaid period in mesopotamia what is the copper age?
CREATE TABLE table_23537091_1 ( copper_age VARCHAR, ubaid_period_in_mesopotamia VARCHAR )
SELECT copper_age FROM table_23537091_1 WHERE ubaid_period_in_mesopotamia = "Middle Assyrian Empire"
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: When middle assyrian empire is the ubaid period in mesopotamia what is the copper age? ### Input: CREATE TABLE table_2353709...
Top 100K users by hit rate (accepted answer percentage rate). 100 users having the highest accepted answer percentage rate (among users with >100 answers)
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT u.Id AS "user_link", COUNT(a.Id), (CAST(SUM(CASE WHEN a.Id = q.AcceptedAnswerId THEN 1 ELSE 0 END) AS FLOAT) / COUNT(a.Id)) * 100 AS HitRate FROM Users AS u JOIN Posts AS a ON a.OwnerUserId = u.Id AND a.PostTypeId = 2 JOIN Posts AS q ON a.ParentId = q.Id GROUP BY u.Id HAVING COUNT(a.Id) > 25 ORDER BY HitRate DES...
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: Top 100K users by hit rate (accepted answer percentage rate). 100 users having the highest accepted answer percentage rate (...
How many Against have a Team of hespanha, and Points smaller than 30?
CREATE TABLE table_40250 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
SELECT COUNT("Against") FROM table_40250 WHERE "Team" = 'hespanha' AND "Points" < '30'
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 Against have a Team of hespanha, and Points smaller than 30? ### Input: CREATE TABLE table_40250 ( "Position" r...