instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_87 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home teams score when north melbourne is the away team?
SELECT home_team AS score FROM table_name_87 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE table_69260 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation with Rank 1 won the fewest gold medals while winning more than 11 silver but fewer than 7 bronze me...
SELECT MIN("Gold") FROM table_69260 WHERE "Silver" > '11' AND "Rank" = '1' AND "Bronze" < '7'
wikisql
CREATE TABLE table_27293285_6 ( won VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches were won by the teams that scored exactly 61 tries for?
SELECT won FROM table_27293285_6 WHERE tries_for = "61"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '3% normal saline' A...
mimic_iii
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE month ( ...
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time 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 AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, Last...
SELECT Id AS "user_link", UpVotes, DownVotes, ROUND(CAST(DownVotes AS FLOAT) / (UpVotes + DownVotes) * 100, 2) AS DownVotesPCT FROM Users WHERE DownVotes > '##MinDownVotes##' ORDER BY DownVotesPCT DESC LIMIT 300
sede
CREATE TABLE table_204_855 ( id number, "year" number, "date" text, "winner" text, "result" text, "loser" text, "attendance" number, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of games that the detriot l...
SELECT COUNT(*) FROM table_204_855 WHERE "loser" = 'detroit lions'
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14990) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-10'
mimic_iii
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_40 ( club VARCHAR, goals VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club had over 0 goals in 2011?
SELECT club FROM table_name_40 WHERE goals > 0 AND season = "2011"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_20501 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the bowl game that was ...
SELECT "Bowl Game" FROM table_20501 WHERE "City" = 'Tempe, Arizona'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "14"
mimicsql_data
CREATE TABLE table_name_50 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Essendon played away; where did they play?
SELECT venue FROM table_name_50 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_27713583_2 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were on october 17?
SELECT COUNT(high_points) FROM table_27713583_2 WHERE date = "October 17"
sql_create_context
CREATE TABLE table_76299 ( "noun root (meaning)" text, "case suffix (case)" text, "postposition" text, "full word" text, "English meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Full Word, when Case Suffix (case) is '-sa (dative)...
SELECT "full word" FROM table_76299 WHERE "case suffix (case)" = '-sa (dative)'
wikisql
CREATE TABLE table_40046 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for ICAO when the IATA is sin?
SELECT "ICAO" FROM table_40046 WHERE "IATA" = 'sin'
wikisql
CREATE TABLE table_name_43 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 value with A in 2009 and A in 2008 in the Australian Open?
SELECT 2010 FROM table_name_43 WHERE 2009 = "a" AND 2008 = "a" AND tournament = "australian open"
sql_create_context
CREATE TABLE table_25501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT MAX("Game") FROM table_25501 WHERE "Team" = 'Cleveland'
wikisql
CREATE TABLE table_12088 ( "Driver" text, "Constructor" text, "Q1 order" real, "Q1 time" text, "Q1 pos" real, "Q1+Q2 time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the driver whose car was constructed by Renault and whose Q1 pos is ...
SELECT "Driver" FROM table_12088 WHERE "Constructor" = 'renault' AND "Q1 pos" > '2'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2176"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.admission_location, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_45 ( to_par VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the To par of the Player who won in 1936?
SELECT to_par FROM table_name_45 WHERE year_s__won = "1936"
sql_create_context
CREATE TABLE table_40454 ( "Rank" real, "Prev" real, "Player" text, "Rating" real, "Chng" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the total number of Prev that has the Chng of +10, and the Rating larger than 2765?
SELECT COUNT("Prev") FROM table_40454 WHERE "Chng" = '+10' AND "Rating" > '2765'
wikisql
CREATE TABLE table_1181375_1 ( introduced VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the introduced where notes is 9 withdrawn in 1946 after fire
SELECT introduced FROM table_1181375_1 WHERE notes = "9 withdrawn in 1946 after fire"
sql_create_context
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_34875 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum for the game with a score of 103 126?
SELECT SUM("Game") FROM table_34875 WHERE "Score" = '103–126'
wikisql
CREATE TABLE table_name_43 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of game 35?
SELECT score FROM table_name_43 WHERE game = 35
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Colostomy, not otherwise specified"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id numbe...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3277) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 month')
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dod_year <= "2138.0"
mimicsql_data
CREATE TABLE table_9878 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date prior to Week 14 was the Record 7-1?
SELECT "Date" FROM table_9878 WHERE "Week" < '14' AND "Record" = '7-1'
wikisql
CREATE TABLE table_27700375_11 ( date VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for the palace of auburn hills 14,554
SELECT date FROM table_27700375_11 WHERE location_attendance = "The Palace of Auburn Hills 14,554"
sql_create_context
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
atis
CREATE TABLE table_203_551 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of international goals ...
SELECT COUNT("goal") FROM table_203_551
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19981) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR...
mimic_iii
CREATE TABLE table_203_855 ( id number, "date" text, "city" text, "venue" text, "member" text, "performance" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last venue brian preformed in ?
SELECT "venue" FROM table_203_855 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_J...
SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
mimic_iii
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TAB...
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori...
scholar
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_35776 ( "Rank" real, "Building" text, "City" text, "Height (m/ft)" text, "Built" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the building in Bucharest with a rank of less than 12?
SELECT "Building" FROM table_35776 WHERE "City" = 'bucharest' AND "Rank" < '12'
wikisql
CREATE TABLE table_10127 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who took the loss against the California Angels when the attendance was 10,886?
SELECT "Loss" FROM table_10127 WHERE "Opponent" = 'california angels' AND "Attendance" = '10,886'
wikisql
CREATE TABLE table_name_18 ( bronze INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals for the United Kingdom when the silver was less than 0?
SELECT AVG(bronze) FROM table_name_18 WHERE nation = "united kingdom" AND silver < 0
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb....
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-141797') AND NOT patient.unitdischargetime IS NULL OR...
eicu
CREATE TABLE table_65292 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for week 2?
SELECT "Result" FROM table_65292 WHERE "Week" = '2'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =...
atis
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'po oral' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-6 year'))
eicu
CREATE TABLE table_name_51 ( week INTEGER, date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the last time, since December 14, 1986, that the attendance was lower than 47,096?
SELECT MAX(week) FROM table_name_51 WHERE date = "december 14, 1986" AND attendance < 47 OFFSET 096
sql_create_context
CREATE TABLE table_57724 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the away team score at Arden...
SELECT "Away team score" FROM table_57724 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_73942 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname of the University of Alabama?
SELECT "Nickname" FROM table_73942 WHERE "School" = 'University of Alabama'
wikisql
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 demographic.name, demographic.gender FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_3543 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Kent State University's ...
SELECT COUNT("Location") FROM table_3543 WHERE "Institution" = 'Kent State University'
wikisql
CREATE TABLE table_73676 ( "Club" text, "Home city" text, "Stadium" text, "First season in the Serie A" real, "First season in current spell" real, "Last title" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the last title for 2012
SELECT "Last title" FROM table_73676 WHERE "First season in current spell" = '2012'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.admityear < "2145"
mimicsql_data
CREATE TABLE table_73795 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Nickname" text, "US News Ranking 2014 for Liberal Arts" text, "Football?" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "Founded" FROM table_73795 WHERE "Institution" = 'Dickinson College'
wikisql
CREATE TABLE table_name_74 ( popular_votes VARCHAR, office VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of popular votes for mn attorney general in 1994
SELECT COUNT(popular_votes) FROM table_name_74 WHERE office = "mn attorney general" AND year = 1994
sql_create_context
CREATE TABLE problems ( problem_id VARCHAR, reported_by_staff_id VARCHAR ) CREATE TABLE staff ( staff_id VARCHAR, staff_last_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the ids of the problems that are reported by the staff whose last n...
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco"
sql_create_context
CREATE TABLE table_51166 ( "Episode" real, "Original airdate" text, "Timeslot (approx.)" text, "Viewers (millions)" real, "Nightly rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Original airdate for #6 with 1.246 viewers?
SELECT "Original airdate" FROM table_51166 WHERE "Nightly rank" = '#6' AND "Viewers (millions)" = '1.246'
wikisql
CREATE TABLE table_26931 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all opponents from the 4-4 scoring game.
SELECT "Opponent" FROM table_26931 WHERE "Record" = '4-4'
wikisql
CREATE TABLE table_name_62 ( year VARCHAR, points VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the year for points less than 20 and chassis of dallara 3087
SELECT year FROM table_name_62 WHERE points < 20 AND chassis = "dallara 3087"
sql_create_context
CREATE TABLE table_27155678_2 ( gene_name VARCHAR, genus_species VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the gene name for methylobacterium nodulans
SELECT gene_name FROM table_27155678_2 WHERE genus_species = "Methylobacterium nodulans"
sql_create_context
CREATE TABLE table_name_92 ( set_1 VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the set 1 score when the total is 85 101?
SELECT set_1 FROM table_name_92 WHERE total = "85–101"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjybgb ( BBCJBW text, BBDM t...
SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGDH = '49805079614' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb.BGDH = '49805079614'
css
CREATE TABLE table_name_62 ( seats INTEGER, general_election VARCHAR, share_of_votes VARCHAR, share_of_seats VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Seats have a Share of votes of 18%, and a Share of seats of 3%, and a General election l...
SELECT MAX(seats) FROM table_name_62 WHERE share_of_votes = "18%" AND share_of_seats = "3%" AND general_election > 1992
sql_create_context
CREATE TABLE table_train_240 ( "id" int, "anemia" bool, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "insulin_requirement" float, "kidney_disease" bool, "body...
SELECT * FROM table_train_240 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr > 60
criteria2sql
CREATE TABLE table_204_143 ( id number, "national park" text, "region" text, "land area (km2)" number, "established" number, "visitation (2009)" number, "coordinates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many national parks wer...
SELECT COUNT("national park") FROM table_204_143 WHERE "established" > 1990
squall
CREATE TABLE table_204_879 ( id number, "year" number, "host / location" text, "division i overall" text, "division i undergraduate" text, "division ii overall" text, "division ii community college" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "year" FROM table_204_879 WHERE id = 1
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_73803 ( "City / Municipality" text, "No. of s Barangay" real, "District" real, "Area (km\u00b2)" text, "Population (2010)" real, "Income class (2007)" text, "ZIP code" real, "Mayor" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "City / Municipality" FROM table_73803 WHERE "Mayor" = 'Helen C. De Castro'
wikisql
CREATE TABLE table_name_24 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the listed opponent in Week 2?
SELECT opponent FROM table_name_24 WHERE week = 2
sql_create_context
CREATE TABLE table_74579 ( "Lane" real, "Name" text, "Nationality" text, "Split (50m)" real, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the slowest 50m split time for a total of 53.74 in a lane of less than 3?
SELECT MAX("Split (50m)") FROM table_74579 WHERE "Time" = '53.74' AND "Lane" < '3'
wikisql
CREATE TABLE table_28219 ( "Unit" text, "Commander" text, "Complement" text, "Killed" text, "Wounded" text, "Missing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the complement associated with 0 off 3 men killed and 0 off 2 men wound...
SELECT "Complement" FROM table_28219 WHERE "Killed" = '0 off 3 men' AND "Wounded" = '0 off 2 men'
wikisql
CREATE TABLE table_41732 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of top-25s for events with more than 1 top-5?
SELECT SUM("Top-25") FROM table_41732 WHERE "Top-5" > '1'
wikisql
CREATE TABLE table_20790 ( "product" text, "dimensions (mm)" text, "dpi" real, "pages per minute (color)" real, "max page size" text, "interface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the mm dimensions of the Plustek Mobileoffi...
SELECT "dimensions (mm)" FROM table_20790 WHERE "product" = 'Plustek MobileOffice D28 Corporate'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, ...
SELECT * FROM (SELECT q.Id AS aid, a.Id AS "post_link", CASE WHEN q.AcceptedAnswerId = a.Id THEN 'Accepted' END AS Accepted, a.Score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2) AS AA INNER JOIN (SELECT DISTINCT Question.Id AS bid, Question.CreationDate ...
sede
CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE invoice ( invoiceid number, customerid number, invoicedate time, billingaddress text, billingcity text, billingstate text, billingcountry text, billingpostalcode text, total number ) CREATE TABLE mediatype ...
SELECT AVG(T2.unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock"
spider
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee
nvbench
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 t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'chest x-ray') AS t1 JOIN (SELECT patient.uni...
eicu
CREATE TABLE table_name_59 ( nationality VARCHAR, lane VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Nationality of the person who has a Rank of 4
SELECT nationality FROM table_name_59 WHERE lane < 4 AND rank = 4
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT txmzjzjlb.JZJSSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '45655595406' UNION SELECT ftxmzjzjlb.JZJSSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '45655595406'
css
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 prescriptions...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "ANGIOEDEMA"
mimicsql_data
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE ...
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'NLP' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_64653 ( "Rank" real, "Name" text, "Status" text, "City" text, "Floors" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for the city of sewri?
SELECT COUNT("Rank") FROM table_64653 WHERE "City" = 'sewri'
wikisql
CREATE TABLE table_74774 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks had an attendance larger than 84,816?
SELECT COUNT("Week") FROM table_74774 WHERE "Attendance" > '84,816'
wikisql
CREATE TABLE table_46715 ( "Season" text, "Competition" text, "Round" text, "Club" text, "1st Leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round of club be ej?
SELECT "Round" FROM table_46715 WHERE "Club" = 'bečej'
wikisql
CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, Aircraft_Movements real, Freight_Metric_Tonnes real ) CREATE TABLE aircraft ( Aircraft_ID int(11...
SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY COUNT(Aircraft)
nvbench
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '施方方' AND qtb.MED_SER_ORG_NO = '4248222' AND qtb.OUT_DIAG_DOC_NM LIKE '陈%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '施方方' AND gyb.MED_SER_ORG_NO = '4248222' AND gyb.OUT_DIAG_DOC_NM LIKE '陈%' UNION ...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '58304822879' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '58304822879'
css
CREATE TABLE table_5232 ( "Rank" real, "Airport" text, "Passengers" real, "% Change" text, "Carriers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Rank that has Passengers larger than 70,921, and 2.8 % Change?
SELECT SUM("Rank") FROM table_5232 WHERE "Passengers" > '70,921' AND "% Change" = '2.8'
wikisql
CREATE TABLE table_name_21 ( lane VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lane number of the swimmer with a time of 55.69?
SELECT lane FROM table_name_21 WHERE time = 55.69
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND intakeoutput.celllabel = 'stool...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.short_title = "Conduit left ventr-aorta"
mimicsql_data
CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT MIN(T2.hs), T1.ppos FROM tryout AS T1 JOIN player AS T2 ON T1.pid = T2.pid GROUP BY T1.ppos
spider
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Votes ( Id number, PostId number, ...
SELECT P.Id AS "post_link", P.Score AS "SCORE PERG.", A.Score AS "SCORE RESP." FROM Posts AS P JOIN (SELECT Id, Score FROM Posts GROUP BY Id, Score) AS A ON P.AcceptedAnswerId = A.Id WHERE P.Score > @Score AND A.Score > @Score
sede
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '74125080' AND t_kc22.STA_DATE BETWEEN '2017-12-05' AND '2018-03-20' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_27988 ( "Rnd" text, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Winning driver" text, "Winning team" text, "Supporting" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT "Winning team" FROM table_27988 WHERE "Winning driver" = 'Mikhail Goikhberg'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY MIN(T2.HS)
nvbench