instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_60072 ( "Players" text, "Position" text, "Year" text, "Ht/Wt" text, "Bats/Throws" text, "Hometown (Last School)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jake Johnson's position?
SELECT "Position" FROM table_60072 WHERE "Players" = 'jake johnson'
wikisql
CREATE TABLE table_25429986_1 ( horse VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what horse is in the 6th position?
SELECT horse FROM table_25429986_1 WHERE position = "6th"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE T...
SELECT Id AS "user_link", LastAccessDate, CASE ANSWERS WHEN 0 THEN 'infinity' ELSE CAST(ROUND(QUESTIONS / CAST(ANSWERS AS FLOAT), 2) AS TEXT) END AS "Q:A ratio" FROM (SELECT u.Id, u.LastAccessDate, SUM(CASE p.PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS "Questions", SUM(CASE p.PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Answer...
sede
CREATE TABLE table_name_31 ( frequency INTEGER, webcast VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Frequency has a Webcast of , and a Callsign of xemr?
SELECT AVG(frequency) FROM table_name_31 WHERE webcast = "•" AND callsign = "xemr"
sql_create_context
CREATE TABLE table_72908 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the part 4 of the word with the part 1 'heizan'?
SELECT "Part 4" FROM table_72908 WHERE "Part 1" = 'heizan'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE table_57194 ( "Rank" real, "Constituency" text, "Winning party 2007" text, "Swing to gain" real, "Labour's place 2007" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of rank 1?
SELECT "Result" FROM table_57194 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_train_21 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "limited_care" bool, "septic_shock" bool, "coagulopathy" bool, "age" float, "lactate" int, "NOUSE" float ) -- Using valid...
SELECT * FROM table_train_21 WHERE active_infection = 1 AND (lactate > 4 OR systolic_blood_pressure_sbp < 90)
criteria2sql
CREATE TABLE table_name_64 ( player VARCHAR, mls_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player from dallas burn
SELECT player FROM table_name_64 WHERE mls_team = "dallas burn"
sql_create_context
CREATE TABLE table_56703 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the label for the album with a catalog number of 83061-2?
SELECT "Label" FROM table_56703 WHERE "Catalog #" = '83061-2'
wikisql
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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '马嘉胜' AND t_kc21.MED_SER_ORG_NO = '0046679' AND t_kc21.IN_DIAG_DIS_NM LIKE '%增生%'
css
CREATE TABLE table_42266 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Year, when the Venue is Beijing, PR China?
SELECT MAX("Year") FROM table_42266 WHERE "Venue" = 'beijing, pr china'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE partic...
SELECT COUNT(*) FROM faculty
spider
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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name tex...
SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE table_80369 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue was on 27 May 2000?
SELECT "Venue" FROM table_80369 WHERE "Date" = '27 may 2000'
wikisql
CREATE TABLE table_203_393 ( id number, "year" number, "film" text, "director" text, "cast" text, "details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which film won the most awards ?
SELECT "film" FROM table_203_393 ORDER BY "details" DESC LIMIT 1
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2156" AND procedures.icd9_code = "9744"
mimicsql_data
CREATE TABLE table_2546 ( "High School" text, "Type" text, "Established" real, "Enrollment" real, "Mascot" text, "WIAA Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many wiaa classifications does fort vancouver high school h...
SELECT COUNT("WIAA Classification") FROM table_2546 WHERE "High School" = 'Fort Vancouver'
wikisql
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 text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '章清懿' AND hz_info.YLJGDM = '0923275' AND zyjzjlb.CYKSMC LIKE '%眼睛%'
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_name_53 ( venue VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the home team was footscray which venue did they play it?
SELECT venue FROM table_name_53 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_name_33 ( starts INTEGER, cuts_made VARCHAR, top_10 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of starts when 11 cuts were made and the top 10 ranking is larger than 4?
SELECT AVG(starts) FROM table_name_33 WHERE cuts_made = 11 AND top_10 > 4
sql_create_context
CREATE TABLE table_41622 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA for Benghazi, Libya?
SELECT "IATA" FROM table_41622 WHERE "Country" = 'libya' AND "City" = 'benghazi'
wikisql
CREATE TABLE table_7413 ( "Tournament" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "2003" FROM table_7413 WHERE "1996" = 'a' AND "Tournament" = 'hamburg masters'
wikisql
CREATE TABLE table_name_94 ( result VARCHAR, time___et__ VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the game at the Shea Stadium at 12:30pm (ET)?
SELECT result FROM table_name_94 WHERE time___et__ = "12:30pm" AND location = "shea stadium"
sql_create_context
CREATE TABLE table_61255 ( "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Count the Draw which has Lost of 0, and a Goals Scored large...
SELECT SUM("Draw") FROM table_61255 WHERE "Lost" = '0' AND "Goals Scored" > '0'
wikisql
CREATE TABLE table_name_29 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the score of 2-0 take place?
SELECT date FROM table_name_29 WHERE score = "2-0"
sql_create_context
CREATE TABLE table_35437 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the last match with a vacancy date of ro...
SELECT "Last match" FROM table_35437 WHERE "Date of vacancy" = 'round 2' AND "Outgoing manager" = 'ney franco'
wikisql
CREATE TABLE table_name_48 ( name VARCHAR, out_of VARCHAR, source VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name had the Source, World Bank, and a Rank smaller than 110, Out of a number smaller than 199?
SELECT name FROM table_name_48 WHERE source = "world bank" AND rank < 110 AND out_of < 199
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 441 AND instructor.name LIKE '%Domenic Desocio%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering...
advising
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '89569884' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6947.2)
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "D-Dimer"
mimicsql_data
CREATE TABLE table_9191 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of surface was played on July 27, 2013?
SELECT "Surface" FROM table_9191 WHERE "Date" = 'july 27, 2013'
wikisql
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 DISTINCT (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 INNER JOIN Comments AS c ON c.PostId = p.Id WHERE t.TagName LIKE '%bigcommerce%' AND p.CreationDate >= '2019-01-01'
sede
CREATE TABLE table_12350 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the score 6 4?
SELECT "Date" FROM table_12350 WHERE "Score" = '6–4'
wikisql
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 patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'nitroglycerin sl' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT Id AS "user_link", DownVotes FROM Users WHERE DownVotes >= '##minvotes##' AND Id > -1 ORDER BY DownVotes DESC
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardi...
eicu
CREATE TABLE table_55962 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least attendance with carolina visitor
SELECT MIN("Attendance") FROM table_55962 WHERE "Visitor" = 'carolina'
wikisql
CREATE TABLE table_55937 ( "Rank" real, "Name" text, "Nation" text, "Placings" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of all total values for Switzerland?
SELECT SUM("Total") FROM table_55937 WHERE "Nation" = 'switzerland'
wikisql
CREATE TABLE table_30133_3 ( gdp_as_of_2012_after_purchasing_power_parity__ppp__calculations__usd_billions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1985 value for the year when GDP as of 2012 after PPP was 369.38?
SELECT 1985 FROM table_30133_3 WHERE gdp_as_of_2012_after_purchasing_power_parity__ppp__calculations__usd_billions_ = "369.38"
sql_create_context
CREATE TABLE table_name_65 ( engine_configuration_ VARCHAR, _notes_0_100km_h VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the engine configuration & notes 0-100km/h with a model with 2.3 t5?
SELECT engine_configuration_ & _notes_0_100km_h FROM table_name_65 WHERE model = "2.3 t5"
sql_create_context
CREATE TABLE table_34787 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- To which college/junior/club team did the player that was Pi...
SELECT "College/junior/club team" FROM table_34787 WHERE "Pick #" = '12'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "79" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE table_name_89 ( population_estimate_2005 INTEGER, area__km_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the population estimate 2005 for the with the area (km2) 3,034.08?
SELECT AVG(population_estimate_2005) FROM table_name_89 WHERE area__km_2__ = 3 OFFSET 034.08
sql_create_context
CREATE TABLE table_75601 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Frequency MHz of 88.7 had what average erp w?
SELECT AVG("ERP W") FROM table_75601 WHERE "Frequency MHz" = '88.7'
wikisql
CREATE TABLE table_train_49 ( "id" int, "consent" bool, "palliative_treatment" bool, "acute_mesenteric_ischemia" bool, "receiving_vasopressor" bool, "septic_shock" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- present or susp...
SELECT * FROM table_train_49 WHERE acute_mesenteric_ischemia = 1
criteria2sql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games DESC
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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND lab.label = "Reticulocyte Count, Manual"
mimicsql_data
CREATE TABLE table_34617 ( "Region served" text, "City" text, "Channels ( Analog / Digital )" text, "First air date" text, "ERP (Analog/ Digital)" text, "HAAT (Analog/ Digital) 1" text, "Transmitter Location" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "Region served" FROM table_34617 WHERE "HAAT (Analog/ Digital) 1" = '1176 m 1190 m'
wikisql
CREATE TABLE table_name_24 ( round VARCHAR, position VARCHAR, signed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round drafted was the 1b and a Signed of no cardinals - 1969 june?
SELECT COUNT(round) FROM table_name_24 WHERE position = "1b" AND signed = "no cardinals - 1969 june"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_70189 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up in 2004?
SELECT "Runner-up" FROM table_70189 WHERE "Year" = '2004'
wikisql
CREATE TABLE table_204_78 ( id number, "no." number, "train no." text, "origin" text, "destination" text, "train name" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many trains are going to trivandrum ?
SELECT COUNT("train name") FROM table_204_78 WHERE "destination" = 'trivandrum'
squall
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, ...
SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE table_78261 ( "Athlete" text, "Event" text, "Snatch" real, "Clean & Jerk" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total that had an event of +105 kg and clean & jerk less than 227.5?
SELECT COUNT("Total") FROM table_78261 WHERE "Event" = '+105 kg' AND "Clean & Jerk" < '227.5'
wikisql
CREATE TABLE table_name_42 ( name VARCHAR, moving_from VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is moving from Treviso with a loan return?
SELECT name FROM table_name_42 WHERE moving_from = "treviso" AND type = "loan return"
sql_create_context
CREATE TABLE table_65811 ( "Airing date" text, "English title (Chinese title)" text, "Number of episodes" real, "Genre" text, "Official website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the airing date for the show with 62 episodes?
SELECT "Airing date" FROM table_65811 WHERE "Number of episodes" = '62'
wikisql
CREATE TABLE table_18161217_2 ( cospar_id VARCHAR, estimated_operational_life VARCHAR, satellite VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cospar ID of the Kosmos 2397 satellite, which has an operational life of 2 months?
SELECT cospar_id FROM table_18161217_2 WHERE estimated_operational_life = "2 months" AND satellite = "Kosmos 2397"
sql_create_context
CREATE TABLE table_47406 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Type has a Name of edson ratinho?
SELECT "Type" FROM table_47406 WHERE "Name" = 'edson ratinho'
wikisql
CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TA...
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_id
nvbench
CREATE TABLE scientists ( ssn number, name text ) CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE assignedto ( scientist number, project text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of scientists w...
SELECT name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM assignedto)
spider
CREATE TABLE table_54149 ( "Year" real, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the composition with an artist of Henry Purdy, a year smaller than 2002, and a mint more ...
SELECT "Composition" FROM table_54149 WHERE "Year" < '2002' AND "Mintage" > '1,998' AND "Artist" = 'henry purdy'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '12...
css
CREATE TABLE table_name_42 ( took_office INTEGER, left_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Took Office Date of the Presidency that Left Office Incumbent?
SELECT SUM(took_office) FROM table_name_42 WHERE left_office = "incumbent"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 AN...
atis
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1457935' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_...
css
CREATE TABLE table_53611 ( "Round" real, "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Crowd" real, "Stadium" text, "Match Details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team played in front of 18,34...
SELECT "Home Team" FROM table_53611 WHERE "Crowd" > '18,345' AND "Stadium" = 'adelaide oval'
wikisql
CREATE TABLE table_name_58 ( pop_act VARCHAR, album VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which act's album has a name of All That You Can't Leave Behind?
SELECT pop_act FROM table_name_58 WHERE album = "all that you can't leave behind"
sql_create_context
CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ...
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC
nvbench
CREATE TABLE table_name_24 ( rd__number VARCHAR, reg_gp VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rd number where the reg GP is 0 and the pick is 150?
SELECT COUNT(rd__number) FROM table_name_24 WHERE reg_gp = 0 AND pick__number = 150
sql_create_context
CREATE TABLE table_44506 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Set 1 of 25 16?
SELECT "Score" FROM table_44506 WHERE "Set 1" = '25–16'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2058"
mimicsql_data
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
SELECT Tags.TagName FROM Tags AS tags JOIN PostTags AS postTags ON PostTags.TagId = Tags.Id JOIN Posts AS posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName IN ('angularjs', 'angular2', 'vue.js', 'ember.js', 'backbone.js', 'reactjs', 'knockout.js', 'typescript') AND Posts.AcceptedAnswerId IS NULL
sede
CREATE TABLE table_27296 ( "Freq" real, "Call" text, "City" text, "Owner" text, "Start" real, "Day Power ( W )" real, "Night Power" real, "Nickname" text, "Format" text, "Stereo" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Doe...
SELECT "Stereo" FROM table_27296 WHERE "City" = 'Moline'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'PHARMACY' AND COURSE_1.num...
advising
CREATE TABLE table_55094 ( "Title" text, "Year" real, "Country" text, "Music" text, "Uncut run time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What music is in the film before 1962?
SELECT "Music" FROM table_55094 WHERE "Year" = '1962'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.days_stay, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Troy Friedman"
mimicsql_data
CREATE TABLE table_45022 ( "Antibody" text, "Brand name" text, "Approval date" real, "Type" text, "Target" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the target for the brand mylotarg?
SELECT "Target" FROM table_45022 WHERE "Brand name" = 'mylotarg'
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 microlab ( microl...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'nacl 0.9% bolus')
eicu
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 JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '2298937' AND BGRQ BETWEEN '2000-02-17' AND '2009-07-01' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL)
css
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 prescriptions.drug_type, prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "METD5"
mimicsql_data
CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE images ( image_id number, image_alt_text text, image_name text, image_url text ) CREATE TABLE document_sections_images ( section_id number, image_id number ) ...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000
spider
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 JOB_ID, 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
nvbench
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_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '63144287347'
css
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.short_title = "Hx surgery to organs NEC" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '卫逸明' AND jybgb.BGRQ BETWEEN '2009-07-05' AND '2017-07-06...
css
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE school_details ( school_id number, nickn...
SELECT enrollment FROM school WHERE denomination <> "Catholic"
spider
CREATE TABLE table_76866 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the game with a 6-11-8...
SELECT "Location" FROM table_76866 WHERE "Record" = '6-11-8'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIM...
eicu
CREATE TABLE table_1979619_3 ( term_ends VARCHAR, residence VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the term ends for bethlehem
SELECT COUNT(term_ends) FROM table_1979619_3 WHERE residence = "Bethlehem"
sql_create_context
CREATE TABLE table_name_35 ( episodes INTEGER, actor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of episodes for anabel barnston?
SELECT MIN(episodes) FROM table_name_35 WHERE actor = "anabel barnston"
sql_create_context
CREATE TABLE table_17685 ( "Track Name" text, "Location" text, "Length" text, "Seating" real, "Year Opened" real, "Year Acquired [A ]" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the track that opened in 1995?
SELECT "Location" FROM table_17685 WHERE "Year Opened" = '1995'
wikisql
CREATE TABLE table_6629 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" text, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a loan as the type...
SELECT "Country" FROM table_6629 WHERE "Type" = 'loan'
wikisql
CREATE TABLE table_6723 ( "Year" real, "Male" text, "Female" text, "Band" text, "Album" text, "Pop Act" text, "Lifetime Achievement Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which act's album has a name of All That You Can't Leav...
SELECT "Pop Act" FROM table_6723 WHERE "Album" = 'all that you can''t leave behind'
wikisql
CREATE TABLE table_name_38 ( result VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of week 13?
SELECT result FROM table_name_38 WHERE week = 13
sql_create_context
CREATE TABLE table_11214212_1 ( naturalisation_by_marriage VARCHAR, registration_of_a_minor_child VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the naturalisation by marriage with regbeingtration of a minor child being 114
SELECT naturalisation_by_marriage FROM table_11214212_1 WHERE registration_of_a_minor_child = 114
sql_create_context