instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the na...
SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_14289 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the week when the result is w 14-13 and the attendance is higher than 53,295?
SELECT AVG("Week") FROM table_14289 WHERE "Result" = 'w 14-13' AND "Attendance" > '53,295'
wikisql
CREATE TABLE t_kc21 ( 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 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_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 7265.59)
css
CREATE TABLE table_64228 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What genre is the game from the year 2007?
SELECT "Genre" FROM table_64228 WHERE "Year" = '2007'
wikisql
CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) -- U...
SELECT Country, COUNT(Country) FROM member GROUP BY Country
nvbench
CREATE TABLE table_17941032_1 ( try_bonus VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 80 is the tries for what is the try bonus?
SELECT try_bonus FROM table_17941032_1 WHERE tries_for = "80"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCFF 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...
css
CREATE TABLE table_1939405_2 ( _percentage_2001 VARCHAR, _percentage_2011 VARCHAR, province VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the percentage in 2001 in Manitoba where the percentage in 2011 is 0.8%?
SELECT _percentage_2001 FROM table_1939405_2 WHERE _percentage_2011 = "0.8%" AND province = "Manitoba"
sql_create_context
CREATE TABLE table_69267 ( "Race" text, "Dist (f)" real, "Course" text, "Prize (\u00a3K)" real, "Runners" real, "Placing" real, "Margin" text, "Jockey" text, "Trainer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many runners h...
SELECT COUNT("Runners") FROM table_69267 WHERE "Placing" > '8'
wikisql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Ac...
SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' ORDER BY COUNT(Document_Date)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.long_title = "Angiocardiography of right heart structures"
mimicsql_data
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT t.TagName, SUM(a.Score) AS "sumscor", COUNT(a.Id) AS "#answers" FROM Posts AS a, Tags AS t JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserID##' AND a.PostTypeId = 2 AND a.DeletionDate IS NULL AND a.ClosedDate IS NULL AND q.DeletionDate IS NULL AND q.ClosedDate IS NULL AND a.CommunityOwnedDate ...
sede
CREATE TABLE table_76927 ( "Taper" text, "Large end" real, "Small end" real, "Length" real, "Taper/ ft" real, "Taper/ in" real, "Angle from center/\u00b0" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Taper/in that has a Small end lar...
SELECT MIN("Taper/ in") FROM table_76927 WHERE "Small end" > '0.7000000000000001' AND "Taper" = '#19' AND "Large end" > '2.375'
wikisql
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE professor ( emp_num number, dep...
SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN class AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code
spider
CREATE TABLE Church ( Open_Date INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many churches opened before 1850 are there?
SELECT COUNT(*) FROM Church WHERE Open_Date < 1850
sql_create_context
CREATE TABLE table_36410 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- on april 9 what was the attendance?
SELECT AVG("Attendance") FROM table_36410 WHERE "Date" = 'april 9'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND DATETIME(outputevents.charttim...
mimic_iii
CREATE TABLE table_name_31 ( founded INTEGER, years VARCHAR, suburb_town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year founded that is located in Broken Hill and has school years of k-6?
SELECT AVG(founded) FROM table_name_31 WHERE years = "k-6" AND suburb_town = "broken hill"
sql_create_context
CREATE TABLE table_39165 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Rider had a Time of 1:01.50.57?
SELECT "Rider" FROM table_39165 WHERE "Time" = '1:01.50.57'
wikisql
CREATE TABLE table_name_92 ( year INTEGER, group VARCHAR, award VARCHAR, result VARCHAR, film_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year in which Kim was nominated for Thirst as Best Actress at the Baeksang Art...
SELECT AVG(year) FROM table_name_92 WHERE result = "nominated" AND film_series = "thirst" AND award = "best actress" AND group = "baeksang arts awards"
sql_create_context
CREATE TABLE table_name_78 ( ihsaa_football_class VARCHAR, ihsaa_class VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the IHSAA Football Class in Decatur with an AAA IHSAA class?
SELECT ihsaa_football_class FROM table_name_78 WHERE ihsaa_class = "aaa" AND location = "decatur"
sql_create_context
CREATE TABLE table_40228 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Runner(s)-Up, when Margin of Victory is 1 Stroke, and when Tournament is...
SELECT "Runner(s)-up" FROM table_40228 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'joburg open 1'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
SELECT Id AS "post_link", OwnerDisplayName, CreationDate, Score FROM Posts WHERE PostTypeId = 2 AND OwnerDisplayName IN ('##list##') ORDER BY Id DESC
sede
CREATE TABLE gyb ( 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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '0641182' AND qtb.IN_HOSP_DATE BETWEEN '2000-01-18' AND '2003-06-12' AND qtb.SERVANT_FLG = '公务员' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '0641182' AND gyb.IN_HOSP_DATE BETWEEN '2000-01-18' AND '2003-06-12' AND gyb.SERVANT_FLG = '公务员' UNION SELECT COU...
css
CREATE TABLE table_53955 ( "Rank" text, "Name" text, "Headquarters" text, "Revenue (Mil.\u20ac)" text, "Profit (Mil.\u20ac)" text, "Employees (World)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is hte nuumber of employees that has a rev...
SELECT "Employees (World)" FROM table_53955 WHERE "Revenue (Mil.\u20ac)" = '104.000'
wikisql
CREATE TABLE table_73789 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode written by Jack Or...
SELECT "Title" FROM table_73789 WHERE "Written by" = 'Jack Orman'
wikisql
CREATE TABLE table_256862_1 ( legs INTEGER, winning_yacht VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most legs for steinlager 2
SELECT MAX(legs) FROM table_256862_1 WHERE winning_yacht = "Steinlager 2"
sql_create_context
CREATE TABLE table_20316 ( "Series #" real, "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 season began on december 5, 1953?
SELECT MAX("Season #") FROM table_20316 WHERE "Original air date" = 'December 5, 1953'
wikisql
CREATE TABLE table_11269 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the Home Team score 5.10 (40)?
SELECT "Venue" FROM table_11269 WHERE "Home team score" = '5.10 (40)'
wikisql
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) 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...
SELECT date, SUM(mean_temperature_f) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
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 lab ( subject_id text, hadm_id text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear >= "2137"
mimicsql_data
CREATE TABLE table_67148 ( "Ship" text, "Site" text, "Guns" real, "Naval constructor" text, "Superintendent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of guns when the superintendent was Silas Talbot?
SELECT "Guns" FROM table_67148 WHERE "Superintendent" = 'silas talbot'
wikisql
CREATE TABLE table_17596418_4 ( COUnT VARCHAR, moving_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many transfer windows coming from Crystal Palace?
SELECT COUnT AS transfer_window FROM table_17596418_4 WHERE moving_from = "Crystal palace"
sql_create_context
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'rdw'...
eicu
CREATE TABLE table_17517 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many mens doubles when womens doubles is catrine b...
SELECT COUNT("Mens doubles") FROM table_17517 WHERE "Womens doubles" = 'Catrine Bengtsson Margit Borg'
wikisql
CREATE TABLE table_name_90 ( league VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the league for 1996
SELECT league FROM table_name_90 WHERE year = "1996"
sql_create_context
CREATE TABLE table_name_27 ( current_streak VARCHAR, last_5_meetings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the current streak when the last 5 meetings is osu, 4-1?
SELECT current_streak FROM table_name_27 WHERE last_5_meetings = "osu, 4-1"
sql_create_context
CREATE TABLE table_name_11 ( points INTEGER, wins VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points the team with 0 wins had before 1992?
SELECT MAX(points) FROM table_name_11 WHERE wins = 0 AND year < 1992
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3606"
mimicsql_data
CREATE TABLE table_name_56 ( aggregate VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Aggregate of Bayer Leverkusen opponents?
SELECT aggregate FROM table_name_56 WHERE opponents = "bayer leverkusen"
sql_create_context
CREATE TABLE txmzjzjlb ( 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 COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '5126566' AND txmzjzjlb.JZKSRQ BETWEEN '2003-10-14' AND '2014-10-02' AND txmzjzjlb.WDBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '5126566' AND ftxmzjzjlb.JZKSRQ BETWEEN '2003-10-14' AND '2014-10-02' AND ftxmzjzjlb.WDBZ > 0
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT TagName, Count FROM Tags WHERE TagName LIKE '%^-0-9a-z%' ORDER BY Count DESC
sede
CREATE TABLE member ( member_id number, name text, membership_card text, age number, time_of_purchase number, level_of_membership number, address text ) CREATE TABLE shop ( shop_id number, address text, num_of_staff text, score number, open_year text ) CREATE TABLE happ...
SELECT membership_card FROM member GROUP BY membership_card HAVING COUNT(*) > 5
spider
CREATE TABLE table_name_18 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has 34-19-6 as the record?
SELECT score FROM table_name_18 WHERE record = "34-19-6"
sql_create_context
CREATE TABLE Suppliers ( supplier_name VARCHAR, supplier_phone VARCHAR, supplier_id VARCHAR ) CREATE TABLE supplier_addresses ( supplier_id VARCHAR, address_id VARCHAR ) CREATE TABLE addresses ( address_id VARCHAR, address_details VARCHAR ) -- Using valid SQLite, answer the following que...
SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details
sql_create_context
CREATE TABLE table_189598_7 ( land_area__km²_ VARCHAR, population__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1233 is the population of 2011 what is the land area in kilometers squared?
SELECT land_area__km²_ FROM table_189598_7 WHERE population__2011_ = 1233
sql_create_context
CREATE TABLE table_name_29 ( team VARCHAR, location_attendance VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Location Attendance of staples center 18,997, and a Series of 1 0?
SELECT team FROM table_name_29 WHERE location_attendance = "staples center 18,997" AND series = "1–0"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status-post ptca" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59002) AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2101-08' ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE employees ( hire_date INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display those employees who joined after 7th September, 1987.
SELECT * FROM employees WHERE hire_date > '1987-09-07'
sql_create_context
CREATE TABLE table_27225 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight ( lb. )" real, "Year" text, "Hometown" text, "Previous School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the previous school of #22?
SELECT "Previous School" FROM table_27225 WHERE "#" = '22'
wikisql
CREATE TABLE table_27562 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lo...
SELECT MIN("Poles") FROM table_27562
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400 DESC
nvbench
CREATE TABLE table_68593 ( "Film" text, "Director(s)" text, "Recipient" text, "Date" text, "Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Passion Pictures receive an award?
SELECT "Date" FROM table_68593 WHERE "Recipient" = 'passion pictures'
wikisql
CREATE TABLE table_32471 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which runner-up player(s) had a margin of 10 strokes?
SELECT "Runner(s)-up" FROM table_32471 WHERE "Margin" = '10 strokes'
wikisql
CREATE TABLE table_45597 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid that has a Rider of mike di meglio, and Laps larger than 23?
SELECT AVG("Grid") FROM table_45597 WHERE "Rider" = 'mike di meglio' AND "Laps" > '23'
wikisql
CREATE TABLE table_3231 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the NFL team is the Minnesota Vikings, what is the position?
SELECT "Position" FROM table_3231 WHERE "NFL Team" = 'Minnesota Vikings'
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '躁狂型精神病' AND jyjgzbb.JCZBDM = '758740' UNION SELECT jyjgzbb.CKZFWXX...
css
CREATE TABLE table_name_87 ( completed VARCHAR, kanji VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the completed date of ?
SELECT completed FROM table_name_87 WHERE kanji = "蓬"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "24" AND prescriptions.formulary_drug_cd = "IPRA2H"
mimicsql_data
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARC...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"
nvbench
CREATE TABLE table_27765 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Original air date" FROM table_27765 WHERE "Title" = 'My Hard Labor'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_35 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nationality is Dick Walker?
SELECT nationality FROM table_name_35 WHERE player = "dick walker"
sql_create_context
CREATE TABLE table_name_21 ( name VARCHAR, birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a birth of 16 august 1401?
SELECT name FROM table_name_21 WHERE birth = "16 august 1401"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year DESC
nvbench
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
SELECT Year, SUM(AVG(Price)) FROM wine
nvbench
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '苗伟懋' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6998.54) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '苗伟懋' AND fgwyjzb.MED_...
css
CREATE TABLE table_35219 ( "Constituency" text, "Electorate" real, "Turnout" text, "Spoilt" text, "Valid Poll" real, "Quota" text, "Seats" real, "Candidates" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least valid poll for mu...
SELECT MIN("Valid Poll") FROM table_35219 WHERE "Constituency" = 'munster'
wikisql
CREATE TABLE table_78363 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was driving the Maserati with a Grid smaller than 6, and a Time/Retired of +2 laps?
SELECT "Driver" FROM table_78363 WHERE "Constructor" = 'maserati' AND "Grid" < '6' AND "Time/Retired" = '+2 laps'
wikisql
CREATE TABLE table_name_35 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Record of 9 8?
SELECT score FROM table_name_35 WHERE record = "9–8"
sql_create_context
CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID INTEGER, Product_Type_Code CHAR(15), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4) ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABL...
SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code
nvbench
CREATE TABLE table_2668352_16 ( party VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party experienced a result of lost re-election democratic-republican hold?
SELECT party FROM table_2668352_16 WHERE result = "Lost re-election Democratic-Republican hold"
sql_create_context
CREATE TABLE table_name_91 ( order VARCHAR, red_list VARCHAR, family VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the order for a red list of 7 in the didelphidae family?
SELECT order FROM table_name_91 WHERE red_list = 7 AND family = "didelphidae"
sql_create_context
CREATE TABLE table_67254 ( "Institution" text, "Location" text, "Nickname" text, "Current Conference" text, "Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the classification for the school in the NEC Conference located in Ne...
SELECT "Classification" FROM table_67254 WHERE "Current Conference" = 'nec' AND "Location" = 'new britain, connecticut'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '61592932' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-05-21' AND '2015-10-12' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '61592932' AND fgwyjzb.IN_HOSP_DATE BETWEEN ...
css
CREATE TABLE table_1389609_3 ( total_population INTEGER, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the entire inhabitants in Southeast Asia?
SELECT MIN(total_population) FROM table_1389609_3 WHERE region = "Southeast Asia"
sql_create_context
CREATE TABLE table_204_698 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was canadian , van amstel or valiquette ?
SELECT "name" FROM table_204_698 WHERE "name" IN ('louis van amstel', 'max valiquette') AND "nationality" = 'canadian'
squall
CREATE TABLE table_name_98 ( code INTEGER, region VARCHAR, type VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest code associated with a type of m for a region less than 17 named, named saint-sylv re?
SELECT MIN(code) FROM table_name_98 WHERE type = "m" AND name = "saint-sylvère" AND region < 17
sql_create_context
CREATE TABLE table_14945112_1 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of values for attendance for the date October 1, 1978?
SELECT COUNT(attendance) FROM table_14945112_1 WHERE date = "October 1, 1978"
sql_create_context
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, round_trip_required varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CR...
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 = 'DENVER' AND date_day.day_number = 16 AND date_day.month_number = 9 AND da...
atis
CREATE TABLE table_name_72 ( record VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a home of Nashville?
SELECT record FROM table_name_72 WHERE home = "nashville"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '56407085516'
css
CREATE TABLE table_28370 ( "Name" text, "GP" real, "Solo" real, "Ast" real, "Total" real, "TFL-Yds" text, "No-Yds" text, "BrUp" real, "No.-Yds" text, "Avg" text, "TD" real, "Long" real, "Rcv-Yds" text, "FF" real, "Blkd Kick" real ) -- Using valid SQLite, ans...
SELECT MIN("GP") FROM table_28370
wikisql
CREATE TABLE table_202_184 ( id number, "year" number, "title" text, "peak chart positions\naus" number, "peak chart positions\nnz" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which single by schnell fenster reached the band '...
SELECT "title" FROM table_202_184 ORDER BY "peak chart positions\nnz" LIMIT 1
squall
CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id in...
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name
nvbench
CREATE TABLE table_name_98 ( stake VARCHAR, occupation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stake has realtor for American equity realty as their occupation?
SELECT stake FROM table_name_98 WHERE occupation = "realtor for american equity realty"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 19981 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder
nvbench
CREATE TABLE table_train_242 ( "id" int, "macroalbuminuria" bool, "hyperlipidemia" bool, "fasting_serum_triglycerides" int, "fasting_ldl_cholesterol" int, "panel_reactive_antibodies" int, "serum_creatinine" float, "albumin" float, "body_mass_index_bmi" float, "fasting_serum_chole...
SELECT * FROM table_train_242 WHERE serum_creatinine > 1.6
criteria2sql
CREATE TABLE table_25108 ( "Player" text, "Nat" text, "Pos" text, "L Apps" real, "L G" real, "C Apps" real, "C G" real, "Total Apps" real, "Total G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the l g for rubio
SELECT "L G" FROM table_25108 WHERE "Player" = 'Rubio'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT DisplayName AS "display_name", Reputation, WebsiteUrl AS Website, Location, Age, Posts.Tags FROM Users LEFT OUTER JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE Location LIKE '%South Africa%' AND NOT Age IS NULL AND Reputation > 500 AND Posts.Tags LIKE '%c#%' ORDER BY age, Reputation DESC LIMIT 100
sede
CREATE TABLE table_204_627 ( id number, "date" text, "opponent" text, "score" text, "top scorer (total points)" text, "venue (location)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games took place in the araneta coliseum ?
SELECT COUNT(*) FROM table_204_627 WHERE "venue (location)" = 'araneta coliseum'
squall
CREATE TABLE table_name_74 ( years VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the SL 350 Model?
SELECT years FROM table_name_74 WHERE model = "sl 350"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome - acute myocardial infarction (with st elevation)...
eicu
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.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '86803950' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4134.59) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '86803950' AND...
css
CREATE TABLE table_26919_6 ( hebrew VARCHAR, proto_semitic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the hebrew for *ti -
SELECT hebrew FROM table_26919_6 WHERE proto_semitic = "*tišʻ-"
sql_create_context
CREATE TABLE table_11406866_2 ( week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the week where attendance is 77,098
SELECT week FROM table_11406866_2 WHERE attendance = "77,098"
sql_create_context
CREATE TABLE table_16048129_5 ( number_of_people INTEGER, average_family_size VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest population in regions where the average family size is 2.8 people?
SELECT MAX(number_of_people) FROM table_16048129_5 WHERE average_family_size = "2.8"
sql_create_context