instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "5720"
mimicsql_data
CREATE TABLE table_name_52 ( points VARCHAR, year VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points does the year after 1986 with a AGS JH23B chassis have?
SELECT points FROM table_name_52 WHERE year > 1986 AND chassis = "ags jh23b"
sql_create_context
CREATE TABLE table_45895 ( "Name" text, "Listed" text, "Location" text, "County" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of Bridge is in Stanley?
SELECT "Type" FROM table_45895 WHERE "Location" = 'stanley'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_1108394_43 ( party VARCHAR, brooklyn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the party with brooklyn value of 51.0%
SELECT party FROM table_1108394_43 WHERE brooklyn = "51.0_percentage"
sql_create_context
CREATE TABLE table_name_78 ( score VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the attendance was 3188 what was the score?
SELECT score FROM table_name_78 WHERE attendance = 3188
sql_create_context
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE table_name_80 ( undecided VARCHAR, source VARCHAR, murray VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the undecided percentage of the poll from Suffolk University with Murray at 11%?
SELECT undecided FROM table_name_80 WHERE source = "suffolk university" AND murray = "11%"
sql_create_context
CREATE TABLE table_56872 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the time of 1:23.32.41?
SELECT "Rider" FROM table_56872 WHERE "Time" = '1:23.32.41'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 808 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_train_46 ( "id" int, "bleeding" int, "active_infection" bool, "hypotension" bool, "burn_injury" int, "hypertension" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 10 % of body surface area a...
SELECT * FROM table_train_46 WHERE burn_injury > 10
criteria2sql
CREATE TABLE table_52647 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed Chris Amon's car?
SELECT "Constructor" FROM table_52647 WHERE "Driver" = 'chris amon'
wikisql
CREATE TABLE table_name_45 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value in 1990 when it is A in 1989, 1985, and 1993?
SELECT 1990 FROM table_name_45 WHERE 1989 = "a" AND 1985 = "a" AND 1993 = "a"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, las...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784) AND prescriptions.drug = 'vancomycin'
mimic_iii
CREATE TABLE table_62740 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the circuit that had an event cancelled?
SELECT "Circuit" FROM table_62740 WHERE "Winner" = 'event cancelled'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
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 = '032-21820')) AND NOT vitalperiodic.respiration IS N...
eicu
CREATE TABLE table_69769 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of october 8 happened at what time?
SELECT "Time" FROM table_69769 WHERE "Date" = 'october 8'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Parent...
SELECT Id AS "user_link", LastAccessDate FROM Users WHERE LastAccessDate > DATEDIFF(DAY, 1, GETDATE()) ORDER BY LastAccessDate
sede
CREATE TABLE table_38574 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has a Tournament of st. petersburg , russia?
SELECT "Surface" FROM table_38574 WHERE "Tournament" = 'st. petersburg , russia'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT Id, CreationDate, CommunityOwnedDate, AnswerCount FROM Posts WHERE YEAR(CreationDate) = 2011 AND PostTypeId = 1 ORDER BY CreationDate
sede
CREATE TABLE table_203_355 ( id number, "year" number, "total" number, "romanians" text, "hungarians" text, "roma" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year had the highest total number ?
SELECT "year" FROM table_203_355 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
SELECT city, MAX(lat) FROM station GROUP BY city
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898')) AND treatment.treatmentname = 'antihyperlipidemic agent - fenof...
eicu
CREATE TABLE table_204_757 ( id number, "state" text, "interview" number, "swimsuit" number, "evening gown" number, "average" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the largest evening gown amount ?
SELECT MAX("evening gown") FROM table_204_757
squall
CREATE TABLE table_18466 ( "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 is the number of party in the arkansas 1 district
SELECT COUNT("Party") FROM table_18466 WHERE "District" = 'Arkansas 1'
wikisql
CREATE TABLE table_name_52 ( runner_s__up VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On the Date of 2 Aug 2009, who was the Runner(s)-up?
SELECT runner_s__up FROM table_name_52 WHERE date = "2 aug 2009"
sql_create_context
CREATE TABLE table_65134 ( "Year" real, "Place" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won bronze in 1994?
SELECT "Bronze" FROM table_65134 WHERE "Year" = '1994'
wikisql
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLO...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
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 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.admission_type = "ELECTIVE" AND lab.label = "Triglycer"
mimicsql_data
CREATE TABLE table_23453931_5 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponents for december 3
SELECT COUNT(opponent) FROM table_23453931_5 WHERE date = "December 3"
sql_create_context
CREATE TABLE table_32879 ( "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 day did the VFL pay MCG?
SELECT "Date" FROM table_32879 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_63942 ( "Rank" real, "Lane" real, "Athlete" text, "Time ( sec )" real, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which athlete is ranked less than 5 with time over 11.22?
SELECT "Athlete" FROM table_63942 WHERE "Time ( sec )" > '11.22' AND "Rank" < '5'
wikisql
CREATE TABLE table_name_97 ( original_name VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the original name for last days of the victim
SELECT original_name FROM table_name_97 WHERE film_title_used_in_nomination = "last days of the victim"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.icd9_code = "17"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT 'EorV_hasEV' AS x, COUNT(Id) AS y FROM Posts WHERE (Tags LIKE '%<excel>%' OR Tags LIKE '%<vba>%') AND NOT Tags LIKE '%<excel-vba>%'
sede
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 SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '55865228' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-05-25' AND '2015-12-24'
css
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 COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND medication.drugname = 'hydromorphone 1 mg/1 ml syr' AND DATET...
eicu
CREATE TABLE table_name_47 ( third VARCHAR, skip VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the third who has Barbora Vojtusova as Skip?
SELECT third FROM table_name_47 WHERE skip = "barbora vojtusova"
sql_create_context
CREATE TABLE table_9572 ( "Year" real, "Character" text, "Title" text, "Author" text, "Artist" text, "Imprint" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the imprint when the title is owari no chronicle (ahead series)?
SELECT "Imprint" FROM table_9572 WHERE "Title" = 'owari no chronicle (ahead series)'
wikisql
CREATE TABLE table_36285 ( "Name" text, "Championship" real, "FA Cup" real, "League Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- League Cup smaller than 0 is what sum of the total?
SELECT SUM("Total") FROM table_36285 WHERE "League Cup" < '0'
wikisql
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, S...
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code DESC
nvbench
CREATE TABLE table_69059 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city of license has a wriq Call sign?
SELECT "City of license" FROM table_69059 WHERE "Call sign" = 'wriq'
wikisql
CREATE TABLE table_name_29 ( country VARCHAR, hdtv VARCHAR, content VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when HDTV is yes, and when Content is cinema?
SELECT country FROM table_name_29 WHERE hdtv = "yes" AND content = "cinema"
sql_create_context
CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Mar...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
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 = '002-58884')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Choledochlith NOS w obst"
mimicsql_data
CREATE TABLE table_name_63 ( laps VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of laps for Tom Bridger?
SELECT COUNT(laps) FROM table_name_63 WHERE driver = "tom bridger"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'replace indwelling cath')
mimic_iii
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE table_34991 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average game number that took place after February 13 against the Toronto ...
SELECT AVG("Game") FROM table_34991 WHERE "February" > '13' AND "Opponent" = 'toronto maple leafs' AND "Points" > '47'
wikisql
CREATE TABLE table_44722 ( "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. -- What was the score for set 3 when set 1 was 14 25?
SELECT "Set 3" FROM table_44722 WHERE "Set 1" = '14–25'
wikisql
CREATE TABLE Documents ( document_id INTEGER, document_status_code CHAR(15), document_type_code CHAR(15), shipping_agent_code CHAR(15), receipt_date DATETIME, receipt_number VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Shipping_Agents ( shipping_agent_code CHAR(15), s...
SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 20603)) AND DATETIME(inputevents_cv....
mimic_iii
CREATE TABLE table_78990 ( "Model" text, "Chassis" real, "Engine" real, "Year From" real, "Year To" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many engines have a Model of sl600, and a Year From of 1994, and a Year To smaller than 1995?
SELECT COUNT("Engine") FROM table_78990 WHERE "Model" = 'sl600' AND "Year From" = '1994' AND "Year To" < '1995'
wikisql
CREATE TABLE table_17330069_1 ( time_retired VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If there are 28 points, what is the time/retired?
SELECT time_retired FROM table_17330069_1 WHERE points = "28"
sql_create_context
CREATE TABLE table_15236 ( "Name" text, "Years" text, "A-League" text, "Finals" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has an A-League of 113 (0)?
SELECT "Name" FROM table_15236 WHERE "A-League" = '113 (0)'
wikisql
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 d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-03' ORDER BY labevents.charttime LIMIT 1)
mimic_iii
CREATE TABLE table_15119 ( "Year" real, "Division I" text, "Division II" text, "Division III" text, "Division IV" text, "Division V" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Division III has Bishop Brady in Division V and Hanover in D...
SELECT "Division III" FROM table_15119 WHERE "Division V" = 'bishop brady' AND "Division IV" = 'hanover'
wikisql
CREATE TABLE table_67890 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Try BP" text, "Losing BP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number drawn when the try BP is 1?
SELECT "Drawn" FROM table_67890 WHERE "Try BP" = '1'
wikisql
CREATE TABLE table_name_34 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent the Buffalo Bills played when their record was 4-4?
SELECT opponent FROM table_name_34 WHERE record = "4-4"
sql_create_context
CREATE TABLE table_57011 ( "Year" real, "Author" text, "English title" text, "Original title" text, "Representing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year for the ocean?
SELECT "Year" FROM table_57011 WHERE "English title" = 'the ocean'
wikisql
CREATE TABLE table_73185 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is the player who went to Regina?
SELECT "Position" FROM table_73185 WHERE "College" = 'Regina'
wikisql
CREATE TABLE table_62772 ( "Tournament" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1994" FROM table_62772 WHERE "1993" = 'grand slam tournaments'
wikisql
CREATE TABLE table_name_52 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2005 that has a grand slam tournaments in 2007?
SELECT 2005 FROM table_name_52 WHERE 2007 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_67600 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the rank when the time is 2:15.98, in a lane larger than 7?
SELECT COUNT("Rank") FROM table_67600 WHERE "Time" = '2:15.98' AND "Lane" > '7'
wikisql
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE airline ( airline_code varchar, airline_name text, note 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...
SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1)
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 procedures.short_title FROM procedures WHERE procedures.subject_id = "6983"
mimicsql_data
CREATE TABLE table_37630 ( "Date" text, "Title" text, "Origin" text, "Label & Cat. no." text, "Chart no." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is origin country for a title that charted at 52?
SELECT "Origin" FROM table_37630 WHERE "Chart no." = '52'
wikisql
CREATE TABLE table_18055005_1 ( no_in_series VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the series number of the episode with production code 329?
SELECT no_in_series FROM table_18055005_1 WHERE prod_code = "329"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_88 ( week__number VARCHAR, original_artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the week number with Phil Collins as the original artist?
SELECT week__number FROM table_name_88 WHERE original_artist = "phil collins"
sql_create_context
CREATE TABLE table_name_56 ( team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the team of the player who went to lawrence tech?
SELECT team FROM table_name_56 WHERE college = "lawrence tech"
sql_create_context
CREATE TABLE table_68037 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament has nov. 21, 1999 as the date?
SELECT "Tournament" FROM table_68037 WHERE "Date" = 'nov. 21, 1999'
wikisql
CREATE TABLE table_name_62 ( nfl_team VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What NFL team did the Tight End position belong to?
SELECT nfl_team FROM table_name_62 WHERE position = "tight end"
sql_create_context
CREATE TABLE table_name_92 ( builder VARCHAR, works_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Builder for the locomotive that has a works number of 323?
SELECT builder FROM table_name_92 WHERE works_number = "323"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text...
SELECT COUNT(*) AS "# votes", TIME_TO_STR(v.CreationDate, '%h') AS "hour" FROM Votes AS v GROUP BY TIME_TO_STR(v.CreationDate, '%h')
sede
CREATE TABLE table_name_59 ( margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Winning score is 68-65-65-68=266, what is the Margin of victory?
SELECT margin_of_victory FROM table_name_59 WHERE winning_score = 68 - 65 - 65 - 68 = 266
sql_create_context
CREATE TABLE table_25431 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "2nd" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Money list rank" real, "Scoring average" text, "Scoring rank" real ) -- Using valid SQLite, answer the fol...
SELECT "Top 10s" FROM table_25431 WHERE "Year" = '2007'
wikisql
CREATE TABLE table_23564 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Foochow" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the foochow for pingnan c...
SELECT "Foochow" FROM table_23564 WHERE "English Name" = 'Pingnan County'
wikisql
CREATE TABLE table_name_12 ( city___state VARCHAR, winner VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what City/State did John Bowe win at Phillip Island Grand Prix Circuit?
SELECT city___state FROM table_name_12 WHERE winner = "john bowe" AND circuit = "phillip island grand prix circuit"
sql_create_context
CREATE TABLE table_8742 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What iwas the attendance of the game that took place on december 6, 1998?
SELECT "Attendance" FROM table_8742 WHERE "Date" = 'december 6, 1998'
wikisql
CREATE TABLE table_1342451_16 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district did James O'Connor belong to?
SELECT district FROM table_1342451_16 WHERE incumbent = "James O'Connor"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20)...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_203_510 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n(/mi2)" number, "population\ndensity\n(/km2)" number, "land area\n(mi2)" number, "land area\n(km2)" number, "water area\n(mi2)" number, ...
SELECT "township" FROM table_203_510 WHERE "water area\n(mi2)" = (SELECT MIN("water area\n(mi2)") FROM table_203_510)
squall
CREATE TABLE table_name_28 ( year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year Inducted is the highest one that has a Year smaller than 1965?
SELECT MAX(year) AS Inducted FROM table_name_28 WHERE year < 1965
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚绮玉' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 4979.12)
css
CREATE TABLE table_16974 ( "Edition" text, "Round" text, "Date" text, "Partnering" text, "Against" text, "Surface" text, "Opponents" text, "W\u2013L" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the res...
SELECT "Date" FROM table_16974 WHERE "Result" = '6–2, 4–6, 6–4'
wikisql
CREATE TABLE table_name_18 ( artist VARCHAR, album VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the artist of the album Soul?
SELECT artist FROM table_name_18 WHERE album = "soul"
sql_create_context
CREATE TABLE table_5045 ( "Year" text, "Title" text, "Role" text, "Producer" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Director Erik Matti's Producer?
SELECT "Producer" FROM table_5045 WHERE "Director" = 'erik matti'
wikisql
CREATE TABLE table_name_85 ( club VARCHAR, stadium VARCHAR, founded VARCHAR, joined_prsl VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the club that was founded before 2007, joined prsl in 2008 and the stadium is yldefonso sol morales stadiu...
SELECT club FROM table_name_85 WHERE founded < 2007 AND joined_prsl = 2008 AND stadium = "yldefonso solá morales stadium"
sql_create_context
CREATE TABLE table_51826 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the championship that had final score of 6 2,...
SELECT "Championship" FROM table_51826 WHERE "Surface" = 'clay' AND "Score in the final" = '6–2, 5–7, 6–4, 6–2'
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.days_stay > "27"
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 zyjybgb.BBCJBW FROM zyjybgb WHERE zyjybgb.BGDH = '68054249569' UNION SELECT mzjybgb.BBCJBW FROM mzjybgb WHERE mzjybgb.BGDH = '68054249569'
css
CREATE TABLE table_name_7 ( rank VARCHAR, studio VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE RANK OF UNIVERSAL, AND DIRECTOR JOHN HUGHES?
SELECT rank FROM table_name_7 WHERE studio = "universal" AND director = "john hughes"
sql_create_context
CREATE TABLE table_25131572_3 ( season__number INTEGER, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest season# for the writer Daegan Fryklind?
SELECT MAX(season__number) FROM table_25131572_3 WHERE written_by = "Daegan Fryklind"
sql_create_context
CREATE TABLE table_1132600_3 ( round VARCHAR, winning_constructor VARCHAR, pole_position VARCHAR, fastest_lap VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round had Michael Schumacher in the pole position, David Coulthard with the fastest lap...
SELECT COUNT(round) FROM table_1132600_3 WHERE pole_position = "Michael Schumacher" AND fastest_lap = "David Coulthard" AND winning_constructor = "McLaren - Mercedes"
sql_create_context