instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_57 ( round VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of rounds with a 4-0 record?
SELECT COUNT(round) FROM table_name_57 WHERE record = "4-0"
sql_create_context
CREATE TABLE table_24039 ( "Episode #" real, "Episode" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "U.S. airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director of the 'Adam's Family'?
SELECT "Director" FROM table_24039 WHERE "Title" = 'Adam''s Family'
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_kc24.MED_CLINIC_ID, t_kc24.t_kc21_PERSON_ID, t_kc24.t_kc21_PERSON_NM, t_kc24.t_kc21_IDENTITY_CARD, t_kc24.t_kc21_PERSON_SEX, t_kc24.t_kc21_PERSON_AGE FROM t_kc24 WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '82639761234')
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 * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'meningitis - acute' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info...
css
CREATE TABLE table_26614365_5 ( galician___reintegrationist__ VARCHAR, galician___official__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Galician (reintegrationist) word of the Galician (Official) is bo d a / bos d as?
SELECT galician___reintegrationist__ FROM table_26614365_5 WHERE galician___official__ = "Bo día / Bos días"
sql_create_context
CREATE TABLE table_9779 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a silver greater than 0, gold of 9 and a bronze less than 9, what is the lowest total listed?
SELECT MIN("Total") FROM table_9779 WHERE "Silver" > '0' AND "Gold" = '9' AND "Bronze" < '9'
wikisql
CREATE TABLE table_65600 ( "Year (Ceremony)" text, "Category" text, "Film title used in nomination" text, "Original title" text, "Language" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What title was used in the nomination of th...
SELECT "Film title used in nomination" FROM table_65600 WHERE "Language" = 'spanish' AND "Original title" = 'traffic'
wikisql
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 jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '21625825' AND jybgb.BGRQ BETWEEN '2002-07-09' AND '2012-...
css
CREATE TABLE table_69242 ( "Date" text, "Time" text, "Round" text, "Opponent" text, "Ground" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the game played at home against the opponent Siena?
SELECT "Date" FROM table_69242 WHERE "Opponent" = 'siena' AND "Ground" = 'home'
wikisql
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 medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230')) AND medication.drugname = 'omeprazole (prilosec) c...
eicu
CREATE TABLE table_name_23 ( song VARCHAR, film VARCHAR, year VARCHAR, music_director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the song with year before 2013 and music director of yuvan shankar raja and film of billa ii
SELECT song FROM table_name_23 WHERE year < 2013 AND music_director = "yuvan shankar raja" AND film = "billa ii"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-87703' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_44148 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on the date of september 15, 1968?
SELECT "Record" FROM table_44148 WHERE "Date" = 'september 15, 1968'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID ORDER BY Name
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Tietze's disease"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '7835150' AND txmzjzjlb.JZKSRQ BETWEEN '2011-04-06' AND '2019-11-23' AND txmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '7835150' AND ftxmzjzjlb.JZKSRQ BETWEEN '2011-04-06' AND '2019-11-23' AND ftxmzjzjlb.ZZBZ > 0
css
CREATE TABLE table_23157997_13 ( winner VARCHAR, mountains_classification VARCHAR, points_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the race with Tom Zirbel as Mountains Classification and Thomas Soladay as Points Classificati...
SELECT winner FROM table_23157997_13 WHERE mountains_classification = "Tom Zirbel" AND points_classification = "Thomas Soladay"
sql_create_context
CREATE TABLE table_72314 ( "Year" real, "Population (Region total)" real, "Population (Mareeba)" real, "Population (Atherton)" real, "Population (Herberton)" real, "Population (Eacham)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many fig...
SELECT COUNT("Population (Region total)") FROM table_72314 WHERE "Year" = '1947'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE table_10944 ( "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. -- What is the crowd total for glenferrie oval?
SELECT COUNT("Crowd") FROM table_10944 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_64614 ( "Name" text, "Nationality" text, "1.85" text, "1.93" text, "Height" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1.93 for Svetlana Shkolina?
SELECT "1.93" FROM table_64614 WHERE "Name" = 'svetlana shkolina'
wikisql
CREATE TABLE table_40985 ( "Class" real, "Date" text, "Builder" text, "No. built" real, "1919 nos." text, "LMS Class" text, "LMS nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1879-81 with number built 4, what is the LMS nos?
SELECT "LMS nos." FROM table_40985 WHERE "Date" = '1879-81' AND "No. built" = '4'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_35487 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won by 2 or more goals difference" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT MAX("Against") FROM table_35487 WHERE "Team" = 'palmeiras' AND "Position" < '4'
wikisql
CREATE TABLE table_48785 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result F-A on 5 August 1990?
SELECT "Result F \u2013 A" FROM table_48785 WHERE "Date" = '5 august 1990'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
SELECT name, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_70063 ( "Value" text, "Khmer" real, "Word Form" text, "UNGEGN" text, "ALA-LC" text, "Other" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the word form for the ALA-LC transliteration of muay s ain?
SELECT "Word Form" FROM table_70063 WHERE "ALA-LC" = 'muay s″ain'
wikisql
CREATE TABLE table_57463 ( "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. -- Which home team has a home score of 11.14 (80)?
SELECT "Home team" FROM table_57463 WHERE "Home team score" = '11.14 (80)'
wikisql
CREATE TABLE table_19028 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the mens doubles with mixed doubles being j...
SELECT "Mens doubles" FROM table_19028 WHERE "Mixed doubles" = 'Jimm Aalto Nina Sarnesto'
wikisql
CREATE TABLE table_12292 ( "Triples" real, "Player" text, "Team" text, "Year" real, "Years Record Stood" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the years record stood from the Pittsburgh Pirates in 1902?
SELECT "Years Record Stood" FROM table_12292 WHERE "Year" = '1902' AND "Team" = 'pittsburgh pirates'
wikisql
CREATE TABLE table_60100 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round had a amtch against cyprus and an edition of 2010 davis...
SELECT "Round" FROM table_60100 WHERE "Edition" = '2010 davis cup europe/africa group ii' AND "Against" = 'cyprus'
wikisql
CREATE TABLE table_name_43 ( round VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the round for southampton opponents
SELECT round FROM table_name_43 WHERE opponents = "southampton"
sql_create_context
CREATE TABLE table_4284 ( "Umpire" text, "Country" text, "Panel" text, "Matches" real, "WC Matches" real, "2011 WC" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of the least matches
SELECT MIN("Matches") FROM table_4284
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15107) AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-11' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_74 ( inflation__percentage_annual__2012_ INTEGER, public_debt__percentage_of_gdp__2013_q1_ VARCHAR, gdp__percentage_of_eu__2012_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest inflation % annual in 2012 of the ...
SELECT MAX(inflation__percentage_annual__2012_) FROM table_name_74 WHERE public_debt__percentage_of_gdp__2013_q1_ > 88.2 AND gdp__percentage_of_eu__2012_ = "2.9%"
sql_create_context
CREATE TABLE table_13393 ( "Rank" real, "Name" text, "1st run" text, "2nd run" text, "3rd run" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what total was 37.410 (4) the 1st run?
SELECT "Total" FROM table_13393 WHERE "1st run" = '37.410 (4)'
wikisql
CREATE TABLE table_name_93 ( tv_time VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which TV Time has a Result of w 24 17?
SELECT tv_time FROM table_name_93 WHERE result = "w 24–17"
sql_create_context
CREATE TABLE table_name_47 ( muzzle_device VARCHAR, barrel_twist VARCHAR, stock VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the muzzle device with a 1:7 barrel twist and a stock 4th generation?
SELECT muzzle_device FROM table_name_47 WHERE barrel_twist = "1:7" AND stock = "4th generation"
sql_create_context
CREATE TABLE table_name_89 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2005, when 1998 is 'F', and when 2002 is '2R'?
SELECT 2005 FROM table_name_89 WHERE 1998 = "f" AND 2002 = "2r"
sql_create_context
CREATE TABLE member_attendance ( member_id number, performance_id number, num_of_pieces number ) CREATE TABLE member ( member_id text, name text, nationality text, role text ) CREATE TABLE performance ( performance_id number, date text, host text, location text, attenda...
SELECT location, COUNT(*) FROM performance GROUP BY location
spider
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.c...
eicu
CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_add...
SELECT T1.crs_code FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'
spider
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 demographic.admission_location, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "1875"
mimicsql_data
CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation bigint, iata character varchar(3), icao character varchar(4) ) CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varc...
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country
nvbench
CREATE TABLE table_name_98 ( film VARCHAR, award VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the film for award of 3,740
SELECT film FROM table_name_98 WHERE award = "£3,740"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI...
atis
CREATE TABLE table_1973816_1 ( nickname VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the nickname of the students of the school founded in 1933?
SELECT nickname FROM table_1973816_1 WHERE founded = 1933
sql_create_context
CREATE TABLE table_11076 ( "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 score was 6.11 (47), what was...
SELECT MAX("Crowd") FROM table_11076 WHERE "Home team score" = '6.11 (47)'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "50946"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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 te...
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_MZJZJL...
css
CREATE TABLE table_2080 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "Average Speed (mph)" FROM table_2080 WHERE "Driver" = 'Tony Stewart'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4601"
mimicsql_data
CREATE TABLE table_204 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Venue" text, "TV" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at week 7...
SELECT "Record" FROM table_204 WHERE "Week" = '7'
wikisql
CREATE TABLE table_14132239_3 ( rookie VARCHAR, transition VARCHAR, offensive VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the rookie award the week the transition award was given to Brodie Merrill and the offensive award was given to Pat Madda...
SELECT rookie FROM table_14132239_3 WHERE transition = "Brodie Merrill" AND offensive = "Pat Maddalena"
sql_create_context
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application 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, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLA...
atis
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE route ( train_id int, ...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority
nvbench
CREATE TABLE table_name_91 ( att INTEGER, avg VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the greatest att with an avg of 4.3
SELECT MAX(att) FROM table_name_91 WHERE avg = 4.3
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Unspecified erythematous condition"
mimicsql_data
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.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 (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE table_22718 ( "interval name" text, "size (steps)" real, "size (cents)" real, "just ratio" text, "just (cents)" text, "error" text, "audio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the just ratio is 11:8 and the cents s...
SELECT "interval name" FROM table_22718 WHERE "size (cents)" = '560' AND "just ratio" = '11:8'
wikisql
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 lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4312' AND patient.hospitaldischargetime IS NULL)) ORDER BY lab.labresulttime LIMIT 1
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'chronic kidney disease - stage 4 (gfr 15-29)' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), ...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Troy Friedman"
mimicsql_data
CREATE TABLE building ( building_id text, name text, street_address text, years_as_tallest text, height_feet number, floors number ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage number, accession_number text, sequence_length numbe...
SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20
spider
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_type = "URGENT" AND demographic.age < "64"
mimicsql_data
CREATE TABLE table_3308 ( "Circuit" text, "Location" text, "Date" text, "Series" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit was the FR3.5 11 series on?
SELECT "Circuit" FROM table_3308 WHERE "Series" = 'FR3.5 11'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2164" AND diagnoses.icd9_code = "3315"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Blasts"
mimicsql_data
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 AVG(demographic.age) FROM demographic WHERE demographic.language = "CAPE" AND demographic.diagnosis = "HYPERGLYCEMIA"
mimicsql_data
CREATE TABLE Order_Items ( order_item_id INTEGER, product_id INTEGER, order_id INTEGER, order_item_status VARCHAR(10), order_item_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, invoice_date DATETIME, invoice_details VARCHAR(255) ) CREATE TABLE Customers ( cu...
SELECT date_order_placed, COUNT(date_order_placed) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
nvbench
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE R...
SELECT * FROM Posts WHERE Tags LIKE '%unit-testing%'
sede
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price)
nvbench
CREATE TABLE table_73801 ( "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 "Income class (2007)" FROM table_73801 WHERE "Mayor" = 'Ma. Ester A. Hamor'
wikisql
CREATE TABLE table_204_589 ( id number, "season" text, "tier" number, "division" text, "pos." text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many were in the first tier ?
SELECT COUNT(*) FROM table_204_589 WHERE "tier" = 1
squall
CREATE TABLE table_73532 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jasons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the broadcast date where Jason's team is Rhod Gilbert and Shappi Khorsandi?
SELECT "First broadcast" FROM table_73532 WHERE "Jasons team" = 'Rhod Gilbert and Shappi Khorsandi'
wikisql
CREATE TABLE table_41379 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the team 1 in the match that had a 1st leg score of 3-0 and a 2nd leg of 1-2?
SELECT "Team 1" FROM table_41379 WHERE "2nd leg" = '1-2' AND "1st leg" = '3-0'
wikisql
CREATE TABLE table_1965650_7 ( nhl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams have a player named Denis Andersen?
SELECT COUNT(nhl_team) FROM table_1965650_7 WHERE player = "Denis Andersen"
sql_create_context
CREATE TABLE table_test_9 ( "id" int, "ejection_fraction_ef" int, "anemia" bool, "child_pugh_class" string, "systolic_blood_pressure_sbp" int, "leukopenia" int, "heart_disease" bool, "stroke" bool, "av_block" bool, "renal_disease" bool, "hepatic_disease" bool, "estimated_...
SELECT * FROM table_test_9 WHERE ejection_fraction_ef >= 20 AND ejection_fraction_ef <= 45
criteria2sql
CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text ) CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discon...
SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints)
spider
CREATE TABLE table_18183850_12 ( score VARCHAR, opponent_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opposing team was from Belgium?
SELECT score FROM table_18183850_12 WHERE opponent_team = "Belgium"
sql_create_context
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 CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), ...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT) DESC
nvbench
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, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "25167"
mimicsql_data
CREATE TABLE table_203_473 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin\nof victory" text, "runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was the margin of victory 3 s...
SELECT COUNT(*) FROM table_203_473 WHERE "margin\nof victory" >= 3
squall
CREATE TABLE table_name_48 ( class VARCHAR, qual_pos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which class has a Qual position of 30?
SELECT class FROM table_name_48 WHERE qual_pos = 30
sql_create_context
CREATE TABLE table_38775 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is donovan's surname?
SELECT "Surname" FROM table_38775 WHERE "First" = 'donovan'
wikisql
CREATE TABLE table_78147 ( "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. -- What is the total Crowd number for the team that...
SELECT SUM("Crowd") FROM table_78147 WHERE "Away team score" = '12.18 (90)'
wikisql
CREATE TABLE enroll ( class_code VARCHAR ) CREATE TABLE CLASS ( class_code VARCHAR, crs_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many students enrolled in class ACCT-211?
SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_name_26 ( game INTEGER, november VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the game when on november 27?
SELECT SUM(game) FROM table_name_26 WHERE november = 27
sql_create_context
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat")
nvbench
CREATE TABLE table_23465864_4 ( sat_29_aug VARCHAR, mon_24_aug VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time was achieved on Saturday 29th August by the rider who recorded 24' 17.26 93.208mph on Monday 24th August?
SELECT sat_29_aug FROM table_23465864_4 WHERE mon_24_aug = "24' 17.26 93.208mph"
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 person_info...
css
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 mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '50197380603'
css
CREATE TABLE table_19839 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT COUNT("Team(s)") FROM table_19839 WHERE "Position" = '76th'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpo...
atis
CREATE TABLE table_1014319_1 ( tonioli VARCHAR, goodman VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many songs received a 10 from Goodman and were rated by Tonioli?
SELECT COUNT(tonioli) FROM table_1014319_1 WHERE goodman = "10"
sql_create_context
CREATE TABLE table_8674 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the game with an away team of Hispano?
SELECT "Attendance" FROM table_8674 WHERE "Away" = 'hispano'
wikisql