instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'P55.131' AND jyjgzbb.JCZBDM = '143654'
css
CREATE TABLE table_21994729_3 ( series__number INTEGER, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many maximum series number have 2apx05 prod. code.
SELECT MAX(series__number) FROM table_21994729_3 WHERE prod_code = "2APX05"
sql_create_context
CREATE TABLE table_name_28 ( position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 rating of the channel with a position of 6?
SELECT 2007 FROM table_name_28 WHERE position = 6
sql_create_context
CREATE TABLE table_49734 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game when the liberty had a record of 12-9?
SELECT "Date" FROM table_49734 WHERE "Record" = '12-9'
wikisql
CREATE TABLE table_name_55 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What value for 2013 corresponds to the US Open Tournament?
SELECT 2013 FROM table_name_55 WHERE tournament = "us open"
sql_create_context
CREATE TABLE table_name_27 ( res VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the fight with Tony Halme?
SELECT res FROM table_name_27 WHERE opponent = "tony halme"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'ventricula...
mimic_iii
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 demographic ...
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.long_title = "Blood in stool" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE diagnoses_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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 129...
mimic_iii
CREATE TABLE table_203_8 ( id number, "player" text, "rec." number, "yards" number, "avg." number, "td's" number, "long" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference between the highest average and the lowest avaer...
SELECT MAX("avg.") - MIN("avg.") FROM table_203_8
squall
CREATE TABLE table_38076 ( "Rank" text, "Scorer" text, "Club" text, "Goals" real, "Matches" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Club has a Rank of 1?
SELECT "Club" FROM table_38076 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_13758945_3 ( won VARCHAR, try_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the won with try bonus being 8
SELECT won FROM table_13758945_3 WHERE try_bonus = "8"
sql_create_context
CREATE TABLE table_12962 ( "Year" real, "Delegate" text, "Hometown" text, "Placement in Miss World" text, "Other awards" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the latest year that daisy garcia reyes did not place in miss world?
SELECT MAX("Year") FROM table_12962 WHERE "Placement in Miss World" = 'did not place' AND "Delegate" = 'daisy garcia reyes'
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.J...
css
CREATE TABLE table_2781227_4 ( college_junior_club_team VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For nhl team is san jose sharks mention all the college/junior/club team
SELECT college_junior_club_team FROM table_2781227_4 WHERE nhl_team = "San Jose Sharks"
sql_create_context
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '白细胞异常' AND jyjgzbb.JCZBMC = '白蛋白'
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Posts ( Id number, PostTypeId number, Accepted...
SELECT T2.Position, T2.Id AS "user_link", T2.Reputation FROM (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Position, Id, Reputation FROM Users) AS T2 WHERE T2.Id = @UserId
sede
CREATE TABLE table_name_1 ( cyl VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Engine 2.3 16v has how many cylinders?
SELECT cyl FROM table_name_1 WHERE engine = "2.3 16v"
sql_create_context
CREATE TABLE table_name_22 ( water__sqmi_ INTEGER, township VARCHAR, geo_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Water (sqmi) has a Township of yorktown, and a GEO ID smaller than 3802187940?
SELECT MIN(water__sqmi_) FROM table_name_22 WHERE township = "yorktown" AND geo_id < 3802187940
sql_create_context
CREATE TABLE table_name_9 ( matches INTEGER, rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total matches that ranked above 10?
SELECT SUM(matches) FROM table_name_9 WHERE rank > 10
sql_create_context
CREATE TABLE table_30794 ( "Player" text, "Matches" real, "Innings" real, "Wickets" real, "Average" text, "BBI" text, "BBM" text, "5wi" real, "10wi" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many 5wi with an average of 33.13...
SELECT COUNT("5wi") FROM table_30794 WHERE "Average" = '33.13'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'cardiac angiography - left heart' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURREN...
eicu
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE neig...
SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Dallas' AND business.rating > 3.5 AND category.business_id = business.business_id AND category.category_name = 'Bars'
yelp
CREATE TABLE table_name_74 ( cerclis_id VARCHAR, proposed VARCHAR, partially_deleted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the cerclis ID when the site was proposed on 12/30/1982 and was partially deleted on 05/01/2003?
SELECT cerclis_id FROM table_name_74 WHERE proposed = "12/30/1982" AND partially_deleted = "05/01/2003"
sql_create_context
CREATE TABLE table_name_66 ( top_5 INTEGER, top_25 VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average value for Top-5, when the value for Top-25 is 0, and the value for Wins is less than 0?
SELECT AVG(top_5) FROM table_name_66 WHERE top_25 = 0 AND wins < 0
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 7 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Winter' AND se...
advising
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId...
SELECT COUNT(p.Id) AS "Edits" FROM Posts AS p WHERE p.OwnerUserId != @user AND p.LastEditorUserId = @user
sede
CREATE TABLE table_name_4 ( heat VARCHAR, mark VARCHAR, react VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the heat number at 7.63, and a reaction less than 0.229?
SELECT COUNT(heat) FROM table_name_4 WHERE mark = "7.63" AND react < 0.229
sql_create_context
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '躁狂型精神病' AND jyjgzbb.JCZBDM = '5...
css
CREATE TABLE table_65591 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest attendance for December 14, 1958 after week 12?
SELECT MIN("Attendance") FROM table_65591 WHERE "Date" = 'december 14, 1958' AND "Week" > '12'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID)
nvbench
CREATE TABLE table_name_9 ( bats VARCHAR, position VARCHAR, first VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which does the lhp player with the first name lachlan bat?
SELECT bats FROM table_name_9 WHERE position = "lhp" AND first = "lachlan"
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '4264494' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 30
css
CREATE TABLE table_64330 ( "Year" real, "1st Place Team" text, "2nd Place Team" text, "3rd Place Team" text, "4th Place Team" text, "Host Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location hosted when the National Cash Regist...
SELECT "Host Location" FROM table_64330 WHERE "4th Place Team" = 'national cash register, dayton, oh' AND "Year" = '1957'
wikisql
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) -- Using valid SQLite, ans...
SELECT team FROM elimination WHERE eliminated_by = "Orton" INTERSECT SELECT team FROM elimination WHERE eliminated_by = "Benjamin"
spider
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W...
css
CREATE TABLE table_11206787_5 ( capacity VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of capacity at somerset park?
SELECT COUNT(capacity) FROM table_11206787_5 WHERE stadium = "Somerset Park"
sql_create_context
CREATE TABLE table_62021 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the game after Week 10 against Philadelphia Eagles?
SELECT "Result" FROM table_62021 WHERE "Week" > '10' AND "Opponent" = 'philadelphia eagles'
wikisql
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 hz_info ( KH text, KLX number...
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '97962620644' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '97962620644'
css
CREATE TABLE table_39020 ( "Station" text, "City of license" text, "Channels TV / RF" text, "First air date" text, "HAAT" text, "Facility ID" real, "Public license information" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which HAAT has 65...
SELECT "HAAT" FROM table_39020 WHERE "Facility ID" = '65944'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diag...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_93 ( home_captain VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the home captain that won AUS by 245 runs?
SELECT home_captain FROM table_name_93 WHERE result = "aus by 245 runs"
sql_create_context
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 demographic.dob, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number...
SELECT DATEDIFF(DAY, u.CreationDate, CreationDate) AS "Account age (days)", AVG(CAST(p.Score AS FLOAT)) AS "Average score" FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 AND DATEDIFF(DAY, u.CreationDate, CreationDate) BETWEEN 0 AND 365 GROUP BY DATEDIFF(DAY, u.CreationDate, Creatio...
sede
CREATE TABLE table_name_10 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total attendance on 10/05/1974?
SELECT COUNT(attendance) FROM table_name_10 WHERE date = "10/05/1974"
sql_create_context
CREATE TABLE table_name_4 ( time VARCHAR, competition VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of the tim trophy competition where juventus was the opponent?
SELECT time FROM table_name_4 WHERE competition = "tim trophy" AND opponent = "juventus"
sql_create_context
CREATE TABLE table_44855 ( "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 of pick 3?
SELECT MAX("Round") FROM table_44855 WHERE "Pick" = '3'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '59317342' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-04-05' AND '2004-07-31' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '59317342' AND fgwyjzb.IN_HOSP_DATE BETWEEN ...
css
CREATE TABLE table_56808 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of ties a team with less than 3 l...
SELECT COUNT("Ties") FROM table_56808 WHERE "Losses" < '3'
wikisql
CREATE TABLE table_203_359 ( id number, "outcome" text, "year" number, "championship" text, "surface" text, "opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times has he been runner up ?
SELECT COUNT(*) FROM table_203_359 WHERE "outcome" = 'runner-up'
squall
CREATE TABLE table_25737761_4 ( writer VARCHAR, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people wrote episode number 2 of the season?
SELECT COUNT(writer) FROM table_25737761_4 WHERE _number = 2
sql_create_context
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.marital_status = "DIVORCED" AND demographic.dod_year <= "2183.0"
mimicsql_data
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREAT...
SELECT AVG(Age), MAX(Age) FROM Student GROUP BY Sex
nvbench
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Country, AVG(Age) FROM artist GROUP BY Country ORDER BY AVG(Age)
nvbench
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 MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.admityear >= "2119"
mimicsql_data
CREATE TABLE table_37289 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 10:30 has an 8:30 of la soir e du hockey?
SELECT "10:30" FROM table_37289 WHERE "8:30" = 'la soirée du hockey'
wikisql
CREATE TABLE table_27539 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lo...
SELECT MIN("Races") FROM table_27539
wikisql
CREATE TABLE table_name_65 ( region VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region has vinyl record listed as its format?
SELECT region FROM table_name_65 WHERE format = "vinyl record"
sql_create_context
CREATE TABLE table_name_14 ( ihsaa_football_class VARCHAR, ihsaa_class VARCHAR, enrollment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which IHSAA Football Class has an IHSAA Class of aa, and an Enrollment of 475?
SELECT ihsaa_football_class FROM table_name_14 WHERE ihsaa_class = "aa" AND enrollment = 475
sql_create_context
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 person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_9842 ( "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. -- Which H...
SELECT "High points" FROM table_9842 WHERE "Score" = 'w 110-81'
wikisql
CREATE TABLE table_22636 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Bills points" real, "Opponents" real, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the opposing team ...
SELECT MAX("Opponents") FROM table_22636 WHERE "Date" = 'Dec. 19'
wikisql
CREATE TABLE table_38999 ( "Result" text, "Record" text, "Opponent" text, "Rd, Time" text, "Date" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the bout against Nikki Eplion, which resulted in a win in...
SELECT "Record" FROM table_38999 WHERE "Result" = 'win' AND "Rd, Time" = '3' AND "Opponent" = 'nikki eplion'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '任博涛' AND t_kc22.STA_DATE BETWEEN '2010-11-11' AND '2013-01-13' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHE...
css
CREATE TABLE table_43895 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Home Team is Richmond?
SELECT "Date" FROM table_43895 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE table_13258 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT AVG("Pop. (2010)") FROM table_13258 WHERE "Longitude" > '-102.353035' AND "Latitude" > '46.937841' AND "Water (sqmi)" = '0.034'
wikisql
CREATE TABLE table_203_35 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which rider scored more than 16 points but less than 25 ?
SELECT "rider" FROM table_203_35 WHERE "points" > 16 AND "points" < 25
squall
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49140) AND prescriptions.drug = 'venlafaxine' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-12 month') ORDER BY prescriptions.startdate LIMIT ...
mimic_iii
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 7 AND date_day.month_number = 7 AN...
atis
CREATE TABLE table_39270 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With an Overall less than 171, what is the Round pick of Lance Moon?
SELECT MIN("Round") FROM table_39270 WHERE "Name" = 'lance moon' AND "Overall" < '171'
wikisql
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
SELECT product_name, SUM(T1.product_quantity) FROM Order_Items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name
nvbench
CREATE TABLE table_name_87 ( week VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week led to a record of 4-10?
SELECT week FROM table_name_87 WHERE record = "4-10"
sql_create_context
CREATE TABLE table_272313_2 ( horizontal INTEGER, pixel_aspect_ratio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least horizontal for smpte 259m three quarters
SELECT MIN(horizontal) FROM table_272313_2 WHERE pixel_aspect_ratio = "SMPTE 259M three quarters"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) DESC
nvbench
CREATE TABLE table_name_19 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest attendance on September 4, 1983?
SELECT MIN(attendance) FROM table_name_19 WHERE date = "september 4, 1983"
sql_create_context
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 diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "25167"
mimicsql_data
CREATE TABLE table_3761 ( "Artist" text, "Country" text, "Number-one single(s)" text, "Year" real, "Weeks at #1" real, "Straight to #1 ?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks was France at #1?
SELECT MAX("Weeks at #1") FROM table_3761 WHERE "Country" = 'France'
wikisql
CREATE TABLE table_name_27 ( release_date VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the release date of model number CORE I7-940?
SELECT release_date FROM table_name_27 WHERE model_number = "core i7-940"
sql_create_context
CREATE TABLE table_name_6 ( design_flow__lpm_ INTEGER, population_served VARCHAR, partner VARCHAR, construction_start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total Design flow (LPM) with a Partner of app, a Construction Start of 20...
SELECT SUM(design_flow__lpm_) FROM table_name_6 WHERE partner = "app" AND construction_start = "2008 january" AND population_served > 3500
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_12624 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:30 pm" text, "4:00 pm" text, "5:00 pm" text, "6:30 pm"...
SELECT "7:00 am" FROM table_12624 WHERE "11:00 am" = 'the price is right'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT mzjzjlb.YLJGDM 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 per...
css
CREATE TABLE table_78909 ( "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 is the Date of the game with a Score of 6 4, 6 2?
SELECT "Date" FROM table_78909 WHERE "Score" = '6–4, 6–2'
wikisql
CREATE TABLE table_name_39 ( time INTEGER, heat INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is a highest time for the heat smaller than 1?
SELECT MAX(time) FROM table_name_39 WHERE heat < 1
sql_create_context
CREATE TABLE table_11645 ( "President" text, "Date of birth" text, "Date of inauguration" text, "Age at inauguration" text, "Length of retirement" text, "Date of death" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Date of inauguration" FROM table_11645 WHERE "Length of retirement" = '00,624 days'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
CREATE TABLE table_77380 ( "Tournament" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text...
SELECT "2002" FROM table_77380 WHERE "1991" = 'w'
wikisql
CREATE TABLE table_75730 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank of the medal total less than 15, more than 2 bronzes, 0 gold and 1 silver?
SELECT MAX("Rank") FROM table_75730 WHERE "Total" < '15' AND "Bronze" > '2' AND "Gold" = '0' AND "Silver" = '1'
wikisql
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ...
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY COUNT(Venue) DESC
nvbench
CREATE TABLE table_62904 ( "Rank" real, "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What soap opera has a rank larger than 1, and a Character named Emily Bishop?
SELECT "Soap Opera" FROM table_62904 WHERE "Rank" > '1' AND "Character" = 'emily bishop'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "81" AND procedures.long_title = "Insertion of endotracheal tube"
mimicsql_data
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.days_stay = "5"
mimicsql_data
CREATE TABLE table_name_5 ( tournament VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament was played on Feb 3, 1991?
SELECT tournament FROM table_name_5 WHERE date = "feb 3, 1991"
sql_create_context
CREATE TABLE table_204_786 ( id number, "riding" text, "candidate" text, "gender" text, "residence" text, "occupation" text, "votes" number, "%" number, "rank" text, "biographical notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("candidate") FROM table_204_786 WHERE "residence" = 'halifax'
squall
CREATE TABLE table_28396 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined MAC" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the enrollment at delaware valley college?
SELECT MAX("Joined MAC") FROM table_28396 WHERE "Institution" = 'Delaware Valley College'
wikisql
CREATE TABLE table_47668 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round has 3-4 as the record?
SELECT "Round" FROM table_47668 WHERE "Record" = '3-4'
wikisql
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2195" AND prescriptions.drug = "NEO*IV*Fat Emulsion"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '任雅昶' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2237.38)
css