instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_70 ( result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the results for a game with an attendance of 41,429?
SELECT result FROM table_name_70 WHERE attendance = "41,429"
sql_create_context
CREATE TABLE table_name_10 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When st kilda played as the Away team which date was that?
SELECT date FROM table_name_10 WHERE away_team = "st kilda"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2125" AND lab.itemid = "51009"
mimicsql_data
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE weather ( date TEX...
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover)
nvbench
CREATE TABLE table_26010857_13 ( stage VARCHAR, teams_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of stages where the teams classification leader is Cerv lo Testteam?
SELECT COUNT(stage) FROM table_26010857_13 WHERE teams_classification = "Cervélo TestTeam"
sql_create_context
CREATE TABLE table_34280 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most silver with bronze more than 1 and gold more than 1 with total less than 7
SELECT MAX("Silver") FROM table_34280 WHERE "Bronze" > '1' AND "Total" < '7' AND "Gold" > '1'
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.marital_status = "SINGLE" AND procedures.icd9_code = "8960"
mimicsql_data
CREATE TABLE table_name_12 ( height__ft_ VARCHAR, name VARCHAR, height__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Height (ft) of the Churchill House with a Height (m) less than 59?
SELECT COUNT(height__ft_) FROM table_name_12 WHERE name = "churchill house" AND height__m_ < 59
sql_create_context
CREATE TABLE table_203_523 ( id number, "state" text, "swimsuit" number, "interview" number, "evening gown" number, "average" number, "finalists" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who placed first ?
SELECT "state" FROM table_203_523 WHERE id = 1
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_name_26 ( date_of_appointment VARCHAR, manner_of_departure VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of appointment of outgoing manager fred rutten, who had a sacked manner of departure?
SELECT date_of_appointment FROM table_name_26 WHERE manner_of_departure = "sacked" AND outgoing_manager = "fred rutten"
sql_create_context
CREATE TABLE table_name_26 ( original_airdate VARCHAR, youtube_hero VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Original Airdate for the YouTube Hero greg pattillo?
SELECT original_airdate FROM table_name_26 WHERE youtube_hero = "greg pattillo"
sql_create_context
CREATE TABLE table_27927185_1 ( directed_by VARCHAR, viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode with 6.37 million viewers?
SELECT directed_by FROM table_27927185_1 WHERE viewers__millions_ = "6.37"
sql_create_context
CREATE TABLE table_1147 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date when week is 9
SELECT "Date" FROM table_1147 WHERE "Week" = '9'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT COUNT(Id) FROM Users WHERE YEAR(CreationDate) = 2012
sede
CREATE TABLE table_8071 ( "Statue" text, "Location" text, "Height m" text, "Height ft" text, "Completed" real, "Material" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the statue in st. paul, minnesota constructed before 1966 made out ...
SELECT "Material" FROM table_8071 WHERE "Completed" < '1966' AND "Location" = 'st. paul, minnesota'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1272) AND microbiologyevents.spec_type_desc = 'tracheal aspirate' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-99 month') O...
mimic_iii
CREATE TABLE table_57186 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were there before 1979 with a ferrari 312b2 chassis?
SELECT "Points" FROM table_57186 WHERE "Year" < '1979' AND "Chassis" = 'ferrari 312b2'
wikisql
CREATE TABLE table_25105 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the state class for iowa admitted to the union ...
SELECT "State (class)" FROM table_25105 WHERE "Reason for change" = 'Iowa admitted to the Union December 28, 1846'
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 FROM demographic WHERE demographic.name = "Lue White"
mimicsql_data
CREATE TABLE table_57225 ( "Rank" real, "Name" text, "Nation" text, "SP+FS" real, "Points" real, "Places" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for points less than 166.96, and a Places of 166?
SELECT AVG("Rank") FROM table_57225 WHERE "Points" < '166.96' AND "Places" = '166'
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 comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%seminar%' OR course.name LIKE '%seminar%') AND (course.description LIKE '%Sociology of Nationalism%' OR course.name LIKE '%Sociology of Nationalism%') AND course.course_id = course_offering.course_id AND semester.semester_id = c...
advising
CREATE TABLE table_27617 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game sites are where the tea...
SELECT "Game site" FROM table_27617 WHERE "Team record" = '1–6'
wikisql
CREATE TABLE fielding ( player_id text, year number, stint number, team_id text, league_id text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, pb number, wp number, sb number, cs number, zr number ) CREA...
SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
spider
CREATE TABLE table_75511 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest pick for a player from a school or club team of Arkansas?
SELECT MAX("Pick") FROM table_75511 WHERE "School/Club Team" = 'arkansas'
wikisql
CREATE TABLE table_name_30 ( state VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state has the venue Tsukisamu dome?
SELECT state FROM table_name_30 WHERE venue = "tsukisamu dome"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description va...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_name_20 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue was essendon the away team?
SELECT venue FROM table_name_20 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_19056 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Height m ( ft )" text, "FCC info" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many height m ( ft ) with notes bein...
SELECT COUNT("Height m ( ft )") FROM table_19056 WHERE "Notes" = 'via WCCV; formerly W236AJ'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '华安然' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 1404.19)
css
CREATE TABLE order_items ( item_id number, order_item_status_code text, order_id number, product_id number, item_status_code text, item_delivered_datetime time, item_order_quantity text ) CREATE TABLE mailshot_campaigns ( mailshot_id number, product_category text, mailshot_name ...
SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'
spider
CREATE TABLE table_name_41 ( first_leg VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first leg score in the 2nd round?
SELECT first_leg FROM table_name_41 WHERE round = "2nd"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime ti...
SELECT chartevents.charttime 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 = 19412)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_60114 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which format is in Japan?
SELECT "Format" FROM table_60114 WHERE "Country" = 'japan'
wikisql
CREATE TABLE table_70793 ( "Player" text, "Height" real, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player born before 1985 who is less than 2.02 tall?
SELECT "Player" FROM table_70793 WHERE "Year born" < '1985' AND "Height" < '2.02'
wikisql
CREATE TABLE table_22678 ( "Name" text, "Career" text, "Matches" real, "Overs" text, "Maidens" real, "Runs" real, "Wickets" real, "Average" text, "Best" text, "5w" real, "10w" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Best" FROM table_22678 WHERE "Maidens" = '547' AND "Overs" = '2755.1'
wikisql
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 jyjgzbb.JYZBLSH 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 AND jybgb.YLJGDM =...
css
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-15167') AND STRFTIME('%y', patient.unitadmittime) <= '2102'
eicu
CREATE TABLE table_30305 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When and where did Chen Qi win in men singles?
SELECT "Year Location" FROM table_30305 WHERE "Mens Singles" = 'Chen Qi'
wikisql
CREATE TABLE table_name_93 ( height_ft___m__ VARCHAR, floors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which height, in meters, has 36 floors?
SELECT height_ft___m__ FROM table_name_93 WHERE floors = 36
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '7721090' AND IN_HOSP_DATE BETWEEN '2013-07-27' AND '2015-08-15') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '7721090' AND IN_HOSP_DATE BETWEEN '2013-07-27' AND '2015-08-15' AND MED_ORG_DEPT_NM = '小儿呼吸内科')
css
CREATE TABLE table_name_48 ( wins VARCHAR, draws VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the total number of Wins that has the Draws larger than 0, and the Points of 11?
SELECT COUNT(wins) FROM table_name_48 WHERE draws > 0 AND points = 11
sql_create_context
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 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 WHERE person_info.XM = '俞嘉平'...
css
CREATE TABLE table_61528 ( "Outcome" text, "Date" text, "Category" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category is Matthew Barton?
SELECT "Category" FROM table_61528 WHERE "Opponent" = 'matthew barton'
wikisql
CREATE TABLE table_25517718_3 ( touchdowns INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many touchdowns does Boggs have?
SELECT MIN(touchdowns) FROM table_25517718_3 WHERE player = "Boggs"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND NOT vitalperiodic.heartrate IS N...
eicu
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "% Hemoglobin A1c"
mimicsql_data
CREATE TABLE table_name_49 ( tournament VARCHAR, margin_of_victory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had a playoff with a margin of victory?
SELECT tournament FROM table_name_49 WHERE margin_of_victory = "playoff"
sql_create_context
CREATE TABLE table_1278 ( "Mission name" text, "Lunar lander" text, "Lunar landing date" text, "Lunar blastoff date" text, "Lunar landing site" text, "Duration on lunar surface" text, "Crew" text, "Number of s EVA" real, "Total EVA Time (HH:MM)" text ) -- Using valid SQLite, answer...
SELECT COUNT("Lunar blastoff date") FROM table_1278 WHERE "Mission name" = 'Apollo 11'
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 t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '郑春华' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5187.37)
css
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE course ( course_id varchar(8), title v...
SELECT building, MAX(capacity) FROM classroom GROUP BY building ORDER BY building DESC
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_38411 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Played has a Scored large...
SELECT MAX("Played") FROM table_38411 WHERE "Scored" > '25' AND "Position" = '1' AND "Draws" < '5'
wikisql
CREATE TABLE table_test_13 ( "id" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "diastolic_blood_pressure_dbp" int, "total_cholesterol" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "serum_creatinine" float, "alcohol_abuse" bool, "drug_abuse" bool, "body_mas...
SELECT * FROM table_test_13 WHERE age >= 20 AND age <= 50
criteria2sql
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varch...
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_name_32 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the 73-82 score?
SELECT record FROM table_name_32 WHERE score = "73-82"
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'CEE' AND number = 830
advising
CREATE TABLE table_28217 ( "Unit" text, "Commander" text, "Complement" text, "Killed" text, "Wounded" text, "Missing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of wounded figures associated with a complement of 22 off 637...
SELECT COUNT("Wounded") FROM table_28217 WHERE "Complement" = '22 off 637 men'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '3364170' AND jybgb.BGRQ BETWEEN '2010-04-09' AND '2016-11-21' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 7 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE table_25783 ( "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. -- How ma...
SELECT COUNT("Score") FROM table_25783 WHERE "Record" = '19–34'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Tag, STR(Year) + '-' + REPLACE(STR(Month, 2), SPACE(1), '0') AS Month, COUNT(*) AS Questions, SUM(ViewCount) AS Views FROM (SELECT ViewCount, MONTH(CreationDate) AS Month, YEAR(CreationDate) AS Year, CASE WHEN Tags LIKE '%<c#>%' THEN 'C#' ELSE 'Other' END AS Tag FROM Posts WHERE PostTypeId = 1 AND (Tags LIKE '%<...
sede
CREATE TABLE mzb ( 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_NM = '陈敏才' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 1086.52) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '陈敏才' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 1086....
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '陈建元' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '6907')
css
CREATE TABLE table_name_22 ( money___ INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest money ($) for bernhard langer?
SELECT MAX(money___) AS $__ FROM table_name_22 WHERE player = "bernhard langer"
sql_create_context
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, ...
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 = 'DALLAS' AND CITY_2.cit...
atis
CREATE TABLE table_name_65 ( margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Margin of Victory of winning score 68-67-69-65=269?
SELECT margin_of_victory FROM table_name_65 WHERE winning_score = 68 - 67 - 69 - 65 = 269
sql_create_context
CREATE TABLE table_18748 ( "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. -- how ma...
SELECT COUNT("Date") FROM table_18748 WHERE "Score" = 'W 113–87'
wikisql
CREATE TABLE table_name_21 ( tonnage INTEGER, date_entered_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least tonnage for the ship(s) that entered service on 11 february 1983?
SELECT MIN(tonnage) FROM table_name_21 WHERE date_entered_service = "11 february 1983"
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code ...
SELECT product_type_code, COUNT(product_type_code) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE table_42197 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of games Played by the Team Vas...
SELECT SUM("Played") FROM table_42197 WHERE "Team" = 'vasco da gama' AND "Against" < '12'
wikisql
CREATE TABLE table_73410 ( "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 successor for north carolina 13th
SELECT "Successor" FROM table_73410 WHERE "District" = 'North Carolina 13th'
wikisql
CREATE TABLE table_12562214_1 ( date__from_ VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date (from) where the notes are apeldoornsche tramweg-maatschappij?
SELECT date__from_ FROM table_12562214_1 WHERE notes = "Apeldoornsche Tramweg-Maatschappij"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'hematopoetic growth factors - sargramostim (leukine )' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year'))
eicu
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '54790820335'
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.admission_type = "URGENT" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_48801 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the manufacturer with a 14 grid?
SELECT "Manufacturer" FROM table_48801 WHERE "Grid" = '14'
wikisql
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 COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3992' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_73079 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering this round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the leas...
SELECT MIN("Clubs remaining") FROM table_73079
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'carvedilol 25 mg po tabs' AND DATETIME(medication.d...
eicu
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 jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '70180070721'
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) ...
SELECT p.*, u.ProfileImageUrl, u.DisplayName, u.WebsiteUrl FROM Posts AS p LEFT JOIN Users AS u ON u.Id = p.OwnerUserId LEFT JOIN Comments AS c ON c.PostId = p.Id WHERE p.Id = 55440926 OR p.ParentId = 55440926
sede
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51265"
mimicsql_data
CREATE TABLE table_name_49 ( total_produced VARCHAR, service VARCHAR, builder’s_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total amount of freight produced of u28c?
SELECT total_produced FROM table_name_49 WHERE service = "freight" AND builder’s_model = "u28c"
sql_create_context
CREATE TABLE table_name_46 ( number VARCHAR, points VARCHAR, steals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number has 0 steals and less than 32 points?
SELECT number FROM table_name_46 WHERE points < 32 AND steals = 0
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE...
atis
CREATE TABLE table_name_81 ( ship VARCHAR, country VARCHAR, builder VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ship was built by Palmers Shipbuilding and Iron Company for the Royal Navy?
SELECT ship FROM table_name_81 WHERE country = "royal navy" AND builder = "palmers shipbuilding and iron company"
sql_create_context
CREATE TABLE table_24212608_1 ( radio_1_presenter VARCHAR, viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the radio 1 presenter for the broadcast that had 9.73 million viewers?
SELECT radio_1_presenter FROM table_24212608_1 WHERE viewers__millions_ = "9.73"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( la...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3507' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patie...
eicu
CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, departm...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price)
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_i...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', prescriptions.startdate) <= '2104'
mimic_iii
CREATE TABLE table_79013 ( "Rank (2012)" real, "IATA Code" text, "Major City Served" text, "State" text, "2012" real, "2011" real, "2010" real, "2009" real, "2008" real, "2007" real, "2006" real, "2005" real ) -- Using valid SQLite, answer the following questions for th...
SELECT COUNT("2012") FROM table_79013 WHERE "2011" < '8,174,194' AND "2009" < '31,135,732' AND "IATA Code" = 'lax'
wikisql
CREATE TABLE table_name_33 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Crowd when Essendon was the home team?
SELECT SUM(crowd) FROM table_name_33 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE table_73462 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 5...
SELECT "High points" FROM table_73462 WHERE "Game" = '5'
wikisql
CREATE TABLE table_44729 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the price of the internet 150 plans?
SELECT "Price" FROM table_44729 WHERE "Internet Plan" = 'internet 150'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, res...
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 = 'OAKLAND' AND date_day.day_number = 21 AND date_day.month_number = 2 AND ...
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.short_title = "Other bronchoscopy"
mimicsql_data
CREATE TABLE table_176529_2 ( official_name VARCHAR, area_km_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the place where area is 578.28 square km?
SELECT official_name FROM table_176529_2 WHERE area_km_2 = "578.28"
sql_create_context
CREATE TABLE table_name_62 ( attendance VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Attendance, when Result is '2-4'?
SELECT attendance FROM table_name_62 WHERE result = "2-4"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0314561' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '03145...
css