instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_20159025_1 ( grid VARCHAR, part_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what grid was the time for part 1 1:31.063?
SELECT grid FROM table_20159025_1 WHERE part_1 = "1:31.063"
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '10110310' AND t_kc22.STA_DATE BETWEEN '2004-07-21' AND '2008-06-22' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_...
css
CREATE TABLE table_18903 ( "Rnd" real, "Circuit" text, "GTO Winning Team" text, "GTU Winning Team" text, "TO Winning Team" text, "TU Winning Team" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is GTU Winning Team's #27 D...
SELECT "TO Winning Team" FROM table_18903 WHERE "GTU Winning Team" = '#27 Don Lindley'
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 jybgb WHERE YLJGDM = '4850709' AND BGRQ BETWEEN '2004-06-21' AND '2018-03-17'
css
CREATE TABLE table_50974 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team for the away game that Canvey Island played?
SELECT "Home team" FROM table_50974 WHERE "Away team" = 'canvey island'
wikisql
CREATE TABLE table_12509 ( "Benalla DFL" text, "Wins" real, "Losses" real, "Draws" real, "Byes" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Benall DFL is Goorambat with less than 13 wins, what is the least amount of losse...
SELECT MIN("Losses") FROM table_12509 WHERE "Benalla DFL" = 'goorambat' AND "Wins" < '13'
wikisql
CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME ) CREATE TABLE Prescribes ( Physician INTEGER, ...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE table_name_79 ( bronze INTEGER, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lest amount of bronzes that ranked 2 and has less silvers than 0?
SELECT MIN(bronze) FROM table_name_79 WHERE rank = 2 AND silver < 0
sql_create_context
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4616814' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 24) AS T
css
CREATE TABLE table_name_78 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has a Date of 4 april 1993?
SELECT result FROM table_name_78 WHERE date = "4 april 1993"
sql_create_context
CREATE TABLE table_53567 ( "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 was the attendance when the VFL played Arde...
SELECT COUNT("Crowd") FROM table_53567 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_name_75 ( total VARCHAR, set_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when the score for set 1 is 14 25?
SELECT total FROM table_name_75 WHERE set_1 = "14–25"
sql_create_context
CREATE TABLE table_77863 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the women's singles champion in 1984?
SELECT "Women's singles" FROM table_77863 WHERE "Year" = '1984'
wikisql
CREATE TABLE table_42940 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of matches with more than 18 points and more than 1 draw?
SELECT MAX("Match") FROM table_42940 WHERE "Points" > '18' AND "Draw" > '1'
wikisql
CREATE TABLE table_40248 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Points have an Against smaller than 43...
SELECT SUM("Points") FROM table_40248 WHERE "Against" < '43' AND "Position" < '1'
wikisql
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 jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '47040795195'
css
CREATE TABLE table_56279 ( "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 score of the away team whose opponen...
SELECT "Away team score" FROM table_56279 WHERE "Crowd" > '24,000' AND "Home team score" = '7.14 (56)'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT a.OwnerUserId AS "user_link", a.OwnerDisplayName, AVG(CAST(a.Score AS FLOAT)) AS "average_score", SUM(a.Score) AS "total_score", COUNT(a.Id) AS "num_answers" FROM Posts AS a WHERE (a.PostTypeId = 2) AND (a.CommunityOwnedDate IS NULL) GROUP BY a.OwnerUserId, a.OwnerDisplayName HAVING COUNT(a.Score) >= '##min?5##'...
sede
CREATE TABLE table_64193 ( "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2010/ 11 which has a 2006/ 07 of not held, an...
SELECT "2010/ 11" FROM table_64193 WHERE "2006/ 07" = 'not held' AND "2011/ 12" = 'a' AND "2012/ 13" = 'a'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON...
eicu
CREATE TABLE table_20702 ( "Year" real, "Lansing (LAN)" text, "Detroit (DTW)" text, "Grand Rapids (GRR)" text, "Flint (FNT)" text, "Kalamazoo (AZO)" text, "Saginaw (MBS)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Saginaw's fare is ...
SELECT "Grand Rapids (GRR)" FROM table_20702 WHERE "Saginaw (MBS)" = '$470.47'
wikisql
CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE classification ( id int, msid int, gid int ) CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREA...
SELECT director.name FROM company, copyright, directed_by, director, movie WHERE company.name = 'NBCUniversal' AND copyright.cid = company.id AND director.did = directed_by.did AND director.gender = 'male' AND movie.mid = copyright.msid AND movie.mid = directed_by.msid
imdb
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 gwyjzb.CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '78371715301' UNION SELECT fgwyjzb.CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '78371715301'
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 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 WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2164"
mimicsql_data
CREATE TABLE table_5127 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length of the Laguna Seca Raceway circuit with a class of gtu?
SELECT "Length" FROM table_5127 WHERE "Circuit" = 'laguna seca raceway' AND "Class" = 'gtu'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inpute...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '26cal sc with bp' A...
mimic_iii
CREATE TABLE table_27369069_4 ( province VARCHAR, soccer_stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the province where the soccer statium is terrain #2 of complexe sportif claude-robillard?
SELECT province FROM table_27369069_4 WHERE soccer_stadium = "terrain #2 of Complexe sportif Claude-Robillard"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.dob, demographic.religion FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_44099 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Score of 69, and a Player of mick soli?
SELECT "Country" FROM table_44099 WHERE "Score" = '69' AND "Player" = 'mick soli'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MAGS1I" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_13852 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cardinalatial title when the elevated is September 18, 1294, and ele...
SELECT "Cardinalatial title" FROM table_13852 WHERE "Elevated" = 'september 18, 1294' AND "Elector" = 'bérard de got'
wikisql
CREATE TABLE table_28697228_4 ( player VARCHAR, total_offense VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player with total offense of 454?
SELECT player FROM table_28697228_4 WHERE total_offense = 454
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM area, course WHERE area.area LIKE '%web technology%' AND course.course_id = area.course_id
advising
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 allergy ( allergy...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-6825' AND NOT patient.hospitaldischargetime IS NULL ORDER ...
eicu
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_CLINIC_ID, gwyjzb.PERSON_ID, gwyjzb.PERSON_NM, gwyjzb.IDENTITY_CARD, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '70444989325') UNION SELECT fgwyjz...
css
CREATE TABLE table_name_60 ( position INTEGER, lost VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a Lost larger than 4, and a Played larger than 14?
SELECT AVG(position) FROM table_name_60 WHERE lost > 4 AND played > 14
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2502709' GROUP BY t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_78349 ( "Player" text, "Pos." text, "From" real, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of assists for players that are f/c and have under 13 reboun...
SELECT MAX("Asts") FROM table_78349 WHERE "Pos." = 'f/c' AND "Rebs" < '13'
wikisql
CREATE TABLE table_2318 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment" real, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the only type of university that was founded in 1873?
SELECT "Control" FROM table_2318 WHERE "Founded" = '1873'
wikisql
CREATE TABLE table_203_465 ( id number, "name" text, "population (2002 census)" number, "population (2007 estimation)" number, "population (2011 census)" number, "area (km2)" number, "density (pop/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT SUM("population (2002 census)") FROM table_203_465
squall
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, O...
SELECT Id AS "comment_link" FROM Comments WHERE Text = 'Thank you for your answer.'
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-86236') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_name_61 ( qual VARCHAR, start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the qual with start of totals
SELECT qual FROM table_name_61 WHERE start = "totals"
sql_create_context
CREATE TABLE table_5923 ( "Round" text, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Mike Crowley plays defense for league?
SELECT "College/Junior/Club Team (League)" FROM table_5923 WHERE "Position" = 'defense' AND "Player" = 'mike crowley'
wikisql
CREATE TABLE table_36758 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games drawn with a Points difference of 31 - 33, and under 4 games lost?
SELECT SUM("Drawn") FROM table_36758 WHERE "Points difference" = '31 - 33' AND "Lost" < '4'
wikisql
CREATE TABLE table_train_243 ( "id" int, "c_peptide_level" float, "finger_stick_measurements" bool, "diabetic" string, "fasting_blood_glucose_fbg" float, "hypoglycemia" bool, "insulin_requirement" float, "triglyceride_tg" float, "a1c" float, "age" float, "NOUSE" float ) -- ...
SELECT * FROM table_train_243 WHERE triglyceride_tg < 150
criteria2sql
CREATE TABLE table_203_645 ( id number, "lower mississippi periods" text, "lower yazoo phases" text, "lower yazoo\ndates" text, "tensas/natchez phases" text, "cahokia phases" text, "cahokia dates" text, "ohio/miss. river\nconfluence phases" text, "ohio/miss. dates" text ) -- Using ...
SELECT COUNT(DISTINCT "lower yazoo phases") FROM table_203_645
squall
CREATE TABLE table_name_94 ( cole VARCHAR, award VARCHAR, work VARCHAR, year VARCHAR, dylan VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Cole for years before 2009 where Dylan was nominated for big daddy at mtv movie awards
SELECT cole FROM table_name_94 WHERE year < 2009 AND dylan = "nominated" AND work = "big daddy" AND award = "mtv movie awards"
sql_create_context
CREATE TABLE table_8383 ( "Pick" real, "Player" text, "Pos." text, "Nationality" text, "Team" text, "Previous team" text, "NBA years [a ]" text, "Career with the franchise [b ]" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Care...
SELECT "Career with the franchise [b ]" FROM table_8383 WHERE "Previous team" = 'new jersey nets'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5887) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_85 ( date VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the result w 28 7?
SELECT date FROM table_name_85 WHERE result = "w 28–7"
sql_create_context
CREATE TABLE table_4927 ( "Player" text, "Span" text, "Lost" text, "Draw" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the draw with drop and pens 0 in 1995?
SELECT "Draw" FROM table_4927 WHERE "Drop" = '0' AND "Pens" = '0' AND "Span" = '1995'
wikisql
CREATE TABLE table_747 ( "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 number of party had a candidate resigned when appointed judge democra...
SELECT COUNT("Party") FROM table_747 WHERE "Result" = 'Resigned when appointed judge Democratic hold'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "8968"
mimicsql_data
CREATE TABLE table_20425 ( "Issuing network" text, "IIN ranges" text, "Active" text, "Length" text, "Validation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length for iin range 51-55?
SELECT "Length" FROM table_20425 WHERE "IIN ranges" = '51-55'
wikisql
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE > 7)
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Alteplase (Catheter Clearance)"
mimicsql_data
CREATE TABLE table_name_17 ( date VARCHAR, label VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has parlophone as the label, and lp as a format?
SELECT date FROM table_name_17 WHERE label = "parlophone" AND format = "lp"
sql_create_context
CREATE TABLE table_24705 ( "Rank" real, "School" text, "Basic Elements" text, "Tumbling" text, "Stunts" text, "Tosses" text, "Pyramids" text, "Deductions" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the rank is 11...
SELECT "Total" FROM table_24705 WHERE "Rank" = '11'
wikisql
CREATE TABLE code_description ( code varchar, description text ) 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, fligh...
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 = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
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 = "GUILLAIN BARRE SYNDROME" AND demographic.dob_year < "2052"
mimicsql_data
CREATE TABLE table_name_3 ( constructor VARCHAR, driver VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the constructor for alberto colombo and chassis of a1
SELECT constructor FROM table_name_3 WHERE driver = "alberto colombo" AND chassis = "a1"
sql_create_context
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_...
SELECT Budget_Type_Description, COUNT(Budget_Type_Description) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY Budget_Type_Description
nvbench
CREATE TABLE table_name_27 ( result VARCHAR, week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Result after the Week 4 on November 3, 1968?
SELECT result FROM table_name_27 WHERE week > 4 AND date = "november 3, 1968"
sql_create_context
CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar )...
SELECT business.review_count FROM business, category WHERE business.name = 'Cafe Zinho' AND business.state = 'Texas' AND category.business_id = business.business_id AND category.category_name = 'restaurant'
yelp
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '2 ml: ondansetron hcl 4 mg/2ml ij soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-6 year'))
eicu
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 COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '18154604' AND t_kc22.STA_DATE BETWEEN '2005-01-07' AND '2016-10-05' AND t_kc21.MED_SER_ORG_NO = '4531182' AND t_kc22.MED_INV...
css
CREATE TABLE table_43974 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Years of the player with Jersey Number(s) of 44?
SELECT "Years" FROM table_43974 WHERE "Jersey Number(s)" = '44'
wikisql
CREATE TABLE table_8255 ( "Channel" real, "Video" text, "Aspect" text, "PSIP Short Name" text, "Programming" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich Video has a Channel larger than 56.4?
SELECT "Video" FROM table_8255 WHERE "Channel" > '56.4'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_name_76 ( overall INTEGER, college VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Overall has a College of florida state, and a Round larger than 2?
SELECT SUM(overall) FROM table_name_76 WHERE college = "florida state" AND round > 2
sql_create_context
CREATE TABLE table_train_41 ( "id" int, "pulmonary_embolization" bool, "hiv_infection" bool, "neutrophil_count" int, "renal_disease" bool, "liver_disease" bool, "serum_creatinine" float, "myocardial_infarction" bool, "NOUSE" float ) -- Using valid SQLite, answer the following quest...
SELECT * FROM table_train_41 WHERE neutrophil_count < 500
criteria2sql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_name_56 ( laps INTEGER, time VARCHAR, bike VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of laps with an accident time and a suzuki gsx-r1000 bike?
SELECT MAX(laps) FROM table_name_56 WHERE time = "accident" AND bike = "suzuki gsx-r1000"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2157" AND diagnoses.icd9_code = "34830"
mimicsql_data
CREATE TABLE table_62667 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the to par score of the golfer that had a score of 68-70=138?
SELECT "To par" FROM table_62667 WHERE "Score" = '68-70=138'
wikisql
CREATE TABLE table_42235 ( "AIRLINE" text, "AIRLINE (in Arabic)" text, "ICAO" text, "CALLSIGN" text, "COMMENCED OPERATIONS" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ICAO with commenced operations before 1989?
SELECT "ICAO" FROM table_42235 WHERE "COMMENCED OPERATIONS" < '1989'
wikisql
CREATE TABLE table_5880 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method for the UFC Fight Night 10 event?
SELECT "Method" FROM table_5880 WHERE "Event" = 'ufc fight night 10'
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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '68782989' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 4261.3)
css
CREATE TABLE table_27162 ( "Tie no" real, "Home team" text, "Score 1" text, "Away team" text, "Attendance" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the away team for tie no 11?
SELECT "Away team" FROM table_27162 WHERE "Tie no" = '11'
wikisql
CREATE TABLE table_72750 ( "Rank" real, "City 1" text, "City 2" text, "2012 Passengers (in millions)" text, "2011 Passengers (in millions)" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many passengers (in millions) flew th...
SELECT "2012 Passengers (in millions)" FROM table_72750 WHERE "Distance" = '1075km'
wikisql
CREATE TABLE table_name_59 ( trial_phase VARCHAR, expected_end_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Trial Phase, when Expected End Date is June 2007?
SELECT trial_phase FROM table_name_59 WHERE expected_end_date = "june 2007"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "3733"
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 hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE competition ( country VARCHAR, competition_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country did participated in the most number of Tournament competitions?
SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
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 Founder, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_60362 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue has a status of Five Nations and an against of 22?
SELECT "Venue" FROM table_60362 WHERE "Status" = 'five nations' AND "Against" = '22'
wikisql
CREATE TABLE table_name_29 ( venue VARCHAR, competition VARCHAR, goal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Venue was the game with a Friendly Competition and 1 Goal played?
SELECT venue FROM table_name_29 WHERE competition = "friendly" AND goal = 1
sql_create_context
CREATE TABLE table_1529793_1 ( listed_owner_s_ VARCHAR, driver_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who owned the team Jeremy Mayfield raced for?
SELECT listed_owner_s_ FROM table_1529793_1 WHERE driver_s_ = "Jeremy Mayfield"
sql_create_context
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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY Team_Name
nvbench
CREATE TABLE playlists ( id VARCHAR, name VARCHAR ) CREATE TABLE tracks ( name VARCHAR, id VARCHAR ) CREATE TABLE playlist_tracks ( track_id VARCHAR, playlist_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of tracks which a...
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'
sql_create_context
CREATE TABLE table_16105186_2 ( california__san_francisco_ VARCHAR, vehicle VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Ford Focus electric vehicle emission test scores were recorded in California?
SELECT COUNT(california__san_francisco_) FROM table_16105186_2 WHERE vehicle = "Ford Focus Electric"
sql_create_context
CREATE TABLE table_51307 ( "Year" real, "Design" text, "Issue" text, "Artist" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What artist was released in 2005?
SELECT "Artist" FROM table_51307 WHERE "Year" = '2005'
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 cost ( costid num...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136854')) AND NOT vitalperiodic.sao2 IS NULL AN...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
SELECT JYKSBM, JYKSMC FROM jybgb WHERE BGDH = '27876710324'
css
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREA...
SELECT position FROM match_season GROUP BY position ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
SELECT TagName, COUNT(*) AS UpVotes, DATEDIFF(month, 0, CreationDate) AS "month" FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 GROUP BY TagName, DATEDIFF(month, 0, CreationDate) ORDER BY UpVot...
sede
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 Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE table_23018775_3 ( pos VARCHAR, lap_two VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which positions have a lap two time of 22.7290?
SELECT pos FROM table_23018775_3 WHERE lap_two = "22.7290"
sql_create_context