instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_76427 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year that Hale Irwin won with 285 points?
SELECT "Year(s) won" FROM table_76427 WHERE "Total" = '285' AND "Player" = 'hale irwin'
wikisql
CREATE TABLE table_name_78 ( college_junior_club_team__league_ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE LEAGUE WITH PLAYER JOE COLBORNE?
SELECT college_junior_club_team__league_ FROM table_name_78 WHERE player = "joe colborne"
sql_create_context
CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE farm_competition ( competition_id number, year number, theme text, host_city_id number, hosts text ) CREATE TABLE competition_record ...
SELECT official_name, status FROM city ORDER BY population DESC LIMIT 1
spider
CREATE TABLE table_12712 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the golfer with winnings of 40,850 and a score of 72-74-...
SELECT "To par" FROM table_12712 WHERE "Money ( \u00a3 )" = '40,850' AND "Score" = '72-74-70-70=286'
wikisql
CREATE TABLE table_13177 ( "Ranking" text, "Nationality" text, "Name" text, "Years" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of the player ranking 3?
SELECT "Nationality" FROM table_13177 WHERE "Ranking" = '3'
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Creatine Kinase, MB Isoenzyme"
mimicsql_data
CREATE TABLE table_47249 ( "Barangay" text, "Urban/rural" text, "Geographic character" text, "Population (2007)" real, "Population (2010)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TYPE OF LAND WITH A 2010 POPULATION GREATER THAN 25...
SELECT "Geographic character" FROM table_47249 WHERE "Population (2010)" > '2539' AND "Urban/rural" = 'rural' AND "Population (2007)" = '2572'
wikisql
CREATE TABLE table_1125 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the losses for general caba...
SELECT "Losses" FROM table_1125 WHERE "Team" = 'General Caballero ZC'
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE table_23718905_6 ( date VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game played in El Paso, Texas?
SELECT date FROM table_23718905_6 WHERE city = "El Paso, Texas"
sql_create_context
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE city ...
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY Official_Name ORDER BY Year
nvbench
CREATE TABLE table_3027 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whe...
SELECT "Conference Player of the Year" FROM table_3027 WHERE "Regular Season Winner" = 'Butler'
wikisql
CREATE TABLE table_name_21 ( points INTEGER, laps VARCHAR, team VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many average points did the team Minardi Team USA have when there was a grid 3 and more laps than 68?
SELECT AVG(points) FROM table_name_21 WHERE team = "minardi team usa" AND grid = 3 AND laps > 68
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 jybgb WHERE jybgb.JZLSH = '11083339230'
css
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-105495' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_71645 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of the original title Cidade de deus?
SELECT "Country" FROM table_71645 WHERE "Original title" = 'cidade de deus'
wikisql
CREATE TABLE table_name_28 ( team_performance VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team performance in 1977?
SELECT team_performance FROM table_name_28 WHERE year = 1977
sql_create_context
CREATE TABLE table_69972 ( "Name [b ]" text, "Term [c ]" text, "Games" real, "Win%" real, "PWin%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the game with a PWin% of , Term [c] of 1987 1988, and Win% less than 0.506?
SELECT SUM("Games") FROM table_69972 WHERE "PWin%" = '—' AND "Term [c ]" = '1987–1988' AND "Win%" < '0.506'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE diagnoses ( 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.insurance = "Private" AND lab.label = "C3"
mimicsql_data
CREATE TABLE table_204_284 ( id number, "jurisdiction" text, "adherents" number, "bishops" number, "priests" number, "monastics" number, "monasteries" number, "parishes" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- total number of ad...
SELECT SUM("adherents") FROM table_204_284 WHERE "jurisdiction" IN ('romania', 'cyprus', 'greece')
squall
CREATE TABLE table_69399 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which number has a 0.35 percentage?
SELECT "Number" FROM table_69399 WHERE "percentage (%)" = '0.35'
wikisql
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 HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_2 ( opponent VARCHAR, event VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent's event was sb 24 - return of the heavyweights 2, and had a method of TKO (knee and punches)?
SELECT opponent FROM table_name_2 WHERE event = "sb 24 - return of the heavyweights 2" AND method = "tko (knee and punches)"
sql_create_context
CREATE TABLE table_59257 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind...
SELECT "Replaced by" FROM table_59257 WHERE "Outgoing manager" = 'guillermo sanguinetti'
wikisql
CREATE TABLE table_name_71 ( nickname VARCHAR, established VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nick name for the school established in 1958?
SELECT nickname FROM table_name_71 WHERE established = 1958
sql_create_context
CREATE TABLE table_name_78 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the match played in Victoria Park?
SELECT date FROM table_name_78 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE table_67896 ( "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 is the record number of the game where Guardado lost?
SELECT "Record" FROM table_67896 WHERE "Loss" = 'guardado'
wikisql
CREATE TABLE table_name_69 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score to par did Mike Weir have?
SELECT to_par FROM table_name_69 WHERE player = "mike weir"
sql_create_context
CREATE TABLE table_46268 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average grid for vehicles manufactured by Aprilia and having run more than 16 laps?
SELECT AVG("Grid") FROM table_46268 WHERE "Manufacturer" = 'aprilia' AND "Laps" > '16'
wikisql
CREATE TABLE table_35339 ( "Race Title" text, "Circuit" text, "Location / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location/ State has a Date of 29 31 may?
SELECT "Location / State" FROM table_35339 WHERE "Date" = '29–31 may'
wikisql
CREATE TABLE table_name_2 ( icao VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ICAO of Lohausen airport?
SELECT icao FROM table_name_2 WHERE airport = "lohausen airport"
sql_create_context
CREATE TABLE table_203_682 ( id number, "year" number, "goalkeeper" text, "defenders" text, "midfielders" text, "forwards" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name each of the midfielders in 2011
SELECT "midfielders" FROM table_203_682 WHERE "year" = 2011
squall
CREATE TABLE table_name_6 ( total_apps VARCHAR, fa_cup_goals VARCHAR, fa_cup_apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- It has a FA Cup Goals smaller than 4, and a FA Cup Apps larger than 7, what is the total number of total apps?
SELECT COUNT(total_apps) FROM table_name_6 WHERE fa_cup_goals < 4 AND fa_cup_apps > 7
sql_create_context
CREATE TABLE table_30134667_2 ( fastest_lap VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap on september 4?
SELECT fastest_lap FROM table_30134667_2 WHERE date = "September 4"
sql_create_context
CREATE TABLE table_7999 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Steve Elkington par?
SELECT "To par" FROM table_7999 WHERE "Player" = 'steve elkington'
wikisql
CREATE TABLE table_26538461_2 ( equivalence_in_varas VARCHAR, english_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the equivalence for varas for geometrical pace
SELECT equivalence_in_varas FROM table_26538461_2 WHERE english_name = "Geometrical pace"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '97726285' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-09-13' AND '2016-10-12' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_298550_1 ( country_with_flag VARCHAR, population__1_july_2005_est_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every country with a flag with population of 11346670?
SELECT country_with_flag FROM table_298550_1 WHERE population__1_july_2005_est_ = 11346670
sql_create_context
CREATE TABLE table_name_8 ( _jerk VARCHAR, clean_ INTEGER, total__kg_ VARCHAR, snatch VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the clean & jerk when the total (kg) is more than 204, and snatch is more than 98?
SELECT AVG(clean_) & _jerk FROM table_name_8 WHERE total__kg_ > 204 AND snatch > 98
sql_create_context
CREATE TABLE gwyjzb ( 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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4652099' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '46520...
css
CREATE TABLE table_29571 ( "Name/Name of Act" text, "Age(s)" text, "Genre" text, "Act" text, "Hometown" text, "Qtr. Final (Week)" real, "Semi Final (Week)" text, "Position Reached" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT MIN("Qtr. Final (Week)") FROM table_29571 WHERE "Genre" = 'Dancing' AND "Age(s)" = '32'
wikisql
CREATE TABLE table_63593 ( "Draw" real, "Language" text, "Artist" text, "English translation" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total ranking when there are less than 16 draws, less than 1 po...
SELECT SUM("Place") FROM table_63593 WHERE "Draw" < '16' AND "English translation" = 'in love with you' AND "Points" < '1'
wikisql
CREATE TABLE table_name_10 ( date VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game where the visiting team was philadelphia?
SELECT date FROM table_name_10 WHERE visitor = "philadelphia"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT (SELECT 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-100609')) AND lab.labname = 'paco2' AND lab.labresulttime = '2104-04-28 09:...
eicu
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.arrival_time = 1700 AND flight.departure_time = 1300) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND fligh...
atis
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Self Pay"
mimicsql_data
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 COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739) AND microbiologyevents.spec_type_desc = 'tissue' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIM...
mimic_iii
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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2124"
mimicsql_data
CREATE TABLE table_17508 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Bob Johnson plays for which AFL team?
SELECT "AFL Team" FROM table_17508 WHERE "Player" = 'Bob Johnson'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2133-08-01 12:06:00"
mimicsql_data
CREATE TABLE table_168 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Rating" text, "Share" text, "18\u201349 Rating" text, "Viewers (millions)" text, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT MAX("#") FROM table_168 WHERE "Episode" = 'The Birthday Present'
wikisql
CREATE TABLE Participants_in_Events ( Event_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the id of the event with the most participants?
SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_89 ( length VARCHAR, stations VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Stations of 16 is assigned what length?
SELECT length FROM table_name_89 WHERE stations = "16"
sql_create_context
CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosom...
SELECT name FROM enzyme WHERE name LIKE "%ALA%"
spider
CREATE TABLE table_name_18 ( year INTEGER, competition VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT YEAR WAS THE WORLD CHAMPIONSHIPS IN WITH NOTES OF 39.01?
SELECT SUM(year) FROM table_name_18 WHERE competition = "world championships" AND notes = 39.01
sql_create_context
CREATE TABLE table_name_89 ( country VARCHAR, money__$_ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country is Player Leland Gibson with Money of 400 from?
SELECT country FROM table_name_89 WHERE money__$_ = "400" AND player = "leland gibson"
sql_create_context
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREA...
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'Caltech' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
scholar
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis....
eicu
CREATE TABLE table_name_15 ( self_employed VARCHAR, investment_income VARCHAR, other_income_sources VARCHAR, employment___salaries_ VARCHAR, _wages_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Investment income of 2%, and an other income sourc...
SELECT self_employed FROM table_name_15 WHERE investment_income = "2%" AND other_income_sources = "3%" AND employment___salaries_ & _wages_ = "71%"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') ORDER BY labevent...
mimic_iii
CREATE TABLE table_name_47 ( netflix VARCHAR, series_ep VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Netflix number having a series episode of 1-01?
SELECT netflix FROM table_name_47 WHERE series_ep = "1-01"
sql_create_context
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 airline.airline_code FROM airline, 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 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.cit...
atis
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hi...
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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU...
atis
CREATE TABLE table_34657 ( "Number of Decks" real, "Non-Suited Match" text, "Double Non-Suited Match" text, "Suited Match" text, "Suited + Non-Suited Match" text, "Double Suited Match" text, "House Edge" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Double Non-Suited Match" FROM table_34657 WHERE "Non-Suited Match" = '4:1' AND "House Edge" = '3.63%'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required t...
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V...
atis
CREATE TABLE table_name_33 ( awards VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which awards happened more recently than 2005?
SELECT awards FROM table_name_33 WHERE year > 2005
sql_create_context
CREATE TABLE table_24089503_1 ( travers_stakes VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at the Travers Stakes in 1977?
SELECT travers_stakes FROM table_24089503_1 WHERE year = 1977
sql_create_context
CREATE TABLE table_73904 ( "Municipality" text, "No. of Barangays" real, "Area (km\u00b2)" text, "Population (2010)" real, "Pop. density (per km\u00b2)" text, "Income Class (2004)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the popul...
SELECT COUNT("Pop. density (per km\u00b2)") FROM table_73904 WHERE "Municipality" = 'Lubang'
wikisql
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film ( Film_ID int, Title text, Stud...
SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title
nvbench
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 WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.dob_year < "2101"
mimicsql_data
CREATE TABLE fgwyjzb ( 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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0081088' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '00...
css
CREATE TABLE table_39017 ( "Station" text, "City of license" text, "Channels TV / RF" text, "First air date" text, "HAAT" text, "Facility ID" real, "Public license information" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which HAAT has a ...
SELECT "HAAT" FROM table_39017 WHERE "Channels TV / RF" = '31 (psip) 44 (uhf)'
wikisql
CREATE TABLE table_1165048_1 ( season INTEGER, leading_goalkicker VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum season where leading goalkicker is scott simister (54)
SELECT MAX(season) FROM table_1165048_1 WHERE leading_goalkicker = "Scott Simister (54)"
sql_create_context
CREATE TABLE table_17325580_6 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every location attendance on the date December 12?
SELECT location_attendance FROM table_17325580_6 WHERE date = "December 12"
sql_create_context
CREATE TABLE table_name_57 ( year INTEGER, team VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year for the ajs team when there are fewer than 0 wins?
SELECT MAX(year) FROM table_name_57 WHERE team = "ajs" AND wins < 0
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS RankInYear, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2015, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostI...
sede
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholangiogram nec')) AND DATETIME(cost.chargetime) <= DAT...
mimic_iii
CREATE TABLE people ( People_ID VARCHAR, Height VARCHAR ) CREATE TABLE entrepreneur ( Company VARCHAR, People_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the company of the tallest entrepreneur.
SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId...
SELECT COUNT(*) FROM Posts JOIN Users AS Owner ON OwnerUserId = Owner.Id WHERE PostTypeId = 1 AND AnswerCount > 0 AND AcceptedAnswerId IS NULL AND CommunityOwnedDate IS NULL AND Owner.LastAccessDate <= DATEADD(mm, -1, GETDATE())
sede
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.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.short_title = "Myalgia and myositis NOS"
mimicsql_data
CREATE TABLE table_14253123_1 ( in_no VARCHAR, county_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Spencer is the county what is the in no.?
SELECT in_no FROM table_14253123_1 WHERE county_name = "Spencer"
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_name_18 ( heat VARCHAR, nationality VARCHAR, lane VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many heats had 5 lanes and a rank less than 110 for the nationality of Honduras?
SELECT COUNT(heat) FROM table_name_18 WHERE lane = 5 AND rank > 110 AND nationality = "honduras"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, pat...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
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 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.person_info_XM = '沈清涵' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2010-11-18')
css
CREATE TABLE table_61675 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Drawn" FROM table_61675 WHERE "Tries against" = '69'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1885024' AND t_kc22.SOC_SRT_DIRE_NM = '木丹颗粒'
css
CREATE TABLE table_24887326_7 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game played with Birmingham City as the away team?
SELECT date FROM table_24887326_7 WHERE away_team = "Birmingham City"
sql_create_context
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y...
css
CREATE TABLE table_26250189_1 ( original_artist VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the original artist of the chosen song when the theme was The Rolling Stones?
SELECT original_artist FROM table_26250189_1 WHERE theme = "The Rolling Stones"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT u.DisplayName AS "User", COUNT(*) AS "Number questions" FROM Posts AS q INNER JOIN Users AS u ON q.OwnerUserId = u.Id AND q.PostTypeId = 1 GROUP BY u.DisplayName ORDER BY COUNT(*) DESC
sede
CREATE TABLE table_74534 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the grid number is 10, what is the total number of laps?
SELECT COUNT("Laps") FROM table_74534 WHERE "Grid" = '10'
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 WHERE demographic.gender = "M" AND demographic.age < "76"
mimicsql_data
CREATE TABLE table_204_426 ( id number, "year" text, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many 3rd place finishes has npsl had ?
SELECT COUNT(*) FROM table_204_426 WHERE "regular season" = '3rd, atlantic'
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT COUNT(*) FROM jybgb WHERE jybgb.YLJGDM = '7759937' AND jybgb.BGRQ BETWEEN '2004-07-03' AND '2018-11-11'
css
CREATE TABLE table_22756549_1 ( runner_up_a VARCHAR, constituency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner up for the Nagapattinam constituency?
SELECT runner_up_a FROM table_22756549_1 WHERE constituency = "Nagapattinam"
sql_create_context
CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGER ) CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15...
SELECT CID, DNO FROM Course ORDER BY Credits
nvbench
CREATE TABLE table_46512 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Round larger than 4, an Overall smaller than 338, a Pick smaller than 1...
SELECT "Name" FROM table_46512 WHERE "Round" > '4' AND "Overall" < '338' AND "Pick" < '11' AND "College" = 'virginia tech'
wikisql