instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY MIN(basePrice)
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, Ta...
WITH questions AS (SELECT q.Id, q.OwnerUserId FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##userid:int?3577745##') SELECT q.Id AS "post_link", q.OwnerUserId AS "user_link", (SELECT COUNT(*) FROM questions AS qs WHERE q.OwnerUserId = qs.OwnerUserId) AS "#_tot_questions" FROM questio...
sede
CREATE TABLE Person ( age INTEGER, job VARCHAR ) CREATE TABLE person ( age INTEGER, job VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of people whose age is greater than all engineers.
SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM Person WHERE job = 'engineer')
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescript...
SELECT COUNT(*) AS "count" FROM Badges AS b WHERE (b.Name = '##name?Caucus##') GROUP BY b.Name LIMIT 100
sede
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb....
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'E68.873'
css
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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.JZLSH_MZJZ...
css
CREATE TABLE qtb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '88581683' AND qtb.MED_SER_ORG_NO = '6417819' AND qtb.OUT_DIAG_DIS_NM LIKE '%失调%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '88581683' AND gyb.MED_SER_ORG_NO = '6417819' AND gyb.OUT_DIAG_DIS_NM LIKE '%失调%' UNION SELECT zyb.MED_CLINIC_ID FROM zy...
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.route = "IV BOLUS"
mimicsql_data
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 person_info.XM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '6...
css
CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year int, Team text ) CREATE TABLE aircraft ( Aircraft_ID int, Orde...
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality
nvbench
CREATE TABLE table_203_158 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which game did the opponent score ...
SELECT "date" FROM table_203_158 WHERE "result" = 7
squall
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) -- Using valid SQLite, answer the ...
SELECT Author, COUNT(Author) FROM submission GROUP BY Author
nvbench
CREATE TABLE table_44711 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the best time for a team with a first-qualifying time of 59.448?
SELECT "Best" FROM table_44711 WHERE "Qual 1" = '59.448'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Id AS "post_link", CreationDate, Score FROM Posts WHERE Tags = '<' + LOWER('##TagName:string##') + '>' ORDER BY CreationDate DESC LIMIT 100
sede
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 text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
(SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '12429077632') INTERSECT (SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '99587287448')
css
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 11 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_20396_1 ( team VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team scored 4 points?
SELECT team FROM table_20396_1 WHERE points = "4"
sql_create_context
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 vitalperiodic ( vitalperiodici...
SELECT patient.age FROM patient WHERE patient.uniquepid = '011-31229' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_69 ( driver VARCHAR, zan_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has 5 as the zan 2?
SELECT driver FROM table_name_69 WHERE zan_2 = "5"
sql_create_context
CREATE TABLE table_54722 ( "Superlative" text, "Actress" text, "Record Set" text, "Year" real, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the last year when Katharine Hepburn won?
SELECT MAX("Year") FROM table_54722 WHERE "Actress" = 'katharine hepburn'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'RUSSIAN' AND COURSE_0.numb...
advising
CREATE TABLE table_name_71 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team's venue is junction oval?
SELECT home_team FROM table_name_71 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_name_82 ( attendance__away_ INTEGER, result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average attendance with result of won 2-0 on 2 november 2007
SELECT AVG(attendance__away_) FROM table_name_82 WHERE result = "won 2-0" AND date = "2 november 2007"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 19144 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_name_26 ( wins INTEGER, loses VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Wins have Losses larger than 2, and an Against of 73.3?
SELECT SUM(wins) FROM table_name_26 WHERE loses > 2 AND against = "73.3"
sql_create_context
CREATE TABLE table_2597 ( "Market Rank & City of license /Market" text, "Station" text, "Channel TV / DT" text, "Owned since" real, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the station WLS-TV owned since?
SELECT "Owned since" FROM table_2597 WHERE "Station" = 'WLS-TV'
wikisql
CREATE TABLE table_name_89 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Geelong play as the home team?
SELECT date FROM table_name_89 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE bdmzjzjlb ( 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, MZZYZDZ...
SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '84842097' AND jybgb.BGRQ BETWEEN '2012-09-17' AND '2021-...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
SELECT Name FROM PostTypes
sede
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.ci...
atis
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE table_47901 ( "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. -- Who was t...
SELECT "Outgoing manager" FROM table_47901 WHERE "Manner of departure" = 'fc energie cottbus purchased rights'
wikisql
CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CRE...
SELECT T3.name, T2.name FROM office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN companies AS T3 ON T1.company_id = T3.id
spider
CREATE TABLE table_33801 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the medal named fatuma roba category:articles with hcards for?
SELECT "Medal" FROM table_33801 WHERE "Name" = 'fatuma roba category:articles with hcards'
wikisql
CREATE TABLE table_74677 ( "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 does Essendon play as the away team...
SELECT "Date" FROM table_74677 WHERE "Away team" = 'essendon'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Insertion of one vascular stent"
mimicsql_data
CREATE TABLE table_name_90 ( pick VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the pick from the Purdue College?
SELECT pick FROM table_name_90 WHERE college = "purdue"
sql_create_context
CREATE TABLE table_23332 ( "District" real, "Representative" text, "Party" text, "Residence" text, "Counties represented" text, "Term ends" real, "First Elected" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the party for bensalem
SELECT "Party" FROM table_23332 WHERE "Residence" = 'Bensalem'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC
nvbench
CREATE TABLE fzzmzjzjlb ( 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 COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '6191580' AND zzmzjzjlb.JZKSRQ BETWEEN '2010-05-16' AND '2019-09-06' AND zzmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '6191580' AND fzzmzjzjlb.JZKSRQ BETWEEN '2010-05-16' AND '2019-09-06' AND fzzmzjzjlb.TXBZ > 0
css
CREATE TABLE table_name_24 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Away Team score of North Melbourne?
SELECT away_team AS score FROM table_name_24 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE table_42169 ( "Date" text, "Opponent" text, "Score" text, "Site/Stadium" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game played at Harmon Stadium on February 24?
SELECT "Score" FROM table_42169 WHERE "Site/Stadium" = 'harmon stadium' AND "Date" = 'february 24'
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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5447034' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-12-14' AND '2013-09-10' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5447034' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2008-12...
css
CREATE TABLE table_45320 ( "Year" real, "Program Title" text, "Placement" text, "Score" real, "Class" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest score for a year before 2008 and had 3rd place?
SELECT MIN("Score") FROM table_45320 WHERE "Year" < '2008' AND "Placement" = '3rd'
wikisql
CREATE TABLE table_train_111 ( "id" int, "mini_mental_state_examination_mmse" int, "liver_disease" bool, "geriatric_depression_scale_gds" int, "rosen_modified_hachinski_ischemic_score" int, "plasma_creatinine" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for...
SELECT * FROM table_train_111 WHERE geriatric_depression_scale_gds < 6
criteria2sql
CREATE TABLE table_56059 ( "\\theta_i" real, "Simulated datasets (step 2)" text, "Summary statistic \\omega_{S,i} (step 3)" real, "Distance \\rho(\\omega_{S,i}, \\omega_E) (step 4)" real, "Outcome (step 4)" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Summary statistic \\omega_{S,i} (step 3)" FROM table_56059 WHERE "\\theta_i" = '0.43'
wikisql
CREATE TABLE table_204_13 ( id number, "finished" text, "post" number, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name a horse that placed after hello and was...
SELECT "horse" FROM table_204_13 WHERE "finished" > (SELECT "finished" FROM table_204_13 WHERE "horse" = 'hello') AND "owner" > 1 ORDER BY "finished" LIMIT 1
squall
CREATE TABLE table_name_46 ( terms VARCHAR, left_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many terms did the governor that left office on August 4, 1825 serve?
SELECT terms FROM table_name_46 WHERE left_office = "august 4, 1825"
sql_create_context
CREATE TABLE table_6607 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which visitor has detroit as the home, and february 24 as the date?
SELECT "Visitor" FROM table_6607 WHERE "Home" = 'detroit' AND "Date" = 'february 24'
wikisql
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made
nvbench
CREATE TABLE table_25103 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the vacator for resigned february 26, 1836 because of ill health
SELECT "Vacator" FROM table_25103 WHERE "Reason for change" = 'Resigned February 26, 1836 because of ill health'
wikisql
CREATE TABLE table_train_57 ( "id" int, "bleeding" int, "in_another_study" bool, "hiv_infection" bool, "hepatitis_c_infection" bool, "receiving_vasopressor" bool, "hypotension" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT * FROM table_train_57 WHERE hepatitis_c_infection = 1
criteria2sql
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.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '51510159' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-11-30' AND '2020-03-24' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_name_4 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament has a 2010 of 1r, and a 2008 of 1r?
SELECT tournament FROM table_name_4 WHERE 2010 = "1r" AND 2008 = "1r"
sql_create_context
CREATE TABLE table_2215159_2 ( outcome VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome of the game when the partner is Rafael Osuna?
SELECT outcome FROM table_2215159_2 WHERE partner = "Rafael Osuna"
sql_create_context
CREATE TABLE table_11111116_8 ( written_by VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episodes that were viewed by 2.12 million viewers?
SELECT written_by FROM table_11111116_8 WHERE us_viewers__million_ = "2.12"
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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
CREATE TABLE table_28585 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many elected catagories are there for the district with Saxby Chambliss as the...
SELECT COUNT("Elected") FROM table_28585 WHERE "Incumbent" = 'Saxby Chambliss'
wikisql
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 Name, Weight FROM people
nvbench
CREATE TABLE table_name_1 ( quantity INTEGER, class_from_1928 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of Quantity for the Class of 1928 of CI-30?
SELECT SUM(quantity) FROM table_name_1 WHERE class_from_1928 = "ci-30"
sql_create_context
CREATE TABLE table_name_14 ( selsdon VARCHAR, coombe_road VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Selsdon for the 17:19 Coombe Road?
SELECT selsdon FROM table_name_14 WHERE coombe_road = "17:19"
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '70307655' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-10-21' AND '2021-08-18' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID...
css
CREATE TABLE table_39389 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release Date for the Region in New Zealand ?
SELECT "Date" FROM table_39389 WHERE "Region" = 'new zealand'
wikisql
CREATE TABLE table_25750 ( "Position" real, "Driver" text, "Points" real, "Starts" real, "Wins" real, "Top 5s" real, "Top 10s" real, "Winnings ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many drivers have 1942 points?
SELECT COUNT("Driver") FROM table_25750 WHERE "Points" = '1942'
wikisql
CREATE TABLE table_204_530 ( id number, "type" text, "stage" number, "cyclist" text, "team" text, "reason" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- daniel martin and joost posthuma both withdrew from the race because of what reason ?
SELECT "reason" FROM table_204_530 WHERE "cyclist" = 'daniel martin'
squall
CREATE TABLE table_52552 ( "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. -- Where did Carlton play as the home team?
SELECT "Venue" FROM table_52552 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Id = 1042848
sede
CREATE TABLE table_name_95 ( location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2013 BAFA adult flag division in Aylesbury?
SELECT 2013 AS _bafa_adult_flag_division FROM table_name_95 WHERE location = "aylesbury"
sql_create_context
CREATE TABLE table_55084 ( "Series ^" text, "Model" text, "CPU clock ( MHz )" text, "CPU cores" real, "TDP ( W )" text, "L2 cache (KiB)" text, "Radeon cores" real, "DDR3 speed" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the seri...
SELECT "Series ^" FROM table_55084 WHERE "CPU clock ( MHz )" = '1500' AND "Model" = 't-52r'
wikisql
CREATE TABLE table_66142 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
SELECT "I/O bus" FROM table_66142 WHERE "Release price ( USD )" = '$657'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '90955811' AND t_kc22.STA_DATE BETWEEN '2001-02-02' AND '2007-03-01' AND t_kc22.SELF_PAY_AMO > 1737.24
css
CREATE TABLE table_name_89 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Indians play on April 23?
SELECT opponent FROM table_name_89 WHERE date = "april 23"
sql_create_context
CREATE TABLE table_76045 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of bronze medals for total of all nations?
SELECT AVG("Bronze") FROM table_76045 WHERE "Nation" = 'total'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51265"
mimicsql_data
CREATE TABLE table_30711 ( "Sl. No" real, "Category wise" text, "Single lane" real, "Intermediate lane" real, "Double lane" real, "Multi lane" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least total?
SELECT MIN("Total") FROM table_30711
wikisql
CREATE TABLE table_74518 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average bronze for total less than 1
SELECT AVG("Bronze") FROM table_74518 WHERE "Total" < '1'
wikisql
CREATE TABLE vocals ( bandmate VARCHAR ) CREATE TABLE band ( id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which vocal type has the band mate with first name 'Solveig' played the most?
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_28 ( title VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title is in Portuguese?
SELECT title FROM table_name_28 WHERE language = "portuguese"
sql_create_context
CREATE TABLE table_23640 ( "County" text, "Obama %" text, "Obama #" real, "McCain %" text, "McCain #" real, "Others %" text, "Others #" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of voters chose McCain in the county where...
SELECT "McCain %" FROM table_23640 WHERE "Others %" = '1.1%'
wikisql
CREATE TABLE table_10333757_1 ( branding VARCHAR, calls VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Branding does WRKO calls use?
SELECT branding FROM table_10333757_1 WHERE calls = "WRKO"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_name_71 ( lecturers VARCHAR, total VARCHAR, associate_professors VARCHAR, assistant_professors VARCHAR, professors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How may lecturers are there in the case when there are more than ...
SELECT COUNT(lecturers) FROM table_name_71 WHERE assistant_professors > 8 AND professors > 14 AND associate_professors < 35 AND total > 81
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND NOT vitalperiodic.systemicsystolic...
eicu
CREATE TABLE table_2169966_2 ( avg_finish VARCHAR, avg_start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was his average finish when his average start was 27.7?
SELECT avg_finish FROM table_2169966_2 WHERE avg_start = "27.7"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "43" AND prescriptions.drug = "Bag"
mimicsql_data
CREATE TABLE table_34831 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what series was on may 14
SELECT "Series" FROM table_34831 WHERE "Date" = 'may 14'
wikisql
CREATE TABLE table_1383 ( "Year" real, "January" text, "February" text, "March" text, "April" text, "May" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text, "Annual Additions(in millions)" text, "...
SELECT "September" FROM table_1383 WHERE "November" = '10.35'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT BGRGH, BGRXM FROM jybgb WHERE BGDH = '46227509627'
css
CREATE TABLE table_25565 ( "R" real, "Player" text, "Position" text, "League" real, "Champions League" real, "Copa del Rey" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most copa del rey for karim benzema
SELECT MAX("Copa del Rey") FROM table_25565 WHERE "Player" = 'Karim Benzema'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT 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 = 23070)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
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 FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '21173614248' AND t_kc22.SOC_SRT_DIRE_NM = '螺内酯片'
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-58787')) AND medication.drugname = 'sodium chloride 0.9% 1...
eicu
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 CYBQDM, CYBQMC, CYCWH FROM zyjzjlb WHERE JZLSH = '33793765856'
css
CREATE TABLE table_48884 ( "Team" text, "Make" text, "Drivers" text, "Tyre" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which drives drove a lexus, made all rounds, had a tyre of B and was on the team of petronas toyota team tom's?...
SELECT "Drivers" FROM table_48884 WHERE "Rounds" = 'all' AND "Make" = 'lexus' AND "Tyre" = 'b' AND "Team" = 'petronas toyota team tom''s'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), START_DATE date, END...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE table_65876 ( "World record" text, "Snatch" text, "Andrei Rybakou ( BLR )" text, "187kg" text, "Chiang Mai , Thailand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has 187kg and a Snatch of Clean & Jerk?
SELECT "187kg" FROM table_65876 WHERE "Snatch" = 'clean & jerk'
wikisql
CREATE TABLE table_203_165 ( 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. -- how many more medals did india earn compared to pakistan ?
SELECT (SELECT "total" FROM table_203_165 WHERE "nation" = 'india') - (SELECT "total" FROM table_203_165 WHERE "nation" = 'pakistan')
squall
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2...
atis
CREATE TABLE table_50534 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season with a Skip of Eve Muirhead and a third of Kerry Barr?
SELECT "Season" FROM table_50534 WHERE "Skip" = 'eve muirhead' AND "Third" = 'kerry barr'
wikisql