instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_63 ( time VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time for the race with the United States?
SELECT time FROM table_name_63 WHERE country = "united states"
sql_create_context
CREATE TABLE table_19716 ( "Rank" real, "Name" text, "Nationality" text, "Total points" text, "Oberstdorf (Rk)" text, "Ga-Pa (Rk)" text, "Bhofen#1 (Rk)" text, "Bhofen#2 (Rk)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Bh...
SELECT "Bhofen#2 (Rk)" FROM table_19716 WHERE "Ga-Pa (Rk)" = '227.5 (19)'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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, ...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT...
mimic_iii
CREATE TABLE table_61310 ( "Player" text, "Club" text, "Qualifying Goals" real, "Finals Goals" real, "Total Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Average Qualifying Goals for Jack Froggatt where the Final Goals is greater...
SELECT AVG("Qualifying Goals") FROM table_61310 WHERE "Player" = 'jack froggatt' AND "Finals Goals" > '0'
wikisql
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) DESC
nvbench
CREATE TABLE table_29135051_2 ( ratings VARCHAR, guest_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of ratings for bruce forsyth
SELECT COUNT(ratings) FROM table_29135051_2 WHERE guest_s_ = "Bruce Forsyth"
sql_create_context
CREATE TABLE table_17751 ( "Clinical Status" text, "Compound Name" text, "Trademark" text, "Marine Organism \u03b1" text, "Chemical Class" text, "Molecular Target" text, "Clinical Trials \u03b2" text, "Disease Area" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "Molecular Target" FROM table_17751 WHERE "Compound Name" = 'Hemiasterlin (E7974)'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
SELECT T.TagName, T.Count AS tagCount, SUM(P.Score) / CAST(COUNT(P.Score) AS FLOAT) AS avgScore FROM Tags AS T JOIN PostTags AS PT ON PT.TagId = T.Id JOIN Posts AS P ON P.Id = PT.PostId WHERE T.Count > 10 AND P.PostTypeId = 1 GROUP BY T.TagName, T.Count ORDER BY avgScore DESC
sede
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "O2 Flow"
mimicsql_data
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2482) AND STRFTIME('%y', prescriptions.startdate) = '2105'
mimic_iii
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 patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month',...
eicu
CREATE TABLE table_14951643_1 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many result with opponent being cleveland browns
SELECT COUNT(result) FROM table_14951643_1 WHERE opponent = "Cleveland Browns"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
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 = '010-29887')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT AVG(hs) FROM player
spider
CREATE TABLE table_72469 ( "Name" text, "First operational" text, "Numeral system" text, "Computing mechanism" text, "Programming" text, "Turing complete" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the first operational with programmi...
SELECT "First operational" FROM table_72469 WHERE "Programming" = 'Not programmable—single purpose'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7573983' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁同济' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8376.61)
css
CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE student_course_attendance ( student_id number, course_id number, date_of_attendance time ) CREATE TABLE candidate_assessments ( candidate_id nu...
SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"
spider
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id num...
SELECT Id FROM Posts WHERE 1 = CASE WHEN Id = 4 THEN 1 WHEN Id = 6 THEN 1 ELSE 0 END
sede
CREATE TABLE table_name_90 ( degree VARCHAR, award_year VARCHAR, award VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the degree for chemistry 1965
SELECT degree FROM table_name_90 WHERE award_year = 1965 AND award = "chemistry"
sql_create_context
CREATE TABLE table_2273738_1 ( metropolitan_area VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tyne and Wear County has what total membership for their metropolitan area?
SELECT metropolitan_area FROM table_2273738_1 WHERE county = "Tyne and Wear"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_203_753 ( id number, "rank" number, "name" text, "caps" number, "goals" number, "years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which name is listed after alan smith ?
SELECT "name" FROM table_203_753 WHERE id = (SELECT id FROM table_203_753 WHERE "name" = 'alan smith') + 1
squall
CREATE TABLE table_55845 ( "Animal Name" text, "Species" text, "Books" text, "TV Series" text, "Gender" text, "TV Seasons" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which species is male?
SELECT "Species" FROM table_55845 WHERE "Gender" = 'male'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention o...
mimicsql_data
CREATE TABLE table_2248784_4 ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2011 GDP (PPP) billions of USD does Israel have?
SELECT 2011 AS _gdp__ppp__billions_of_usd FROM table_2248784_4 WHERE country = "Israel"
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fx astragalus-closed'))
mimic_iii
CREATE TABLE table_204_297 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of silver medals won by italy ?
SELECT "silver" FROM table_204_297 WHERE "nation" = 'italy'
squall
CREATE TABLE table_28068063_3 ( proceed_to_quarter_final VARCHAR, eliminated_from_competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who proceeded to the quarter final when the london irish were eliminated from competition?
SELECT proceed_to_quarter_final FROM table_28068063_3 WHERE eliminated_from_competition = "London Irish"
sql_create_context
CREATE TABLE table_name_39 ( country VARCHAR, money___$__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was the golfer from who had a money amount of 45,000?
SELECT country FROM table_name_39 WHERE money___$__ = "45,000"
sql_create_context
CREATE TABLE table_name_31 ( top_10 INTEGER, top_25 VARCHAR, cuts_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of top-10s for the major with 2 top-25s and fewer than 10 cuts made?
SELECT AVG(top_10) FROM table_name_31 WHERE top_25 = 2 AND cuts_made < 10
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 AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'congestive heart failure - diastolic')) AND ...
eicu
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in ...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time,...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
CREATE TABLE table_38265 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game held at Lahore?
SELECT "Date" FROM table_38265 WHERE "Venue" = 'lahore'
wikisql
CREATE TABLE table_test_11 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "bradycardia" int, "renal_disease" bool, "allergy_to_aspirin" bool, "temperature" float, "creatinine_clearance_cl" float, "diastolic_blood_p...
SELECT * FROM table_test_11 WHERE hypertension = 1 OR systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 110
criteria2sql
CREATE TABLE table_43007 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Score of 108-107?
SELECT "Team" FROM table_43007 WHERE "Score" = '108-107'
wikisql
CREATE TABLE table_name_40 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did Keith Shologan play for?
SELECT college FROM table_name_40 WHERE player = "keith shologan"
sql_create_context
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.JCRGH, jyjgzbb.JCRXM 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.YLJGD...
css
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_600, ID FROM swimmer ORDER BY meter_600 DESC
nvbench
CREATE TABLE table_75012 ( "Vol. #" real, "Title" text, "Material collected" text, "Publication date" text, "ISBN" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Volume Numbers have the title of Darkness Falls?
SELECT SUM("Vol. #") FROM table_75012 WHERE "Title" = 'darkness falls'
wikisql
CREATE TABLE table_62280 ( "Name" text, "Builder" text, "Type" text, "Works Number" text, "Built" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name, when Builder is 'Kerr Stuart'?
SELECT "Name" FROM table_62280 WHERE "Builder" = 'kerr stuart'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT patients.gender FROM patients WHERE patients.subject_id = 5905
mimic_iii
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.days_stay > "17" AND procedures.long_title = "Other radiotherapeutic procedure"
mimicsql_data
CREATE TABLE table_name_79 ( player VARCHAR, draft VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had a draft before 1975 and before round 6?
SELECT player FROM table_name_79 WHERE draft < 1975 AND round < 6
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 t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '94188667' AND t_kc22.STA_DATE BETWEEN '2004-06-14' AND '2019-06-29' AND t_kc22.SOC_SRT_DIRE_NM = '谷维素片'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '012-14774' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_19905183_1 ( province VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What province does the Ruhuna Royals team come from?
SELECT province FROM table_19905183_1 WHERE team = "Ruhuna Royals"
sql_create_context
CREATE TABLE table_62496 ( "Geelong DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Geelong DFL has 8 losses and more than 4 wins?
SELECT "Geelong DFL" FROM table_62496 WHERE "Wins" > '4' AND "Losses" = '8'
wikisql
CREATE TABLE table_name_82 ( year VARCHAR, role_episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year when the role/episode is david duchovny?
SELECT year FROM table_name_82 WHERE role_episode = "david duchovny"
sql_create_context
CREATE TABLE table_1590 ( "Character" text, "Indianapolis Concerts" text, "Sarasota" text, "Broadway" text, "Brighton Cast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the indianapolis concerts for les minski
SELECT "Indianapolis Concerts" FROM table_1590 WHERE "Sarasota" = 'Les Minski'
wikisql
CREATE TABLE table_name_51 ( winning_amount VARCHAR, contestant_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What winning amount has himesh reshammiya as the contestant name?
SELECT winning_amount FROM table_name_51 WHERE contestant_name = "himesh reshammiya"
sql_create_context
CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number,...
SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE country = 'China')
spider
CREATE TABLE table_60788 ( "Year" real, "First member" text, "First party" text, "Second member" text, "Second party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the second party where the first party is Tory and the year is 1820?
SELECT "Second party" FROM table_60788 WHERE "First party" = 'tory' AND "Year" = '1820'
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_204_26 ( id number, "name" text, "position" text, "birth date/age at start of campaign" text, "games in campaign" text, "club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which club was represented the most ?
SELECT "club" FROM table_204_26 GROUP BY "club" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, ...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 634 OR course.number = 592) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_27722734_11 ( score VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for denver
SELECT score FROM table_27722734_11 WHERE team = "Denver"
sql_create_context
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, win...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC
nvbench
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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '姜娟秀' AND hz_info.YLJGDM = '5351150' AND zyjzjlb.JZKSMC LIKE '%康复%'
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
SELECT * FROM Posts WHERE Id = 28231
sede
CREATE TABLE table_29302711_12 ( prize_money__usd_ INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how much prize money (in USD) did bob lutz win
SELECT MAX(prize_money__usd_) FROM table_29302711_12 WHERE name = "Bob Lutz"
sql_create_context
CREATE TABLE table_64547 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what day was game 2 played?
SELECT "Date" FROM table_64547 WHERE "Game" = '2'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid...
SELECT patients.dob FROM patients WHERE patients.subject_id = 7524
mimic_iii
CREATE TABLE product_categories ( production_type_code text, product_type_description text, vat_rating number ) CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, deri...
SELECT order_id, SUM(product_quantity) FROM order_items GROUP BY order_id
spider
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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '12159301' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 1137.43)
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
SELECT Posts.Id, REPLACE(REPLACE(REPLACE(Title, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "title", Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, CreationDate, Score, REPLACE(REPLACE(REPLACE(Body, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "...
sede
CREATE TABLE table_name_94 ( total__kg_ INTEGER, bodyweight VARCHAR, clean_ VARCHAR, _jerk VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total (kg when the bodyweight is more than 57.8, and the clean & jerk is less than 103?
SELECT SUM(total__kg_) FROM table_name_94 WHERE bodyweight > 57.8 AND clean_ & _jerk < 103
sql_create_context
CREATE TABLE table_66248 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Heat of the Player with a Rank of 18 or less and Result of 55.15?
SELECT "Heat" FROM table_66248 WHERE "Rank" < '18' AND "Result" = '55.15'
wikisql
CREATE TABLE table_43530 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for week 15?
SELECT "Attendance" FROM table_43530 WHERE "Week" = '15'
wikisql
CREATE TABLE table_14700 ( "Goal" real, "Date" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the friendly competition?
SELECT "Result" FROM table_14700 WHERE "Competition" = 'friendly'
wikisql
CREATE TABLE table_dev_45 ( "id" int, "tc" int, "systolic_blood_pressure_sbp" int, "parenteral_antibiotic_therapy" bool, "fasting_plasma_glucose_fpg" float, "active_infection" bool, "untreated_hyperlipidemia" bool, "hemoglobin_a1c_hba1c" float, "temperature" float, "diastolic_blo...
SELECT * FROM table_dev_45 WHERE alcohol_abuse = 1
criteria2sql
CREATE TABLE table_2352 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Boilermakers points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were there in the 1966 season?
SELECT MAX("Game") FROM table_2352
wikisql
CREATE TABLE table_name_68 ( catalog VARCHAR, format VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What catalog has a format of ED remaster CD and a date of December 19, 2001?
SELECT catalog FROM table_name_68 WHERE format = "ed remaster cd" AND date = "december 19, 2001"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
SELECT * FROM PostHistory WHERE PostId = 1257021
sede
CREATE TABLE postseason ( team_id_loser VARCHAR, year VARCHAR ) CREATE TABLE team ( team_id_br VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did Boston Red Stockings lose in 2009 postseason?
SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009
sql_create_context
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '91780713' AND hz_info.YLJGDM = '1411436' AND mzjzjlb.JZKSMC LIKE '%母乳喂养%'
css
CREATE TABLE table_13554 ( "Sunrayia FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest losses for a team that has 0 draws, fewer than 4 wins, and no Byes?...
SELECT MIN("Losses") FROM table_13554 WHERE "Draws" = '0' AND "Wins" < '4' AND "Byes" < '0'
wikisql
CREATE TABLE table_name_77 ( year VARCHAR, nominee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was jack cole nominated?
SELECT year FROM table_name_77 WHERE nominee = "jack cole"
sql_create_context
CREATE TABLE table_53348 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much time does it take for jean alesi and grids lesser than 5?
SELECT "Time/Retired" FROM table_53348 WHERE "Grid" < '5' AND "Driver" = 'jean alesi'
wikisql
CREATE TABLE table_16655 ( "Season" text, "Group A Winner" text, "Group B Winner" text, "Group C Winner" text, "Group D Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What group a winner was for nocerina?
SELECT "Group A Winner" FROM table_16655 WHERE "Group D Winner" = 'Nocerina'
wikisql
CREATE TABLE table_name_91 ( played INTEGER, losses VARCHAR, points VARCHAR, wins VARCHAR, goals_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number played that has fewer than 11 wins, more than 42 goals, more than 22 po...
SELECT AVG(played) FROM table_name_91 WHERE wins < 11 AND goals_for > 42 AND points > 22 AND losses = 11
sql_create_context
CREATE TABLE table_name_82 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away team plays at Arden Street Oval?
SELECT away_team FROM table_name_82 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE table_name_50 ( church_name VARCHAR, organized_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which church was organized by George M. Hinkle?
SELECT church_name FROM table_name_50 WHERE organized_by = "george m. hinkle"
sql_create_context
CREATE TABLE table_16704 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue where the margin is...
SELECT "Venue" FROM table_16704 WHERE "Margin" = '4'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
(SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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...
css
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '11758190455'
css
CREATE TABLE table_name_87 ( grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids are associated with a Time/Retired of +1.837?
SELECT COUNT(grid) FROM table_name_87 WHERE time_retired = "+1.837"
sql_create_context
CREATE TABLE table_name_77 ( website VARCHAR, language VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which website is in english and has the frequency of an online newspaper ?
SELECT website FROM table_name_77 WHERE language = "english" AND frequency = "online newspaper"
sql_create_context
CREATE TABLE table_name_9 ( rank INTEGER, player VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the rank when the player is henry shefflin and the matches is higher than 4?
SELECT SUM(rank) FROM table_name_9 WHERE player = "henry shefflin" AND matches > 4
sql_create_context
CREATE TABLE table_name_27 ( total INTEGER, county VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many totals does cork have whose rank is larger than 2?
SELECT SUM(total) FROM table_name_27 WHERE county = "cork" AND rank > 2
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'lorenzo bruzzone' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE employees ( first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR, salary VARCHAR, department_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display the full name (first and last), hire date, salary, and department number for t...
SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'
sql_create_context
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of scien...
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*)
nvbench
CREATE TABLE table_47506 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds in the event when record is 1-5?
SELECT COUNT("Round") FROM table_47506 WHERE "Record" = '1-5'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "URGENT"
mimicsql_data
CREATE TABLE table_68056 ( "Tournament" text, "1999" text, "2002" text, "2004" text, "2006" text, "2007" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 value with a 2r in 2012 a...
SELECT "2007" FROM table_68056 WHERE "2012" = '2r' AND "2002" = '1r'
wikisql
CREATE TABLE table_name_60 ( transfer_fee VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the transfer fee for evilasio?
SELECT transfer_fee FROM table_name_60 WHERE name = "evilasio"
sql_create_context