instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_11369 ( "Nat." text, "Name" text, "Since" real, "Goals" real, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Ends with a Name of abidal, and has a Since larger than 2007?
SELECT SUM("Ends") FROM table_11369 WHERE "Name" = 'abidal' AND "Since" > '2007'
wikisql
CREATE TABLE table_13464416_4 ( high_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the high point scorers in game 7?
SELECT high_points FROM table_13464416_4 WHERE game = 7
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
SELECT TIME_TO_STR(CreationDate, '%M') AS "month", TIME_TO_STR(CreationDate, '%Y') AS "year", COUNT(Id) AS "num" FROM Posts WHERE Title LIKE '%which%' GROUP BY TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '%Y') ORDER BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%M')
sede
CREATE TABLE table_name_64 ( rank INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average rank for south africa when they had more than 8 silver medals?
SELECT AVG(rank) FROM table_name_64 WHERE nation = "south africa" AND silver > 8
sql_create_context
CREATE TABLE table_name_1 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least recent week number when the attendance is 16,562?
SELECT MIN(week) FROM table_name_1 WHERE attendance = 16 OFFSET 562
sql_create_context
CREATE TABLE table_203_773 ( id number, "season" number, "network" text, "play-by-play" text, "color commentator(s)" text, "sideline reporter(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year was the last season of cbs 's play by p...
SELECT MAX("season") FROM table_203_773
squall
CREATE TABLE table_67974 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 9:30 has a 10:30 of le journal weekend?
SELECT "9:30" FROM table_67974 WHERE "10:30" = 'le journal weekend'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
(SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.BGDH = jyjgzbb...
css
CREATE TABLE table_name_40 ( top_5 VARCHAR, top_25 VARCHAR, cuts_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Top-5 when the Top-25 is 6, and a Cuts made are less than 12?
SELECT COUNT(top_5) FROM table_name_40 WHERE top_25 = 6 AND cuts_made < 12
sql_create_context
CREATE TABLE table_39739 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Top-5 when the Tournament is the open champi...
SELECT MAX("Top-5") FROM table_39739 WHERE "Tournament" = 'the open championship' AND "Top-25" < '9'
wikisql
CREATE TABLE table_1661 ( "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. -- Name th...
SELECT "High assists" FROM table_1661 WHERE "High rebounds" = 'Yi Jianlian , Brook Lopez (7)'
wikisql
CREATE TABLE table_10797463_1 ( village__german_ VARCHAR, percent_of_slovenes_1991 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many villages had 21.7% of slovenes in 1991?
SELECT COUNT(village__german_) FROM table_10797463_1 WHERE percent_of_slovenes_1991 = "21.7%"
sql_create_context
CREATE TABLE table_name_31 ( home_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team when the Tie no was 60?
SELECT home_team FROM table_name_31 WHERE tie_no = "60"
sql_create_context
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 int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 281
advising
CREATE TABLE table_12790 ( "Tournament" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2009 for 2012 1R in Wimbledon and a 2011 2r?
SELECT "2009" FROM table_12790 WHERE "2012" = '1r' AND "Tournament" = 'wimbledon' AND "2011" = '2r'
wikisql
CREATE TABLE table_61278 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location did Anke Huber win the championship?
SELECT "Location" FROM table_61278 WHERE "Champion" = 'anke huber'
wikisql
CREATE TABLE table_10938 ( "Round" text, "Pick" text, "Player" text, "Nationality" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school's nationality was United States when its pick was 595?
SELECT "School" FROM table_10938 WHERE "Nationality" = 'united states' AND "Pick" = '595'
wikisql
CREATE TABLE technician ( Name VARCHAR, Age VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of technicians in ascending order of age.
SELECT Name FROM technician ORDER BY Age
sql_create_context
CREATE TABLE table_64815 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When against is more than 1244 with less than 8 losses, what is the average of wins?
SELECT AVG("Wins") FROM table_64815 WHERE "Against" > '1244' AND "Losses" < '8'
wikisql
CREATE TABLE table_name_37 ( competing_entities VARCHAR, sport VARCHAR, age_groups VARCHAR, held_every VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competing entities when the age group is 18 or younger, held every is one year and the s...
SELECT competing_entities FROM table_name_37 WHERE age_groups = "18 or younger" AND held_every = "one year" AND sport = "table tennis"
sql_create_context
CREATE TABLE table_name_4 ( diagram INTEGER, built VARCHAR, lot_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What diagram built in 1962 has a lot number smaller than 30702?
SELECT MIN(diagram) FROM table_name_4 WHERE built = "1962" AND lot_no < 30702
sql_create_context
CREATE TABLE table_42868 ( "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Douglas Soares had the fastest lap, what was the report?
SELECT "Report" FROM table_42868 WHERE "Fastest Lap" = 'douglas soares'
wikisql
CREATE TABLE table_15442 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other [C ]" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for the League Cup when the...
SELECT "League Cup" FROM table_15442 WHERE "FA Cup" = '0 13 0 (49)'
wikisql
CREATE TABLE table_46456 ( "Game" real, "Date" text, "Score" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Game was the Attendance more than 45,718 with a Time of 2:55?
SELECT COUNT("Game") FROM table_46456 WHERE "Attendance" > '45,718' AND "Time" = '2:55'
wikisql
CREATE TABLE table_52727 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date when Lebron James (25) was the lead scorer?...
SELECT "Date" FROM table_52727 WHERE "Leading scorer" = 'lebron james (25)'
wikisql
CREATE TABLE table_30567 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team did David McLay play for?
SELECT "College/junior/club team" FROM table_30567 WHERE "Player" = 'David McLay'
wikisql
CREATE TABLE table_25572 ( "Stage" real, "Winner" text, "General classification \u017b\u00f3\u0142ta koszulka" text, "Mountains classification Klasyfikacja g\u00f3rska" text, "Intermediate Sprints Classification Klasyfikacja najaktywniejszych" text, "Points classification Klasyfikacja punktowa" ...
SELECT "Winner" FROM table_25572 WHERE "Stage" = '1'
wikisql
CREATE TABLE table_43132 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which cfl team was associated with the college of manitoba?
SELECT "CFL Team" FROM table_43132 WHERE "College" = 'manitoba'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS seqnum, Id AS "userid", Reputation FROM Users WHERE LOWER(Location) LIKE '%germany%'
sede
CREATE TABLE table_28140578_1 ( written_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote episode number 19 in the series?
SELECT written_by FROM table_28140578_1 WHERE no_in_series = 19
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 demographic.diagnosis FROM demographic WHERE demographic.name = "Hector Blair"
mimicsql_data
CREATE TABLE table_44249 ( "Season" text, "Series" text, "Races" real, "Poles" real, "Wins" real, "Points" text, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SUM OF RACES WITH 9 POINTS?
SELECT SUM("Races") FROM table_44249 WHERE "Points" = '9'
wikisql
CREATE TABLE table_name_31 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2008 has 14.2% as the 2009?
SELECT 2008 FROM table_name_31 WHERE 2009 = "14.2%"
sql_create_context
CREATE TABLE Customer_Addresses ( customer_id INTEGER, premise_id INTEGER, date_address_from DATETIME, address_type_code VARCHAR(15), date_address_to DATETIME ) CREATE TABLE Order_Items ( item_id INTEGER, order_item_status_code VARCHAR(15), order_id INTEGER, product_id INTEGER, ...
SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY outcome_code DESC
nvbench
CREATE TABLE table_69400 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage for Russian?
SELECT "percentage (%)" FROM table_69400 WHERE "Language" = 'russian'
wikisql
CREATE TABLE table_21154 ( "Season" real, "Class" text, "Motorcycle" text, "Team" text, "Races" real, "Wins" real, "Podiums" real, "Poles" real, "FLaps" real, "Points" text, "Placement" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT MIN("FLaps") FROM table_21154
wikisql
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "61" AND diagnoses.long_title = "Other pulmonary embolism and infarction"
mimicsql_data
CREATE TABLE table_48389 ( "Player" text, "Attempts" real, "Yards" real, "Avg Yards" real, "Long" real, "Touchdowns" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Touchdowns, when Yards is less than 293, and when Long is gre...
SELECT AVG("Touchdowns") FROM table_48389 WHERE "Yards" < '293' AND "Long" > '39'
wikisql
CREATE TABLE table_name_81 ( position VARCHAR, round INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is the player selected that has a round value over 3?
SELECT position FROM table_name_81 WHERE round > 3
sql_create_context
CREATE TABLE table_49237 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Round, when Player is 'Gurnest Brown', and when Pick # is greater than 180?
SELECT AVG("Round") FROM table_49237 WHERE "Player" = 'gurnest brown' AND "Pick #" > '180'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewT...
SELECT CountTotal, CountClosedAsDuplicate, CAST(CountClosedAsDuplicate AS FLOAT) / CountTotal AS FractionClosedAsDuplicate FROM (SELECT (SELECT COUNT(*) FROM Posts AS p WHERE CreationDate > '2018-06-25' AND PostTypeId = 1 AND EXISTS(SELECT 1 FROM PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId = 10 AN...
sede
CREATE TABLE table_name_51 ( games INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average games of Tony Dixon?
SELECT AVG(games) AS ↑ FROM table_name_51 WHERE name = "tony dixon"
sql_create_context
CREATE TABLE table_name_63 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game when the liberty had a record of 12-9?
SELECT date FROM table_name_63 WHERE record = "12-9"
sql_create_context
CREATE TABLE table_name_62 ( total VARCHAR, set_2 VARCHAR, set_4 VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of NA for set 4, a score of 3-0 and a 26-24 for set 2?
SELECT total FROM table_name_62 WHERE set_4 = "na" AND score = "3-0" AND set_2 = "26-24"
sql_create_context
CREATE TABLE table_name_96 ( champion VARCHAR, purse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the champion with a 200,000,000 purse?
SELECT champion FROM table_name_96 WHERE purse = "¥200,000,000"
sql_create_context
CREATE TABLE table_name_65 ( channel INTEGER, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of channels for qubo network?
SELECT SUM(channel) FROM table_name_65 WHERE network = "qubo"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCAT...
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '72776229' AND mzjzjlb.JZKSRQ BETWEEN '2002-03-03' AND '2006-02-09' AND mzjzjlb.YLJGDM = '7840461'
css
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 SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '邹学博' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-04-09' AND '2014-05-05' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '邹学博' A...
css
CREATE TABLE table_name_4 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the loss with record of 71-33
SELECT loss FROM table_name_4 WHERE record = "71-33"
sql_create_context
CREATE TABLE table_203_245 ( 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. -- what are the number of times a competition took place in the unite...
SELECT COUNT(*) FROM table_203_245 WHERE "venue" = 'united states'
squall
CREATE TABLE table_26623 ( "Reference" text, "Author" text, "Section Size" text, "Violins" real, "Violas" real, "Celli" real, "Basses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the biggest number of basses suggested in either on...
SELECT MAX("Basses") FROM table_26623
wikisql
CREATE TABLE table_19061 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many highest with team being forfar athletic
SELECT COUNT("Highest") FROM table_19061 WHERE "Team" = 'Forfar Athletic'
wikisql
CREATE TABLE table_name_43 ( airport VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What airport is in Sabha?
SELECT airport FROM table_name_43 WHERE city = "sabha"
sql_create_context
CREATE TABLE table_14828 ( "Team" text, "Matches" text, "Winner" text, "Lost" text, "No result" text, "Tied" text, "% Won" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Winner of 1?
SELECT "Team" FROM table_14828 WHERE "Winner" = '1'
wikisql
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_60040 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm"...
SELECT "3:00 pm" FROM table_60040 WHERE "7:00 am" = 'men in black (mon-thu) pokémon (fri)'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '24030773' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE table_9575 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which language has 3 draws?
SELECT "Language" FROM table_9575 WHERE "Draw" = '3'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id ...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2...
mimic_iii
CREATE TABLE table_54150 ( "Year" real, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average mintage for that of artist Celia Godkin, before the year 2010?
SELECT AVG("Mintage") FROM table_54150 WHERE "Artist" = 'celia godkin' AND "Year" < '2010'
wikisql
CREATE TABLE table_25960 ( "Round" real, "Location" text, "Circuit" text, "Date" text, "Pole Position" text, "Winning Driver" text, "Winning Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which location is aci vallelunga circuit?
SELECT "Location" FROM table_25960 WHERE "Circuit" = 'ACI Vallelunga Circuit'
wikisql
CREATE TABLE table_59034 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the Player with a To par of 4?
SELECT "Country" FROM table_59034 WHERE "To par" = '–4'
wikisql
CREATE TABLE table_1429629_1 ( broadcast_date VARCHAR, run_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had a broadcast date and run time of 24:43?
SELECT COUNT(broadcast_date) FROM table_1429629_1 WHERE run_time = "24:43"
sql_create_context
CREATE TABLE table_name_78 ( season VARCHAR, round VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season did the Sporting CP Club have a 1. round?
SELECT season FROM table_name_78 WHERE round = "1. round" AND club = "sporting cp"
sql_create_context
CREATE TABLE table_name_17 ( goals_for INTEGER, goals_against VARCHAR, position VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goals for has a Position smaller than 16, and Wins smaller than 19, and Goals against smaller than 32?
SELECT MIN(goals_for) FROM table_name_17 WHERE position < 16 AND wins < 19 AND goals_against < 32
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE >= 10 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE >= 10)
css
CREATE TABLE table_name_70 ( team VARCHAR, name VARCHAR, rebounds VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In game 34 Curtis Borchardt played on which team with less than 275 rebounds?
SELECT team FROM table_name_70 WHERE rebounds < 275 AND games < 34 AND name = "curtis borchardt"
sql_create_context
CREATE TABLE table_65155 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which To par has a Player of johanna head?
SELECT "To par" FROM table_65155 WHERE "Player" = 'johanna head'
wikisql
CREATE TABLE table_name_60 ( place INTEGER, lost INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the place that has less than 2 losses?
SELECT SUM(place) FROM table_name_60 WHERE lost < 2
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeo...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos...
eicu
CREATE TABLE table_22488 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Na...
SELECT "Township" FROM table_22488 WHERE "County" = 'Kidder'
wikisql
CREATE TABLE table_8146 ( "Year" real, "Tournament" text, "Surface" text, "Round" text, "Winner" text, "Score" text, "Length" text, "Ivanovic" real, "Jankovic" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Ivanovic win...
SELECT SUM("Year") FROM table_8146 WHERE "Winner" = 'ivanovic' AND "Ivanovic" > '4' AND "Round" = 'r16'
wikisql
CREATE TABLE table_23370 ( "N\u00ba" real, "Ep" real, "Huckleberry Hound" text, "Pixie and Dixie" text, "Yogi Bear" text, "Air date" text, "Credited animators" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Yogi Bear that aired o...
SELECT "Yogi Bear" FROM table_23370 WHERE "Air date" = '1959.12.21'
wikisql
CREATE TABLE table_1140116_6 ( winning_driver VARCHAR, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winners did I Dessau Autobahnspinne have?
SELECT COUNT(winning_driver) FROM table_1140116_6 WHERE race_name = "I Dessau Autobahnspinne"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Aida Kasumovic' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, ...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime LIM...
mimic_iii
CREATE TABLE Apartment_Buildings ( building_id VARCHAR, building_short_name VARCHAR ) CREATE TABLE Apartments ( room_count INTEGER, building_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the total number of rooms of the apartments in the bu...
SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square"
sql_create_context
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) DESC
nvbench
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '78964308' AND t_kc22.STA_DATE BETWEEN '2012-03-26' AND '2018-10-14' AND t_kc22.SELF_PAY_PRO < 0.65
css
CREATE TABLE table_64669 ( "Year" real, "Tournament" text, "Venue" text, "Discipline" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the extra when the result is 4th at the NCAA Championships?
SELECT "Extra" FROM table_64669 WHERE "Result" = '4th' AND "Tournament" = 'ncaa championships'
wikisql
CREATE TABLE table_62930 ( "Campus" text, "Year opened" text, "Students" text, "Size" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What campus was opened in 1977?
SELECT "Campus" FROM table_62930 WHERE "Year opened" = '1977'
wikisql
CREATE TABLE table_name_30 ( score VARCHAR, place VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Place of t5, and a Country of united states?
SELECT score FROM table_name_30 WHERE place = "t5" AND country = "united states"
sql_create_context
CREATE TABLE table_71476 ( "Name" text, "Position" text, "Party" text, "Took office" real, "Up for reelection" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year that Yvette Alexander took office and was up for reelection afte...
SELECT MIN("Took office") FROM table_71476 WHERE "Name" = 'yvette alexander' AND "Up for reelection" > '2016'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '20851648462'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '花志专'
css
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2174.0" AND lab.itemid = "50990"
mimicsql_data
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARC...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank
nvbench
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, food_service WHERE (((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DALLAS...
atis
CREATE TABLE mzjybgb ( 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 COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '4879097' AND zyjybgb.BGRQ BETWEEN '2000-04-27' AND '2007-01-01' GROUP BY zyjybgb.KSBM HAVING COUNT(*) < 28 UNION SELECT mzjybgb.KSBM FROM mzjzj...
css
CREATE TABLE table_name_34 ( opponent VARCHAR, game VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for game number less than 47 and a record of 24-13-4?
SELECT opponent FROM table_name_34 WHERE game < 47 AND record = "24-13-4"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY AVG(Price) DESC
nvbench
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Excision or destruction of other lesion or tissue of heart, endovascular approach" AND lab."CATEGORY" = "Hem...
mimicsql_data
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.admission_type = "EMERGENCY" AND procedures.long_title = "Endoscopic excision or destruction of lesion or tissue of stomach"
mimicsql_data
CREATE TABLE table_63992 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Serial numbers" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) retired" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Fleet number(s)" FROM table_63992 WHERE "Serial numbers" = '68056'
wikisql
CREATE TABLE table_203_131 ( id number, "pos." number, "car #" number, "driver" text, "make" text, "team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did scott wimmer place before or after carl edwards ?
SELECT (SELECT "pos." FROM table_203_131 WHERE "driver" = 'scott wimmer') < (SELECT "pos." FROM table_203_131 WHERE "driver" = 'carl edwards')
squall
CREATE TABLE table_47905 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest round when the college is penn state?
SELECT MAX("Round") FROM table_47905 WHERE "College" = 'penn state'
wikisql
CREATE TABLE table_12194021_1 ( womens_doubles VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the womens doubles in 2002?
SELECT womens_doubles FROM table_12194021_1 WHERE season = 2002
sql_create_context
CREATE TABLE table_63245 ( "Sunrayia FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the most wins with byes more than 0 and 1637 against?
SELECT MAX("Wins") FROM table_63245 WHERE "Against" = '1637' AND "Byes" > '0'
wikisql
CREATE TABLE table_4049 ( "Year" real, "Host Nation(s)" text, "Final Venue" text, "Winner" text, "Result" text, "Runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the runner-up record where winner record is Ireland 59 points?
SELECT "Runner-up" FROM table_4049 WHERE "Winner" = 'Ireland 59 points'
wikisql