instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_689 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the party with opponent being mike oxley (r) unopposed
SELECT "Party" FROM table_689 WHERE "Opponent" = 'Mike Oxley (R) unopposed'
wikisql
CREATE TABLE table_name_17 ( title_of_work VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the title of work for year more than 2009
SELECT title_of_work FROM table_name_17 WHERE year > 2009
sql_create_context
CREATE TABLE table_25369796_1 ( season INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest season where a team got a 29th position?
SELECT MIN(season) FROM table_25369796_1 WHERE position = "29th"
sql_create_context
CREATE TABLE table_9747 ( "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 result in week 10?
SELECT "Result" FROM table_9747 WHERE "Week" = '10'
wikisql
CREATE TABLE table_74846 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance at a week 4 game?
SELECT AVG("Attendance") FROM table_74846 WHERE "Week" = '4'
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 COUNT(*) AS "post_link", Score FROM Comments WHERE UserId = 12952 GROUP BY Score ORDER BY Score DESC
sede
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT COUNT(p.Id) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 1 AND NOT p.ClosedDate IS NULL
sede
CREATE TABLE table_name_24 ( apparent_magnitude VARCHAR, constellation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the apparent magnitude of the constellation sculptor
SELECT COUNT(apparent_magnitude) FROM table_name_24 WHERE constellation = "sculptor"
sql_create_context
CREATE TABLE table_name_78 ( leader_at_the_summit VARCHAR, finish VARCHAR, start VARCHAR, stage VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the leader at the summit when the stage was larger than 14, the category was ...
SELECT leader_at_the_summit FROM table_name_78 WHERE stage > 14 AND category = 1 AND start = "saint-girons" AND finish = "cauterets"
sql_create_context
CREATE TABLE table_name_84 ( manufacturer VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who manufactured the motorcycle that did 24 laps and 9 grids?
SELECT manufacturer FROM table_name_84 WHERE laps = 24 AND grid = 9
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'cortisol') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURREN...
mimic_iii
CREATE TABLE table_70777 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of points scored by Goulds' Garage (Bristol), engines of Maserati Straight-6, in...
SELECT MIN("Points") FROM table_70777 WHERE "Entrant" = 'goulds'' garage (bristol)' AND "Engine" = 'maserati straight-6' AND "Year" < '1956'
wikisql
CREATE TABLE table_train_12 ( "id" int, "sequential_organ_failure_assessment_sofa" int, "active_infection" bool, "taking_pioglitazone" bool, "taking_rosiglitazone" bool, "body_weight" float, "diabetic" string, "organ_failure" bool, "age" float, "NOUSE" float ) -- Using valid SQ...
SELECT * FROM table_train_12 WHERE diabetic = 'i' OR diabetic = 'ii'
criteria2sql
CREATE TABLE table_53159 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team played under 52 Reg GP, and picked 130?
SELECT "Team (League)" FROM table_53159 WHERE "Reg GP" < '52' AND "Pick #" = '130'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Road
nvbench
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '蒋丹彤' AND MED_SER_ORG_NO = '6374436' AND IN_DIAG_DIS_NM LIKE '%粥样%'
css
CREATE TABLE table_13464416_7 ( location_attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many locations have a record of 14-38?
SELECT COUNT(location_attendance) FROM table_13464416_7 WHERE record = "14-38"
sql_create_context
CREATE TABLE table_name_36 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is game 9's record?
SELECT record FROM table_name_36 WHERE game = 9
sql_create_context
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '1388267' AND IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '1388267' AND IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' AND MED_ORG_DEPT_CD = '72353')
css
CREATE TABLE table_name_63 ( attendance INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average attendance when the record was 58 49?
SELECT AVG(attendance) FROM table_name_63 WHERE record = "58–49"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests i...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN course_offering ON COURSE_1.course_id = cour...
advising
CREATE TABLE Ref_Document_Types ( document_type_description VARCHAR, document_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the description of document type 'Paper'?
SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper"
sql_create_context
CREATE TABLE table_47336 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest attendance of the match with a 2:0 score and vida as the away team?
SELECT MAX("Attendance") FROM table_47336 WHERE "Score" = '2:0' AND "Away" = 'vida'
wikisql
CREATE TABLE table_name_95 ( week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of week number(s) had an attendance of 61,985?
SELECT COUNT(week) FROM table_name_95 WHERE attendance = 61 OFFSET 985
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( 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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA"
mimicsql_data
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
SELECT Title, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title
nvbench
CREATE TABLE table_40622 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week was on November 13, 1955 when the attendance was over 33,982?
SELECT COUNT("Week") FROM table_40622 WHERE "Date" = 'november 13, 1955' AND "Attendance" > '33,982'
wikisql
CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) ...
SELECT Location, COUNT(Location) FROM performance GROUP BY Location
nvbench
CREATE TABLE table_name_61 ( lost VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lost when the points were dissolved?
SELECT lost FROM table_name_61 WHERE points = "dissolved"
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT zyjybgb.BGJGDM, zyjybgb.BGJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '39632855563' UNION SELECT mzjybgb.BGJGDM, mzjybgb.BGJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '39632855563'
css
CREATE TABLE table_9105 ( "Candidate" text, "Party" text, "Election List" text, "Governorate" text, "Votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Candidate has a Votes larger than 622,961, and a Governorate of baghdad?
SELECT "Candidate" FROM table_9105 WHERE "Votes" > '622,961' AND "Governorate" = 'baghdad'
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 demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.name = "Charley Pescatore"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2114"
mimicsql_data
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_dat...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number...
SELECT TagName, Count FROM Tags WHERE TagName LIKE '%zip%' ORDER BY Count DESC
sede
CREATE TABLE table_25816476_2 ( air_date VARCHAR, team_guest_captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the air date when the team guest captain was john bishop?
SELECT air_date FROM table_25816476_2 WHERE team_guest_captain = "John Bishop"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit')
mimic_iii
CREATE TABLE table_2328 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (fall 2010)" real, "Founded" real, "Accreditation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the school founded with an ...
SELECT MAX("Founded") FROM table_2328 WHERE "Enrollment (fall 2010)" = '898'
wikisql
CREATE TABLE table_39551 ( "Tournament" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career W\u2013L" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "1997" FROM table_39551 WHERE "1992" = '1r' AND "1994" = 'a'
wikisql
CREATE TABLE table_name_92 ( genre VARCHAR, english_title__chinese_title_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Genre has an English title (Chinese title) of the romance of the white hair maiden ?
SELECT genre FROM table_name_92 WHERE english_title__chinese_title_ = "the romance of the white hair maiden 白髮魔女傳"
sql_create_context
CREATE TABLE table_72151 ( "School" text, "Mascot" text, "Location" text, "League" text, "Enrollment" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which leagues is the Galena school in?
SELECT "League" FROM table_72151 WHERE "School" = 'Galena'
wikisql
CREATE TABLE table_44339 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has 102 Points against?
SELECT "Team" FROM table_44339 WHERE "Points against" = '102'
wikisql
CREATE TABLE table_76352 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Drawn" FROM table_76352 WHERE "Club" = 'hirwaun rfc'
wikisql
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 description, name FROM course WHERE department = 'MILSCI' AND number = 101
advising
CREATE TABLE table_48158 ( "Year" real, "Championship" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner-up" text, "Winner's share ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest winner's...
SELECT MIN("Winner's share ( $ )") FROM table_48158 WHERE "Championship" = 'lpga championship'
wikisql
CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway ( Railway_ID int, Railway ...
SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC
nvbench
CREATE TABLE table_name_60 ( away_leg VARCHAR, opposition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ist the Away Leg with an Opposition that is aarhus gymnastik forening?
SELECT away_leg FROM table_name_60 WHERE opposition = "aarhus gymnastik forening"
sql_create_context
CREATE TABLE table_42051 ( "Outcome" text, "Year" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the match against filippo volandri where xavier malisse was runner-up?
SELECT "Year" FROM table_42051 WHERE "Outcome" = 'runner-up' AND "Opponent" = 'filippo volandri'
wikisql
CREATE TABLE table_name_47 ( year VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the Honda ra168e 1.5 v6 t engine used?
SELECT year FROM table_name_47 WHERE engine = "honda ra168e 1.5 v6 t"
sql_create_context
CREATE TABLE table_46170 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Result of loss, and an Opponent of @ la clippers?
SELECT "Record" FROM table_46170 WHERE "Result" = 'loss' AND "Opponent" = '@ la clippers'
wikisql
CREATE TABLE products ( product_id number, product_name text, product_details text ) CREATE TABLE orders ( order_id number, customer_id number, order_status text, date_order_placed time, order_details text ) CREATE TABLE shipment_items ( shipment_id number, order_item_id number...
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
spider
CREATE TABLE table_name_24 ( digital VARCHAR, provider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the digital of Virgin [analogue]?
SELECT digital FROM table_name_24 WHERE provider = "virgin [analogue]"
sql_create_context
CREATE TABLE table_187239_1 ( kit_manufacturer VARCHAR, minor_sponsors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When tim brasil brokers are the minor sponsors who is the kit manufacturer?
SELECT kit_manufacturer FROM table_187239_1 WHERE minor_sponsors = "Tim Brasil Brokers"
sql_create_context
CREATE TABLE table_42089 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "American Labor ticket" text, "Socialist ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which American Labor candidate ran against Democratic candi...
SELECT "American Labor ticket" FROM table_42089 WHERE "Democratic ticket" = 'robert f. wagner'
wikisql
CREATE TABLE table_name_55 ( country VARCHAR, province_region VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what country is Hokkaid and New Chitose airport located?
SELECT country FROM table_name_55 WHERE province_region = "hokkaidō" AND airport = "new chitose airport"
sql_create_context
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 event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT name, ID FROM swimmer ORDER BY name DESC
nvbench
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 WHERE qtb.MED_SER_ORG_NO = '4663033' AND qtb.IN_HOSP_DATE BETWEEN '2004-05-25' AND '2013-06-11' AND qtb.INSURED_STS = '未就业' AND qtb.MED_AMOUT >= 9829.08 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4663033' AND gyb.IN_HOSP_DATE BETWEEN '2004-05-25' AND '2013-06-11' AND gyb.INSURED...
css
CREATE TABLE table_22380270_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what air date were there 2.15 million u.s. viewers?
SELECT original_air_date FROM table_22380270_1 WHERE us_viewers__millions_ = "2.15"
sql_create_context
CREATE TABLE table_16481 ( "Trim" text, "Engine" text, "Turbo" text, "Fuel Delivery" text, "Power" text, "Torque" text, "Transmission" text, "Performance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the engine where performance...
SELECT "Engine" FROM table_16481 WHERE "Performance" = '0–100km/h: 10.5s, VMax km/h (mph)'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_fro...
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 = 'BOSTON' AND date_day.day_number = 24 AND date_day.month_number = 5 AND d...
atis
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 jybgb ( BBCJBW text, BBDM tex...
SELECT hz_info_mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL...
css
CREATE TABLE table_name_43 ( attendance VARCHAR, opponent VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance in the gave versus the Brewers with a score of 9 6?
SELECT attendance FROM table_name_43 WHERE opponent = "brewers" AND score = "9–6"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CR...
SELECT Title, 'https://stackoverflow.com/questions/' + CAST(Id AS TEXT) AS Link, ViewCount, AnswerCount, Score FROM Posts WHERE LOWER(Title) LIKE '%error%' AND Tags LIKE '%c++%' AND AnswerCount > 0 AND Score > 0 ORDER BY (ViewCount * AnswerCount + Score) DESC
sede
CREATE TABLE table_72038 ( "Code Name" text, "Function (figure)" text, "Real Name" text, "Birthplace" text, "Serial number" text, "Primary military speciality" text, "Secondary military speciality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Function (figure)" FROM table_72038 WHERE "Real Name" = 'jean-luc bouvier'
wikisql
CREATE TABLE table_204_863 ( id number, "state" text, "city/county" text, "population served" number, "charter type" text, "station name" text, "web site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which has the least number of people se...
SELECT "city/county" FROM table_204_863 WHERE "city/county" IN ('black jack', 'jefferson city') ORDER BY "population served" LIMIT 1
squall
CREATE TABLE table_name_84 ( margin_of_victory VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Margin of victory in the southwest golf classic Tournament?
SELECT margin_of_victory FROM table_name_84 WHERE tournament = "southwest golf classic"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Suggeste...
SELECT CAST(YEAR(p.CreationDate) AS TEXT(4)) + '-' + REPLACE(STR(CAST(MONTH(p.CreationDate) AS TEXT(2)), 2), SPACE(1), '0') AS "period", COUNT(p.Id) AS "count" FROM Posts AS p WHERE p.CreationDate >= '2015-01-01' AND p.CreationDate < '2017-01-01' AND p.PostTypeId = 1 AND p.Tags LIKE '%kentico%' GROUP BY CAST(YEAR(p.Cre...
sede
CREATE TABLE table_name_83 ( skip VARCHAR, second VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Skip will play Joan Mccusker?
SELECT skip FROM table_name_83 WHERE second = "joan mccusker"
sql_create_context
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 PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE table_11603006_1 ( tournament VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tournaments were held in Maryland?
SELECT COUNT(tournament) FROM table_11603006_1 WHERE location = "Maryland"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7831592' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-23' AND '2019-12-27'
css
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_34921 ( "Team" text, "Driver" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Laps that shows spun off for time?
SELECT AVG("Laps") FROM table_34921 WHERE "Time" = 'spun off'
wikisql
CREATE TABLE table_33097 ( "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. -- Who was the home team that scored 19.15 (129) on...
SELECT "Home team" FROM table_33097 WHERE "Date" = '15 june 1959' AND "Home team score" = '19.15 (129)'
wikisql
CREATE TABLE table_204_423 ( id number, "name" text, "location" text, "city" text, "listing date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name a site that was listed no later than 1960 .
SELECT "name" FROM table_204_423 WHERE "listing date" <= 1960
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-20711')) AND medication.drugname IN ('thiamine hcl 100 mg po tabs', 'n...
eicu
CREATE TABLE table_name_93 ( ihsaa_class VARCHAR, mascot VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which IHSAA Class has a Mascot of eagles, and a City of evansville?
SELECT ihsaa_class FROM table_name_93 WHERE mascot = "eagles" AND city = "evansville"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'ORALBIOL' AND COURSEalias0.numb...
advising
CREATE TABLE table_name_50 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Stacy Lewis' place?
SELECT place FROM table_name_50 WHERE player = "stacy lewis"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-11635')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_72196 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the original air date where written by is iain ...
SELECT "Original air date" FROM table_72196 WHERE "Written by" = 'Iain Morris & Damon Beesley'
wikisql
CREATE TABLE table_70946 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of all the points won by Peter Whitehead in an alta f2 Chassis?
SELECT SUM("Points") FROM table_70946 WHERE "Entrant" = 'peter whitehead' AND "Chassis" = 'alta f2'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), ...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_i...
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 = 30044)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGER, fault_status VA...
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name DESC
nvbench
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 qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0573118' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy...
css
CREATE TABLE table_75058 ( "Team" text, "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text, "Week 6" text, "Week 7" text, "Week 8 Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for week 1 o...
SELECT "Team" FROM table_75058 WHERE "Week 1" = '33'
wikisql
CREATE TABLE table_name_89 ( year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 250 cc with a year bigger than 1984?
SELECT 250 AS _cc FROM table_name_89 WHERE year > 1984
sql_create_context
CREATE TABLE table_14683 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has october 16, 2000 as the date?
SELECT "Score" FROM table_14683 WHERE "Date" = 'october 16, 2000'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '凤锐达' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 7564.57)
css
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, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_204_880 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- was the venue in athens or beijing associated with 31st place ?
SELECT "venue" FROM table_204_880 WHERE "venue" IN ('athens', 'beijing') AND "position" = 31
squall
CREATE TABLE table_23154 ( "LGA Name" text, "Area (km 2 )" real, "Census 2006 population" real, "Administrative capital" text, "Postal Code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the administrative capital that has a 2006 census pop...
SELECT "Administrative capital" FROM table_23154 WHERE "Census 2006 population" = '249425'
wikisql
CREATE TABLE table_24329520_8 ( members VARCHAR, borough VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of members that have boroughs of Bandon Bridge?
SELECT COUNT(members) FROM table_24329520_8 WHERE borough = "Bandon Bridge"
sql_create_context
CREATE TABLE table_26652 ( "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. -- What was the reason for change to the successor that was seated on Decembe...
SELECT "Reason for change" FROM table_26652 WHERE "Date successor seated" = 'December 13, 1880'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM hz_info JOIN 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 table_name_61 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Record of 0-1?
SELECT score FROM table_name_61 WHERE record = "0-1"
sql_create_context
CREATE TABLE table_name_93 ( series_leader VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Series leader with a Date that is october 9?
SELECT series_leader FROM table_name_93 WHERE date = "october 9"
sql_create_context