instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT * 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.YLJGDM...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 16)
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY...
SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_name_50 ( losses VARCHAR, goals_for VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of losses for the Team of Montreal with Goals For larger than 29?
SELECT COUNT(losses) FROM table_name_50 WHERE goals_for > 29 AND team = "montreal"
sql_create_context
CREATE TABLE table_12526990_1 ( gayndah INTEGER, perry VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gayndah when perry is 304?
SELECT MAX(gayndah) FROM table_12526990_1 WHERE perry = 304
sql_create_context
CREATE TABLE table_24224647_2 ( main_presenter VARCHAR, region_country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is every main presenter for the Estonia region/country?
SELECT main_presenter FROM table_24224647_2 WHERE region_country = "Estonia"
sql_create_context
CREATE TABLE table_48596 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the resolution of the fight against steve ...
SELECT "Res." FROM table_48596 WHERE "Opponent" = 'steve schneider'
wikisql
CREATE TABLE table_16857_2 ( mls_cup_playoffs VARCHAR, concacaf_champions_cup___champions_league VARCHAR, us_open_cup VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did the team place when they did not qualify for the Concaf Champions Cup but made it...
SELECT mls_cup_playoffs FROM table_16857_2 WHERE concacaf_champions_cup___champions_league = "Did not qualify" AND us_open_cup = "Round of 16"
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Insomnia, unspecified" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '1400547' AND jybgb.BGRQ BETWEEN '2009-09-26' AND '2018-10-23' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 5) AS T
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
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_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '71120230685'
css
CREATE TABLE table_29584 ( "Represent" real, "Contestant" text, "Age" real, "Sizes" text, "Height" text, "Hometown" text, "Agency" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who are the participants that wear clothing in 33-23-36
SELECT "Contestant" FROM table_29584 WHERE "Sizes" = '33-23-36'
wikisql
CREATE TABLE table_23987362_2 ( world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many of 3:26.00 have a championship record?
SELECT COUNT(3) AS :2600 FROM table_23987362_2 WHERE world_record = "Championship record"
sql_create_context
CREATE TABLE table_name_61 ( play VARCHAR, company VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the play when the company is cyprus theatre organisation?
SELECT play FROM table_name_61 WHERE company = "cyprus theatre organisation"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )...
SELECT 'https://apple.stackexchange.com/questions/' + CAST(PostId AS TEXT), Text, Score, Comments.CreationDate, Users.DisplayName, Users.Reputation FROM Comments INNER JOIN Users ON Comments.UserId = Users.Id WHERE LENGTH(Text) < 20 AND (Text LIKE '%thanks%' OR Text LIKE '%welcome%' OR Text LIKE '%works%') ORDER BY Cre...
sede
CREATE TABLE table_14050 ( "Event" text, "Record" text, "Nationality" text, "Date" text, "Games" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the record of Barbados?
SELECT "Record" FROM table_14050 WHERE "Nationality" = 'barbados'
wikisql
CREATE TABLE table_name_65 ( part_4 VARCHAR, part_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Part 4, when Part 2 is 'hlj p'?
SELECT part_4 FROM table_name_65 WHERE part_2 = "hljóp"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
SELECT DISTINCT airline.airline_code FROM airline, fare, fare_basis, flight, flight_fare WHERE fare_basis.class_type = 'BUSINESS' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = airline.airline_code AND flight.flight_id = flight_fare.flight_id
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "65652"
mimicsql_data
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
SELECT * FROM fires WHERE state = "TX" AND stat_cause_descr LIKE "Campfire"
uswildfires
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '40176918' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-08-23' AND '2002-12-05' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_...
css
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '92724967' AND qtb.MED_SER_ORG_NO = '4295408' AND qtb.IN_HOSP_DATE BETWEEN '2010-12-27' AND '2021-12-06' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = ...
css
CREATE TABLE table_15430606_1 ( no_disc INTEGER, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the maximum number of disc for bill gereghty
SELECT MAX(no_disc) FROM table_15430606_1 WHERE directed_by = "Bill Gereghty"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'dialysis access surgery' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(),...
eicu
CREATE TABLE table_4216 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 52 is the ends won what i...
SELECT "Skip (Club)" FROM table_4216 WHERE "Ends Won" = '52'
wikisql
CREATE TABLE table_name_14 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Home team of tranmere rovers?
SELECT date FROM table_name_14 WHERE home_team = "tranmere rovers"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'E70.881' AND jyjgzbb.JCZBMC = '甲胎蛋白'
css
CREATE TABLE table_33202 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The school nicknamed the wildcats has what sum of enrollment?
SELECT SUM("Enrollment") FROM table_33202 WHERE "Team Nickname" = 'wildcats'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
SELECT SBBM, YQBH, YQMC FROM jyjgzbb WHERE JYZBLSH = '49153085887'
css
CREATE TABLE table_63669 ( "School" text, "City" text, "Team Name" text, "Enrollment 08-09" real, "IHSAA Class" text, "IHSAA Class Football" text, "County" text, "Year Joined (Or Joining)" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for ...
SELECT COUNT("Enrollment 08-09") FROM table_63669 WHERE "School" = 'franklin county'
wikisql
CREATE TABLE table_name_33 ( format VARCHAR, country VARCHAR, label VARCHAR, catalogue_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Format has a Label of eagle eye media, a Catalogue number(s) of , and a Country of united states?
SELECT format FROM table_name_33 WHERE label = "eagle eye media" AND catalogue_number_s_ = "—" AND country = "united states"
sql_create_context
CREATE TABLE table_77831 ( "Name" text, "Date of Birth" text, "Date of Death" text, "Age at Time of Disaster" text, "Age at Time of Death" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the person born 24 September 1851 pass away?
SELECT "Date of Death" FROM table_77831 WHERE "Date of Birth" = '24 september 1851'
wikisql
CREATE TABLE table_name_55 ( solvent VARCHAR, boiling_point VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What solvent has a boiling point of 100 103 c?
SELECT solvent FROM table_name_55 WHERE boiling_point = "100–103 °c"
sql_create_context
CREATE TABLE table_name_97 ( opponent VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with a score of 141 102?
SELECT opponent FROM table_name_97 WHERE score = "141–102"
sql_create_context
CREATE TABLE table_name_83 ( class VARCHAR, number_in_class INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which class has more than 15 people in the class?
SELECT class FROM table_name_83 WHERE number_in_class > 15
sql_create_context
CREATE TABLE table_name_92 ( time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/retired for thierry boutsen?
SELECT time_retired FROM table_name_92 WHERE driver = "thierry boutsen"
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '蒋岚翠' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-05-06' AND '2015-12-28' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "ALBU5250"
mimicsql_data
CREATE TABLE table_37191 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text, "Customer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the location and ship type in the Gulf of Mexico that...
SELECT "Name" FROM table_37191 WHERE "Location" = 'gulf of mexico' AND "Type" = 'ship' AND "Entered service" = '1999'
wikisql
CREATE TABLE football_data ( season text, datetime time, div text, country text, league text, referee text, hometeam text, awayteam text, fthg number, ftag number, ftr text, hthg number, htag number, htr text, psh number, psd number, psa number, b3...
SELECT year FROM betfront GROUP BY year ORDER BY COUNT(*) DESC LIMIT 1
worldsoccerdatabase
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.itemid = "51214" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_19026 ( "Rank" real, "Airport" text, "Total Passengers" real, "% Change 2005/2006" text, "International Passengers" real, "Domestic Passengers" real, "Transit Passengers" real, "Aircraft Movements" real, "Freight (Metric Tonnes)" real ) -- Using valid SQLite, ans...
SELECT COUNT("Airport") FROM table_19026 WHERE "Rank" = '4'
wikisql
CREATE TABLE table_31535 ( "Player" text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year is United States school/club team from Arkansas play in Toronto
SELECT "Years in Toronto" FROM table_31535 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'arkansas'
wikisql
CREATE TABLE table_49635 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team played against Los Angeles in game 1?
SELECT "Home Team" FROM table_49635 WHERE "Road Team" = 'los angeles' AND "Game" = 'game 1'
wikisql
CREATE TABLE table_1341586_26 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which candidates are from the Missouri 3 district?
SELECT candidates FROM table_1341586_26 WHERE district = "Missouri 3"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Government"
mimicsql_data
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT country FROM nuclear_power_plants WHERE status = "Operational" GROUP BY country ORDER BY COUNT(name) DESC LIMIT 10
geonucleardata
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medication...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-205326')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATET...
eicu
CREATE TABLE table_2004 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Year Joined" real, "Nickname" text, "Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many University fo...
SELECT COUNT("Enrollment") FROM table_2004 WHERE "Founded" = '1863'
wikisql
CREATE TABLE table_name_4 ( quantity_rebuilt VARCHAR, type VARCHAR, railway_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of quantity rebuilt if the type is 1B N2T and the railway number is 88, 118?
SELECT COUNT(quantity_rebuilt) FROM table_name_4 WHERE type = "1b n2t" AND railway_number_s_ = "88, 118"
sql_create_context
CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sale...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters)
nvbench
CREATE TABLE train ( train_number VARCHAR, name VARCHAR, TIME VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show all train numbers and names ordered by their time from early to late.
SELECT train_number, name FROM train ORDER BY TIME
sql_create_context
CREATE TABLE table_66788 ( "Rank" text, "Goals" text, "Player" text, "Club" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club scored 143 goals?
SELECT "Club" FROM table_66788 WHERE "Goals" = '143'
wikisql
CREATE TABLE table_73910 ( "Institution" text, "Location (all in Ohio)" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" text, "Joined" real, "Left" real, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT MIN("Left") FROM table_73910 WHERE "Location (all in Ohio)" = 'Gambier'
wikisql
CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( ...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "LEFT FEMUR FRACTURE"
mimicsql_data
CREATE TABLE table_test_5 ( "id" int, "systemic_lupus_erythematosus" bool, "anemia" bool, "gender" string, "pregnancy_or_lactation" bool, "serum_potassium" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "estim...
SELECT * FROM table_test_5 WHERE renal_disease = 1 OR lung_disease = 1 OR liver_disease = 1
criteria2sql
CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_audience number ) CREATE TABLE artwork ( artwork_id number, type text, name text ) CREATE TABLE nomination ( artwork_id number, festival_id number, ...
SELECT T2.name FROM nomination AS T1 JOIN artwork AS T2 ON T1.artwork_id = T2.artwork_id JOIN festival_detail AS T3 ON T1.festival_id = T3.festival_id ORDER BY T3.year
spider
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_30682 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode watched by 0...
SELECT "Title" FROM table_30682 WHERE "U.S. viewers (million)" = '0.88'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 54386 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE table_16857 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the players that played for the jazz from 1979-86
SELECT "Player" FROM table_16857 WHERE "Years for Jazz" = '1979-86'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall from chair') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
mimic_iii
CREATE TABLE table_203_3 ( id number, "province" text, "capital" text, "population" number, "density" text, "municipalities" text, "legal districts" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many municipalities exist in the provin...
SELECT "municipalities" FROM table_203_3 WHERE "province" = 'cadiz'
squall
CREATE TABLE table_55864 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what county is...
SELECT "County" FROM table_55864 WHERE "Listed" = '09/21/1984' AND "Construction completed" = '07/19/2000'
wikisql
CREATE TABLE table_name_1 ( player VARCHAR, score VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the T4 Place Player with a Score of more than 66?
SELECT player FROM table_name_1 WHERE score > 66 AND place = "t4"
sql_create_context
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 PRESCRIPTION_CODE, PRESCRIPTION_ID FROM t_kc22 WHERE MED_EXP_DET_ID = '85275083957'
css
CREATE TABLE table_45893 ( "Technology" text, "\u03b7 (%)" real, "V OC (V)" text, "I SC (A)" text, "W/m\u00b2" text, "t (\u00b5m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of t ( m), when Technology is MJ?
SELECT SUM("t (\u00b5m)") FROM table_45893 WHERE "Technology" = 'mj'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEP...
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_204_374 ( id number, "event" text, "gold" number, "silver" number, "bronze" number, "total" number, "ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the 1984 paralympics had a total ranking of 5th , in what other y...
SELECT "event" FROM table_204_374 WHERE "event" <> '1984 winter paralympics' AND "ranking" < 6
squall
CREATE TABLE table_name_15 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team that played at Corio Oval?
SELECT home_team FROM table_name_15 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE table_52127 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Date of Country of United States?
SELECT "Date" FROM table_52127 WHERE "Country" = 'united states'
wikisql
CREATE TABLE table_69466 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest ranking for Paul Mctiernan?
SELECT MIN("Ranking") FROM table_69466 WHERE "Name" = 'paul mctiernan'
wikisql
CREATE TABLE table_34672 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the best time for marcus marshall?
SELECT AVG("Best") FROM table_34672 WHERE "Name" = 'marcus marshall'
wikisql
CREATE TABLE table_name_68 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In games where st kilda was the away team, what was the smallest crowd?
SELECT MIN(crowd) FROM table_name_68 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE table_72380 ( "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. -- Name the districk for larry mcdonald
SELECT "District" FROM table_72380 WHERE "Incumbent" = 'Larry McDonald'
wikisql
CREATE TABLE table_203_862 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the first song listed on this chart ?
SELECT "song" FROM table_203_862 WHERE id = 1
squall
CREATE TABLE table_47758 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Result of the game W 30 15?
SELECT "Date" FROM table_47758 WHERE "Result" = 'w 30–15'
wikisql
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "45"
mimicsql_data
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code)
nvbench
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '<cognito-forms>'
sede
CREATE TABLE table_name_99 ( location VARCHAR, method VARCHAR, res VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location has a Method of decision (unanimous), and Res of win x?
SELECT location FROM table_name_99 WHERE method = "decision (unanimous)" AND res = "win x"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, ins...
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester...
advising
CREATE TABLE table_44420 ( "q > 1" real, "q > 1.05" real, "q > 1.1" real, "q > 1.2" real, "q > 1.3" real, "q > 1.4" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of q > 1 when q > 1.05 is bigger than 18,233, and a q > 1.4 less t...
SELECT COUNT("q > 1") FROM table_44420 WHERE "q > 1.05" > '18,233' AND "q > 1.4" < '112' AND "q > 1.1" = '13,266'
wikisql
CREATE TABLE table_8026 ( "World Record" text, "Press" text, "92.5" text, "Hans W\u00f6lpert" text, "Mannheim ( GER )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 92.5 holds the world record?
SELECT "World Record" FROM table_8026 WHERE "Press" = '92.5'
wikisql
CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER ) CREATE TABLE On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patie...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_58137 ( "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 date was the crowd larger than 16,000 peopl...
SELECT "Date" FROM table_58137 WHERE "Crowd" > '16,000' AND "Away team score" = '8.11 (59)'
wikisql
CREATE TABLE table_name_89 ( region VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Region with a Catalog of alca-487?
SELECT region FROM table_name_89 WHERE catalog = "alca-487"
sql_create_context
CREATE TABLE table_name_19 ( original_channel VARCHAR, programme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which channel did Going for Gold air on?
SELECT original_channel FROM table_name_19 WHERE programme = "going for gold"
sql_create_context
CREATE TABLE table_name_15 ( bronze INTEGER, total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Total smaller than 1?
SELECT AVG(bronze) FROM table_name_15 WHERE total < 1
sql_create_context
CREATE TABLE table_31824 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell mem the opponent for result of w 31-21
SELECT "Opponent" FROM table_31824 WHERE "Result" = 'w 31-21'
wikisql
CREATE TABLE table_name_60 ( played INTEGER, lost VARCHAR, drawn VARCHAR, difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest played that has a drawn less than 9, 36 as the difference, with a lost greater than 7?
SELECT MAX(played) FROM table_name_60 WHERE drawn < 9 AND difference = "36" AND lost > 7
sql_create_context
CREATE TABLE table_22032599_1 ( result VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for City of the Sun?
SELECT result FROM table_22032599_1 WHERE film_title_used_in_nomination = "City of the Sun"
sql_create_context
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 WHERE demographic.gender = "M" AND demographic.dob_year < "2060"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT AVG(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 = 'remov ext immobilization')) AND STRFTIME('%y', cost.charg...
mimic_iii
CREATE TABLE table_14091 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" text, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the ratings of TBS of Episode 10 and had a Japanese title of Scandal?
SELECT "Average Ratings" FROM table_14091 WHERE "TV Station" = 'tbs' AND "Episodes" = '10' AND "Japanese Title" = 'scandal'
wikisql
CREATE TABLE table_61583 ( "Minister" text, "Party" text, "Governments" text, "Term start" text, "Term end" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What term end had minister Danny Ayalon?
SELECT "Term end" FROM table_61583 WHERE "Minister" = 'danny ayalon'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_lab...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii