context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_81 ( score VARCHAR, attendance VARCHAR, opponent VARCHAR )
What is the score when the attendance shows TBC, and Sidley United was the opponent?
SELECT score FROM table_name_81 WHERE attendance = "tbc" AND opponent = "sidley united"
sql_create_context
CREATE TABLE table_name_60 ( loss VARCHAR, score VARCHAR )
What's the Loss listed with a Score of 5-1?
SELECT loss FROM table_name_60 WHERE score = "5-1"
sql_create_context
CREATE TABLE table_69437 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average total with a Rank larger than 11, a Nation of switzerland, and a Silver smaller than 0?
SELECT AVG("Total") FROM table_69437 WHERE "Rank" > '11' AND "Nation" = 'switzerland' AND "Silver" < '0'
wikisql
CREATE TABLE table_name_9 ( exit_date VARCHAR, to_club VARCHAR )
What is the exit date of the player who transferred to Cardiff City?
SELECT exit_date FROM table_name_9 WHERE to_club = "cardiff city"
sql_create_context
CREATE TABLE table_62050 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Competition" text )
Which opponent has a result of 2-0 l?
SELECT "Opponent" FROM table_62050 WHERE "Result" = '2-0 l'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( ...
since 70 months ago, what was the daily minimum value of the wbc casts of patient 14458?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14458) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'wbc casts') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '...
mimic_iii
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...
在医院2706257病患75571942出院确诊疾病名称包含病的医疗有什么就诊记录编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75571942' AND t_kc21.MED_SER_ORG_NO = '2706257' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%病%'
css
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...
Return a bar chart about the distribution of All_Road and School_ID , and could you show x axis from high to low order?
SELECT All_Road, School_ID FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE table_name_99 ( area_km² VARCHAR, population VARCHAR )
What is the area km for a population of 99,685 (2008)?
SELECT area_km² FROM table_name_99 WHERE population = "99,685 (2008)"
sql_create_context
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 hz_info ( KH text, KLX number...
以往患者32467373有哪些门诊诊断还记得吗?
SELECT wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '32467373' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz...
css
CREATE TABLE table_name_49 ( player VARCHAR, events VARCHAR )
Which player competed in 12 events?
SELECT player FROM table_name_49 WHERE events = 12
sql_create_context
CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TAB...
What is the sport with the most scholarship students?
SELECT sportname FROM sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1
spider
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...
在01-07-22到19-03-08的就诊结算日期内,患者24293382所有医疗就诊记录的编号给列出来
SELECT MED_CLINIC_ID FROM t_kc24 WHERE PERSON_ID = '24293382' AND CLINIC_SLT_DATE BETWEEN '2001-07-22' AND '2019-03-08'
css
CREATE TABLE table_1015914_24 ( we_two VARCHAR, case_suffix VARCHAR )
What is we two when the case/suffix is loc.?
SELECT we_two FROM table_1015914_24 WHERE case_suffix = "loc."
sql_create_context
CREATE TABLE table_name_17 ( date VARCHAR, competition VARCHAR )
what is the date when the competition is 1998 asian games?
SELECT date FROM table_name_17 WHERE competition = "1998 asian games"
sql_create_context
CREATE TABLE table_47687 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who is the player from Spain that has a +2 to par?
SELECT "Player" FROM table_47687 WHERE "To par" = '+2' AND "Country" = 'spain'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
Frequency of anonymous suggested edits. Returns the cumulative number of suggested edits that were submitted by anonymous users over the past NumberOfEdits suggested edits. If the anonymous suggestion rate was constant at x%, then the graph would show a straight line at slope 100x (e.g. if all edit suggestions were ano...
SELECT 'post_link', Score, NumEdits FROM (SELECT p.Id AS "post_link", p.Score AS Score, COUNT(ph.UserId) AS NumEdits FROM Posts AS p, PostHistory AS ph WHERE p.Id = ph.PostId AND p.Score >= 100 AND ph.UserId != p.OwnerUserId GROUP BY p.Id, p.Score) AS Y WHERE NumEdits >= 10
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
how many asian ethnic background patients were born before the year 2152?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "2152"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients are discharged to snf and followed the procedure icd9 code 966?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "966"
mimicsql_data
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...
参保人86022614在二0一一年四月十九日到二0一二年三月一日内,在门诊产生了多少检查费
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '86022614' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2011-04-19' AND '2012-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_38 ( round INTEGER, school_club_team VARCHAR )
What is the highest round number for the player who came from team Missouri?
SELECT MAX(round) FROM table_name_38 WHERE school_club_team = "missouri"
sql_create_context
CREATE TABLE table_name_6 ( yr_plyf INTEGER, g_plyf VARCHAR, coach VARCHAR )
What is the sum of the yr plyf of coach ed robinson, who has a G plyf of 0?
SELECT SUM(yr_plyf) FROM table_name_6 WHERE g_plyf = 0 AND coach = "ed robinson"
sql_create_context
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...
19242256这个病人在哪几次医疗记录中被开出过的药品不少于3101.15元,医疗就诊编号是啥
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '19242256' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 3101.15)
css
CREATE TABLE table_name_24 ( record VARCHAR, score VARCHAR, game VARCHAR, points VARCHAR )
Which Record has a Game smaller than 19, and Points smaller than 19, and a Score of 4 6?
SELECT record FROM table_name_24 WHERE game < 19 AND points < 19 AND score = "4–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...
病人07564193之前做的检查有哪些
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '07564193' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_17 ( lead VARCHAR, city VARCHAR, third_vice_skip VARCHAR )
Which Lead has a City of winnipeg, and a Third/Vice skip of kevin park?
SELECT lead FROM table_name_17 WHERE city = "winnipeg" AND third_vice_skip = "kevin park"
sql_create_context
CREATE TABLE table_name_40 ( average INTEGER, tally VARCHAR, total VARCHAR )
Name the average with tally of 0-29 and total more than 29
SELECT AVG(average) FROM table_name_40 WHERE tally = "0-29" AND total > 29
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
what is patient 17638's first ward on the last hospital visit?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17638 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
Top 100 User in Faisalabad.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%faisalabad%' OR UPPER(Location) LIKE '%Faisalabad' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_name_45 ( team VARCHAR, year VARCHAR )
Which Team has a Year of 2000?
SELECT team FROM table_name_45 WHERE year = 2000
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how many hours have passed since patient 42473 was admitted for to the hospital?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 42473 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_47481 ( "Company name" text, "Hardware Model" text, "Accreditation type" text, "Accreditation level" text, "Date" text )
What is the accreditation level for the approved (awarded 05.12.12) date?
SELECT "Accreditation level" FROM table_47481 WHERE "Date" = 'approved (awarded 05.12.12)'
wikisql
CREATE TABLE table_12273 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What player had a total less than 277?
SELECT "Player" FROM table_12273 WHERE "Total" < '277'
wikisql
CREATE TABLE table_1020 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the least amount of points made by Herrnstein?
SELECT MIN("Points") FROM table_1020 WHERE "Player" = 'Herrnstein'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
did patient 52598 get a lab test since 4 years ago.
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52598) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_79429 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What country is ranked larger than 4?
SELECT "Country" FROM table_79429 WHERE "Rank" > '4'
wikisql
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
陶梦秋病人做的下肢各项指标的检验情况咋样
SELECT * 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 jybgb.YLJGDM = jy...
css
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...
找一找医疗费总费用与医疗就诊11812286713相同的人,在他们的医疗就诊记录中的ID、人员ID、人员姓名、公民身份号码、人员性别、人员年龄分别是啥?
SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE 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_kc24.MED_AMOUT = (SELECT t_kc24....
css
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
Give me the comparison about ID over the meter_700 by a bar chart.
SELECT meter_700, ID FROM swimmer
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 ( ...
how many patients with an emergency admission type had the diagnosis icd9 code 56210?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "56210"
mimicsql_data
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...
Finland users grouped by location.
SELECT Location, COUNT(*) AS amount FROM Users WHERE Location LIKE ('%Finland%') GROUP BY Location ORDER BY amount DESC
sede
CREATE TABLE table_7176 ( "Year" real, "League" text, "Average Attendance" real, "# of Home Games" real, "League Rank" text, "Canada - USA Rank" text )
Before 2012, what was the greatest # of Home Games with a Canada - USA Rank of 52nd, and an Average Attendance less than 992?
SELECT MAX("# of Home Games") FROM table_7176 WHERE "Year" < '2012' AND "Canada - USA Rank" = '52nd' AND "Average Attendance" < '992'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
09年10月8日到13年11月23日期间,患者84974890的369859指标是怎样的
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE market ( market_id number, district text, num_of_employees number, num_of_shops number, ranking number ) CREATE TABLE phone ( name text, phone_id number, memory_in_g number, carrier text, price number ) CREATE TABLE phone_market ( market_id number, phone_id...
Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.
SELECT T3.name, T2.district FROM phone_market AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id JOIN phone AS T3 ON T1.phone_id = T3.phone_id ORDER BY T2.ranking
spider
CREATE TABLE Documents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR )
List the document ids for any documents with the status code done and the type code paper.
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper"
sql_create_context
CREATE TABLE table_name_7 ( city_of_license VARCHAR, call_sign VARCHAR )
Name the city of license for call sign of k215es
SELECT city_of_license FROM table_name_7 WHERE call_sign = "k215es"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients were diagnosed with fall on stair/step nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Fall on stair/step NEC"
mimicsql_data
CREATE TABLE table_name_38 ( bronze INTEGER, nation VARCHAR, gold VARCHAR )
Which Bronze is the lowest one that has a Nation of total, and a Gold smaller than 14?
SELECT MIN(bronze) FROM table_name_38 WHERE nation = "total" AND gold < 14
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 ...
从05年12月30日到16年5月12这段时间内,患者86930913的住院次数为多少?
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '86930913' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-12-30' AND '2016-05-12' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_37 ( heat VARCHAR, name VARCHAR, lane VARCHAR )
What is the total heat number of sun yang, who has a lane less than 2?
SELECT COUNT(heat) FROM table_name_37 WHERE name = "sun yang" AND lane < 2
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...
Downvoted questions from new users.
SELECT q.Id AS "post_link", OwnerUserId AS "user_link", Reputation, Score, q.CreationDate FROM Posts AS q JOIN Users AS u ON OwnerUserId = u.Id WHERE q.CreationDate > '2018-01-01' AND PostTypeId = 1 AND Reputation <= 200 AND Score < 0 AND q.Id IN (SELECT PostId FROM Votes WHERE VoteTypeId = 3) ORDER BY q.CreationDate D...
sede
CREATE TABLE table_76776 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "College/Junior Team" text )
What is the nationality of player corey fienhage, who has a pick less than 104?
SELECT "Nationality" FROM table_76776 WHERE "Pick" < '104' AND "Player" = 'corey fienhage'
wikisql
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, ...
韦宏峻患者在门诊诊断为多动性障碍的检测指标037121的结果还有他的定量及单位都是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE table_228973_5 ( no_in_series INTEGER, original_air_date VARCHAR )
What episode number in the series originally aired on April 27, 1999?
SELECT MAX(no_in_series) FROM table_228973_5 WHERE original_air_date = "April 27, 1999"
sql_create_context
CREATE TABLE table_16376436_1 ( nfl_team VARCHAR, college VARCHAR )
What is the NFL team for the player who's college was Norfolk State?
SELECT nfl_team FROM table_16376436_1 WHERE college = "Norfolk State"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
User Count: Reputation 1 and Greater Than 1 by Location.
SELECT Reputation, COUNT(*) AS NumUsers FROM Users WHERE Reputation IN (90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110) AND Location LIKE '%##location##%' GROUP BY Reputation ORDER BY Reputation
sede
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
能知道患者62410155在2004.2.7到2005.5.15这段时间医保的消费金额吗
SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '62410155' AND CLINIC_SLT_DATE BETWEEN '2004-02-07' AND '2005-05-15'
css
CREATE TABLE table_20970 ( "Runs" text, "Wicket" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text )
How many runs when bangladesh was the fielding team?
SELECT "Runs" FROM table_20970 WHERE "Fielding team" = 'Bangladesh'
wikisql
CREATE TABLE table_14389782_2 ( winning_pct VARCHAR, jersey_no VARCHAR )
What is the winning pct for jersey 15?
SELECT winning_pct FROM table_14389782_2 WHERE jersey_no = "15"
sql_create_context
CREATE TABLE table_name_9 ( pick INTEGER, name VARCHAR, round VARCHAR )
What was John Strohmeyer's average pick before round 12?
SELECT AVG(pick) FROM table_name_9 WHERE name = "john strohmeyer" AND round < 12
sql_create_context
CREATE TABLE table_66318 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
what is the school when the team is new york yankees?
SELECT "School" FROM table_66318 WHERE "Team" = 'new york yankees'
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...
陶迎秋这个病患的医疗记录里一共被开出了多少次均价小于2684.97元的药物?看病时的编号是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '陶迎秋' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 2684.97)
css
CREATE TABLE table_name_9 ( losses INTEGER, ballarat_fl VARCHAR, wins VARCHAR )
What is the fewest losses that Ballarat FL of Lake Wendouree has when the wins are smaller than 9?
SELECT MIN(losses) FROM table_name_9 WHERE ballarat_fl = "lake wendouree" AND wins < 9
sql_create_context
CREATE TABLE table_70862 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
What is the Season Outcome, when the School is Sussex Tech?
SELECT "Season Outcome" FROM table_70862 WHERE "School" = 'sussex tech'
wikisql
CREATE TABLE table_name_5 ( original_airdate VARCHAR, writer_s_ VARCHAR, episode VARCHAR )
What is the original airdate for episode 7-17 (195) from writer Sidney Slon?
SELECT original_airdate FROM table_name_5 WHERE writer_s_ = "sidney slon" AND episode = "7-17 (195)"
sql_create_context
CREATE TABLE table_43827 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
What number game happened on November 19?
SELECT MAX("Game") FROM table_43827 WHERE "Date" = 'november 19'
wikisql
CREATE TABLE table_255812_1 ( area__km²_ VARCHAR, income_class__2007_ VARCHAR )
What are all the vicinity (km ) where profits magnificence (2007) is 2nd
SELECT area__km²_ FROM table_255812_1 WHERE income_class__2007_ = "2nd"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '04312120' AND jyjgzbb.JYRQ BETWEEN '2000-10-1...
css
CREATE TABLE table_name_61 ( score VARCHAR, opponent VARCHAR, date VARCHAR )
Name the score when the opponent was the dodgers on april 21
SELECT score FROM table_name_61 WHERE opponent = "dodgers" AND date = "april 21"
sql_create_context
CREATE TABLE table_name_76 ( pos VARCHAR, to_club VARCHAR, player VARCHAR )
Teerasil Dangda who had a to club of released plays what position?
SELECT pos FROM table_name_76 WHERE to_club = "released" AND player = "teerasil dangda"
sql_create_context
CREATE TABLE table_7731 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What is the to par when the winning score was 67-68-70-66=271?
SELECT "To par" FROM table_7731 WHERE "Winning score" = '67-68-70-66=271'
wikisql
CREATE TABLE table_22458 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
How many square miles of water is in Ramsey County with a geo id larger than 3807159460.0?
SELECT "Water (sqmi)" FROM table_22458 WHERE "County" = 'Ramsey' AND "GEO ID" > '3807159460.0'
wikisql
CREATE TABLE table_79919 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text, "Source" text )
What is the person's name that is from the country of SCO?
SELECT "Name" FROM table_79919 WHERE "Country" = 'sco'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
When classes start next Winter , who is teaching MDE classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
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 less than 63 years who have lab test item id 51098.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "63" AND lab.itemid = "51098"
mimicsql_data
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
Return a histogram on what are the names of different tracks, and how many races has each had?, and sort from low to high by the bar.
SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY T2.Name
nvbench
CREATE TABLE table_56636 ( "Elector" text, "Nationality" text, "Faction" text, "Order and Title" text, "Elevated" text, "Elevator" text )
What is the Order and Title with an Elevated with 1261, december 17, and a Faction with angevin?
SELECT "Order and Title" FROM table_56636 WHERE "Elevated" = '1261, december 17' AND "Faction" = 'angevin'
wikisql
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...
列出在医院4562632患者73880776的某次出院诊断结果是什么,其中出院诊断医生姓魏?
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '73880776' AND MED_SER_ORG_NO = '4562632' AND OUT_DIAG_DOC_NM LIKE '魏%'
css
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
Show different types of ships and the average tonnage of ships of each type in a bar chart, could you list y axis in asc order?
SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage)
nvbench
CREATE TABLE table_27698941_8 ( team VARCHAR, date VARCHAR )
Who were the 76ers opponents on January 17?
SELECT team FROM table_27698941_8 WHERE date = "January 17"
sql_create_context
CREATE TABLE table_name_43 ( player VARCHAR, score VARCHAR )
What player has a score of 69-68-68=205?
SELECT player FROM table_name_43 WHERE score = 69 - 68 - 68 = 205
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Most popular StackOverflow tags in May 2010.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
CREATE TABLE table_27539535_4 ( november INTEGER, game VARCHAR )
What is the highest entry in November for the game 20?
SELECT MAX(november) FROM table_27539535_4 WHERE game = 20
sql_create_context
CREATE TABLE table_24702 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text )
reginald hudlin directed how many written by.
SELECT "Written by" FROM table_24702 WHERE "Directed by" = 'Reginald Hudlin'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
when was the first time patient 006-229746 had a respiration measured on the last intensive care unit visit.
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-229746') AND NOT patient.unitdischargetime IS N...
eicu
CREATE TABLE table_20884 ( "Parameter" text, "1st stage" text, "2nd stage" text, "3rd stage" text, "4th stage" text )
Name the 1st stage for parameter being diameter
SELECT "1st stage" FROM table_20884 WHERE "Parameter" = 'Diameter'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
how much did the hospitalization during this year cost patient 008-40862?
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-40862') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_396 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What team were the Bulls hosted by on December 7?
SELECT "Team" FROM table_396 WHERE "Date" = 'December 7'
wikisql
CREATE TABLE table_16597 ( "No." real, "Episode" text, "Air Date" text, "Timeslot" text, "Rating" text, "Share" real, "18\u201349 (Rating/Share)" text, "Viewers (m)" text, "Rank (#)" text )
Which timeslot did episode no. 15 hold?
SELECT "Timeslot" FROM table_16597 WHERE "No." = '15'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
Find tags in need of love.
SELECT TagName, COUNT(Posts.Id) AS UnansweredCount, Tags.Count, CAST(COUNT(Posts.Id) AS FLOAT) / CAST(Tags.Count AS FLOAT) AS UnansweredRatio FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId INNER JOIN Posts AS Answers ON Answers.ParentId = Posts.Id WHERE Posts.Ac...
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
患者83706671的030972指标是什么情况在17年的10月30号到11月23号期间
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_2479 ( "Period" text, "Civilians" real, "Security forces" real, "Insurgents" real, "Total per period" real )
How many insurgents have 2003 as a period?
SELECT COUNT("Insurgents") FROM table_2479 WHERE "Period" = '2003'
wikisql
CREATE TABLE table_28253870_1 ( affiliation VARCHAR, enrollment VARCHAR )
Name the affiliation for 27209 enrollment
SELECT affiliation FROM table_28253870_1 WHERE enrollment = 27209
sql_create_context
CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
Draw a bar chart of destination versus the total number
SELECT destination, COUNT(*) FROM flight GROUP BY destination
nvbench
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...
病患82459876开出的所有药品的编号、名称、数量、单价、金额列出在2000年5月9日到2017年10月31日期间的详细情况?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '82459876' AND t_kc21.IN_HOSP_DATE BETWEEN...
css
CREATE TABLE table_25868 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
When chauncey billups (7) has the highest amount of assists what is the score?
SELECT "Score" FROM table_25868 WHERE "High assists" = 'Chauncey Billups (7)'
wikisql
CREATE TABLE batting_postseason ( year INTEGER, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INTEGER, ab INTEGER, r INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, rbi INTEGER, sb INTEGER, cs NUMERIC, bb INTEGER, so INTEG...
Show me the frequency of the weekdays (binning year into weekdays interval) that the team Boston Red Stockings won in the postseasons with a bar chart, and order total number from low to high order please.
SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY COUNT(year)
nvbench
CREATE TABLE table_204_492 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
in how many competitions has irina gordeeva finished higher than 10th but lower than fourth ?
SELECT COUNT("competition") FROM table_204_492 WHERE "position" < 10 AND "position" > 4
squall
CREATE TABLE table_10819 ( "Pick" real, "Round" text, "Player" text, "Free Agent Class" text, "New Team" text )
Which new team has a compensation-a round, and Frank Catalanotto as a player?
SELECT "New Team" FROM table_10819 WHERE "Round" = 'compensation-a' AND "Player" = 'frank catalanotto'
wikisql
CREATE TABLE table_name_8 ( screen_size VARCHAR, bluetooth VARCHAR, model VARCHAR )
What is the screen size of the s45 (Australia only) Model with no bluetooth?
SELECT screen_size FROM table_name_8 WHERE bluetooth = "no" AND model = "s45 (australia only)"
sql_create_context