instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_8013 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when away team is Crystal Palace?
SELECT "Score" FROM table_8013 WHERE "Away team" = 'crystal palace'
wikisql
CREATE TABLE table_1956 ( "Player" text, "Country" text, "Year(s) won" text, "R1" real, "R2" real, "R3" real, "R4" real, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country had a r3 a...
SELECT "Country" FROM table_1956 WHERE "R3" = '72' AND "Player" = 'Larry Mize'
wikisql
CREATE TABLE table_51184 ( "Player" text, "Position" text, "Tries" real, "Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tries has a Goal smaller than 0?
SELECT MIN("Tries") FROM table_51184 WHERE "Goals" < '0'
wikisql
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 microlab ( microl...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318...
eicu
CREATE TABLE table_70394 ( "Overall place" text, "Yacht name" text, "Skipper" text, "Points" text, "Combined elapsed time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Combined elapsed time has a Skipper of stephen wilkins?
SELECT "Combined elapsed time" FROM table_70394 WHERE "Skipper" = 'stephen wilkins'
wikisql
CREATE TABLE table_203_410 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which game date had a higher attendance ? fe...
SELECT "date" FROM table_203_410 WHERE "date" IN ('february 8, 2009', 'april 4, 2009') ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE table_67910 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had a qf in 2011?
SELECT "Tournament" FROM table_67910 WHERE "2011" = 'qf'
wikisql
CREATE TABLE table_name_15 ( top_10 INTEGER, poles VARCHAR, top_5 VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Top 10 has a Top 5 larger than 1, and a Year of 2003, and Poles larger than 0?
SELECT AVG(top_10) FROM table_name_15 WHERE top_5 > 1 AND year = 2003 AND poles > 0
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE table_name_97 ( location VARCHAR, pitch VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the Old Bedians Pitch?
SELECT location FROM table_name_97 WHERE pitch = "old bedians"
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 jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '12267094021') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '12267094021') AND jyjgzbb.JCZBJGDL >= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '12267094021')
css
CREATE TABLE table_name_91 ( date VARCHAR, margin_of_victory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had a margin victory of 2 strokes?
SELECT date FROM table_name_91 WHERE margin_of_victory = "2 strokes"
sql_create_context
CREATE TABLE table_name_64 ( televote INTEGER, artist VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Artist Justinas Lapatinskas with a draw of greater than 9 got what as the highest televote?
SELECT MAX(televote) FROM table_name_64 WHERE artist = "justinas lapatinskas" AND draw > 9
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 ReviewRejectionReasons ( Id number, N...
SELECT Id AS "user_link", WebsiteUrl FROM Users WHERE WebsiteUrl LIKE '%##Website##%'
sede
CREATE TABLE table_68854 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ICAO for when IATA is zyl
SELECT "ICAO" FROM table_68854 WHERE "IATA" = 'zyl'
wikisql
CREATE TABLE table_78336 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Apparent magn...
SELECT "Apparent magnitude" FROM table_78336 WHERE "Object type" = 'globular cluster'
wikisql
CREATE TABLE table_name_32 ( name VARCHAR, mark VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What name has 8.19 as the mark, with 3 as the lane?
SELECT name FROM table_name_32 WHERE mark = "8.19" AND lane = 3
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '50 ml syringe: dextrose 50 % iv soln' AND patient.uniquepid = '002-58884' AND DATETIME(medication.drugstarttime, 'start o...
eicu
CREATE TABLE table_204_54 ( id number, "pondicherry assembly" text, "duration" text, "name of m.l.a." text, "party affiliation" text, "election year" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who served after v. vaithilingam ?
SELECT "name of m.l.a." FROM table_204_54 WHERE "duration" > (SELECT "duration" FROM table_204_54 WHERE "name of m.l.a." = 'v. vaithilingam' ORDER BY "duration" DESC LIMIT 1) ORDER BY "duration" LIMIT 1
squall
CREATE TABLE documents ( document_id number, document_status_code text, document_type_code text, shipping_agent_code text, receipt_date time, receipt_number text, other_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_description text ) CREATE...
SELECT addresses.address_details FROM addresses JOIN documents_mailed ON documents_mailed.mailed_to_address_id = addresses.address_id WHERE document_id = 4
spider
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 5828) AND icustays.outtime IS NULL) A...
mimic_iii
CREATE TABLE table_27886 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the pop...
SELECT MAX("Population (2011)") FROM table_27886 WHERE "Cyrillic Name Other Names" = 'Ватин'
wikisql
CREATE TABLE table_name_36 ( name VARCHAR, local_board VARCHAR, decile VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name when the local board is albert eden, and a Decile of 9?
SELECT name FROM table_name_36 WHERE local_board = "albert–eden" AND decile = "9"
sql_create_context
CREATE TABLE table_name_34 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team when the home was st kilda?
SELECT away_team FROM table_name_34 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '凤欣合' AND IN_HOSP_DATE BETWEEN '2004-11-27' AND '2013-08-03' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_22078972_2 ( title VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of the episode first seen by 18.15 million people in the US?
SELECT title FROM table_22078972_2 WHERE us_viewers__millions_ = "18.15"
sql_create_context
CREATE TABLE table_14866 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which women's single had Cai Jaini Qi Yu on the wo...
SELECT "Women's singles" FROM table_14866 WHERE "Women's doubles" = 'cai jaini qi yu'
wikisql
CREATE TABLE table_13570_1 ( cytoplasm VARCHAR, nucleus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many cytoplasms result in a blue nucleus?
SELECT COUNT(cytoplasm) FROM table_13570_1 WHERE nucleus = "Blue"
sql_create_context
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 Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
nvbench
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '6607183' AND jybgb.BGRQ BETWEEN '2004-04-06' AND '2016-04-25' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 13 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb...
css
CREATE TABLE table_train_205 ( "id" int, "anemia" bool, "gender" string, "renal_disease" bool, "hematocrit_hct" float, "creatinine_gfr" int, "fasting_plasma_triglyceride" int, "thiazolidinediones" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following qu...
SELECT * FROM table_train_205 WHERE fasting_plasma_triglyceride > 600
criteria2sql
CREATE TABLE table_51365 ( "Year" real, "Property Taxes" text, "Investment Earnings" text, "Other Local Sources" text, "State & Federal" text, "Total Revenue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the investment earnings in th...
SELECT "Investment Earnings" FROM table_51365 WHERE "State & Federal" = '13,999,169'
wikisql
CREATE TABLE table_12876 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- 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_12876 WHERE "Year(s) won" = '1936'
wikisql
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 (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2555130' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-01-08' AND '2019-09-30' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 5728.03 UNION SELECT fgwyjzb....
css
CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE match_resul...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY Gender DESC
nvbench
CREATE TABLE table_name_96 ( school VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did bo jackson attend?
SELECT school FROM table_name_96 WHERE player = "bo jackson"
sql_create_context
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numci...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'yejin choi' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
scholar
CREATE TABLE table_56525 ( "Chapter" text, "University" text, "City" text, "State" text, "Conference" text, "Founding Date" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the chapter in Lubbock?
SELECT "Chapter" FROM table_56525 WHERE "City" = 'lubbock'
wikisql
CREATE TABLE table_80410 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent after week 9 with an attendance of 44,020?
SELECT "Opponent" FROM table_80410 WHERE "Week" > '9' AND "Attendance" = '44,020'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildin...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_77581 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the driver when the engine is mercedes fo110m?
SELECT "Driver" FROM table_77581 WHERE "Engine \u2020" = 'mercedes fo110m'
wikisql
CREATE TABLE table_51430 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did samardo samuels go to?
SELECT "School" FROM table_51430 WHERE "Player" = 'samardo samuels'
wikisql
CREATE TABLE tracks ( id INTEGER, name VARCHAR(200), album_id INTEGER, media_type_id INTEGER, genre_id INTEGER, composer VARCHAR(220), milliseconds INTEGER, bytes INTEGER, unit_price NUMERIC(10,2) ) CREATE TABLE playlists ( id INTEGER, name VARCHAR(120) ) CREATE TABLE sqlit...
SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8
nvbench
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((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
CREATE TABLE table_37213 ( "Name" text, "Birth" text, "Marriage" text, "Became Duchess" text, "Ceased to be Duchess" text, "Death" text, "Spouse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the person die who was born on 18 novem...
SELECT "Death" FROM table_37213 WHERE "Birth" = '18 november 1630'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "UPPER GI BLEED"
mimicsql_data
CREATE TABLE table_name_81 ( week INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest week that has September 14, 2003 as the date?
SELECT MAX(week) FROM table_name_81 WHERE date = "september 14, 2003"
sql_create_context
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
SELECT color, COUNT(color) FROM photos GROUP BY color
nvbench
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 AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'traumatic injury to major vessels - r femoral artery' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM location AS LOCATIONalias1, restaurant AS RESTAURANTalias1 W...
restaurants
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.discharge_location = "REHAB/DISTINCT PART HOSP"
mimicsql_data
CREATE TABLE table_40527 ( "Match No." text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the match with rosso kumamoto as the away team?
SELECT "Attendance" FROM table_40527 WHERE "Away Team" = 'rosso kumamoto'
wikisql
CREATE TABLE table_1341472_51 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts had results related to incumbent Toby Roth?
SELECT COUNT(result) FROM table_1341472_51 WHERE incumbent = "Toby Roth"
sql_create_context
CREATE TABLE table_47009 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Total frequency with ERP W of 62?
SELECT COUNT("Frequency MHz") FROM table_47009 WHERE "ERP W" = '62'
wikisql
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '94479415' AND t_kc21.IN_HOSP_DATE BETWEEN '2016-04-10' AND '2018-12-25' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏梦凡' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_28776 ( "Year (Ceremony)" text, "English title" text, "Arabic title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the arabic title when is the year (ceremony)?
SELECT "Year (Ceremony)" FROM table_28776 WHERE "Arabic title" = 'موسم زيتون'
wikisql
CREATE TABLE table_74127 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least december for hsbc arena/18,017
SELECT MIN("December") FROM table_74127 WHERE "Location/Attendance" = 'HSBC Arena/18,017'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-77873')) AND lab.labname = '-polys' AND STRFTIME('%y-%m', lab.labresulttime) >...
eicu
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_name_2 ( height_in_ft VARCHAR, school_club_team_country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of the player from Benetton Treviso, Italy?
SELECT height_in_ft FROM table_name_2 WHERE school_club_team_country = "benetton treviso, italy"
sql_create_context
CREATE TABLE table_name_25 ( home_team VARCHAR, away_team VARCHAR, tie_no VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home team has a Tie no of replay, a Date of 19 november 1985, and an Away team of tranmere rovers?
SELECT home_team FROM table_name_25 WHERE tie_no = "replay" AND date = "19 november 1985" AND away_team = "tranmere rovers"
sql_create_context
CREATE TABLE table_name_5 ( gold INTEGER, total VARCHAR, silver VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Gold award that has a Silver award greater than 2, and a Bronze award less than 13, and a Total greater...
SELECT AVG(gold) FROM table_name_5 WHERE silver > 2 AND bronze < 13 AND total > 24
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Users ( Id num...
SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate, LastActivityDate, Score, ViewCount, Body FROM Posts WHERE (Body LIKE '%##text##%') ORDER BY CreationDate DESC LIMIT 100
sede
CREATE TABLE table_name_89 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when indiana pacers were the opponent what was the date?
SELECT date FROM table_name_89 WHERE opponent = "indiana pacers"
sql_create_context
CREATE TABLE table_16208 ( "Name" text, "Dates active" text, "Peak classification" text, "Windspeeds" text, "Pressure" text, "Areas affected" text, "Damage (USD)" text, "Deaths" text, "Refs" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Dates active" FROM table_16208 WHERE "Deaths" = '185km/h (115mph)'
wikisql
CREATE TABLE table_14523 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game that put the team at 27-32?
SELECT "Loss" FROM table_14523 WHERE "Record" = '27-32'
wikisql
CREATE TABLE table_name_47 ( titles INTEGER, city VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of titles for the city of gy r with a rank larger than 4?
SELECT SUM(titles) FROM table_name_47 WHERE city = "győr" AND rank > 4
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2151" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bladder rupt, nont...
mimic_iii
CREATE TABLE table_50828 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the verb meaning for *bar as Part 2?
SELECT "Verb meaning" FROM table_50828 WHERE "Part 2" = '*bar'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT FIRST_NAME, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE member ( address VARCHAR, age INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which address has both members younger than 30 and members older than 40?
SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40
sql_create_context
CREATE TABLE table_5984 ( "Year" text, "Sports" text, "Competitors" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year did Yugoslavia have 4 Competitors with 0 medals Total?
SELECT "Year" FROM table_5984 WHERE "Total" = '0' AND "Competitors" = '4'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_seme...
SELECT DISTINCT course.department, course.name, course.number, semester.semester 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...
advising
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-43538') AND STRFTIME('%y', patient.unitadmittime) >= '2102' ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2180" AND procedures.short_title = "Open reduc-int fix femur"
mimicsql_data
CREATE TABLE table_54270 ( "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. -- When the home team was carlton how many people w...
SELECT "Crowd" FROM table_54270 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE table_18279 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the party for the incumbent Wyche Fowler?
SELECT "Party" FROM table_18279 WHERE "Incumbent" = 'Wyche Fowler'
wikisql
CREATE TABLE table_204_240 ( id number, "name" text, "current use" text, "completed" text, "namesake" text, "info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- are there more than 5 library buildings ?
SELECT (SELECT COUNT("name") FROM table_204_240 WHERE "current use" = 'library') > 5
squall
CREATE TABLE table_name_95 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of chicago bears involved what date?
SELECT date FROM table_name_95 WHERE opponent = "chicago bears"
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 zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '90418965888'
css
CREATE TABLE table_name_46 ( yards INTEGER, starts INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average number of yards Michael Henig had in a year when he had more than 12 starts/
SELECT AVG(yards) FROM table_name_46 WHERE starts > 12
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "8" AND diagnoses.long_title = "Ostium secundum type atrial septal defect"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.long_title = "Diabetes with renal manifestations, type II or unspecified type, not stated as uncontrolled"
mimicsql_data
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country
nvbench
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'demeclocycline') AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_51015 ( "Constituency" text, "Electorate" real, "Votes" real, "Turnout" real, "Spoilt" real, "Percent Yes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS AN AVERAGE ELECTORATE WITH VOTES OF 28,475 AND SPOILT SMALLER TH...
SELECT AVG("Electorate") FROM table_51015 WHERE "Votes" = '28,475' AND "Spoilt" < '5,779'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
SELECT CAST(TIME_TO_STR(Question.CreationDate, '%Y-%m-%d') AS TEXT(4)) AS Year, COUNT(Answer.Id) AS Answers FROM Posts AS Question JOIN Posts AS Answer ON Question.Id = Answer.ParentId WHERE Question.PostTypeId = 1 AND Answer.PostTypeId = 2 AND Question.ClosedDate IS NULL AND (Question.Tags LIKE '%<amazon-%' OR Questio...
sede
CREATE TABLE table_name_9 ( heat INTEGER, lane VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the 4 lane person from Canada?
SELECT MIN(heat) FROM table_name_9 WHERE lane = 4 AND nationality = "canada"
sql_create_context
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER,...
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code DESC
nvbench
CREATE TABLE club ( clubdesc VARCHAR, clubname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the description of the club 'Pen and Paper Gaming'.
SELECT clubdesc FROM club WHERE clubname = "Pen and Paper Gaming"
sql_create_context
CREATE TABLE table_train_248 ( "id" int, "anemia" bool, "prostate_specific_antigen_psa" float, "hemoglobin_a1c_hba1c" float, "body_weight" float, "fasting_triglycerides" int, "hyperlipidemia" bool, "hgb" int, "fasting_total_cholesterol" int, "fasting_ldl_cholesterol" int, "bo...
SELECT * FROM table_train_248 WHERE body_mass_index_bmi > 26 OR body_weight > 80
criteria2sql
CREATE TABLE table_name_85 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game that was held at the Princes Park?
SELECT date FROM table_name_85 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_25973 ( "Rank" real, "Dismissals" real, "Player" text, "Caught" real, "Stumped" real, "Matches" real, "Innings" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least dismissals for sammy carter
SELECT MIN("Dismissals") FROM table_25973 WHERE "Player" = 'Sammy Carter'
wikisql
CREATE TABLE table_203_347 ( id number, "temple name" text, "posthumous name" text, "family name (in bold) and personal name" text, "reign" text, "era names and their year ranges" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "family name (in bold) and personal name" FROM table_203_347 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_9991 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Pick is less than 161, and when College is 'Auburn University'?
SELECT "Player" FROM table_9991 WHERE "Pick" < '161' AND "College" = 'auburn university'
wikisql
CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREAT...
SELECT salary FROM salary WHERE league_id = "AL"
thehistoryofbaseball
CREATE TABLE table_name_38 ( losses INTEGER, scored VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lowest losses with more than 13 scored, and more than 7 draws?
SELECT MIN(losses) FROM table_name_38 WHERE scored > 13 AND draws > 7
sql_create_context