instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_75302 ( "Throne Name" text, "Title" text, "Born-Died" text, "Entered office" text, "Left office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the born-died that has office of 13 September 1229 as the entered?
SELECT "Born-Died" FROM table_75302 WHERE "Entered office" = '13 september 1229'
wikisql
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 demographic.age, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_27298240_26 ( pluperfect VARCHAR, perfect VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pluperfect for the perfect si bio/la; bio/la si?
SELECT pluperfect FROM table_27298240_26 WHERE perfect = "si bio/la; bio/la si"
sql_create_context
CREATE TABLE table_56472 ( "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 count for the venue Prin...
SELECT SUM("Crowd") FROM table_56472 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_79057 ( "Player" text, "Round" real, "Pick" real, "Position" text, "NFL Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest pick that has arizona cardinals as the NFL club?
SELECT MIN("Pick") FROM table_79057 WHERE "NFL Club" = 'arizona cardinals'
wikisql
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '蒋蕴藉' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8634.98) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '蒋蕴藉' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8634....
css
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY Rank
nvbench
CREATE TABLE table_61090 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the player than won $450?
SELECT "Score" FROM table_61090 WHERE "Money ( $ )" = '450'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '94709761' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2014-02-18')
css
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.JCFF FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '16067327' AND jyjgzbb.JYRQ BETWEEN '2006-04-14' ...
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts WHERE Score = 0 AND OwnerUserId > 0 GROUP BY OwnerUserId ORDER BY Count DESC, OwnerUserId LIMIT 100
sede
CREATE TABLE table_18264 ( "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 number first elected for tennessee 2?
SELECT COUNT("First elected") FROM table_18264 WHERE "District" = 'Tennessee 2'
wikisql
CREATE TABLE table_76406 ( "Year" text, "2009" text, "2008" text, "2007" text, "2006" text, "2005" text, "2004" text, "2003" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2008 for the 2009 ch our charming lady?
SELECT "2008" FROM table_76406 WHERE "2009" = 'ch our charming lady'
wikisql
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 COUNT(*) FROM zyjzjlb WHERE YLJGDM = '0372047' AND RYDJSJ > '2020-03-24'
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
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 = '009-10951' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_40309 ( "Date" text, "Result" text, "Opponent" text, "Location" text, "Method" text, "Round" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location has a Method of decision?
SELECT "Location" FROM table_40309 WHERE "Method" = 'decision'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "4" AND diagnoses.long_title = "Candidiasis of skin and nails"
mimicsql_data
CREATE TABLE table_name_67 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent during week 8?
SELECT opponent FROM table_name_67 WHERE week = 8
sql_create_context
CREATE TABLE table_name_90 ( year VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Year, when Bronze is 'Jamie Stevenson'?
SELECT COUNT(year) FROM table_name_90 WHERE bronze = "jamie stevenson"
sql_create_context
CREATE TABLE table_name_40 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team score at kardinia park?
SELECT away_team AS score FROM table_name_40 WHERE venue = "kardinia park"
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 MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5697273' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD
css
CREATE TABLE table_25527255_2 ( shirt_sponsor VARCHAR, average_squad_age VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the shirt sponsor of the team with an average squad age of 25.46?
SELECT shirt_sponsor FROM table_25527255_2 WHERE average_squad_age = "25.46"
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( ...
SELECT chartevents.charttime 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 = 19175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
mimic_iii
CREATE TABLE table_46767 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "2005" FROM table_46767 WHERE "2003" = 'a' AND "2007" = '2r' AND "2012" = '3r'
wikisql
CREATE TABLE table_name_47 ( state VARCHAR, appointment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state has an appointment for jul 12, 2001?
SELECT state FROM table_name_47 WHERE appointment = "jul 12, 2001"
sql_create_context
CREATE TABLE table_name_10 ( region VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the region for frank erwin center
SELECT region FROM table_name_10 WHERE venue = "frank erwin center"
sql_create_context
CREATE TABLE table_name_19 ( nfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich team draft the player who went to college in Washington?
SELECT nfl_team FROM table_name_19 WHERE college = "washington"
sql_create_context
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1),...
SELECT product_name, COUNT(*) FROM Order_Items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name
nvbench
CREATE TABLE table_73949 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number when the vote percentage was 44.8%?
SELECT COUNT("Total") FROM table_73949 WHERE "Vote percentage" = '44.8%'
wikisql
CREATE TABLE table_13241993_3 ( part_1 VARCHAR, part_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the air date of part 1 of the episode whose part 2 aired on December 2, 2007?
SELECT part_1 FROM table_13241993_3 WHERE part_2 = "December 2, 2007"
sql_create_context
CREATE TABLE table_name_85 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was Colorado the home team?
SELECT date FROM table_name_85 WHERE home = "colorado"
sql_create_context
CREATE TABLE table_16963 ( "Series no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production Code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the series number 23 air?
SELECT "Original air date" FROM table_16963 WHERE "Series no." = '23'
wikisql
CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_id INTEGER, first_name VARCHAR(50), last_...
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_name DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE d_icd_diagnoses ( 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 TABLE...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47746) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.charttime = '2103-09-16 14:24:00') - (SELECT l...
mimic_iii
CREATE TABLE table_name_73 ( first_elected VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the first person elected from Democratic GAIN?
SELECT first_elected FROM table_name_73 WHERE result = "democratic gain"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'svt - re-entrant')
eicu
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12274)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'iv piggy...
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT AVG(vitalperiodic.systemicsystolic) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480')) AND NOT vitalperiodic.systemicsy...
eicu
CREATE TABLE table_16903 ( "number" real, "date of debut" text, "name" text, "date of birth" text, "number of caps" real, "number of goals" real, "date of death\u2020" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the toatl number o...
SELECT COUNT("number of caps") FROM table_16903 WHERE "name" = 'Hans Blume'
wikisql
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY SUM(COUNT(*))
nvbench
CREATE TABLE table_name_31 ( engine VARCHAR, chassis VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was used when Aguri Suzuki drove the FA13B FA14 Chassis?
SELECT engine FROM table_name_31 WHERE chassis = "fa13b fa14" AND driver = "aguri suzuki"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM qtb WHERE qtb.PERSON_ID = '70117479' AND qtb.MED_SER_ORG_NO = '2870578' AND qtb.MED_ORG_DEPT_NM LIKE '%泌尿科%' UNION SELECT * FROM gyb WHERE gyb.PERSON_ID = '70117479' AND gyb.MED_SER_ORG_NO = '2870578' AND gyb.MED_ORG_DEPT_NM LIKE '%泌尿科%' UNION SELECT * FROM zyb WHERE zyb.PERSON_ID = '70117479' AND zyb.MED...
css
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 treatment ( treatmentid number...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-10830')) AND STRFTIME('%y', medication.drugstarttime) <= '2104'
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
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 = '010-17316')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-9 month') ORDE...
eicu
CREATE TABLE table_train_137 ( "id" int, "hbv" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "substance_dependence" bool, "hcv" bool, "schizophrenia" bool, "neutrophil_count" int, "renal_disease" bool, "creatinine_clearance_cl" float, "platelet_count"...
SELECT * FROM table_train_137 WHERE (systolic_blood_pressure_sbp > 150 OR diastolic_greater_than > 95) OR (pulse_rate < 55 OR pulse_rate > 85)
criteria2sql
CREATE TABLE table_32396 ( "Player" text, "Team" text, "Date" text, "Opposition" text, "Game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team opposed Tipperary in the Munster Final game?
SELECT "Team" FROM table_32396 WHERE "Opposition" = 'tipperary' AND "Game" = 'munster final'
wikisql
CREATE TABLE table_46405 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the diameter for 1997 when longitude is 212.0e and latitude is 47.0n?
SELECT MIN("Diameter (km)") FROM table_46405 WHERE "Year named" = '1997' AND "Longitude" = '212.0e' AND "Latitude" = '47.0n'
wikisql
CREATE TABLE member ( member_id number, name text, country text, college_id number ) CREATE TABLE round ( round_id number, member_id number, decoration_theme text, rank_in_round number ) CREATE TABLE college ( college_id number, name text, leader_name text, college_loca...
SELECT name FROM member ORDER BY name
spider
CREATE TABLE table_29126 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Incoming manager" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT "Manner of departure" FROM table_29126 WHERE "Team" = 'Notts County' AND "Incoming manager" = 'Martin Allen'
wikisql
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = '001097'
css
CREATE TABLE table_name_31 ( college_junior_club_team__league_ VARCHAR, position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the College/Junior/Club Team (League) when the position is rw, and the player is Don Murdoch?
SELECT college_junior_club_team__league_ FROM table_name_31 WHERE position = "rw" AND player = "don murdoch"
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '马展鹏' AND jybg...
css
CREATE TABLE table_59813 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term of office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Term of office for Leonard Reynolds of NSW?
SELECT "Term of office" FROM table_59813 WHERE "State" = 'nsw' AND "Member" = 'leonard reynolds'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'COACH' AND fare.fare_basis_code = fare_basis.fare_basis_code) OR fare.one_direction_cost = (SELECT MIN(FARE...
atis
CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE investors ( investor_id number, investor_details text ) CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE lots ( lot_id number, ...
SELECT investor_id, COUNT(*) FROM transactions WHERE transaction_type_code = "SALE" GROUP BY investor_id
spider
CREATE TABLE table_68054 ( "Tournament" text, "1999" text, "2002" text, "2004" text, "2006" text, "2007" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2006 value with a 1r in 2011?
SELECT "2006" FROM table_68054 WHERE "2011" = '1r'
wikisql
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, departure_airline text, departure_flight_number int, stop_time int ) 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
SELECT MAX(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 = 28253 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent...
mimic_iii
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ...
SELECT u.Id AS "user_link" FROM Users AS u WHERE AboutMe LIKE '%' + '##userName:string##' + '%' ORDER BY CreationDate DESC
sede
CREATE TABLE table_22074 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the le...
SELECT MIN("Games played") FROM table_22074 WHERE "Loses" = '21'
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 * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '王子安' AND hz_info.YLJGDM = '6839787' AND NOT mzjzjlb.JZZDSM LIKE '%肾结石%'
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_name_7 ( date VARCHAR, opponents VARCHAR, h___a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the opponent Nottingham Forest, and the H/A was A?
SELECT date FROM table_name_7 WHERE opponents = "nottingham forest" AND h___a = "a"
sql_create_context
CREATE TABLE table_name_80 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result on 10/06/1934?
SELECT result FROM table_name_80 WHERE date = "10/06/1934"
sql_create_context
CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE roles ( role_code text, role_name tex...
SELECT destruction_authorised_by_employee_id, COUNT(*) FROM documents_to_be_destroyed GROUP BY destruction_authorised_by_employee_id
spider
CREATE TABLE table_61566 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "2012 club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Weight which has a 2012 club of pro recco, and a Name of tam s k s s category:articles with hcards...
SELECT "Weight" FROM table_61566 WHERE "2012 club" = 'pro recco' AND "Name" = 'tamás kásás category:articles with hcards'
wikisql
CREATE TABLE table_1167698_1 ( third_place VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won third place with the runner up being dynamo moscow?
SELECT third_place FROM table_1167698_1 WHERE runner_up = "Dynamo Moscow"
sql_create_context
CREATE TABLE table_name_4 ( silver VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Silver has a Rank of 7?
SELECT COUNT(silver) FROM table_name_4 WHERE rank = 7
sql_create_context
CREATE TABLE table_29830 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Score" FROM table_29830 WHERE "Team" = 'Washington'
wikisql
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 DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'beta-2 microglobulin'))
mimic_iii
CREATE TABLE table_23338 ( "Contestant" text, "Background" text, "Original team" text, "Age" real, "Hometown" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the contestant who was a small business owner?
SELECT "Result" FROM table_23338 WHERE "Background" = 'Small business owner'
wikisql
CREATE TABLE table_name_64 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue features hawthorn as the away team?
SELECT venue FROM table_name_64 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_name_49 ( opponents VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opposing team when playing in the Portugal venue?
SELECT opponents FROM table_name_49 WHERE venue = "portugal"
sql_create_context
CREATE TABLE table_1242447_1 ( english_spelling VARCHAR, strongs_transliteration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the english spelling of the word that has the strongs trasliteration of y e howram?
SELECT english_spelling FROM table_1242447_1 WHERE strongs_transliteration = "Y e howram"
sql_create_context
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE jo...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Luke Zettlemoyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( ...
SELECT u.Id AS "user_link", u.LastAccessDate FROM Users AS u WHERE u.Id IN ('##list##')
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 COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject/infus nesiritide') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15107 AND NOT admissions.di...
mimic_iii
CREATE TABLE table_23190 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many steals did Nicole Levandusky make?
SELECT "Steals" FROM table_23190 WHERE "Player" = 'Nicole Levandusky'
wikisql
CREATE TABLE table_203_418 ( id number, "#" number, "player" text, "position" text, "height" number, "current club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in height between garreth lodge and thomas pearson ?
SELECT ABS((SELECT "height" FROM table_203_418 WHERE "player" = 'garreth lodge') - (SELECT "height" FROM table_203_418 WHERE "player" = 'thomas pearson'))
squall
CREATE TABLE table_204_14 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "time" text, "deficit" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who ran the quickest race from italy ?
SELECT "athlete" FROM table_204_14 WHERE "country" = 'italy' ORDER BY "rank" LIMIT 1
squall
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.religion = "CATHOLIC" AND diagnoses.long_title = "Personal history, urinary (tract) infection"
mimicsql_data
CREATE TABLE table_66511 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Artist has a Draw of 6?
SELECT "Artist" FROM table_66511 WHERE "Draw" = '6'
wikisql
CREATE TABLE table_name_45 ( year VARCHAR, weight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year of the Player weighing 185?
SELECT year FROM table_name_45 WHERE weight = 185
sql_create_context
CREATE TABLE table_63385 ( "TIME" text, "ATHLETE" text, "SCHOOL" text, "CITY" text, "DATE" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the Player from Marshfield High School?
SELECT "DATE" FROM table_63385 WHERE "SCHOOL" = 'marshfield high school'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE table_name_54 ( runner_up VARCHAR, season INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Runner-up that has a Season less than 2005?
SELECT runner_up FROM table_name_54 WHERE season < 2005
sql_create_context
CREATE TABLE table_2446333_2 ( circuit VARCHAR, main_winner VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the circuit for france and portugal
SELECT circuit FROM table_2446333_2 WHERE main_winner = "France" AND country = "Portugal"
sql_create_context
CREATE TABLE table_1981 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the film titled for marcel camus category:articles with hcar...
SELECT "Film title used in nomination" FROM table_1981 WHERE "Director" = 'Marcel Camus Category:Articles with hCards'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Hydrocortisone Oint 0.5%"
mimicsql_data
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "77" AND procedures.long_title = "Excision or destruction of other lesion or tissue of heart, open approach"
mimicsql_data
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text...
SELECT stuid FROM student EXCEPT SELECT stuid FROM sportsinfo
spider
CREATE TABLE table_name_58 ( railway VARCHAR, location VARCHAR, objectnumber VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Railway has a Location of shildon, and an ObjectNumber of 1975-7022?
SELECT railway FROM table_name_58 WHERE location = "shildon" AND objectnumber = "1975-7022"
sql_create_context
CREATE TABLE table_60660 ( "Season" text, "League" text, "Finish" text, "Wins" text, "Losses" text, "Pct." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the league with 0 losses?
SELECT "League" FROM table_60660 WHERE "Losses" = '0'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.IN_HOSP_DAYS FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '17340163122' UNION SELECT fgwyjzb.IN_HOSP_DAYS FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '17340163122'
css
CREATE TABLE table_name_34 ( total VARCHAR, bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is bronze 2 and gold more than 3?
SELECT COUNT(total) FROM table_name_34 WHERE bronze = 2 AND gold > 3
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, JSB...
SELECT COUNT(mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM ...
css
CREATE TABLE table_204_124 ( id number, "no." number, "name" text, "public access" number, "location & map links" text, "area\nha" number, "area\nacres" number, "references" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name...
SELECT "name" FROM table_204_124 WHERE id = (SELECT id FROM table_204_124 WHERE "no." = '16') - 1
squall
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY)
nvbench