context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_75012 ( "Vol. #" real, "Title" text, "Material collected" text, "Publication date" text, "ISBN" text )
How many Volume Numbers have the title of Darkness Falls?
SELECT SUM("Vol. #") FROM table_75012 WHERE "Title" = 'darkness falls'
wikisql
CREATE TABLE table_62280 ( "Name" text, "Builder" text, "Type" text, "Works Number" text, "Built" real )
What is Name, when Builder is 'Kerr Stuart'?
SELECT "Name" FROM table_62280 WHERE "Builder" = 'kerr stuart'
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, ...
does patient 5905 have a male or female gender?
SELECT patients.gender FROM patients WHERE patients.subject_id = 5905
mimic_iii
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...
what is the number of patients whose days of hospital stay is greater than 17 and procedure long title is other radiotherapeutic procedure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "17" AND procedures.long_title = "Other radiotherapeutic procedure"
mimicsql_data
CREATE TABLE table_name_79 ( player VARCHAR, draft VARCHAR, round VARCHAR )
Which player had a draft before 1975 and before round 6?
SELECT player FROM table_name_79 WHERE draft < 1975 AND round < 6
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...
想知道患者94188667在二00四年六月十四日到二0一九年六月二十九日期间被开出谷维素片的总次数是多少
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '94188667' AND t_kc22.STA_DATE BETWEEN '2004-06-14' AND '2019-06-29' AND t_kc22.SOC_SRT_DIRE_NM = '谷维素片'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
how many times in this year has patient 012-14774 been to the hospital?
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '012-14774' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_19905183_1 ( province VARCHAR, team VARCHAR )
What province does the Ruhuna Royals team come from?
SELECT province FROM table_19905183_1 WHERE team = "Ruhuna Royals"
sql_create_context
CREATE TABLE table_62496 ( "Geelong DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
Which Geelong DFL has 8 losses and more than 4 wins?
SELECT "Geelong DFL" FROM table_62496 WHERE "Wins" > '4' AND "Losses" = '8'
wikisql
CREATE TABLE table_name_82 ( year VARCHAR, role_episode VARCHAR )
what is the year when the role/episode is david duchovny?
SELECT year FROM table_name_82 WHERE role_episode = "david duchovny"
sql_create_context
CREATE TABLE table_1590 ( "Character" text, "Indianapolis Concerts" text, "Sarasota" text, "Broadway" text, "Brighton Cast" text )
Name the indianapolis concerts for les minski
SELECT "Indianapolis Concerts" FROM table_1590 WHERE "Sarasota" = 'Les Minski'
wikisql
CREATE TABLE table_name_51 ( winning_amount VARCHAR, contestant_name VARCHAR )
What winning amount has himesh reshammiya as the contestant name?
SELECT winning_amount FROM table_name_51 WHERE contestant_name = "himesh reshammiya"
sql_create_context
CREATE TABLE table_60788 ( "Year" real, "First member" text, "First party" text, "Second member" text, "Second party" text )
What is the second party where the first party is Tory and the year is 1820?
SELECT "Second party" FROM table_60788 WHERE "First party" = 'tory' AND "Year" = '1820'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_204_26 ( id number, "name" text, "position" text, "birth date/age at start of campaign" text, "games in campaign" text, "club" text )
which club was represented the most ?
SELECT "club" FROM table_204_26 GROUP BY "club" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to order total number in desc order.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, ...
Which one is easiest , EECS 634 or EECS 592 ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 634 OR course.number = 592) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_27722734_11 ( score VARCHAR, team VARCHAR )
Name the score for denver
SELECT score FROM table_27722734_11 WHERE team = "Denver"
sql_create_context
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, win...
Count the number of local authorities by the local authority, and rank in desc by the x axis.
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
列出患者93496868就诊科室名称不包含产的所有门诊就诊记录的流水号是什么,在医院3314397中?
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
Creating a post through SEDE.
SELECT * FROM Posts WHERE Id = 28231
sede
CREATE TABLE table_29302711_12 ( prize_money__usd_ INTEGER, name VARCHAR )
how much prize money (in USD) did bob lutz win
SELECT MAX(prize_money__usd_) FROM table_29302711_12 WHERE name = "Bob Lutz"
sql_create_context
CREATE TABLE table_64547 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
On what day was game 2 played?
SELECT "Date" FROM table_64547 WHERE "Game" = '2'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid...
what's the date of the birth of patient 7524?
SELECT patients.dob FROM patients WHERE patients.subject_id = 7524
mimic_iii
CREATE TABLE product_categories ( production_type_code text, product_type_description text, vat_rating number ) CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, deri...
Show order ids and the total quantity in each order.
SELECT order_id, SUM(product_quantity) FROM order_items GROUP BY order_id
spider
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...
在哪几次医疗记录中编码为12159301的病患被开出过金额高于1137.43元的药品?医疗就诊编号是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '12159301' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 1137.43)
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
cryptography posts for specific langauge/tag.
SELECT Posts.Id, REPLACE(REPLACE(REPLACE(Title, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "title", Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, CreationDate, Score, REPLACE(REPLACE(REPLACE(Body, CHAR(10) + CHAR(13), '<br />'), CHAR(10), '<br />'), CHAR(13), '<br />') AS "...
sede
CREATE TABLE table_name_94 ( total__kg_ INTEGER, bodyweight VARCHAR, clean_ VARCHAR, _jerk VARCHAR )
What is the total (kg when the bodyweight is more than 57.8, and the clean & jerk is less than 103?
SELECT SUM(total__kg_) FROM table_name_94 WHERE bodyweight > 57.8 AND clean_ & _jerk < 103
sql_create_context
CREATE TABLE table_66248 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Result" text )
What is the Heat of the Player with a Rank of 18 or less and Result of 55.15?
SELECT "Heat" FROM table_66248 WHERE "Rank" < '18' AND "Result" = '55.15'
wikisql
CREATE TABLE table_43530 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the attendance for week 15?
SELECT "Attendance" FROM table_43530 WHERE "Week" = '15'
wikisql
CREATE TABLE table_14700 ( "Goal" real, "Date" text, "Score" text, "Result" text, "Competition" text )
What was the result of the friendly competition?
SELECT "Result" FROM table_14700 WHERE "Competition" = 'friendly'
wikisql
CREATE TABLE table_dev_45 ( "id" int, "tc" int, "systolic_blood_pressure_sbp" int, "parenteral_antibiotic_therapy" bool, "fasting_plasma_glucose_fpg" float, "active_infection" bool, "untreated_hyperlipidemia" bool, "hemoglobin_a1c_hba1c" float, "temperature" float, "diastolic_blo...
heavy alcohol consumption ( > 21 drinks / week male , > 14 drinks / week female )
SELECT * FROM table_dev_45 WHERE alcohol_abuse = 1
criteria2sql
CREATE TABLE table_2352 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Boilermakers points" real, "Opponents" real, "Record" text )
How many games were there in the 1966 season?
SELECT MAX("Game") FROM table_2352
wikisql
CREATE TABLE table_name_68 ( catalog VARCHAR, format VARCHAR, date VARCHAR )
What catalog has a format of ED remaster CD and a date of December 19, 2001?
SELECT catalog FROM table_name_68 WHERE format = "ed remaster cd" AND date = "december 19, 2001"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
Find a certain deleted post 1257021.
SELECT * FROM PostHistory WHERE PostId = 1257021
sede
CREATE TABLE postseason ( team_id_loser VARCHAR, year VARCHAR ) CREATE TABLE team ( team_id_br VARCHAR, name VARCHAR )
How many times did Boston Red Stockings lose in 2009 postseason?
SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009
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...
查一下病患91780713在医院1411436中就诊科室名中有母乳喂养这几个字的门诊就诊记录的流水号
SELECT mzjzjlb.JZLSH 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 = '91780713' AND hz_info.YLJGDM = '1411436' AND mzjzjlb.JZKSMC LIKE '%母乳喂养%'
css
CREATE TABLE table_13554 ( "Sunrayia FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the lowest losses for a team that has 0 draws, fewer than 4 wins, and no Byes?
SELECT MIN("Losses") FROM table_13554 WHERE "Draws" = '0' AND "Wins" < '4' AND "Byes" < '0'
wikisql
CREATE TABLE table_name_77 ( year VARCHAR, nominee VARCHAR )
What year was jack cole nominated?
SELECT year FROM table_name_77 WHERE nominee = "jack cole"
sql_create_context
CREATE TABLE table_53348 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
How much time does it take for jean alesi and grids lesser than 5?
SELECT "Time/Retired" FROM table_53348 WHERE "Grid" < '5' AND "Driver" = 'jean alesi'
wikisql
CREATE TABLE table_16655 ( "Season" text, "Group A Winner" text, "Group B Winner" text, "Group C Winner" text, "Group D Winner" text )
What group a winner was for nocerina?
SELECT "Group A Winner" FROM table_16655 WHERE "Group D Winner" = 'Nocerina'
wikisql
CREATE TABLE table_name_91 ( played INTEGER, losses VARCHAR, points VARCHAR, wins VARCHAR, goals_for VARCHAR )
What is the average number played that has fewer than 11 wins, more than 42 goals, more than 22 points, and 11 losses?
SELECT AVG(played) FROM table_name_91 WHERE wins < 11 AND goals_for > 42 AND points > 22 AND losses = 11
sql_create_context
CREATE TABLE table_name_82 ( away_team VARCHAR, venue VARCHAR )
What away team plays at Arden Street Oval?
SELECT away_team FROM table_name_82 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE table_name_50 ( church_name VARCHAR, organized_by VARCHAR )
Which church was organized by George M. Hinkle?
SELECT church_name FROM table_name_50 WHERE organized_by = "george m. hinkle"
sql_create_context
CREATE TABLE table_16704 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
what is the venue where the margin is 4?
SELECT "Venue" FROM table_16704 WHERE "Margin" = '4'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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 t...
从10年12月28日开始到2011年10月6日为止,为病员25627838检测前白蛋白的医务人员工号及姓名各是什么?
(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 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...
医疗就诊11758190455在出院时,诊断出来是什么疾病,以及该疾病相对应的编号是什么
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '11758190455'
css
CREATE TABLE table_name_87 ( grid VARCHAR, time_retired VARCHAR )
How many grids are associated with a Time/Retired of +1.837?
SELECT COUNT(grid) FROM table_name_87 WHERE time_retired = "+1.837"
sql_create_context
CREATE TABLE table_name_77 ( website VARCHAR, language VARCHAR, frequency VARCHAR )
Which website is in english and has the frequency of an online newspaper ?
SELECT website FROM table_name_77 WHERE language = "english" AND frequency = "online newspaper"
sql_create_context
CREATE TABLE table_name_9 ( rank INTEGER, player VARCHAR, matches VARCHAR )
what is the rank when the player is henry shefflin and the matches is higher than 4?
SELECT SUM(rank) FROM table_name_9 WHERE player = "henry shefflin" AND matches > 4
sql_create_context
CREATE TABLE table_name_27 ( total INTEGER, county VARCHAR, rank VARCHAR )
How many totals does cork have whose rank is larger than 2?
SELECT SUM(total) FROM table_name_27 WHERE county = "cork" AND rank > 2
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int...
keywords in the papers written by lorenzo bruzzone
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'lorenzo bruzzone' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int )
Find the number of scientists involved for each project name, and display by the y-axis in ascending.
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*)
nvbench
CREATE TABLE table_47506 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
How many rounds in the event when record is 1-5?
SELECT COUNT("Round") FROM table_47506 WHERE "Record" = '1-5'
wikisql
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...
provide the number of patients whose gender is f and admission type is urgent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "URGENT"
mimicsql_data
CREATE TABLE table_68056 ( "Tournament" text, "1999" text, "2002" text, "2004" text, "2006" text, "2007" text, "2010" text, "2011" text, "2012" text )
What is the 2007 value with a 2r in 2012 and 1r in 2002?
SELECT "2007" FROM table_68056 WHERE "2012" = '2r' AND "2002" = '1r'
wikisql
CREATE TABLE table_name_60 ( transfer_fee VARCHAR, name VARCHAR )
what is the transfer fee for evilasio?
SELECT transfer_fee FROM table_name_60 WHERE name = "evilasio"
sql_create_context
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
Count the total number of different locations of parties using a pie chart.
SELECT Location, COUNT(Location) FROM party GROUP BY Location
nvbench
CREATE TABLE table_11295 ( "Parties and voter communities" text, "% 2006" real, "Seats 2006" real, "% 2001" real, "Seats 2001" real )
There are communities listed that a percentage larger than 7.6 in 2001, but none of them has 2 seats listed in 2006.
SELECT SUM("Seats 2001") FROM table_11295 WHERE "Seats 2006" = '2' AND "% 2001" > '7.6'
wikisql
CREATE TABLE user_profiles ( uid number, name text, email text, partitionid number, followers number ) CREATE TABLE tweets ( id number, uid number, text text, createdate time ) CREATE TABLE follows ( f1 number, f2 number )
How many followers does each user have?
SELECT COUNT(*) FROM follows
spider
CREATE TABLE table_name_1 ( title VARCHAR, production_code VARCHAR )
what is the title of the episode with the production code of ad1a22?
SELECT title FROM table_name_1 WHERE production_code = "ad1a22"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
the number of times that patient 594 had taken tpn d5.0 on 05/02/this year.
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 594)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d5.0' AND ...
mimic_iii
CREATE TABLE table_name_85 ( date VARCHAR, score VARCHAR )
What is the Date of the Competition with a Score of 1 2?
SELECT date FROM table_name_85 WHERE score = "1–2"
sql_create_context
CREATE TABLE table_train_181 ( "id" int, "systolic_blood_pressure_sbp" int, "fasting_plasma_glucose_fpg" float, "hemoglobin_a1c_hba1c" float, "hepatitis_c" bool, "hepatitis_b" bool, "exposure_to_hiv" bool, "diastolic_blood_pressure_dbp" int, "hypertension" bool, "NOUSE" float )
hypertension ( blood pressure > 160 / 100 mm / hg at screening or day of study visit
SELECT * FROM table_train_181 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100
criteria2sql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
how many patients are diagnosed with bronchoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Other bronchoscopy"
mimicsql_data
CREATE TABLE table_name_14 ( score VARCHAR, player VARCHAR, place VARCHAR, country VARCHAR )
What was the Score for T9 United States Player Kirk Triplett?
SELECT score FROM table_name_14 WHERE place = "t9" AND country = "united states" AND player = "kirk triplett"
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, ...
what would be the maximum daily number of patients diagnosed with valve repair < 7 days - aortic in 2105?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'valve repair < 7 days - aortic' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_name_54 ( position VARCHAR, player VARCHAR )
what is the position for andrew paopao?
SELECT position FROM table_name_54 WHERE player = "andrew paopao"
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...
the total number of times until 36 months ago patient 010-15363 has had a lab test for -eos.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-15363')) AND lab.labname = '-eos' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TI...
eicu
CREATE TABLE table_name_67 ( country VARCHAR, rank VARCHAR, notes VARCHAR )
What country were the athletes where ranked smaller than 5 with notes listed as fb?
SELECT country FROM table_name_67 WHERE rank < 5 AND notes = "fb"
sql_create_context
CREATE TABLE table_79234 ( "School" text, "Mascot" text, "Location" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What school has south bend as the location, with indians as the mascot?
SELECT "School" FROM table_79234 WHERE "Location" = 'south bend' AND "Mascot" = 'indians'
wikisql
CREATE TABLE table_49900 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text )
What time does the trainer, Todd Pletcher have?
SELECT "Time" FROM table_49900 WHERE "Trainer" = 'todd pletcher'
wikisql
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB d...
Give me a histogram for what is the number of professors for different school?, list by the the total number in desc.
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_58001 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What city of license is associated with call sign w244bk?
SELECT "City of license" FROM table_58001 WHERE "Call sign" = 'w244bk'
wikisql
CREATE TABLE table_19766 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
what is the result for October 14, 1956?
SELECT "Result" FROM table_19766 WHERE "Date" = 'October 14, 1956'
wikisql
CREATE TABLE table_204_421 ( id number, "name" text, "nationality" text, "position" text, "spartak career" text, "appearances" number, "goals" number )
which player has the most appearances with the club ?
SELECT "name" FROM table_204_421 ORDER BY "appearances" DESC LIMIT 1
squall
CREATE TABLE table_55437 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the home team when the away team scored 14.21 (105)?
SELECT "Home team score" FROM table_55437 WHERE "Away team score" = '14.21 (105)'
wikisql
CREATE TABLE table_name_31 ( Id VARCHAR )
2007 of 1r is involved in what 2001?
SELECT 2001 FROM table_name_31 WHERE 2007 = "1r"
sql_create_context
CREATE TABLE table_name_75 ( animal VARCHAR, resting_potential__mv_ VARCHAR )
Which animal has a resting potential of 60?
SELECT animal FROM table_name_75 WHERE resting_potential__mv_ = "−60"
sql_create_context
CREATE TABLE table_name_5 ( crowd INTEGER, home_team VARCHAR )
What was the largest crowd size at a South Melbourne home game?
SELECT MAX(crowd) FROM table_name_5 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE table_42716 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
What is the state Yi?
SELECT "State" FROM table_42716 WHERE "Name" = 'yi'
wikisql
CREATE TABLE table_name_63 ( station VARCHAR, genre VARCHAR, operator VARCHAR )
Which station is operated by BBC Radio under the talk radio genre?
SELECT station FROM table_name_63 WHERE genre = "talk radio" AND operator = "bbc radio"
sql_create_context
CREATE TABLE table_66505 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text )
Which Debut year has Goals of 0, and Years at club of 1963, and Games larger than 5?
SELECT AVG("Debut year") FROM table_66505 WHERE "Goals" = '0' AND "Years at club" = '1963' AND "Games" > '5'
wikisql
CREATE TABLE table_name_63 ( game_site VARCHAR, attendance VARCHAR )
Where was the game held when the attendance was 56,770?
SELECT game_site FROM table_name_63 WHERE attendance = "56,770"
sql_create_context
CREATE TABLE table_name_54 ( affiliation VARCHAR, school VARCHAR )
What is the affiliation of the University of Maryland?
SELECT affiliation FROM table_name_54 WHERE school = "university of maryland"
sql_create_context
CREATE TABLE table_name_18 ( played INTEGER, lost VARCHAR, goals_against VARCHAR, team VARCHAR )
What is the average Played, when Goals Against is less than 63, when Team is 'Nelson', and when Lost is greater than 16?
SELECT AVG(played) FROM table_name_18 WHERE goals_against < 63 AND team = "nelson" AND lost > 16
sql_create_context
CREATE TABLE table_36569 ( "Outcome" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Who was the opponent when the score was 6-3, 6-3?
SELECT "Opponent" FROM table_36569 WHERE "Score" = '6-3, 6-3'
wikisql
CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number )
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
SELECT country FROM mountain WHERE height > 5600 INTERSECT SELECT country FROM mountain WHERE height < 5200
spider
CREATE TABLE table_29397 ( "Name" text, "Nation" text, "Seasons" text, "Championship titles" text, "Races (Starts)" text, "Poles" real, "Wins" real, "Podiums" real, "Fastest Laps" real, "Points" text )
How many pole position achieved 0 points from Mexico?
SELECT COUNT("Poles") FROM table_29397 WHERE "Points" = '0' AND "Nation" = 'Mexico'
wikisql
CREATE TABLE table_16914 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
How many different locations have the score 207 (-10)?
SELECT COUNT("Location") FROM table_16914 WHERE "Score" = '207 (-10)'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在2000年9月2日到2007年2月7日期间,医院9719119的科室9117涉及的医疗费总额有多少
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9719119' AND t_kc21.MED_ORG_DEPT_CD = '9117') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-09-02' AND '2007-02-07'
css
CREATE TABLE table_22171 ( "Greek Designation" text, "Collegiate Institution" text, "Charter Date" text, "Status" text, "City" text, "U.S. State/District" text )
what is the status in vestal
SELECT "Status" FROM table_22171 WHERE "City" = 'Vestal'
wikisql
CREATE TABLE table_name_41 ( director VARCHAR, producer VARCHAR, platform_s_ VARCHAR )
Who is the director of the game with HIroshi Sato as the producer on the GBA platform?
SELECT director FROM table_name_41 WHERE producer = "hiroshi sato" AND platform_s_ = "gba"
sql_create_context
CREATE TABLE table_27115 ( "Afghan" text, "Albanian" text, "Arabic" text, "Bangladeshi" text, "Bosnian" text, "Chinese" text, "Colombian" text, "Cook Islands" text )
how many bosnian in cook islands is sri lankan
SELECT "Bosnian" FROM table_27115 WHERE "Cook Islands" = 'Sri Lankan'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many white patients were born before 2065?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2065"
mimicsql_data
CREATE TABLE table_name_87 ( named VARCHAR, name VARCHAR, diameter__km_ VARCHAR, longitude VARCHAR, latitude VARCHAR )
What is the namesake of Ayashe at a longitude less than 270.7, latitude more than -47.1, and a diameter less than 7.2?
SELECT named AS after FROM table_name_87 WHERE longitude < 270.7 AND latitude > -47.1 AND diameter__km_ < 7.2 AND name = "ayashe"
sql_create_context
CREATE TABLE table_14699 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What was Liu Limin's time in heat 4?
SELECT "Time" FROM table_14699 WHERE "Heat" = '4' AND "Name" = 'liu limin'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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 jybg...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
门诊诊断病患吴嘉祥为急性胃肠炎的检测指标101818的结果定量是多少和单位是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_47954 ( "Date" text, "Region" text, "Label" text, "Catalogue" text, "Format" text )
What is Format, when Label is Bronze, when Date is 1982, and when Catalogue is 204 636?
SELECT "Format" FROM table_47954 WHERE "Label" = 'bronze' AND "Date" = '1982' AND "Catalogue" = '204 636'
wikisql