context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_17660 ( "Strongs #" text, "Hebrew word" text, "Strongs Transliteration" text, "Strongs Words Compounded" text, "English Spelling" text )
What is the English spelling of the strongs transliteration: 'adoniyah?
SELECT "English Spelling" FROM table_17660 WHERE "Strongs Transliteration" = 'Adoniyah'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose age is less than 67?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "67"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
since 5 years ago, how many patients were prescribed with aspart insulin in the same hospital visit after having received valve replacement or repair?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'valve replacement or repair' AND DATETIME(treatment.treatmenttime) >= DAT...
eicu
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
what was the daily maximum amount of foley given to patient 53176 since 12/28/2105?
SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53176)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fol...
mimic_iii
CREATE TABLE table_23399 ( "No. in series" text, "No. in season" real, "Family/families" text, "Location(s)" text, "Original air date" text )
What episode in the series was the Amaral family featured?
SELECT "No. in series" FROM table_23399 WHERE "Family/families" = 'The Amaral Family'
wikisql
CREATE TABLE mill ( type VARCHAR, architect_id VARCHAR ) CREATE TABLE architect ( Id VARCHAR )
What are the distinct types of mills that are built by American or Canadian architects?
SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.Id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian'
sql_create_context
CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id...
Show me about the distribution of other_details and the average of monthly_rental , and group by attribute other_details in a bar chart.
SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real )
Plot how many party by grouped by party as a bar graph
SELECT Party, COUNT(Party) FROM representative GROUP BY Party
nvbench
CREATE TABLE table_name_81 ( home_town VARCHAR, year VARCHAR, height VARCHAR )
What is the Home Town with a Year of freshman, and a Height with 6 6?
SELECT home_town FROM table_name_81 WHERE year = "freshman" AND height = "6–6"
sql_create_context
CREATE TABLE table_203_461 ( id number, "dvd title" text, "discs" number, "year" text, "no. of ep." number, "dvd release\nregion 2" text, "dvd release\nregion 4" text )
how many series had 8 episodes ?
SELECT COUNT("dvd title") FROM table_203_461 WHERE "no. of ep." = 8
squall
CREATE TABLE table_27987623_3 ( timeslot VARCHAR, viewers__millions_ VARCHAR )
How many timeslots had viewers of 0.238 million?
SELECT COUNT(timeslot) FROM table_27987623_3 WHERE viewers__millions_ = "0.238"
sql_create_context
CREATE TABLE table_79328 ( "Country" text, "Human development (2012) HDI" real, "GDP (PPP) (2012) US$ per capita" text, "Real GDP growth (2011) %" text, "Income inequality (2011) Gini" text, "Poverty (2009) HPI-1 %" real, "Extreme poverty (2011) <1.25 US$ %" text, "Literacy (2010) %" rea...
What is the sum of poverty (2009) HPI-1 % when the GDP (PPP) (2012) US$ per capita of 11,284?
SELECT COUNT("Poverty (2009) HPI-1 %") FROM table_79328 WHERE "GDP (PPP) (2012) US$ per capita" = '11,284'
wikisql
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 ...
这个名叫的冯晓霜的患者被门诊诊断为妊娠合并精神障碍,看一下他总蛋白的检测结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE table_8555 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Assists" real )
What's the largest amount of assists juan ignacio s nchez ever had?
SELECT MAX("Assists") FROM table_8555 WHERE "Name" = 'juan ignacio sánchez'
wikisql
CREATE TABLE table_name_93 ( album VARCHAR, year VARCHAR, title VARCHAR )
What album came out before 2008 called We're not Made in the USA?
SELECT album FROM table_name_93 WHERE year < 2008 AND title = "we're not made in the usa"
sql_create_context
CREATE TABLE table_27228 ( "Season" text, "Date" text, "Home team" text, "Result" text, "Away team" text, "Stadium" text )
Who as the home team for game on 5 october 2011?
SELECT "Home team" FROM table_27228 WHERE "Date" = '5 October 2011'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( r...
retrieve the patient identifications of patients that were diagnosed with long-term use anticoagul during the previous year.
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use anticoagul') AND DATETIME(diagnoses_icd.charttime, 'start of...
mimic_iii
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 demographic ...
give me the number of patients born before 2041 who left against medical advice.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2041"
mimicsql_data
CREATE TABLE table_204_448 ( id number, "team" text, "winners" number, "runners-up" number, "years won" text, "years runner-up" text )
which team has the most wins ?
SELECT "team" FROM table_204_448 ORDER BY "winners" DESC LIMIT 1
squall
CREATE TABLE table_name_67 ( location VARCHAR, record VARCHAR )
What is the location for the 23-17 record?
SELECT location FROM table_name_67 WHERE record = "23-17"
sql_create_context
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...
count the number of patients whose primary disease is rash and age is less than 43?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.age < "43"
mimicsql_data
CREATE TABLE table_7527 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2010\u201311" text )
What in 2006 07 has a 2007 08 of q?
SELECT "2006\u201307" FROM table_7527 WHERE "2007\u201308" = 'q'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what is the daily average value of patient 002-11679's weight?
SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-11679') AND NOT patient.admissionweight IS NULL GROUP BY STRFTIME('%y-%m-%d', patient.unitadmittime)
eicu
CREATE TABLE table_26679 ( "Region/Country" text, "Local name" text, "Main presenter" text, "Network" text, "Year premiered" real )
Who is every main presenter for the Estonia region/country?
SELECT "Main presenter" FROM table_26679 WHERE "Region/Country" = 'Estonia'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TAB...
Selects answers with score 0 from users with <50 score. (Helps to find answers to upvote :) ).
SELECT Posts.Body, Posts.Id, Posts.ParentId, Users.DisplayName, Users.Id, Users.Reputation FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 2 AND Posts.Score = 0 AND Users.Reputation < 50 ORDER BY Posts.CreationDate DESC
sede
CREATE TABLE table_44223 ( "Episode" real, "Title" text, "Writer" text, "Director" text, "Original Airdate" text )
Which Director has an Episode of 13?
SELECT "Director" FROM table_44223 WHERE "Episode" = '13'
wikisql
CREATE TABLE table_35346 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
How many Picks have a Position of defensive end, and an Overall smaller than 33?
SELECT COUNT("Pick #") FROM table_35346 WHERE "Position" = 'defensive end' AND "Overall" < '33'
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...
在医院7485822患者云曼冬入院诊断疾病名称包含楔状缺损的是什么医疗就诊记录编号?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '云曼冬' AND gwyjzb.MED_SER_ORG_NO = '7485822' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%楔状缺损%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '云曼冬' AND fgwyjzb.MED_SER_ORG_NO = '7485822' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%楔状缺损%'
css
CREATE TABLE table_39950 ( "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the highest draw against 2161?
SELECT MAX("Draws") FROM table_39950 WHERE "Against" > '2161'
wikisql
CREATE TABLE table_name_54 ( team VARCHAR, inn VARCHAR )
What team had the record asscoiated with the 9th inning?
SELECT team FROM table_name_54 WHERE inn = "9th"
sql_create_context
CREATE TABLE table_name_81 ( date VARCHAR, venue VARCHAR )
If the Venue is brunswick street oval, what date was the game played ?
SELECT date FROM table_name_81 WHERE venue = "brunswick street oval"
sql_create_context
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 whose ethnicity is hispanic or latino and age is less than 20?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.age < "20"
mimicsql_data
CREATE TABLE table_18089 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Originalairdate" text, "Repeatairdate(s)" text, "Prod.Code" text )
What is the repeat date of the episode that aired 22/12/1968?
SELECT "Repeatairdate(s)" FROM table_18089 WHERE "Originalairdate" = '22/12/1968'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
what flights from LOS ANGELES to MINNEAPOLIS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LOS ANGELES' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MI...
atis
CREATE TABLE table_26464364_1 ( us_air_date VARCHAR, _number VARCHAR )
On which date did episode # 18 air in the U.S.?
SELECT us_air_date FROM table_26464364_1 WHERE _number = 18
sql_create_context
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
where are some good places for arabic on buchanan in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_name_38 ( points VARCHAR, goals VARCHAR, games VARCHAR )
What are the points in the season with 47 games and 28 goals?
SELECT points FROM table_name_38 WHERE goals = "28" AND games = "47"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
when was patient 013-27480 first prescribed a drug via subcutan in 05/this year?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480')) AND medication.routeadmin = 'subcutan' AND DATETI...
eicu
CREATE TABLE zyjybgb ( 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, ...
90835300患者被门诊诊断为急性精神分裂症样精神病性障碍,查看检测中三碘甲状腺原氨酸的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
CREATE TABLE film ( title VARCHAR, rental_rate VARCHAR )
Which film has the highest rental rate? And what is the rate?
SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_18 ( score VARCHAR, surface VARCHAR, tournament VARCHAR )
what is the score when the surface is clay and the tournament is san marino?
SELECT score FROM table_name_18 WHERE surface = "clay" AND tournament = "san marino"
sql_create_context
CREATE TABLE table_name_83 ( gold INTEGER, silver VARCHAR, bronze VARCHAR )
What is the highest number of gold medals won by a team that won fewer than 2 silver and fewer than 4 bronze medals?
SELECT MAX(gold) FROM table_name_83 WHERE silver < 2 AND bronze < 4
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...
患者戚绮玉被开出的药品都不高出4979.12元在哪几次医疗记录中?医疗就诊序列号分别都是多少?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '戚绮玉' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 4979.12) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '戚绮玉' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FRO...
css
CREATE TABLE table_name_44 ( college VARCHAR, pick__number VARCHAR )
What college is pick number 268 from?
SELECT college FROM table_name_44 WHERE pick__number = "268"
sql_create_context
CREATE TABLE table_10935548_1 ( title VARCHAR, us_viewers__millions_ VARCHAR )
Which episode had 16.38 million U.S. viewers?
SELECT title FROM table_10935548_1 WHERE us_viewers__millions_ = "16.38"
sql_create_context
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ...
Show the number of debates for each person on the negative side in a bar chart, ordered in ascending alphabetical order of name.
SELECT Name, COUNT(Name) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID GROUP BY Name ORDER BY T3.Name
nvbench
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
How many cities are in counties that have populations of over 20000?
SELECT COUNT(*) FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE population > 20000)
spider
CREATE TABLE table_64585 ( "Tournament" text, "2000" text, "1999" text, "1998" text, "1997" text, "1996" text, "1995" text, "1994" text, "1993" text, "1992" text, "1991" text )
What is the 1994 when QF is 1999?
SELECT "1994" FROM table_64585 WHERE "1999" = 'qf'
wikisql
CREATE TABLE table_19072602_3 ( team_europe VARCHAR, team_usa VARCHAR )
When chris barnes is on team usa how many europe teams are there?
SELECT COUNT(team_europe) FROM table_19072602_3 WHERE team_usa = "Chris Barnes"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Draw a bar chart about the distribution of All_Road and ACC_Percent , I want to list total number in ascending order please.
SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_46497 ( "Railway" text, "Builder" text, "Built" real, "Wheels" text, "Location" text, "ObjectNumber" text )
Which Built has a Builder of brel crewe?
SELECT AVG("Built") FROM table_46497 WHERE "Builder" = 'brel crewe'
wikisql
CREATE TABLE table_203_339 ( id number, "year" text, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text )
how many total laps have been driven in the indy 500 ?
SELECT SUM("laps") FROM table_203_339
squall
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
2012年9月30日到2012年12月13日,编号为2529055的医院有多少科室涉及的医疗费总额不低于2796.97元
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD 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.MED_SER_ORG_NO = '2529055' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-09-30' AND '2012-12-13' GROUP B...
css
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
Score history graph of a post. The vote timestamps are estimated by level distributing their time in the day (they are estimated to 12:00:00 if it was a single vote on that day).
WITH Raw AS (SELECT CreationDate, RANK() OVER (PARTITION BY CreationDate ORDER BY Id) AS DayNo, COUNT(*) OVER (PARTITION BY CreationDate) AS DayCount, VoteTypeId FROM Votes WHERE VoteTypeId BETWEEN 2 AND 3 AND PostId = '##PostId:int##') SELECT DATE(CreationDate, '86400.0 / (DayCount + 1) * DayNo s') AS EstCrDate, SUM(5...
sede
CREATE TABLE table_66510 ( "Medal" text, "Name" text, "Sport" text, "Event" text, "Date" text )
What sport did Miroslav Jambor Richard Csejtey participate in?
SELECT "Sport" FROM table_66510 WHERE "Name" = 'miroslav jambor richard csejtey'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId...
Total score and number of questions/answers by tag.
SELECT TagName, COUNT(DISTINCT Posts.Id) AS "Number of questions", (SELECT SUM(Score) FROM Tags AS TagsI INNER JOIN PostTags ON PostTags.TagId = TagsI.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE TagsI.TagName = TagsO.TagName) AS "Total score of all questions", COUNT(Answers.Id) AS "Number of answers", SUM(A...
sede
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 maximum age of patients whose marital status is married and admission year is greater than or equal to 2184?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2184"
mimicsql_data
CREATE TABLE table_60194 ( "Election" text, "First member" text, "1st Party" text, "Second member" text, "2nd Party" text )
What is Second Member, when Election is '1835'?
SELECT "Second member" FROM table_60194 WHERE "Election" = '1835'
wikisql
CREATE TABLE table_6603 ( "Year" real, "Team" text, "Progress" text, "Score" text, "Opponents" text )
What was the score in 1997 for the team that has a Progress of no entrants?
SELECT "Score" FROM table_6603 WHERE "Progress" = 'no entrants' AND "Year" = '1997'
wikisql
CREATE TABLE table_13700749_1 ( language_s_ VARCHAR, film_title VARCHAR )
What are all the languages for tsotsi?
SELECT language_s_ FROM table_13700749_1 WHERE film_title = "Tsotsi"
sql_create_context
CREATE TABLE table_73035 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
What was the county with a latitude of 46.770977?
SELECT "County" FROM table_73035 WHERE "Latitude" = '46.770977'
wikisql
CREATE TABLE zyjybgb ( 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, ...
门诊诊断病患吴嘉祥为急性胃肠炎的检测指标101818的结果定量是多少和单位是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
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 outputevents ( row_id number, subject_id number, ...
did patient 12938 visit the hospital since 5 years ago?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 12938 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year')
mimic_iii
CREATE TABLE table_42033 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text )
Which Venue has a Notes of 2:28:31?
SELECT "Venue" FROM table_42033 WHERE "Notes" = '2:28:31'
wikisql
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?
SELECT T1.name, T1.age, T1.job FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(year) FROM personfriend WHERE friend = 'Alice')
spider
CREATE TABLE table_name_66 ( away_team VARCHAR )
What was North Melbourne's score as an away team?
SELECT away_team AS score FROM table_name_66 WHERE away_team = "north melbourne"
sql_create_context
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
Can you draw the trend of salary over the hire date?
SELECT HIRE_DATE, SALARY FROM employees
nvbench
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), co...
Show me a bar chart for what is the average song rating for each language?
SELECT languages, AVG(rating) FROM song GROUP BY languages
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event...
so whats the last weight of patient 7112 in 12/this year?
SELECT 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 = 7112)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ...
mimic_iii
CREATE TABLE table_72413 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What party did the incumbent from the Arkansas 5 district belong to?
SELECT "Party" FROM table_72413 WHERE "District" = 'Arkansas 5'
wikisql
CREATE TABLE table_40391 ( "School year" text, "95-96" text, "99-00" text, "00-01" text, "01-02" text, "02-03" text, "03-04" text, "04-05" text, "05-06" text, "06-07" text )
What is 04-05, when 05-06 is 205,189?
SELECT "04-05" FROM table_40391 WHERE "05-06" = '205,189'
wikisql
CREATE TABLE table_22810095_9 ( name VARCHAR, age VARCHAR )
What player is 24 years old?
SELECT name FROM table_22810095_9 WHERE age = 24
sql_create_context
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...
3169312这个医疗机构在零一年八月二十日到二零年六月四日期间看过的转诊门诊记录有多少
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '3169312' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-08-20' AND '2020-06-04' AND wdmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '3169312' AND bdmzjzjlb.JZKSRQ BETWEEN '2001-08-20' AND '2020-06-04' AND bdmzjzjlb.ZZBZ > 0
css
CREATE TABLE table_name_55 ( caps INTEGER, position VARCHAR, club_province VARCHAR )
What is the high cap total for a lock with the vicenza rangers?
SELECT MAX(caps) FROM table_name_55 WHERE position = "lock" AND club_province = "vicenza rangers"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患有沙眼的患者在门诊诊断的甘油三酯数值的平均值以及最值各是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '沙眼' AND jyjgzbb.JCZBMC = '甘油三酯'...
css
CREATE TABLE table_57723 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text, "Attendance" real, "Record" text )
WHICH Attendance that has a Loss of paniagua (3 3)?
SELECT MAX("Attendance") FROM table_57723 WHERE "Loss" = 'paniagua (3–3)'
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...
零八年的二月二十七号到二一年九月三号这段时间里医疗机构7969204患者是未就业人员的就诊记录数
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7969204' AND IN_HOSP_DATE BETWEEN '2008-02-27' AND '2021-09-03' AND INSURED_STS = '未就业'
css
CREATE TABLE table_61567 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "2012 club" text )
Name the Weight which has a Name of bal zs h rai category:articles with hcards?
SELECT "Weight" FROM table_61567 WHERE "Name" = 'balázs hárai category:articles with hcards'
wikisql
CREATE TABLE table_28592 ( "Engine Family" text, "Cylinder Layout" text, "Displacement(s)" text, "Injection type" text, "Years produced" text )
Where the displacement(s) is 10.5L is, what is the engine family?
SELECT "Engine Family" FROM table_28592 WHERE "Displacement(s)" = '10.5L'
wikisql
CREATE TABLE table_14357 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
Which lane ranked less than 4 for the Netherlands?
SELECT "Lane" FROM table_14357 WHERE "Rank" < '4' AND "Nationality" = 'netherlands'
wikisql
CREATE TABLE table_name_70 ( date VARCHAR, attendance VARCHAR )
What was the date of the game attended by 25,022?
SELECT date FROM table_name_70 WHERE attendance = "25,022"
sql_create_context
CREATE TABLE table_63640 ( "World record" text, "Snatch" text, "Shi Zhiyong ( CHN )" text, "153kg" text, "Izmir , Turkey" text )
Who has the world record of 153kg in the clean & jerk?
SELECT "153kg" FROM table_63640 WHERE "World record" = 'clean & jerk'
wikisql
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, ...
hey what was the last calcium of patient 035-9193 until 04/2101?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-9193')) AND lab.labname = 'calcium' AND STRFTIME('%y-%m', lab.labresulttime) <= '21...
eicu
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...
find the number of patients who stayed in hospital for more than 2 days and had ventriculopuncture through previously implanted catheter.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.long_title = "Ventriculopuncture through previously implanted catheter"
mimicsql_data
CREATE TABLE table_name_86 ( ngc_number VARCHAR, declination___j2000__ VARCHAR, constellation VARCHAR, object_type VARCHAR )
Name the total number of NGC number for sagittarius and diffuse nebula with declination of 02
SELECT COUNT(ngc_number) FROM table_name_86 WHERE constellation = "sagittarius" AND object_type = "diffuse nebula" AND declination___j2000__ = "°02′"
sql_create_context
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 patients are single and lab tested for potassium whole blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Potassium, Whole Blood"
mimicsql_data
CREATE TABLE table_26686908_2 ( production VARCHAR, championship VARCHAR, challenge VARCHAR )
Who handled production for the race when the championship went to david wall and challenge was jordan ormsby?
SELECT production FROM table_26686908_2 WHERE championship = "David Wall" AND challenge = "Jordan Ormsby"
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, ...
how many insertion of thoracostomy tube treatments were performed during the last year?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'insertion of thoracostomy tube' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
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...
67143371696医疗就诊的出院日期是哪一年几月几日
SELECT qtb.OUT_HOSP_DATE FROM qtb WHERE qtb.MED_CLINIC_ID = '67143371696' UNION SELECT gyb.OUT_HOSP_DATE FROM gyb WHERE gyb.MED_CLINIC_ID = '67143371696' UNION SELECT zyb.OUT_HOSP_DATE FROM zyb WHERE zyb.MED_CLINIC_ID = '67143371696' UNION SELECT mzb.OUT_HOSP_DATE FROM mzb WHERE mzb.MED_CLINIC_ID = '67143371696'
css
CREATE TABLE table_26841 ( "Series" real, "Season" real, "Original air date" text, "Production code" real, "Episode title" text )
What date did episode 115 in the series originally air?
SELECT "Original air date" FROM table_26841 WHERE "Series" = '115'
wikisql
CREATE TABLE table_name_13 ( location VARCHAR, method VARCHAR, round VARCHAR )
Where was the decision draw before round 5?
SELECT location FROM table_name_13 WHERE method = "decision draw" AND round < 5
sql_create_context
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) )
Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, 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_51837 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
WHAT WAS THE SCORE IN THE FINAL PLAYED AGAINST JOSE CHECA-CALVO IN THE SANT CUGAT TOURNAMENT ?
SELECT "Score" FROM table_51837 WHERE "Tournament" = 'sant cugat' AND "Opponent in the final" = 'jose checa-calvo'
wikisql
CREATE TABLE table_11764007_2 ( member VARCHAR, week_arrived_on_main_island VARCHAR )
How many members arrived on the main island in week 4?
SELECT COUNT(member) FROM table_11764007_2 WHERE week_arrived_on_main_island = "4"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Users who favorited a post.
SELECT U.Id AS "user_link" FROM Votes AS V INNER JOIN Posts AS P ON P.Id = V.PostId INNER JOIN Users AS U ON U.Id = V.UserId WHERE P.Id = '##PostId##' AND V.VoteTypeId = 5
sede
CREATE TABLE table_23394920_1 ( power_kw VARCHAR, callsign VARCHAR )
When dxzb-tv is the call sign what is the power kw?
SELECT power_kw FROM table_23394920_1 WHERE callsign = "DXZB-TV"
sql_create_context
CREATE TABLE table_18371 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the last year that someone is first elected?
SELECT MAX("First elected") FROM table_18371
wikisql
CREATE TABLE table_name_47 ( year INTEGER, result VARCHAR )
Name the average year for result of nominated
SELECT AVG(year) FROM table_name_47 WHERE result = "nominated"
sql_create_context
CREATE TABLE table_name_78 ( height_in_ft VARCHAR, years_for_rockets VARCHAR )
What is the Height for Years for Rockets of 2005-06?
SELECT height_in_ft FROM table_name_78 WHERE years_for_rockets = "2005-06"
sql_create_context
CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15...
Return a scatter chart about the correlation between CID and Credits .
SELECT CID, Credits FROM Course ORDER BY Credits
nvbench