instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_4590 ( "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. -- On what Date is there a Home team score of 8.15 (...
SELECT "Date" FROM table_4590 WHERE "Home team score" = '8.15 (63)'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou...
advising
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '04455332' AND hz_info.YLJGDM = '0621051' AND txmzjzjlb.JZZDSM LIKE '%形式%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz...
css
CREATE TABLE gwyjzb ( 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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '75834844' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '75834844' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE table_54764 ( "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 Essendon played as ...
SELECT COUNT("Crowd") FROM table_54764 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
nvbench
CREATE TABLE table_204_604 ( id number, "year" number, "date" text, "driver" text, "team" text, "manufacturer" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text ) -- Using valid SQLite, answe...
SELECT COUNT(*) FROM table_204_604 WHERE "manufacturer" = 'chevrolet'
squall
CREATE TABLE table_13038 ( "Average population (x 1000)" real, "Live births" text, "Deaths" text, "Natural change" text, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT MAX("Crude death rate (per 1000)") FROM table_13038 WHERE "Deaths" = '3 433' AND "Average population (x 1000)" > '298'
wikisql
CREATE TABLE table_57174 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is nerlens noel?
SELECT "Height" FROM table_57174 WHERE "Player" = 'nerlens noel'
wikisql
CREATE TABLE table_77332 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" rea...
SELECT COUNT("40 to 44") FROM table_77332 WHERE "50 to 54" < '4,184' AND "15 to 17" < '3'
wikisql
CREATE TABLE table_name_63 ( director_s_ VARCHAR, recipient VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the film that Avie Luthra received an award for?
SELECT director_s_ FROM table_name_63 WHERE recipient = "avie luthra"
sql_create_context
CREATE TABLE table_56904 ( "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 home score with a crowd larger than ...
SELECT "Home team score" FROM table_56904 WHERE "Crowd" > '25,603'
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND 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_zyj...
css
CREATE TABLE table_name_34 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2006 has q2 as the 2007?
SELECT 2006 FROM table_name_34 WHERE 2007 = "q2"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_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 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_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_43908 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game which featured...
SELECT "Score" FROM table_43908 WHERE "Away team" = 'gold coast blaze' AND "Home team" = 'adelaide 36ers'
wikisql
CREATE TABLE table_name_72 ( year VARCHAR, status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year is the status of won?
SELECT year FROM table_name_72 WHERE status = "won"
sql_create_context
CREATE TABLE table_70144 ( "Year" text, "Starts" real, "Cuts made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of number of w...
SELECT SUM("Wins") FROM table_70144 WHERE "Earnings (\u20ac)" > '2,864,342' AND "Money list rank" = '3'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, pati...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) >= '2103'
eicu
CREATE TABLE table_44649 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest round when the overall is less than 17?
SELECT MAX("Round") FROM table_44649 WHERE "Overall" < '17'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE table_name_40 ( hometown VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Hasan Shah's hometown?
SELECT hometown FROM table_name_40 WHERE name = "hasan shah"
sql_create_context
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypocalcemia - due to rhabdomyolysis' AND DATETIME...
eicu
CREATE TABLE table_73538 ( "Date" text, "Opponent" text, "Location" text, "Irish Points" real, "Opp. Points" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the record where the opponent is central connecticut?
SELECT "Record" FROM table_73538 WHERE "Opponent" = 'Central Connecticut'
wikisql
CREATE TABLE table_29595 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "First Star" text, "Decision" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Record" FROM table_29595 WHERE "Date" = 'October 22'
wikisql
CREATE TABLE table_name_35 ( school VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School has a Mascot of squires?
SELECT school FROM table_name_35 WHERE mascot = "squires"
sql_create_context
CREATE TABLE table_name_95 ( attendance VARCHAR, week INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the attendance when the week was more than 16?
SELECT attendance FROM table_name_95 WHERE week > 16
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179' AND patient.hospitaldischargetime IS NULL)) AND medication.drug...
eicu
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE table_name_55 ( time VARCHAR, writer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of songs that have the writer Aaron Schroeder and Wally Gold?
SELECT time FROM table_name_55 WHERE writer_s_ = "aaron schroeder and wally gold"
sql_create_context
CREATE TABLE table_32996 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tonnage of the Great Britain ship Batna?
SELECT "Tonnage" FROM table_32996 WHERE "Nationality" = 'great britain' AND "Ship" = 'batna'
wikisql
CREATE TABLE table_6919 ( "Season" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Goals for" real, "Goals against" real, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most points when the goals against...
SELECT MAX("Points") FROM table_6919 WHERE "Goals against" = '354' AND "Games" < '82'
wikisql
CREATE TABLE table_name_91 ( constructor VARCHAR, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor has a race called I News of the World Trophy?
SELECT constructor FROM table_name_91 WHERE race_name = "i news of the world trophy"
sql_create_context
CREATE TABLE table_24865763_2 ( rnd INTEGER, gt2_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the maximum round where Marc Lieb Richard Lietz was on the GT2 Winning Team?
SELECT MAX(rnd) FROM table_24865763_2 WHERE gt2_winning_team = "Marc Lieb Richard Lietz"
sql_create_context
CREATE TABLE table_name_42 ( mintage INTEGER, year VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the MIntage after 2006 of the Ruby-Throated Hummingbird Theme coin?
SELECT MAX(mintage) FROM table_name_42 WHERE year > 2006 AND theme = "ruby-throated hummingbird"
sql_create_context
CREATE TABLE table_1577 ( "Constituency" text, "Electorate" real, "Votes" real, "Turnout" text, "Yes" real, "No" real, "Spoilt" real, "Percent Yes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least yes for dublin south
SELECT MIN("Yes") FROM table_1577 WHERE "Constituency" = 'Dublin South'
wikisql
CREATE TABLE table_18209 ( "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. -- how many candidates with party being democratic and dbeingtrict being ne...
SELECT COUNT("Candidates") FROM table_18209 WHERE "Party" = 'Democratic' AND "District" = 'New York5'
wikisql
CREATE TABLE table_11734041_16 ( height_in_ft VARCHAR, years_for_rockets VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height in ft for the rockets from 1973-78?
SELECT height_in_ft FROM table_11734041_16 WHERE years_for_rockets = "1973-78"
sql_create_context
CREATE TABLE table_29729 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT "High rebounds" FROM table_29729 WHERE "Team" = 'Charlotte'
wikisql
CREATE TABLE table_51557 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text, "Arena" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the Staples Center?
SELECT "Opponent" FROM table_51557 WHERE "Arena" = 'staples center'
wikisql
CREATE TABLE table_50722 ( "Rank" real, "Club" text, "Winners" real, "Runners-up" real, "Third" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has 1 runners-up with 0 winners and 2 third place earned?
SELECT "Club" FROM table_50722 WHERE "Runners-up" = '1' AND "Winners" = '0' AND "Third" = '2'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_2668336_17 ( district VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- First elected in 1807 1817 in what district?
SELECT district FROM table_2668336_17 WHERE first_elected = "1807 1817"
sql_create_context
CREATE TABLE problem_category_codes ( problem_category_code text, problem_category_description text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, ...
SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
spider
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type...
SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY Type
nvbench
CREATE TABLE table_78933 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the aggregate score that had a 1-2 second leg score?
SELECT "Aggregate" FROM table_78933 WHERE "2nd leg" = '1-2'
wikisql
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE accounts ( account_id number, customer_id number, account_name text, ot...
SELECT DISTINCT card_type_code FROM customers_cards
spider
CREATE TABLE table_name_28 ( type VARCHAR, moving_to VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the type movinig to alianza atl tico?
SELECT type FROM table_name_28 WHERE moving_to = "alianza atlético"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pa...
eicu
CREATE TABLE table_28031 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many maximum points did Curtis scored?
SELECT MAX("Points") FROM table_28031 WHERE "Player" = 'Curtis'
wikisql
CREATE TABLE table_204_772 ( id number, "team" text, "county" text, "wins" number, "years won" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team comes before confey
SELECT "team" FROM table_204_772 WHERE id = (SELECT id FROM table_204_772 WHERE "team" = 'confey') - 1
squall
CREATE TABLE table_name_29 ( year INTEGER, partner VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most recent year gardnar mulloy played as a partner and score was 12 10, 8 10, 12 10, 6 2?
SELECT MAX(year) FROM table_name_29 WHERE partner = "gardnar mulloy" AND score = "12–10, 8–10, 12–10, 6–2"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '45721416246'
css
CREATE TABLE table_71510 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what stadium was the final score 31-28?
SELECT "Stadium" FROM table_71510 WHERE "Final Score" = '31-28'
wikisql
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 PostNotices ( Id number, PostId number, PostNot...
SELECT a.Id AS "post_link" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.CreationDate > a.CreationDate ORDER BY a.CreationDate DESC
sede
CREATE TABLE table_203_303 ( id number, "tribunal" text, "number of autos da fe" number, "executions in persona" number, "executions in effigie" number, "penanced" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the...
SELECT "tribunal" FROM table_203_303 WHERE "total" = 0
squall
CREATE TABLE table_28001 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many introductory phrases are there with '...
SELECT COUNT("Introductory phrase") FROM table_28001 WHERE "The W\u00f8rd" = 'Unrequited Gov'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.icd9_code = "3970"
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 jybgb.JYXMDM, jybgb.JYXMMC FROM jybgb WHERE jybgb.BGDH = '54831539211'
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-34632') AND NOT patient.unitdischargetime IS...
eicu
CREATE TABLE table_40750 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Away Team of Blackpool's Home game?
SELECT "Away team" FROM table_40750 WHERE "Home team" = 'blackpool'
wikisql
CREATE TABLE table_24864 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote when the original airdate is April 5, 1987...
SELECT "Written by" FROM table_24864 WHERE "Original air date" = 'April 5, 1987'
wikisql
CREATE TABLE table_33293 ( "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. -- At what venue did the match where the home team ...
SELECT "Venue" FROM table_33293 WHERE "Home team score" = '8.6 (54)'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, a...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND microbiologyevents.spec_type_desc = 'bile' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 mon...
mimic_iii
CREATE TABLE table_58771 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Method, when Time is '3:20'?
SELECT "Method" FROM table_58771 WHERE "Time" = '3:20'
wikisql
CREATE TABLE table_27692 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of contestants who are 5'7' and exactly 26 years of ag...
SELECT COUNT("Contestant") FROM table_27692 WHERE "Height (ft)" = '5''7' AND "Age" = '26'
wikisql
CREATE TABLE table_50881 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Rider has a Grid of 21?
SELECT "Rider" FROM table_50881 WHERE "Grid" = '21'
wikisql
CREATE TABLE table_9325 ( "Articulatory class" text, "Non- stop" text, "Plain stop" text, "Aspirated stop" text, "\"Muddy\" voice" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the Plain stop is , what is the Non- stop?
SELECT "Non- stop" FROM table_9325 WHERE "Plain stop" = 'ㄷ'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "78791" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_name_26 ( position VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT POSITION IS 273?
SELECT position FROM table_name_26 WHERE overall = 273
sql_create_context
CREATE TABLE table_name_12 ( secretary VARCHAR, social_ao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Secretary has a Social AO of lieke de boer?
SELECT secretary FROM table_name_12 WHERE social_ao = "lieke de boer"
sql_create_context
CREATE TABLE table_name_84 ( year VARCHAR, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year that has points larger than 20?
SELECT COUNT(year) FROM table_name_84 WHERE points > 20
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, chartt...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20441 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (...
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Potassium, Urine"
mimicsql_data
CREATE TABLE shop ( Shop_ID int, Address text, Num_of_staff text, Score real, Open_Year text ) CREATE TABLE member ( Member_ID int, Name text, Membership_card text, Age int, Time_of_purchase int, Level_of_membership int, Address text ) CREATE TABLE happy_hour ( HH_I...
SELECT Address, Num_of_staff FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM happy_hour)
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT MAX(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 = '002-4486') AND NOT patient.unitdischargetime IS NULL...
eicu
CREATE TABLE table_63644 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "Cores" real, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" t...
SELECT "Release price ( USD )" FROM table_63644 WHERE "Frequency" = '3.2 ghz' AND "I/O bus" = '1 × 6.4 gt/s qpi'
wikisql
CREATE TABLE table_49047 ( "Source Version" text, "Target Version" text, "Last Release" text, "License" text, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Website, when License is Apache License 2.0?
SELECT "Website" FROM table_49047 WHERE "License" = 'apache license 2.0'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT"
mimicsql_data
CREATE TABLE table_204_547 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many competitors competed in the semifinal 2 ?
SELECT COUNT("name") FROM table_204_547
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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...
css
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ tim...
SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '09772478615'
css
CREATE TABLE table_64313 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of draws for Mortlake club when they have less than 0 wins?
SELECT AVG("Draws") FROM table_64313 WHERE "Club" = 'mortlake' AND "Wins" < '0'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
CREATE TABLE table_name_68 ( hp_model VARCHAR, _number_hdd VARCHAR, sides VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the HP model with a #HDD of 1 of sides of ds
SELECT hp_model FROM table_name_68 WHERE _number_hdd = 1 AND sides = "ds"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Metamyelocytes"
mimicsql_data
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ACIDOSIS" AND procedures.short_title = "Skin & subq dx proc NEC"
mimicsql_data
CREATE TABLE table_7759 ( "Province of Silla" text, "Administrative district" text, "Pre-1009 province" text, "Post-1009 province" text, "Modern equivalent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Modern equivalent has a Post-100...
SELECT "Modern equivalent" FROM table_7759 WHERE "Post-1009 province" = 'gyeongsang -do' AND "Administrative district" = 'jinju -mok' AND "Province of Silla" = 'gangju'
wikisql
CREATE TABLE table_7052 ( "Country" text, "Host" text, "Channel" text, "Premiere" text, "Jackpot" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the host of the premiere on November 10, 2007?
SELECT "Host" FROM table_7052 WHERE "Premiere" = 'november 10, 2007'
wikisql
CREATE TABLE table_2665 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the r...
SELECT "Replaced by" FROM table_2665 WHERE "Date of appointment" = '8 July 2009'
wikisql
CREATE TABLE table_61212 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which circuit was the atcc round 7 at?
SELECT "Circuit" FROM table_61212 WHERE "Series" = 'atcc round 7'
wikisql
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 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 = '022-98345')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer...
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 ((date_day.day_number = 20 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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_test...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_51039 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for a no. 21 tie?
SELECT "Score" FROM table_51039 WHERE "Tie no" = '21'
wikisql
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.icd9_code = "42741"
mimicsql_data
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate ti...
SELECT ROW_NUMBER() OVER (ORDER BY u.Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, u.Location FROM Users AS u JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = 'javascript' AND b.Class = 3 AND u.Reputation >= 1000 AND (LOWER(u.Location) LIKE '%nyc%' OR UPPER(Location) LIKE '%NY, NY%' OR LOWER(Location) L...
sede