context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_41 ( episode_number INTEGER, air_date VARCHAR )
What kind of Episode Number has a Air Date on 29 june 2007?
SELECT AVG(episode_number) FROM table_name_41 WHERE air_date = "29 june 2007"
sql_create_context
CREATE TABLE table_34107 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
How many Games have a Drawn smaller than 1, and a Lost larger than 4?
SELECT COUNT("Games") FROM table_34107 WHERE "Drawn" < '1' AND "Lost" > '4'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
top 200,000 posts by viewcount.
SELECT * FROM Posts ORDER BY Posts.ViewCount DESC LIMIT 200000
sede
CREATE TABLE table_2597876_2 ( winnings VARCHAR, avg_start VARCHAR )
How many values for winnings correspond to average start of 19.0?
SELECT COUNT(winnings) FROM table_2597876_2 WHERE avg_start = "19.0"
sql_create_context
CREATE TABLE table_61221 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who is the Opponents on May 3, 1982?
SELECT "Opponents" FROM table_61221 WHERE "Date" = 'may 3, 1982'
wikisql
CREATE TABLE table_17220 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real )
If the enrollment is 3584, what's the largest founded?
SELECT MAX("Founded") FROM table_17220 WHERE "Enrollment" = '3584'
wikisql
CREATE TABLE table_52098 ( "Year" text, "Player" text, "School" text, "Hometown" text, "College" text )
Which player is from Queens, NY?
SELECT "Player" FROM table_52098 WHERE "Hometown" = 'queens, ny'
wikisql
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, ...
how many patients have been diagnosed with short title norml pressure hydroceph anfd have had a urine lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Norml pressure hydroceph" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_204_405 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
what is the total points scored in the second round by all teams ?
SELECT SUM("2nd leg" + "2nd leg") FROM table_204_405
squall
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dup...
Assignment 1 - Step 8: Data File 5.
SELECT * FROM Posts WHERE Posts.ViewCount > 24231 AND Posts.ViewCount < 30580
sede
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...
有多少次10元以内小金额结算是参保人任飞烟在04年12月27日到20年7月15日内支付的?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '任飞烟' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-12-27' AND '2020-07-15' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE table_23819979_3 ( final_place VARCHAR, last_match VARCHAR )
Name the final place for july 25, 2009
SELECT final_place FROM table_23819979_3 WHERE last_match = "July 25, 2009"
sql_create_context
CREATE TABLE table_12001 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What is the result against everton?
SELECT "Result" FROM table_12001 WHERE "Opponent" = 'everton'
wikisql
CREATE TABLE table_name_35 ( year VARCHAR, team VARCHAR, pos VARCHAR )
In what year did the team of aston martin racing have a position of 6th?
SELECT COUNT(year) FROM table_name_35 WHERE team = "aston martin racing" AND pos = "6th"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
在59467092414的医疗就诊中,是哪位医生负责这次医疗就诊的出院诊断的,想知道编码和名称
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '59467092414'
css
CREATE TABLE table_59306 ( "Periodo" text, "Births" real, "Deaths" real, "Difference" real, "CBR*" real, "CDR*" real, "IMR*" real, "TFR*" real )
What is the lowest CDR that has 112 as the difference?
SELECT MIN("CDR*") FROM table_59306 WHERE "Difference" = '112'
wikisql
CREATE TABLE table_16494599_10 ( nationality VARCHAR, player VARCHAR )
How many nationalities does athlete Casey Jacobsen have?
SELECT COUNT(nationality) FROM table_16494599_10 WHERE player = "Casey Jacobsen"
sql_create_context
CREATE TABLE table_54635 ( "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Rating" real, "Share" text, "18\u201349 Rating" text, "Viewers (millions)" real, "Rank" text )
How many total viewers for 'the summer house'?
SELECT SUM("Viewers (millions)") FROM table_54635 WHERE "Episode" = 'the summer house'
wikisql
CREATE TABLE table_name_60 ( grid VARCHAR, laps VARCHAR )
Tell me the total number of grid for laps of 52
SELECT COUNT(grid) FROM table_name_60 WHERE laps = 52
sql_create_context
CREATE TABLE table_204_690 ( id number, "election" number, "party name" text, "total votes" number, "share of votes" text, "seats" number, "share of seats" text, "party leader(s)" text, "notes" text )
what election had the most total votes ?
SELECT "election" FROM table_204_690 ORDER BY "total votes" DESC LIMIT 1
squall
CREATE TABLE table_45610 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who manufactures Makoto Tamada's vehicle?
SELECT "Manufacturer" FROM table_45610 WHERE "Rider" = 'makoto tamada'
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...
在2004年8月14日到2017年5月20日内有多少医生接诊了名叫柏梦竹的患者?
SELECT COUNT(txmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '柏梦竹' AND txmzjzjlb.JZKSRQ BETWEEN '2004-08-14' AND '2017-05-20' UNION SELECT COUNT(ft...
css
CREATE TABLE table_68847 ( "Round" real, "Name" text, "Position" text, "School" text, "Signed" text )
what is the position for robert johnson?
SELECT "Position" FROM table_68847 WHERE "Name" = 'robert johnson'
wikisql
CREATE TABLE table_29183 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 29 Aug" text )
How many times was tues 24 aug 19' 19.83 117.110mph?
SELECT COUNT("Rank") FROM table_29183 WHERE "Tues 24 Aug" = '19'' 19.83 117.110mph'
wikisql
CREATE TABLE table_2168295_1 ( headquarters VARCHAR, population__2011_ VARCHAR )
If the 2011 population is 3685681, what is the name of the headquarters?
SELECT headquarters FROM table_2168295_1 WHERE population__2011_ = 3685681
sql_create_context
CREATE TABLE table_78964 ( "Date" text, "Ship Name" text, "Tonnage" text, "Ship Type" text, "Location" text, "Disposition of Ship" text )
For the ship that was a brig and located in the English Channel, what was the disposition of ship?
SELECT "Disposition of Ship" FROM table_78964 WHERE "Ship Type" = 'brig' AND "Location" = 'english channel'
wikisql
CREATE TABLE table_22447 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How many draws occurred when 25 points were scored?
SELECT COUNT("Draws") FROM table_22447 WHERE "Scored" = '25'
wikisql
CREATE TABLE table_20466963_9 ( guest_3 VARCHAR, guest_1 VARCHAR )
On episodes where guest 1 is Jim White, who was guest 3?
SELECT guest_3 FROM table_20466963_9 WHERE guest_1 = "Jim White"
sql_create_context
CREATE TABLE table_204_257 ( id number, "ethnicity" text, "1926 census" text, "1939 census" text, "1959 census" text, "1970 census" text, "1979 census" text, "1989 census" text, "2007 estimate" text )
how many russians lived in south ossetia in 1970 ?
SELECT "1970 census" FROM table_204_257 WHERE "ethnicity" = 'russians'
squall
CREATE TABLE table_name_62 ( release_date VARCHAR, model_number VARCHAR )
What is the Release Date for Model Number c7 1.8?
SELECT release_date FROM table_name_62 WHERE model_number = "c7 1.8"
sql_create_context
CREATE TABLE table_47218 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What is the report corresponding to the game that had the Townsville Crocodiles as home team?
SELECT "Report" FROM table_47218 WHERE "Home team" = 'townsville crocodiles'
wikisql
CREATE TABLE table_204_312 ( id number, "stage" text, "date" text, "route" text, "terrain" text, "length" text, "winner" text )
how many number of stages in the tour de france contain stages with mountains ?
SELECT COUNT("stage") FROM table_204_312 WHERE "terrain" = 'stage with mountain(s)'
squall
CREATE TABLE store ( store_id number, manager_staff_id number, address_id number, last_update time ) CREATE TABLE film_text ( film_id number, title text, description text ) CREATE TABLE film_category ( film_id number, category_id number, last_update time ) CREATE TABLE film_ac...
What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?
SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01')
spider
CREATE TABLE procedures_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, ...
when is the first procedure time of patient 74624 in 2105?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74624) AND STRFTIME('%y', procedures_icd.charttime) = '2105' ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(5...
Show the number of apartment bookings in each weekday and bin booking start date by weekday with a bar chart, show how many booking start date in ascending order.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_204_157 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text )
what is the combined result on 9/28 ?
SELECT "result" FROM table_204_157 WHERE "date" = '09/28/1946'
squall
CREATE TABLE table_28764 ( "Dist." real, "Democratic Coalition" text, "Alliance" text, "Together We Can Do More" text, "Independent Regional Force" text, "Independents" text )
Who is the independent regional force when democratic coalition is (r) jorge tarud ( ppd )?
SELECT "Independent Regional Force" FROM table_28764 WHERE "Democratic Coalition" = '(R) Jorge Tarud ( PPD )'
wikisql
CREATE TABLE table_name_48 ( record VARCHAR, attendance VARCHAR )
What was the record at the game attended by 10,389?
SELECT record FROM table_name_48 WHERE attendance = "10,389"
sql_create_context
CREATE TABLE table_15823 ( "District" text, "Counties Represented" text, "Party" text, "First Elected" real, "Committee" text )
What is the Highest first elected year that has a district of 06.0 6, and a committee of economic matters?
SELECT MAX("First Elected") FROM table_15823 WHERE "District" = '06.0 6' AND "Committee" = 'economic matters'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
What is the minimum days of hospital stay of patients whose age is equal or more than 41 years?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41"
mimicsql_data
CREATE TABLE table_name_83 ( louise VARCHAR, dainty_june VARCHAR )
Who was Louise when Tracy Venner was Dainty June?
SELECT louise FROM table_name_83 WHERE dainty_june = "tracy venner"
sql_create_context
CREATE TABLE table_name_14 ( listed VARCHAR, county VARCHAR )
when was the site listed when the county is cochise?
SELECT listed FROM table_name_14 WHERE county = "cochise"
sql_create_context
CREATE TABLE table_61324 ( "Episode" text, "18-49" text, "Viewers (m)" real, "Rating" text, "Share" text )
What Episode has a Rating of 1.8, and Viewers (m) smaller than 2.73?
SELECT "Episode" FROM table_61324 WHERE "Rating" = '1.8' AND "Viewers (m)" < '2.73'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在医院1027298的医疗记录中显示出院诊断出号码J20.239疾病的人的最低和最高医疗费合计金额是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1027298' AND t_kc24.t_kc21_OUT_DIAG_DIS_CD = 'J20.239')
css
CREATE TABLE table_name_51 ( tournament VARCHAR )
Which 2009 tournament was french open?
SELECT 2009 FROM table_name_51 WHERE tournament = "french open"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Count the number of people of each sex who have a weight higher than 85, and display x-axis from high to low order.
SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_53105 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What date was the Tyre d and Bruce Mclaren won?
SELECT "Date" FROM table_53105 WHERE "Tyre" = 'd' AND "Winning driver" = 'bruce mclaren'
wikisql
CREATE TABLE royal_family ( royal_family_id number, royal_family_details text ) CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE ref_hotel_star_ratings ( star_rating_code text, star_rating_description text ) CREATE TABLE theme_parks ( theme_park_id number, ...
Find the names and descriptions of the photos taken at the tourist attraction called 'film festival'.
SELECT T1.name, T1.description FROM photos AS T1 JOIN tourist_attractions AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id WHERE T2.name = "film festival"
spider
CREATE TABLE table_name_60 ( week_2 VARCHAR, week_3 VARCHAR )
What was the week 2 prior to the when Brittany Alyse was week 3?
SELECT week_2 FROM table_name_60 WHERE week_3 = "brittany alyse"
sql_create_context
CREATE TABLE table_49509 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
What was the average amount of losses for teams with played less than 14?
SELECT AVG("Lost") FROM table_49509 WHERE "Played" < '14'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
Find questions with a lower-case first character in the title.
SELECT Title, CONCAT('https://electronics.stackexchange.com/questions/', CAST(Id AS TEXT), '/') AS URL FROM Posts WHERE PostTypeId = 1 AND LEFT(Title, 1) = LOWER(LEFT(Title, 1)) ORDER BY CreationDate DESC
sede
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Bar chart x axis meter 500 y axis meter_100, sort y axis in desc order.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
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...
how many patients are diagnosed with primary disease coronary artery disease or coronary artery bypass graft myomectomy/sda and tested with blood in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Blood"
mimicsql_data
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND ...
css
CREATE TABLE table_25800134_12 ( director VARCHAR, airdate VARCHAR )
Who directed the episode that aired on September 25, 1967?
SELECT director FROM table_25800134_12 WHERE airdate = "September 25, 1967"
sql_create_context
CREATE TABLE table_name_47 ( location VARCHAR, circuit VARCHAR, race VARCHAR )
what is the location when the circuit is lowood circuit and the race is lowood trophy?
SELECT location FROM table_name_47 WHERE circuit = "lowood circuit" AND race = "lowood trophy"
sql_create_context
CREATE TABLE table_train_124 ( "id" int, "loss_of_consciousness" bool, "serum_glucose" bool, "myelosuppression" bool, "retinoids_hepatotoxic" bool, "pulmonary_disease" bool, "etiology" bool, "abnormal_thyroid_function" bool, "laboratory_abnormality" bool, "chest_pain" bool, "...
evidence of any significant clinical disorder or laboratory finding that renders the participant unsuitable for receiving an investigational new drug including clinically significant or unstable hematologic, hepatic, cardiovascular ( including history of ventricular fibrillation or ventricular tachycardia ) , pulmonary...
SELECT * FROM table_train_124 WHERE clinical_disorder = 1 OR (investigational_new_drug = 1 OR hematologic_disease = 1 OR hepatic_disease = 1 OR (cardiovascular_disease = 1 OR ventricular_fibrillation = 1 OR ventricular_tachycardia = 1) OR pulmonary_disease = 1 OR gastrointestinal_disease = 1 OR endocrine_disease = 1 OR...
criteria2sql
CREATE TABLE table_204_940 ( id number, "year" number, "tournaments\nplayed" number, "cuts\nmade" number, "wins" number, "2nd" number, "3rd" number, "top 10s" number, "best\nfinish" text, "earnings\n(\u20ac)" number, "money\nlist rank" number, "scoring\naverage" number, ...
what was the first year where this golfer scored in the top 10 ?
SELECT MIN("year") FROM table_204_940 WHERE "top 10s" > 0
squall
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Year on year growth by month for a tag.
SELECT ((YEAR(CURRENT_TIMESTAMP()) - YEAR(P.CreationDate)) * 12 + MONTH(CURRENT_TIMESTAMP()) - MONTH(P.CreationDate)) AS monthsAgo, COUNT(*) FROM Posts AS P INNER JOIN PostTags AS PT ON P.Id = PT.PostId INNER JOIN Tags AS T ON PT.TagId = T.Id WHERE ((YEAR(CURRENT_TIMESTAMP()) - YEAR(P.CreationDate)) * 12 + MONTH(CURREN...
sede
CREATE TABLE table_28884858_2 ( capacity_percentage VARCHAR, average_attendance VARCHAR )
What was the capacity percentage when attendance was 71080?
SELECT capacity_percentage FROM table_28884858_2 WHERE average_attendance = 71080
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...
列出患者赵宏义的所有检验结果指标记录在2014-02-10到2019-02-10内的检测人为56821852的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
Beginning next semester ; which classes will be taught by Dr. Giorgio Bertellini ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Giorgio Bertellini%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructo...
advising
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 demographic ( subject_id text, hadm_id t...
count the number of patients whose diagnoses short title is physical restrain status and drug type is base?
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 = "Physical restrain status" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_43 ( tournament VARCHAR )
What shows for 1992 when 1988 is A, at the Australian Open?
SELECT 1992 FROM table_name_43 WHERE 1988 = "a" AND tournament = "australian open"
sql_create_context
CREATE TABLE table_name_77 ( year VARCHAR, engine VARCHAR )
What year engine does a ferrari v6 have?
SELECT year FROM table_name_77 WHERE engine = "ferrari v6"
sql_create_context
CREATE TABLE table_name_32 ( lane INTEGER, time VARCHAR, rank VARCHAR )
How many lanes have a Time of 53.61, and a Rank larger than 3?
SELECT SUM(lane) FROM table_name_32 WHERE time = 53.61 AND rank > 3
sql_create_context
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
Bin the installation date into the day of week interval, and then you can draw a bar chart to tell me how many stations each year, and list Y in desc order.
SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_date) DESC
nvbench
CREATE TABLE table_name_52 ( icao VARCHAR, airport VARCHAR )
What is the ICAO for the Yangon International Airport?
SELECT icao FROM table_name_52 WHERE airport = "yangon international airport"
sql_create_context
CREATE TABLE table_5533 ( "Appearances" real, "Team" text, "Wins" real, "Losses" real, "Win %" real )
What's the total number of Win % with an Appearances of 4, and Losses that's larger than 3?
SELECT COUNT("Win %") FROM table_5533 WHERE "Appearances" = '4' AND "Losses" > '3'
wikisql
CREATE TABLE table_name_88 ( name VARCHAR, term_end VARCHAR )
Which Name has a Term end of 18 july 1944?
SELECT name FROM table_name_88 WHERE term_end = "18 july 1944"
sql_create_context
CREATE TABLE table_68072 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
Name the division record for riders
SELECT "Division Record" FROM table_68072 WHERE "Team" = 'riders'
wikisql
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Dat...
Return a bar chart to show how many documents for different budget type code, I want to list from high to low by the bars.
SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code ORDER BY T1.Budget_Type_Code DESC
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
Users with the most Favorites.
SELECT U.Id AS "user_link", (SELECT COUNT(V.Id) AS "favorites" FROM Votes AS V, VoteTypes AS Vt WHERE Vt.Id = V.VoteTypeId AND U.Id = V.UserId AND Vt.Id = 5) AS "favs" FROM Users AS U WHERE (SELECT COUNT(V.Id) AS "favorites" FROM Votes AS V, VoteTypes AS Vt WHERE Vt.Id = V.VoteTypeId AND U.Id = V.UserId AND Vt.Id = 5) ...
sede
CREATE TABLE table_62247 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is Home Team, when Tie no is '27'?
SELECT "Home team" FROM table_62247 WHERE "Tie no" = '27'
wikisql
CREATE TABLE table_68485 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" real, "Investing Dragon(s)" text )
Name the investing dragon for razzamataz
SELECT "Investing Dragon(s)" FROM table_68485 WHERE "Company or product name" = 'razzamataz'
wikisql
CREATE TABLE table_14342592_7 ( points VARCHAR, position VARCHAR )
How many points did the player who was right guard score?
SELECT COUNT(points) FROM table_14342592_7 WHERE position = "Right guard"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Bar chart of all_games_percent from each all road, and show in asc by the Y.
SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
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 procedures ( ...
what is admission time of subject name jerry deberry?
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_29989 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
How many values are displayed under pick for Vlastimil Kroupa?
SELECT COUNT("Pick") FROM table_29989 WHERE "Player" = 'Vlastimil Kroupa'
wikisql
CREATE TABLE table_name_5 ( score INTEGER, to_par VARCHAR, country VARCHAR )
What is the low score for TO par +2 in japan?
SELECT MIN(score) FROM table_name_5 WHERE to_par = "+2" AND country = "japan"
sql_create_context
CREATE TABLE table_18690 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
To which party does Riley Joseph Wilson belong?
SELECT "Party" FROM table_18690 WHERE "Incumbent" = 'Riley Joseph Wilson'
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 job_history ( EMPLOYEE_ID decimal(6,0...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_67 ( score VARCHAR, tie_no VARCHAR )
What is Score, when Tie No is '109'?
SELECT score FROM table_name_67 WHERE tie_no = "109"
sql_create_context
CREATE TABLE table_name_14 ( result VARCHAR, week VARCHAR )
Name the result for week 7
SELECT result FROM table_name_14 WHERE week = 7
sql_create_context
CREATE TABLE Reviewer ( rID VARCHAR, name VARCHAR )
What is the reviewer id of Daniel Lewis?
SELECT rID FROM Reviewer WHERE name = "Daniel Lewis"
sql_create_context
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 )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of code , and group by attribute name, and display y-axis in ascending order.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Limiting Posts by Date and Rep, Parameterized (Tutorial).
SELECT p.Title, p.Id, u.DisplayName, u.Reputation FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.CreationDate BETWEEN '##StartDate:string##' AND '##EndDate:string##' AND p.PostTypeId = 1 AND u.Reputation < '##MaxReputation:int##'
sede
CREATE TABLE table_1099080_1 ( bleeding_time VARCHAR, partial_thromboplastin_time VARCHAR, platelet_count VARCHAR )
What were the bleeding times when both the platelet count was unaffected and the partial thromboplastin time was unaffected
SELECT bleeding_time FROM table_1099080_1 WHERE partial_thromboplastin_time = "Unaffected" AND platelet_count = "Unaffected"
sql_create_context
CREATE TABLE table_24346 ( "Team #1" text, "Agg. score" text, "Team #2" text, "1st leg" text, "2nd leg" text )
which team #1 played again chalkida
SELECT "Team #1" FROM table_24346 WHERE "Team #2" = 'Chalkida'
wikisql
CREATE TABLE table_37840 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text )
What is the try bonus that has llangefni rfc as the club?
SELECT "Try bonus" FROM table_37840 WHERE "Club" = 'llangefni rfc'
wikisql
CREATE TABLE table_15187735_4 ( episode INTEGER, segment_d VARCHAR )
What is the last episode which has segment d as blown glass?
SELECT MAX(episode) FROM table_15187735_4 WHERE segment_d = "Blown Glass"
sql_create_context
CREATE TABLE table_name_73 ( catalog INTEGER, date VARCHAR )
Which Catalog has a Date of july 15, 2011?
SELECT AVG(catalog) FROM table_name_73 WHERE date = "july 15, 2011"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number by a bar chart, list y-axis in desc order.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC
nvbench
CREATE TABLE table_name_71 ( overall VARCHAR, plyff VARCHAR, away VARCHAR )
Which Overall has a playoff record of (0-1) and an away record of (1-1)?
SELECT overall FROM table_name_71 WHERE plyff = "(0-1)" AND away = "(1-1)"
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...
医疗就诊73259917842中药品0958的医疗机构三大目录编码及名称分别是什么?
SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '73259917842' AND t_kc22.SOC_SRT_DIRE_CD = '0958'
css
CREATE TABLE table_639 ( "W.H. Archer" text, "J.E. Armstrong" text, "H.L. Birkett" text, "F.A. Brill" text, "H.T. Brewer" text )
Who is h.t. brewer when je armstrong is c.p. greeks?
SELECT "H.T. Brewer" FROM table_639 WHERE "J.E. Armstrong" = 'C.P. Greeks'
wikisql
CREATE TABLE table_2468961_4 ( written_by VARCHAR, original_air_date VARCHAR )
Who wrote the episode that originally aired April 29, 1994?
SELECT written_by FROM table_2468961_4 WHERE original_air_date = "April 29, 1994"
sql_create_context
CREATE TABLE table_26240481_1 ( opponents_conference VARCHAR, result VARCHAR )
Which opponents conference has the result L, 62-10?
SELECT opponents_conference FROM table_26240481_1 WHERE result = "L, 62-10"
sql_create_context
CREATE TABLE table_train_179 ( "id" int, "systolic_blood_pressure_sbp" int, "fasting_plasma_glucose_fpg" float, "diastolic_blood_pressure_dbp" int, "diabetes" bool, "body_mass_index_bmi" float, "triglyceride_tg" float, "hypertension" bool, "age" float, "NOUSE" float )
elevated triglyceride level > 150 mg / dl
SELECT * FROM table_train_179 WHERE triglyceride_tg > 150
criteria2sql
CREATE TABLE table_73898 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
which institutions can be categorized as private/united church of christ?
SELECT "Institution" FROM table_73898 WHERE "Type" = 'Private/United Church of Christ'
wikisql