instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_738 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the party with incumbent being herbert covington bonner
SELECT "Party" FROM table_738 WHERE "Incumbent" = 'Herbert Covington Bonner'
wikisql
CREATE TABLE table_32250 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "Podiums" text, "Points" text, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the points for the ...
SELECT "Points" FROM table_32250 WHERE "Series" = 'gp3 series' AND "Podiums" = '2'
wikisql
CREATE TABLE table_38734 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Result of 5-1, and a Score of 3-0?
SELECT "Venue" FROM table_38734 WHERE "Result" = '5-1' AND "Score" = '3-0'
wikisql
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 county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( ...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT diagnoses.short_title, procedures.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Lue White"
mimicsql_data
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) -- Using valid SQLite, answer th...
SELECT name FROM actor ORDER BY name
spider
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, ...
SELECT SUM(inputevents_cv.amount) 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 = 17398)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_name_40 ( partner VARCHAR, style VARCHAR, results VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the partner for the jazz piece in the bottom three?
SELECT partner FROM table_name_40 WHERE style = "jazz" AND results = "bottom three"
sql_create_context
CREATE TABLE table_name_51 ( unit VARCHAR, novelty VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What unit has gen et sp nov as the novelty?
SELECT unit FROM table_name_51 WHERE novelty = "gen et sp nov"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "*LIT" AND lab.label = "Creatine Kinase, MB Isoenzyme"
mimicsql_data
CREATE TABLE t_kc21 ( 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.PRESCRIPTION_CODE, t_kc22.PRESCRIPTION_ID FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '40871241962'
css
CREATE TABLE table_name_44 ( draws INTEGER, against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Draws that has the Against larger than 1106, and the Wins larger than 13?
SELECT SUM(draws) FROM table_name_44 WHERE against > 1106 AND wins > 13
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '8058667' AND IN_DIAG_DIS_NM = '非器质性睡眠障碍')
css
CREATE TABLE table_name_77 ( total INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Total with a Gold that is larger than 4?
SELECT AVG(total) FROM table_name_77 WHERE gold > 4
sql_create_context
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.insurance = "Medicaid" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
SELECT (SELECT SUM(inputevents_cv.amount) 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 = 15447) AND icustays.outtime IS NULL)) - (SELECT SUM(outputevents.value) FROM outpu...
mimic_iii
CREATE TABLE college ( state VARCHAR, enr INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)
sql_create_context
CREATE TABLE table_name_89 ( platform VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the platform of Super Mario All-Stars?
SELECT platform FROM table_name_89 WHERE title = "super mario all-stars"
sql_create_context
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3950"
mimicsql_data
CREATE TABLE table_347 ( "Year" real, "Song name" text, "Film name" text, "Co-singer" text, "Music director" text, "Lyricist" text, "Language" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the lyricist for gopal krishna and co singe...
SELECT "Lyricist" FROM table_347 WHERE "Film name" = 'Gopal Krishna' AND "Co-singer" = 'Solo'
wikisql
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 COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND...
mimic_iii
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, Pos...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%gothenburg%' OR UPPER(Location) LIKE '%GOTHENBURG%' OR Location LIKE '%Gothenburg%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_57079 ( "Player" text, "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 is the player from Auburn?
SELECT "Player" FROM table_57079 WHERE "School/Club Team" = 'auburn'
wikisql
CREATE TABLE table_name_34 ( date VARCHAR, team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did Glentoran play at Windsor Park, Belfast?
SELECT date FROM table_name_34 WHERE team = "glentoran" AND venue = "windsor park, belfast"
sql_create_context
CREATE TABLE table_name_50 ( to_par VARCHAR, country VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the player from the United States with a place of t1 and a 76-68=144 score?
SELECT to_par FROM table_name_50 WHERE country = "united states" AND place = "t1" AND score = 76 - 68 = 144
sql_create_context
CREATE TABLE table_55411 ( "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 combined of Crowd when richmond play...
SELECT COUNT("Crowd") FROM table_55411 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
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 table_35708 ( "Source" text, "Date" text, "Fidesz" text, "MSZP" text, "SZDSZ" text, "Jobbik" text, "others" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the SZDSZ percentage with a Jobbik of 5% and a Fidesz of 68%?
SELECT "SZDSZ" FROM table_35708 WHERE "Jobbik" = '5%' AND "Fidesz" = '68%'
wikisql
CREATE TABLE table_40246 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which teams ha...
SELECT "Team" FROM table_40246 WHERE "Races" = '1' AND "Position" = '1st'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
mimic_iii
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTasks (...
SELECT p.Id AS "post_link", p.Tags FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId WHERE p.Id IN (SELECT p.Id FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE PostTypeId = 1 AND TagName = 'mythology') AND p.ClosedDate IS NULL GROUP BY p.Id, p.Tags...
sede
CREATE TABLE table_43564 ( "Year" text, "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of wins in 2010, when there were more than 14 matches?
SELECT COUNT("Wins") FROM table_43564 WHERE "Year" = '2010' AND "Matches" > '14'
wikisql
CREATE TABLE table_27476 ( "Rank" real, "Rank w/o Hydropower" real, "State" text, "% Renewable" text, "% Renewable w/o Hydro" text, "Renewable electricity (GW\u00b7h)" real, "Renewable electricity w/o Hydro (GW\u00b7h)" real, "Total electricity (GW\u00b7h)" real ) -- Using valid SQLite...
SELECT COUNT("Total electricity (GW\u00b7h)") FROM table_27476 WHERE "Renewable electricity w/o Hydro (GW\u00b7h)" = '3601'
wikisql
CREATE TABLE table_name_80 ( year INTEGER, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest year when the city is casablanca?
SELECT MIN(year) FROM table_name_80 WHERE city = "casablanca"
sql_create_context
CREATE TABLE table_14070062_3 ( points VARCHAR, try_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points does the club with a try bonus of 10 have?
SELECT points FROM table_14070062_3 WHERE try_bonus = "10"
sql_create_context
CREATE TABLE table_40538 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Centerfold model is on 3-04?
SELECT "Centerfold model" FROM table_40538 WHERE "Date" = '3-04'
wikisql
CREATE TABLE table_203_687 ( id number, "#" number, "title" text, "time" text, "performer(s)" text, "songwriters" text, "producer(s)" text, "samples and notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what title had the longest run...
SELECT "title" FROM table_203_687 ORDER BY "time" DESC LIMIT 1
squall
CREATE TABLE table_train_72 ( "id" int, "extracorporeal_membrane_oxygenation_ecmo_cannulation" bool, "heart_disease" bool, "meningitis_or_encephalitis" bool, "sepsis" bool, "cancer" bool, "prisoners" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the ta...
SELECT * FROM table_train_72 WHERE extracorporeal_membrane_oxygenation_ecmo_cannulation = 1
criteria2sql
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "2560"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
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 files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating nu...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC
nvbench
CREATE TABLE table_name_45 ( location VARCHAR, fc_matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the FC match with a score of 12 played?
SELECT location FROM table_name_45 WHERE fc_matches = "12"
sql_create_context
CREATE TABLE table_66333 ( "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. -- For the Cage Combat Fighting Championships: Mayhem,...
SELECT "Record" FROM table_66333 WHERE "Event" = 'cage combat fighting championships: mayhem'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( ...
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 = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ...
mimic_iii
CREATE TABLE table_53231 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city was a visitor on the date of April 30?
SELECT "Visitor" FROM table_53231 WHERE "Date" = 'april 30'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12985')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_36305 ( "Tournament" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1992" FROM table_36305 WHERE "1989" = '1–2'
wikisql
CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT shop_name FROM shop ORDER BY open_year
spider
CREATE TABLE table_name_71 ( rider VARCHAR, time_retired VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the rider for laps less than 23 with grid greater than 21 that had a time of +1 lap?
SELECT rider FROM table_name_71 WHERE laps < 23 AND grid > 21 AND time_retired = "+1 lap"
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '62213446252' GROUP BY SOC_SRT_DIRE_CD ORDER BY SUM(SELF_PAY_AMO) DESC LIMIT 1
css
CREATE TABLE table_name_33 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2010 for 2008 of 1r and tournament of us open
SELECT 2010 FROM table_name_33 WHERE 2008 = "1r" AND 2011 = "1r" AND tournament = "us open"
sql_create_context
CREATE TABLE table_59903 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT "Name" FROM table_59903 WHERE "League Cup Goals" > '0' AND "Total Goals" < '13' AND "League Cup Apps" = '4'
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 FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY COUNT(FIRST_NAME)
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.admityear < "2173"
mimicsql_data
CREATE TABLE table_51813 ( "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 location was f bio maldonado the opponent at?
SELECT "Location" FROM table_51813 WHERE "Opponent" = 'fábio maldonado'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( 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...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9519842' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-09-08' AND '2013-11-18' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_45124 ( "Event" text, "2006\u201307" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 2012-13 when 2011-12 is dnp and event is autumn go...
SELECT "2012\u201313" FROM table_45124 WHERE "2011\u201312" = 'dnp' AND "Event" = 'autumn gold'
wikisql
CREATE TABLE table_46393 ( "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. -- Who ha...
SELECT "High points" FROM table_46393 WHERE "Date" = 'november 12'
wikisql
CREATE TABLE table_name_79 ( catalog VARCHAR, format VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Catalog number of the CD Reissue Universal release?
SELECT catalog FROM table_name_79 WHERE format = "cd reissue" AND label = "universal"
sql_create_context
CREATE TABLE table_27539535_4 ( points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of points?
SELECT MIN(points) FROM table_27539535_4
sql_create_context
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sal...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE"
nvbench
CREATE TABLE table_name_11 ( time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which time has eddie miller as opponent?
SELECT time FROM table_name_11 WHERE opponent = "eddie miller"
sql_create_context
CREATE TABLE table_name_26 ( laps INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were done in 2012?
SELECT SUM(laps) FROM table_name_26 WHERE year = 2012
sql_create_context
CREATE TABLE table_201_39 ( id number, "no" number, "title" text, "directed by" text, "released" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who directed the most cartoons ?
SELECT "directed by" FROM table_201_39 GROUP BY "directed by" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_1342426_3 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when incumbent John R. Tyson was elected?
SELECT result FROM table_1342426_3 WHERE incumbent = "John R. Tyson"
sql_create_context
CREATE TABLE table_name_81 ( first_match VARCHAR, last_match VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the first match for the competition that ended its last match on December 16, 2007?
SELECT first_match FROM table_name_81 WHERE last_match = "december 16, 2007"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_20673 ( "State" text, "Preliminary Average" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Semifinal Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the evening gown score for the one who had a...
SELECT "Evening Gown" FROM table_20673 WHERE "Preliminary Average" = '8.121 (8)'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM zyjybgb WHERE zyjybgb.BGDH = '55858343244' UNION SELECT mzjybgb.KSBM, mzjybgb.KSMC FROM mzjybgb WHERE mzjybgb.BGDH = '55858343244'
css
CREATE TABLE table_name_77 ( played VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number Played that has 310 Points for?
SELECT played FROM table_name_77 WHERE points_for = "310"
sql_create_context
CREATE TABLE table_57332 ( "Council" text, "2003 result" text, "Notional control (based on 2003 results)" text, "2007 result" text, "Details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2007 result when the notional control is noc and ...
SELECT "2007 result" FROM table_57332 WHERE "Notional control (based on 2003 results)" = 'noc' AND "2003 result" = 'snp'
wikisql
CREATE TABLE table_49618 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "No. 8" FROM table_49618 WHERE "No. 4" = 'noah'
wikisql
CREATE TABLE table_name_84 ( song_title VARCHAR, movie VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the song in Amma Cheppindi?
SELECT song_title FROM table_name_84 WHERE movie = "amma cheppindi"
sql_create_context
CREATE TABLE table_name_33 ( rank VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for 1961?
SELECT rank FROM table_name_33 WHERE year = "1961"
sql_create_context
CREATE TABLE table_36623 ( "Fraction" text, "Ellipsis" text, "Vinculum" text, "Dots" text, "Parentheses" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What fraction has parentheses of 0.(3)?
SELECT "Fraction" FROM table_36623 WHERE "Parentheses" = '0.(3)'
wikisql
CREATE TABLE Document_Sections_Images ( section_id INTEGER, image_id INTEGER ) CREATE TABLE Documents ( document_code VARCHAR(15), document_structure_code VARCHAR(15), document_type_code VARCHAR(15), access_count INTEGER, document_name VARCHAR(80) ) CREATE TABLE Images ( image_id INTEG...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_228973_11 ( no_in_series VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- David James Elliott directed which episode number within the series?
SELECT no_in_series FROM table_228973_11 WHERE directed_by = "David James Elliott"
sql_create_context
CREATE TABLE table_2066 ( "Role" text, "Original Broadway Cast" text, "Current Broadway Cast" text, "Original Toronto Cast" text, "First National Tour Cast" text, "Original Australian Cast" text, "Original West End Cast" text, "Current West End Cast" text, "Second National Tour Cast"...
SELECT "Current Broadway Cast" FROM table_2066 WHERE "Original Broadway Cast" = 'Constantine Maroulis'
wikisql
CREATE TABLE table_203_771 ( id number, "#" number, "artist" text, "featuring" text, "title" text, "version" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many tracks are there on the 2005 best of benassi bros. album ?
SELECT COUNT("title") FROM table_203_771
squall
CREATE TABLE table_name_60 ( director VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the Romanian film?
SELECT director FROM table_name_60 WHERE language = "romanian"
sql_create_context
CREATE TABLE table_name_31 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents for week 12?
SELECT opponent FROM table_name_31 WHERE week = 12
sql_create_context
CREATE TABLE table_name_97 ( height__m_ INTEGER, name VARCHAR, ave__no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Height (m) has a Name of plessur alps, and a AVE-No larger than 63?
SELECT MIN(height__m_) FROM table_name_97 WHERE name = "plessur alps" AND ave__no > 63
sql_create_context
CREATE TABLE table_6750 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of silver medals with a rank of 4 and total medals greater than 1?
SELECT MIN("Silver") FROM table_6750 WHERE "Rank" = '4' AND "Total" > '1'
wikisql
CREATE TABLE table_test_32 ( "id" int, "anemia" bool, "symptomatic_disease" bool, "language" string, "deceased" bool, "abdominal_pain" bool, "fever" bool, "arthralgia" bool, "unable_provide_consent" bool, "headache" bool, "myalgia" bool, "rash" bool, "thrombocytopenia...
SELECT * FROM table_test_32 WHERE age < 18 OR language <> 'english' OR deceased = 1 OR unable_provide_consent = 1
criteria2sql
CREATE TABLE table_17622423_12 ( high_assists VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high assists for may 21
SELECT high_assists FROM table_17622423_12 WHERE date = "May 21"
sql_create_context
CREATE TABLE table_31770 ( "Nationality" text, "No [a ]" text, "Pos [a ]" text, "From" text, "School/club" text, "Pts [b ]" real, "Reb [b ]" real, "Ast [b ]" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the points that is more ...
SELECT "Pts [b ]" FROM table_31770 WHERE "Reb [b ]" > '636' AND "No [a ]" = '50'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4573"
mimicsql_data
CREATE TABLE table_55158 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "TD's" real, "Long" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the toal rec with more than 27 and averages less than 10.8 and TDs more than 6?
SELECT COUNT("Long") FROM table_55158 WHERE "Rec." > '27' AND "Avg." < '10.8' AND "TD's" > '6'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND medication.drugname = '1000 ml bag : lactated ringers iv ...
eicu
CREATE TABLE table_name_1 ( method VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the method with a record of 4-2
SELECT method FROM table_name_1 WHERE record = "4-2"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE...
mimic_iii
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT mid, AVG(stars) FROM rating GROUP BY mid HAVING COUNT(*) >= 2
spider
CREATE TABLE table_31808 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the result for 2008-12-23
SELECT "Result" FROM table_31808 WHERE "Date" = '2008-12-23'
wikisql
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 mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
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.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5280788' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '52...
css
CREATE TABLE table_8528 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player lost more than 12?
SELECT COUNT("Lost") FROM table_8528 WHERE "Played" > '12'
wikisql
CREATE TABLE table_40479 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins are related to events of 7 and more than 2 top-10s...
SELECT COUNT("Wins") FROM table_40479 WHERE "Events" = '7' AND "Top-10" > '2'
wikisql
CREATE TABLE table_10812403_4 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did Calvin Mccarty play?
SELECT position FROM table_10812403_4 WHERE player = "Calvin McCarty"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'potassium chloride' ORDER BY prescriptions.st...
mimic_iii