context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_35654 ( "Year" real, "League" text, "Class" text, "Record" text, "Finish" text, "Manager" text, "Playoffs" text )
Manager of spencer abbott, and a Year of 1919 involves what playoffs?
SELECT "Playoffs" FROM table_35654 WHERE "Manager" = 'spencer abbott' AND "Year" = '1919'
wikisql
CREATE TABLE table_name_75 ( place VARCHAR, country VARCHAR )
What is the Place of the Player from Zimbabwe?
SELECT place FROM table_name_75 WHERE country = "zimbabwe"
sql_create_context
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 diagnoses ( ...
How many patients born before the year 2043 had a lab test for cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_name_14 ( athlete VARCHAR, country_state VARCHAR )
Which Athlete is from the United Kingdom?
SELECT athlete FROM table_name_14 WHERE country_state = "united kingdom"
sql_create_context
CREATE TABLE table_27312918_5 ( team VARCHAR, game VARCHAR )
What was the team the Suns played against in game number 4?
SELECT team FROM table_27312918_5 WHERE game = 4
sql_create_context
CREATE TABLE table_name_95 ( category VARCHAR, result VARCHAR, nominee VARCHAR )
What is Category, when Result is 'Won', and when Nominee is 'Bebe Neuwirth'?
SELECT category FROM table_name_95 WHERE result = "won" AND nominee = "bebe neuwirth"
sql_create_context
CREATE TABLE table_name_36 ( pick__number INTEGER, position VARCHAR, round VARCHAR )
What is the sum of Pick #, when Position is Guard, and when Round is greater than 2?
SELECT SUM(pick__number) FROM table_name_36 WHERE position = "guard" AND round > 2
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
what are the top four most frequent medications that followed within 2 months for patients who were given ssri administration - citalopram (celexa) since 5 years ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ssri administration - citalopram (celexa)' AND DAT...
eicu
CREATE TABLE table_52180 ( "Game #" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real )
What game number was played on March 4?
SELECT AVG("Game #") FROM table_52180 WHERE "Date" = 'march 4'
wikisql
CREATE TABLE table_name_86 ( company VARCHAR, profits__billion_$_ VARCHAR, industry VARCHAR, assets__billion_$_ VARCHAR, sales__billion_$_ VARCHAR )
Which company in the oil and gas industry has assets (billion $) under 235.45, sales (billion $) larger than 159.29 and brings in profits (billion $) of 19.28?
SELECT company FROM table_name_86 WHERE assets__billion_$_ < 235.45 AND sales__billion_$_ > 159.29 AND industry = "oil and gas" AND profits__billion_$_ = 19.28
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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, lan...
give me the top five most often prescribed drugs for patients 50s in 2101?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND STRFTIME('%y', prescriptions.startdate) = '2101' GROUP BY prescriptions.drug) AS t1 WH...
mimic_iii
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...
在张秀媛的患者的检查过程中有哪些检验报告单对应的检验结果指标是都不正常的?具体的检验报告单号是啥?
SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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_MZJZJLB WHERE person_info.XM = '张秀媛' ...
css
CREATE TABLE HOTELS ( price_range VARCHAR, star_rating_code VARCHAR )
Show the price ranges of hotels with 5 star ratings.
SELECT price_range FROM HOTELS WHERE star_rating_code = "5"
sql_create_context
CREATE TABLE table_name_5 ( round INTEGER, school VARCHAR )
What wss the average round drafted for xavier players?
SELECT AVG(round) FROM table_name_5 WHERE school = "xavier"
sql_create_context
CREATE TABLE table_78354 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
Which record has a time of 0:13?
SELECT "Record" FROM table_78354 WHERE "Time" = '0:13'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
i want to go between BOSTON and SAN FRANCISCO
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_name_87 ( year_s__won VARCHAR, player VARCHAR )
What year did Tom Watson win?
SELECT year_s__won FROM table_name_87 WHERE player = "tom watson"
sql_create_context
CREATE TABLE table_42310 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winner's share ($)" real )
How many purses were there after 2012 that had a winner's share of less than 15,000?
SELECT COUNT("Purse ($)") FROM table_42310 WHERE "Year" > '2012' AND "Winner's share ($)" < '15,000'
wikisql
CREATE TABLE table_77032 ( "Rank" real, "Country" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of the bronze medals when there were more than 2 silver medals and a rank larger than 6?
SELECT SUM("Bronze") FROM table_77032 WHERE "Silver" > '2' AND "Rank" > '6'
wikisql
CREATE TABLE table_name_26 ( date_made VARCHAR, type VARCHAR )
When was the railmotor made?
SELECT date_made FROM table_name_26 WHERE type = "railmotor"
sql_create_context
CREATE TABLE table_1341672_14 ( party VARCHAR, incumbent VARCHAR )
Name the party for tim lee hall
SELECT party FROM table_1341672_14 WHERE incumbent = "Tim Lee Hall"
sql_create_context
CREATE TABLE batting ( player_id text, year number, stint number, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, ...
For each team, return the team name, id and the maximum salary among the team.
SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id
spider
CREATE TABLE table_name_96 ( tournament VARCHAR )
What is the tournament with a 2r in 2009 and a 2r in 2010?
SELECT tournament FROM table_name_96 WHERE 2009 = "2r" AND 2010 = "2r"
sql_create_context
CREATE TABLE table_name_6 ( region VARCHAR, date VARCHAR )
Name the region for february 14, 2002
SELECT region FROM table_name_6 WHERE date = "february 14, 2002"
sql_create_context
CREATE TABLE table_55419 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
Name the highest pick number for PI GP more than 55
SELECT MAX("Pick #") FROM table_55419 WHERE "Pl GP" > '55'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
what is the COACH fare between BOSTON and ATLANTA on DL
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId numb...
Prevent protecting questions under certain circumstances. http://meta.stackexchange.com/questions/274324/prevent-protecting-questions-under-certain-circumstances
SELECT p.Id AS "post_link" FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 19 AND p.PostTypeId = 1 AND p.AnswerCount = 0 AND NOT EXISTS(SELECT 1 FROM PostHistory AS pu WHERE pu.PostId = p.Id AND pu.PostHistoryTypeId = 20 AND pu.CreationDate > ph.CreationDate)
sede
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 lab ( subject_id text, hadm_id text, ...
Count the patients admitted before the year 2148 that are categorized under the chemistry lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2148" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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 ) ...
provide the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of death is less than or equal to 2174?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dod_year <= "2174.0"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
在张秀媛的患者的检查过程中有哪些检验报告单对应的检验结果指标是都不正常的?具体的检验报告单号是啥?
(SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '张秀媛' AND NOT...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of patients whose diagnoses short title is anemia-other chronic dis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Anemia-other chronic dis"
mimicsql_data
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 PostFeedback ( Id number, PostId number, IsAnonymous...
Number of >=3 score posts per month. Android questions per day in 2011
SELECT YEAR(CreationDate) AS Year, MONTH(CreationDate) AS Month, COUNT(CreationDate) AS Count FROM Posts WHERE Score >= 3 GROUP BY MONTH(CreationDate), YEAR(CreationDate) ORDER BY YEAR(CreationDate), MONTH(CreationDate)
sede
CREATE TABLE table_name_44 ( points_for VARCHAR, tries_against VARCHAR )
What is the Points for number of the team with a 10 Tries against number?
SELECT points_for FROM table_name_44 WHERE tries_against = "10"
sql_create_context
CREATE TABLE table_name_31 ( team VARCHAR, time VARCHAR )
Which Team has a Time of 1:14.51.73?
SELECT team FROM table_name_31 WHERE time = "1:14.51.73"
sql_create_context
CREATE TABLE table_25718 ( "#" real, "Producing Nation" text, "10 3 bbl/d (2006)" text, "10 3 bbl/d (2007)" real, "10 3 bbl/d (2008)" real, "10 3 bbl/d (2009)" real, "Present Share" text )
Name the most 10 3 bbl/d (2008) for present share being 1.7%
SELECT MAX("10 3 bbl/d (2008)") FROM table_25718 WHERE "Present Share" = '1.7%'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE a...
what were the three most most common specimen tests?
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 3
eicu
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从两千年八月二十四日到两千零一年三月十一日期间,在0936106医院接受治疗的吴姓患者详细记录
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0936106' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-08-24' AND '2001-03-11' AND t_kc21.PERSON_NM LIKE '吴%'
css
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrase...
What years did alvin cheung publish papers in ?
SELECT DISTINCT paper.year FROM author, paper, writes WHERE author.authorname = 'alvin cheung' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.year
scholar
CREATE TABLE table_32018 ( "Ship" text, "Guns" text, "Class" text, "Captain" text, "Rank" text, "Year" text )
Tell me the guns for third-rate ship of the line and rank of vice-admiral with year of 1802
SELECT "Guns" FROM table_32018 WHERE "Class" = 'third-rate ship of the line' AND "Rank" = 'vice-admiral' AND "Year" = '1802'
wikisql
CREATE TABLE table_41421 ( "Player" text, "Club" text, "League" real, "Play-offs" real, "FA Cup" real, "FA Trophy" real, "Total" real )
How many totals have a play-off less than 0?
SELECT COUNT("Total") FROM table_41421 WHERE "Play-offs" < '0'
wikisql
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,...
看看08-03-26到17-12-25这段时间,小儿口腔颌面外科开掉多少苏黄止咳胶囊
SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '小儿口腔颌面外科' AND STA_DATE BETWEEN '2008-03-26' AND '2017-12-25' AND SOC_SRT_DIRE_NM = '苏黄止咳胶囊'
css
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
Show me a pie chart for how many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
nvbench
CREATE TABLE table_55667 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
Tell me the 2004 for 2012 of 21
SELECT "2004" FROM table_55667 WHERE "2012" = '21'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, subj...
whats the price for emtricitabine.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'emtricitabine')
mimic_iii
CREATE TABLE table_19496 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
how many college with player being rich voltzke
SELECT COUNT("College") FROM table_19496 WHERE "Player" = 'Rich Voltzke'
wikisql
CREATE TABLE table_name_17 ( opponents VARCHAR, date VARCHAR )
Date of 4 august 2007 had what opponents?
SELECT opponents FROM table_name_17 WHERE date = "4 august 2007"
sql_create_context
CREATE TABLE table_31070 ( "Train Number" real, "Train Name" text, "Departure Pune" text, "Arrival Lonavla" text, "Frequency" text, "Origin" text )
which train number departs pune at 13:00
SELECT "Train Number" FROM table_31070 WHERE "Departure Pune" = '13:00'
wikisql
CREATE TABLE table_name_33 ( date VARCHAR, game VARCHAR )
Which Date has a Game of 4?
SELECT date FROM table_name_33 WHERE game = 4
sql_create_context
CREATE TABLE table_name_68 ( year INTEGER, nominated_work VARCHAR, event VARCHAR )
What year was Herself nominated at the MTV Movie Awards?
SELECT MAX(year) FROM table_name_68 WHERE nominated_work = "herself" AND event = "mtv movie awards"
sql_create_context
CREATE TABLE table_name_47 ( score VARCHAR, result VARCHAR, date VARCHAR )
What is the Score that has a Result of 2 1 on 5 july 2007?
SELECT score FROM table_name_47 WHERE result = "2–1" AND date = "5 july 2007"
sql_create_context
CREATE TABLE table_13626 ( "Year" real, "Recipient" text, "Award" text, "Category" text, "Result" text )
What year had the category of best international newcomer?
SELECT COUNT("Year") FROM table_13626 WHERE "Category" = 'best international newcomer'
wikisql
CREATE TABLE table_68911 ( "Round" text, "Name" text, "Song" text, "Score" real, "Status" text )
Which status accompanies the score 21.5?
SELECT "Status" FROM table_68911 WHERE "Score" = '21.5'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
患者王飞燕有哪些门诊就诊的检验报告日期在2020-10-11以后?查询这些门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
CREATE TABLE wdmzjzjlb ( 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...
在15年6月14日到17年1月10日期间,医疗机构8513028处理的新生儿门诊的就诊次数共是多少次?
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8513028' AND wdmzjzjlb.JZKSRQ BETWEEN '2015-06-14' AND '2017-01-10' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8513028' AND bdmzjzjlb.JZKSRQ BETWEEN '2015-06-14' AND '2017-01-10' AND bdmzjzjlb.ZSEBZ > 0
css
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, ...
把检测指标名称与检测指标结果定量单位跟检验指标记录99657546229一样,而且检测指标结果定量不等于其的检验指标记录列出来
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '99657546229') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '99657546229') AND jyjgzbb.JCZBJGDL <> (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '99657546229')
css
CREATE TABLE table_name_37 ( event VARCHAR, year INTEGER )
What is the event in a year before 1989?
SELECT event FROM table_name_37 WHERE year < 1989
sql_create_context
CREATE TABLE table_32742 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Who was the opponent of the New Orleans Saints?
SELECT "Result" FROM table_32742 WHERE "Opponent" = 'new orleans saints'
wikisql
CREATE TABLE table_name_20 ( crowd INTEGER, venue VARCHAR )
What is the lowest crowd at corio oval?
SELECT MIN(crowd) FROM table_name_20 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE table_38102 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real )
In what Year is the length of the Song 7:42?
SELECT AVG("Year") FROM table_38102 WHERE "Length" = '7:42'
wikisql
CREATE TABLE table_name_99 ( score VARCHAR, venue VARCHAR )
The game played at Sultan Qaboos Sports Complex, Muscat had what score?
SELECT score FROM table_name_99 WHERE venue = "sultan qaboos sports complex, muscat"
sql_create_context
CREATE TABLE table_name_76 ( team VARCHAR, game VARCHAR, score VARCHAR )
What is the Team with a game of more than 56, and the score is l 85 90 (ot)?
SELECT team FROM table_name_76 WHERE game > 56 AND score = "l 85–90 (ot)"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
Q:A ratio for top users.
SELECT Id AS "user_link", Reputation, CASE Questions WHEN 0 THEN '1:infinity' ELSE '1:' + CAST(ROUND(Answers / CAST(Questions AS FLOAT), 2) AS TEXT) END AS "Q:A ratio" FROM (SELECT u.Id, u.Reputation, SUM(CASE p.PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS "Questions", SUM(CASE p.PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Ans...
sede
CREATE TABLE table_58730 ( "Name" text, "Total" real, "First" text, "Last" text, "Highest rank" text )
Who had a total of 34?
SELECT "Name" FROM table_58730 WHERE "Total" = '34'
wikisql
CREATE TABLE table_name_76 ( intra_molecular_structure VARCHAR, comparative VARCHAR, name VARCHAR )
Which Intra-molecular structure has a Comparative of no, and a Name of mitarget?
SELECT intra_molecular_structure FROM table_name_76 WHERE comparative = "no" AND name = "mitarget"
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
施蕴秀这个团伙的成员最常去的医生排序情况是啥样的?
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '施蕴秀' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '施蕴秀' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_CD, zyb.OU...
css
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose admission year is less than 2145 and drug route is iv drip?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2145" AND prescriptions.route = "IV DRIP"
mimicsql_data
CREATE TABLE table_203_202 ( id number, "network" text, "company" text, "mobile prefixes" text, "mobile examples" text, "landline prefixes" text, "landline examples" text, "notes" text )
which network comes after cootel in alphabetical order ?
SELECT "network" FROM table_203_202 WHERE id = (SELECT id FROM table_203_202 WHERE "network" = 'cootel') + 1
squall
CREATE TABLE table_name_67 ( record VARCHAR, attendance VARCHAR )
Name the record with attendance of 73,996
SELECT record FROM table_name_67 WHERE attendance = "73,996"
sql_create_context
CREATE TABLE table_name_95 ( lane INTEGER, reaction_time VARCHAR, country VARCHAR, time VARCHAR )
Which Lane has a Country of united states, and a Time smaller than 22.01, and a Reaction Time smaller than 0.193?
SELECT MIN(lane) FROM table_name_95 WHERE country = "united states" AND time < 22.01 AND reaction_time < 0.193
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...
知道62013127这个病人住了多少次院吗?在2000年3月7日到2015年6月1日的这段时间里
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '62013127' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-03-07' AND '2015-06-01' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_61938 ( "Summoned" text, "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text )
What is the dissolved date of the parliament summoned on 28 February 1467?
SELECT "Dissolved" FROM table_61938 WHERE "Summoned" = '28 february 1467'
wikisql
CREATE TABLE table_59810 ( "Rank" real, "Show" text, "Number of Viewers" text, "Date" text, "Network" text )
Which Network has a Rank larger than 5, a Show of 2012 summer olympics closing ceremony in london?
SELECT "Network" FROM table_59810 WHERE "Rank" > '5' AND "Show" = '2012 summer olympics closing ceremony in london'
wikisql
CREATE TABLE table_79353 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
How many wins did Cobden have when draws were more than 0?
SELECT COUNT("Wins") FROM table_79353 WHERE "Club" = 'cobden' AND "Draws" > '0'
wikisql
CREATE TABLE table_name_96 ( roll INTEGER, name VARCHAR, gender VARCHAR, authority VARCHAR )
Name the highest roll for coed and authority of state integrated with sacred heart school
SELECT MAX(roll) FROM table_name_96 WHERE gender = "coed" AND authority = "state integrated" AND name = "sacred heart school"
sql_create_context
CREATE TABLE table_73884 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text )
How many pole positions for round 20?
SELECT COUNT("Pole Position") FROM table_73884 WHERE "Round" = '20'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many patients diagnosed with fever in other diseases had csf lab test done?
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 = "Fever in other diseases" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_45920 ( "Date" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text )
What was the result of the game played in Venue H?
SELECT "Result" FROM table_45920 WHERE "Venue" = 'h'
wikisql
CREATE TABLE table_25179 ( "Version" text, "Release date" text, "Distribution mechanism" text, "Features" text, "Security issues" text )
If the version is 1.5b, what is the distribution mechanism?
SELECT "Distribution mechanism" FROM table_25179 WHERE "Version" = '1.5b'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number...
did there exist any microbiological tests for patient 031-17834's sputum, tracheal specimen when they came to the hospital last time?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital...
eicu
CREATE TABLE table_2417330_4 ( vacator VARCHAR, district VARCHAR )
Name the vacator for kentucky 2nd
SELECT vacator FROM table_2417330_4 WHERE district = "Kentucky 2nd"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_i...
what are the name of the drug that patient 52647 was prescribed in the same hospital visit after receiving a sm bowel stoma closure?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 52647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
list the top three most frequent drugs that patients were prescribed with within 2 months after being prescribed with oxycodone (oxy ir) cap-tab 5 mg until 2104.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'oxycodone (oxy ir) cap-tab 5 mg' AND STRFTIME('%y',...
eicu
CREATE TABLE table_45427 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
What position was played by the player during 1986 1991 1997 1999?
SELECT "Position" FROM table_45427 WHERE "Years" = '1986 – 1991 1997 – 1999'
wikisql
CREATE TABLE table_33892 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
On what Date was the Venue Los Angeles?
SELECT "Date" FROM table_33892 WHERE "Venue" = 'los angeles'
wikisql
CREATE TABLE table_24758 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What is the title that had 13.59 u.s. viewers (millions)?
SELECT "Title" FROM table_24758 WHERE "U.S. viewers (millions)" = '13.59'
wikisql
CREATE TABLE table_21942 ( "Actor in original production" text, "Actor required" text, "GamePlan" text, "FlatSpin" text, "RolePlay" text )
What were the requirements for the role played by Robert Austin in the original production?
SELECT "Actor required" FROM table_21942 WHERE "Actor in original production" = 'Robert Austin'
wikisql
CREATE TABLE table_name_50 ( laps VARCHAR, qual VARCHAR )
How many laps had a qualification of 136.168?
SELECT COUNT(laps) FROM table_name_50 WHERE qual = "136.168"
sql_create_context
CREATE TABLE table_name_36 ( maidens INTEGER, matches VARCHAR )
What is the sum of Maidens with a number of Matches that is 2?
SELECT SUM(maidens) FROM table_name_36 WHERE matches = 2
sql_create_context
CREATE TABLE table_44362 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What country is the player ho had a To par of +1 and a score of 69-70-72=211 from?
SELECT "Country" FROM table_44362 WHERE "To par" = '+1' AND "Score" = '69-70-72=211'
wikisql
CREATE TABLE table_203_568 ( id number, "town/village" text, "population" number, "postal code" text, "municipality" text, "island" text, "location" text )
where is there a population larger than klaksvik ?
SELECT "town/village" FROM table_203_568 WHERE "population" > (SELECT "population" FROM table_203_568 WHERE "town/village" = 'klaksvik')
squall
CREATE TABLE table_62104 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/junior/club team (league)" text )
In what round was Kelsey Tessier drafted?
SELECT "Round" FROM table_62104 WHERE "Player" = 'kelsey tessier'
wikisql
CREATE TABLE table_18616 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
what's the party with first elected being 1926
SELECT "Party" FROM table_18616 WHERE "First elected" = '1926'
wikisql
CREATE TABLE table_203_603 ( id number, "service" text, "service id" text, "bit rate" text, "audio channels" text, "description" text, "analogue availability" text )
how long is the bit rate number for gold radio service ?
SELECT "bit rate" FROM table_203_603 WHERE "service" = 'gold'
squall
CREATE TABLE table_42333 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
When the Winning score was 9 (69-72-68-70=279), what was the Margin of victory?
SELECT "Margin of victory" FROM table_42333 WHERE "Winning score" = '–9 (69-72-68-70=279)'
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...
在医院5241360中,病患鲁俊健在名中包括肾内的就诊科室的所有门诊就诊记录的流水号是什么
SELECT txmzjzjlb.JZLSH 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 hz_info.YLJGDM = '5241360' AND txmzjzjlb.JZKSMC LIKE '%肾内%' UNION SELECT ftxmzjzjlb....
css
CREATE TABLE table_name_41 ( position VARCHAR, year VARCHAR )
What is the position that is shown for 2011?
SELECT position FROM table_name_41 WHERE year = 2011
sql_create_context
CREATE TABLE table_149 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
The gayfield park stadium had a highest attendance of what?
SELECT MAX("Highest") FROM table_149 WHERE "Stadium" = 'Gayfield Park'
wikisql
CREATE TABLE table_name_98 ( to_par VARCHAR, margin_of_victory VARCHAR, tournament VARCHAR )
What is To par, when Margin of Victory is '2 Strokes', and when Tournament is 'Women's British Open'?
SELECT to_par FROM table_name_98 WHERE margin_of_victory = "2 strokes" AND tournament = "women's british open"
sql_create_context
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,...
编码为13358901组织成员最常去的医院排序是哪几个医院?
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '13358901' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_14 ( _2_clubs VARCHAR, nation VARCHAR, total VARCHAR )
What is the highest 4 hoops, 2 clubs of Belarus, which has a total less than 38.25?
SELECT MAX(4 AS _hoops), _2_clubs FROM table_name_14 WHERE nation = "belarus" AND total < 38.25
sql_create_context