instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_49377 ( "Result" text, "Race" text, "Distance" text, "Weight" real, "Winner or 2nd" text, "Pos'n" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the ajc craven plate (wfa) race?
SELECT "Result" FROM table_49377 WHERE "Race" = 'ajc craven plate (wfa)'
wikisql
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '混合性焦虑和抑郁障碍' AND jyjgzbb.JCZBMC = '促肾上腺皮质激素' UNION SELECT jyjgzbb...
css
CREATE TABLE table_name_81 ( result VARCHAR, score VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the match in Penrith that featured a score of 48-12?
SELECT result FROM table_name_81 WHERE score = "48-12" AND city = "penrith"
sql_create_context
CREATE TABLE table_12592074_1 ( namesake VARCHAR, commissioned_or_completed_ VARCHAR, _ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the namesake of the ship that was commissioned or completed(*) 16 april 1864?
SELECT namesake FROM table_12592074_1 WHERE commissioned_or_completed_ * _ = "16 April 1864"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT jybgb.SHSJ FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '70984037' AND jybgb.BGRQ BETWEEN '2009-08-30' AND '2012-...
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_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, drug text, dose...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY procedur...
mimic_iii
CREATE TABLE table_name_49 ( earnings___ INTEGER, wins VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest earnings of Lee Trevino who has 28 wins?
SELECT MIN(earnings___) AS $__ FROM table_name_49 WHERE wins = 28 AND player = "lee trevino"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 96728 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_69 ( owner VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the owner of fm 94.5?
SELECT owner FROM table_name_69 WHERE frequency = "fm 94.5"
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 jybgb ( BBCJBW text, BBDM tex...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2892777' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 22 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_k...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '30194082' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2017-12-01')
css
CREATE TABLE table_name_16 ( circuit VARCHAR, fastest_lap VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit did Juan Manuel Fangio have the fastest lap at the german grand prix?
SELECT circuit FROM table_name_16 WHERE fastest_lap = "juan manuel fangio" AND race = "german grand prix"
sql_create_context
CREATE TABLE table_name_60 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country is Gene Littler from?
SELECT country FROM table_name_60 WHERE player = "gene littler"
sql_create_context
CREATE TABLE qualifying ( qualifyId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, number INTEGER, position INTEGER, q1 TEXT, q2 TEXT, q3 TEXT ) CREATE TABLE results ( resultId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, n...
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(name)
nvbench
CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text,...
SELECT DISTINCT T2.name FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T1.area = "North Coast"
spider
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 1784 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_62573 ( "Actor in original production" text, "Actor required" text, "GamePlan" text, "FlatSpin" text, "RolePlay" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the GamePlan when Arabella Lazenby is the RolePlay actor?
SELECT "GamePlan" FROM table_62573 WHERE "RolePlay" = 'arabella lazenby'
wikisql
CREATE TABLE table_11960944_7 ( high_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many high points were there in the game 67?
SELECT COUNT(high_points) FROM table_11960944_7 WHERE game = 67
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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 ...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '37329044' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6376.37)
css
CREATE TABLE table_name_10 ( points INTEGER, games VARCHAR, tied VARCHAR, goals_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points scored when Acadie-Bathurst had 4 tied games, less than 257 goals, and over 72 gam...
SELECT MAX(points) FROM table_name_10 WHERE tied = "4" AND goals_for < 257 AND games > 72
sql_create_context
CREATE TABLE table_204_898 ( id number, "seed" text, "school" text, "conf (overall)" text, "tiebreaker" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many seeds above villanova is marquette ?
SELECT (SELECT "seed" FROM table_204_898 WHERE "school" = 'villanova') - (SELECT "seed" FROM table_204_898 WHERE "school" = 'marquette')
squall
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '38590585' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_58032 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What MLB draft has Shaun Boyd?
SELECT "MLB Draft" FROM table_58032 WHERE "Player" = 'shaun boyd'
wikisql
CREATE TABLE table_28401 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Founding Religious Affiliation" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which institution's nickname i...
SELECT "Institution" FROM table_28401 WHERE "Nickname" = 'Polar Bears'
wikisql
CREATE TABLE table_36441 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was Wales the Opponent?
SELECT "Date" FROM table_36441 WHERE "Opponent" = 'wales'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898') AND treatment.treatme...
eicu
CREATE TABLE table_name_37 ( no_9 VARCHAR, no_4 VARCHAR, no_6 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was No. 9 when Ava was No. 4 and Addison was No. 6?
SELECT no_9 FROM table_name_37 WHERE no_4 = "ava" AND no_6 = "addison"
sql_create_context
CREATE TABLE table_21756039_1 ( maac VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maac when the overall is 26-8?
SELECT maac FROM table_21756039_1 WHERE overall = "26-8"
sql_create_context
CREATE TABLE table_name_62 ( venue VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue of teh carfax 250 race?
SELECT venue FROM table_name_62 WHERE race = "carfax 250"
sql_create_context
CREATE TABLE table_47587 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Losses" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for less than 6 plays?
SELECT SUM("Rank") FROM table_47587 WHERE "Played" < '6'
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 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 WHERE demographic.gender = "M" AND diagnoses.icd9_code = "5845"
mimicsql_data
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE airlines ( name VARCHAR, alid VARCHAR ) CREATE TABLE routes ( alid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of the top 10 airlines that operate the most number of routes.
SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10
sql_create_context
CREATE TABLE table_15497 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Venue before 2003 with Notes of 57.73 m?
SELECT "Venue" FROM table_15497 WHERE "Year" < '2003' AND "Notes" = '57.73 m'
wikisql
CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- G...
SELECT class FROM race GROUP BY class ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) )...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date
nvbench
CREATE TABLE table_203_242 ( id number, "season" text, "competition" text, "round" text, "club" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long has fc shakhtyor salihorsk been playing in europe ?
SELECT MAX("season") - MIN("season") + 1 FROM table_203_242
squall
CREATE TABLE table_train_154 ( "id" int, "systolic_blood_pressure_sbp" int, "fpg" float, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT * FROM table_train_154 WHERE systolic_blood_pressure_sbp > 100 OR diastolic_blood_pressure_dbp > 70
criteria2sql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '06227779' AND jybgb.BGRQ BETWEEN '2008-03-13' AND '2016-12-19') UNI...
css
CREATE TABLE table_10812938_4 ( position VARCHAR, cfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Position did the Hamilton Tiger-Cats (via Ottawa) pick in the 2006 Draft.
SELECT position FROM table_10812938_4 WHERE cfl_team = "Hamilton Tiger-Cats (via Ottawa)"
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '34115354' AND zzmzjzjlb.JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '34115354' AND fzzmzjzjlb.JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19'
css
CREATE TABLE table_name_13 ( adelaide VARCHAR, sydney VARCHAR, perth VARCHAR, gold_coast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Adelaide has Perth no, Gold Coast no, and Sydney yes?
SELECT adelaide FROM table_name_13 WHERE perth = "no" AND gold_coast = "yes" AND sydney = "yes"
sql_create_context
CREATE TABLE table_204_87 ( id number, "courthouse" text, "city" text, "street address" text, "jurisdiction" text, "dates of use" text, "named for" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total number of courthouses locat...
SELECT COUNT("courthouse") FROM table_204_87 WHERE "city" = 'biloxi'
squall
CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE gas_station ( station_id number, open_year number, location...
SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1
spider
CREATE TABLE table_58070 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the score when goran ivani evi was runner up and the tournament was in algarve?
SELECT "Score" FROM table_58070 WHERE "Runner-up" = 'goran ivanišević' AND "Tournament" = 'algarve'
wikisql
CREATE TABLE table_35711 ( "Province" text, "Kibaki" text, "Raila" text, "Wamalwa" text, "Ngilu" text, "Others" text, "Registered Voters" text, "Turnout %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's listed for the Turnout % wi...
SELECT "Turnout %" FROM table_35711 WHERE "Raila" = '519,180'
wikisql
CREATE TABLE table_26124 ( "Represent" text, "Contestant" text, "Age" real, "Height (ft.)" text, "Height (mtr.)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country had a contestant that was 1.76 meters tall?
SELECT "Represent" FROM table_26124 WHERE "Height (mtr.)" = '1.76'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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 requirement (...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'GEOSCI' AND COURSE_0.numbe...
advising
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ci...
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_28026156_1 ( rank__week_ VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the episode rank that was written by thomas l. moran?
SELECT rank__week_ FROM table_28026156_1 WHERE written_by = "Thomas L. Moran"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2089"
mimicsql_data
CREATE TABLE table_name_15 ( branding VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the branding for cbxp-fm?
SELECT branding FROM table_name_15 WHERE call_sign = "cbxp-fm"
sql_create_context
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 ReviewTaskResults ( Id number, Review...
SELECT edits.PostId AS "post_link", edits.CreationDate, edits.Text AS "Edited tags", originalTags.Text AS "Original tags" FROM PostHistory AS edits JOIN PostHistory AS originalTags ON originalTags.PostId = edits.PostId WHERE edits.PostHistoryTypeId = 6 AND originalTags.PostHistoryTypeId = 3 AND originalTags.Text LIKE '...
sede
CREATE TABLE table_12922 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 entry for the row that has a 2009 entry of 270?
SELECT "2010" FROM table_12922 WHERE "2009" = '270'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
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 = '027-149724')) AND intakeoutput.celllabel = 'urin...
eicu
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_28148 ( "Total #" real, "Series #" real, "Title" text, "Director" text, "Writer(s)" text, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the show with director Paul Annett?
SELECT "Title" FROM table_28148 WHERE "Director" = 'Paul Annett'
wikisql
CREATE TABLE table_name_45 ( silver INTEGER, rank VARCHAR, bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver for rank 22 when gold count was more than 0 and Bronze count was less than 5?
SELECT SUM(silver) FROM table_name_45 WHERE bronze < 5 AND gold > 0 AND rank = "22"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
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 = 'BOSTON...
atis
CREATE TABLE table_15707 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the brabham bt46 bt48 bt49 Chassis common?
SELECT AVG("Year") FROM table_15707 WHERE "Chassis" = 'brabham bt46 bt48 bt49'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '81684964484' AND NOT t_kc22.SOC_SRT_DIRE_NM LIKE '%粉%'
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_11683 ( "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation has 1 bronze and 3 silvers?
SELECT "Nation" FROM table_11683 WHERE "Bronze" = '1' AND "Silver" = '3'
wikisql
CREATE TABLE table_name_28 ( total_apps INTEGER, cl_apps VARCHAR, pl_g VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the total apps of player benayoun, who has a PL G greater than 0 and more than 9 CL apps?
SELECT SUM(total_apps) FROM table_name_28 WHERE pl_g > 0 AND player = "benayoun" AND cl_apps > 9
sql_create_context
CREATE TABLE table_2638104_1 ( callsign VARCHAR, channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign for channel 6?
SELECT callsign FROM table_2638104_1 WHERE channel = 6
sql_create_context
CREATE TABLE table_47913 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Grid that has the Manufacturer of aprilia, and the sandro cortese?
SELECT SUM("Grid") FROM table_47913 WHERE "Manufacturer" = 'aprilia' AND "Rider" = 'sandro cortese'
wikisql
CREATE TABLE table_name_36 ( stage VARCHAR, points_classification VARCHAR, general_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is teh stage with Daniele Bennati as the points classification and Giovanni VIsconti as the general clas...
SELECT stage FROM table_name_36 WHERE points_classification = "daniele bennati" AND general_classification = "giovanni visconti"
sql_create_context
CREATE TABLE table_77208 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Area of the Allardville Parish with a Population smaller than 2,151?
SELECT SUM("Area km 2") FROM table_77208 WHERE "Official Name" = 'allardville' AND "Population" < '2,151'
wikisql
CREATE TABLE table_name_32 ( type VARCHAR, opened_in VARCHAR, ride_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which ride opened after the 2000 Peeking Heights?
SELECT type FROM table_name_32 WHERE opened_in > 2000 AND ride_name = "peeking heights"
sql_create_context
CREATE TABLE table_1342270_42 ( result VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the Tennessee 2 district election?
SELECT result FROM table_1342270_42 WHERE district = "Tennessee 2"
sql_create_context
CREATE TABLE table_name_22 ( team VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has a location and attendance at the Seattle Center Coliseum 12,591?
SELECT team FROM table_name_22 WHERE location_attendance = "seattle center coliseum 12,591"
sql_create_context
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABLE ...
SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000
spider
CREATE TABLE table_62923 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competition on 10 august 2011?
SELECT "Competition" FROM table_62923 WHERE "Date" = '10 august 2011'
wikisql
CREATE TABLE table_58273 ( "Competition" text, "Stage" text, "Venue" text, "Date" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue did group g play at on Mar 8, 1998?
SELECT "Venue" FROM table_58273 WHERE "Stage" = 'group g' AND "Date" = 'mar 8, 1998'
wikisql
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, me...
SELECT MAX(omim) FROM enzyme
spider
CREATE TABLE table_name_49 ( week VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week held a tournament in Rome?
SELECT week FROM table_name_49 WHERE tournament = "rome"
sql_create_context
CREATE TABLE table_4968 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average points White made with 0 extra points?
SELECT AVG("Points") FROM table_4968 WHERE "Extra points" = '0' AND "Player" = 'white'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2482) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate') GROUP BY STRFTIME('%y', labevents.charttime)
mimic_iii
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial injury - with intracerebral hemorrhage' AND STRFTIME('%y', d...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16627')) AND lab.labname = 'hct' AND STRFTIME('%y-%m', lab.labresulttime) <= '2...
eicu
CREATE TABLE table_38306 ( "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. -- Who ha...
SELECT "High assists" FROM table_38306 WHERE "Team" = 'milwaukee'
wikisql
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.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '67745789' AND jyjgzbb.JYRQ BETWEEN...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '26123080048'
css
CREATE TABLE schedule ( cinema_id number, film_id number, date text, show_times_per_day number, price number ) CREATE TABLE cinema ( cinema_id number, name text, openning_year number, capacity number, location text ) CREATE TABLE film ( film_id number, rank_in_series nu...
SELECT title, directed_by FROM film
spider
CREATE TABLE table_7479 ( "LastDays begin" text, "Startof Christ's Presence" text, "Christ madeKing" text, "Resurrection of144,000" text, "Judgmentof Religion" text, "Separating Sheep &Goats" text, "Great Tribulation" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT "Resurrection of144,000" FROM table_7479 WHERE "Christ madeKing" = '1914' AND "Separating Sheep &Goats" = 'during christ''s presence' AND "Judgmentof Religion" = '1878'
wikisql
CREATE TABLE table_62218 ( "Name" text, "Years" text, "MLS Cup" real, "U.S. Open Cup" real, "CONCACAF" real, "Other" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value for Other that has CONCACAF value of ...
SELECT MAX("Other") FROM table_62218 WHERE "U.S. Open Cup" > '0' AND "CONCACAF" = '0'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
atis
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '99152621' AND t_kc22.STA_DATE BETWEEN '2011-10-16' AND '2017-02-16' AND gwyjzb.MED_SER_ORG_NO = '1737840' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CL...
css
CREATE TABLE table_20616 ( "#" real, "Series Sorted" text, "Title" text, "Author" text, "Doctor" text, "Featuring" text, "Released" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the author for 6y/ae
SELECT "Author" FROM table_20616 WHERE "Series Sorted" = '6Y/AE'
wikisql
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_name_55 ( date_completed VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Little Tavern completed?
SELECT date_completed FROM table_name_55 WHERE nickname = "little tavern"
sql_create_context
CREATE TABLE country ( Country_name VARCHAR, Capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the country name and capital of all countries.
SELECT Country_name, Capital FROM country
sql_create_context
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), pro...
SELECT COUNT(*), customer_id FROM Accounts GROUP BY customer_id
nvbench
CREATE TABLE table_name_99 ( year INTEGER, result VARCHAR, nominated_work_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest year with the result is nominated for the work title is love bites?
SELECT MIN(year) FROM table_name_99 WHERE result = "nominated" AND nominated_work_title = "love bites"
sql_create_context
CREATE TABLE table_41160 ( "Player" text, "Team" text, "Inns" real, "Runs" real, "Balls" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Inns of 435 Runs?
SELECT "Inns" FROM table_41160 WHERE "Runs" = '435'
wikisql
CREATE TABLE table_name_30 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the to par for colin montgomerie
SELECT to_par FROM table_name_30 WHERE player = "colin montgomerie"
sql_create_context
CREATE TABLE table_name_7 ( visitor VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visitor for Chicago Black Hawks on May 6?
SELECT visitor FROM table_name_7 WHERE home = "chicago black hawks" AND date = "may 6"
sql_create_context
CREATE TABLE table_5264 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in Kathmandu?
SELECT "Score" FROM table_5264 WHERE "Venue" = 'kathmandu'
wikisql
CREATE TABLE table_149426_4 ( available_subnets INTEGER, network_mask VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the network mask is 255.255.255.128 what is the lowest available subnet?
SELECT MIN(available_subnets) FROM table_149426_4 WHERE network_mask = "255.255.255.128"
sql_create_context