context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_92 ( silver INTEGER, gold VARCHAR, total VARCHAR, bronze VARCHAR )
Name the sum of silver when total is mor ethan 1, bronze is 1 and gold is les than 0
SELECT SUM(silver) FROM table_name_92 WHERE total > 1 AND bronze = 1 AND gold < 0
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 demographic ...
what is average age of patients whose gender is f and age is greater than or equal to 86?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "86"
mimicsql_data
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
患者43148907在05年1月3日到09年12月17日,是找的哪些工号及姓名的医务人员检测免疫球蛋白M(标准)的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real...
Return a bar chart on what are the id and name of the mountains that have at least 2 photos?, I want to list by the y-axis from low to high.
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id
nvbench
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
在2004-12-03到2015-08-20期间,患者17722570看了多少病?
SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_ID = '17722570' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-12-03' AND '2015-08-20'
css
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...
在医院4694071所有的就诊记载里,依科室不同的编号和入院诊断的疾病编号不同查查民政补助的开销与全部医疗费之比的最大值,然后把结果从大到小排一下
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) 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 = '4694071' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_D...
css
CREATE TABLE table_name_75 ( bronze VARCHAR, gold VARCHAR )
What's the Bronze that's also got a Godl of Kim Woo-Jin?
SELECT bronze FROM table_name_75 WHERE gold = "kim woo-jin"
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...
医疗就诊43665866915在其出院时经过诊断的疾病它编号以及其名称分别是什么?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '43665866915'
css
CREATE TABLE table_56911 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the home team scored 11.15 (81), what did the Away team score?
SELECT "Away team score" FROM table_56911 WHERE "Home team score" = '11.15 (81)'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
In 2015 , can I take PHYSICS 452 in the Spring ?
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
where can we find some restaurants on bethel island rd in bethel island ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id
restaurants
CREATE TABLE table_204_57 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text )
which language has madhurima spoken more often in films : malayalam or telugu ?
SELECT "language" FROM table_204_57 WHERE "language" IN ('malayalam', 'telugu') GROUP BY "language" ORDER BY COUNT("film") DESC LIMIT 1
squall
CREATE TABLE table_name_4 ( years VARCHAR, jersey_number_s_ VARCHAR, position VARCHAR )
What years did the player with the jersey number 33 and played position pf play?
SELECT years FROM table_name_4 WHERE jersey_number_s_ = 33 AND position = "pf"
sql_create_context
CREATE TABLE table_48449 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text )
What is the lowest numbered game with an opponent of Minnesota North Stars earlier than February 25?
SELECT MIN("Game") FROM table_48449 WHERE "Opponent" = 'minnesota north stars' AND "February" < '25'
wikisql
CREATE TABLE table_19072602_1 ( score VARCHAR, team_europe VARCHAR )
What was the score when Tore Torgersen played for Team Europe?
SELECT score FROM table_19072602_1 WHERE team_europe = "Tore Torgersen"
sql_create_context
CREATE TABLE table_name_26 ( state VARCHAR, interview VARCHAR, swimsuit VARCHAR, evening_gown VARCHAR )
What state had less than 8.874 for swimsuit, less than 9.257 for evening gown, and less than 9.121 for interview?
SELECT state FROM table_name_26 WHERE swimsuit < 8.874 AND evening_gown < 9.257 AND interview < 9.121
sql_create_context
CREATE TABLE table_name_85 ( rank INTEGER, lane VARCHAR, name VARCHAR )
What is the lowest rank of a swimmer named Elizabeth Van Welie with a lane larger than 5?
SELECT MIN(rank) FROM table_name_85 WHERE lane > 5 AND name = "elizabeth van welie"
sql_create_context
CREATE TABLE table_name_64 ( owner VARCHAR, trainer VARCHAR )
What Owner's Trainer is Todd A. Pletcher?
SELECT owner FROM table_name_64 WHERE trainer = "todd a. pletcher"
sql_create_context
CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) ) CREATE TABLE On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME ) CREATE TABLE Procedures ( Code INTEGER, Name VARCHA...
A pie chart for listing the number of the name of physicians who took some appointment.
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
Number of questions closed by close vote count. Sceptics questions closed, by number of close votes. Useful to identify moderator-closed questions.
SELECT 'close_votes', COUNT(*) FROM (SELECT COUNT(*) AS "close_votes" FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND NOT Posts.ClosedDate IS NULL GROUP BY Posts.Id) AS X GROUP BY 'close_votes'
sede
CREATE TABLE table_23284271_10 ( high_assists VARCHAR, record VARCHAR )
Who has the high assists when 50-26 is the record?
SELECT high_assists FROM table_23284271_10 WHERE record = "50-26"
sql_create_context
CREATE TABLE mzb ( 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...
1714876这个医院涉及医疗费总额超过6282.3元的科室有多少?时间范围是2004-06-08到2016-11-26
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1714876' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-08' AND '2016-11-26' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 6282.3 UNION SELECT gyb.MED_ORG_DEPT_CD FROM...
css
CREATE TABLE table_2791668_1 ( title VARCHAR, written_by VARCHAR )
what is the name of the episode whose writer is philippe browning?
SELECT title FROM table_2791668_1 WHERE written_by = "Philippe Browning"
sql_create_context
CREATE TABLE table_27098 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Viewers" text, "Air date" text, "Production code" real )
When 7.55 is the amount of viewers what is the lowest number?
SELECT MIN("#") FROM table_27098 WHERE "Viewers" = '7.55'
wikisql
CREATE TABLE table_3123 ( "Rank" text, "Player" text, "Nationality" text, "Team" text, "Opponent" text, "Score" text, "Competition" text, "Vote percentage" text )
What was the name of the player that had a vote percentage of 7.85%?
SELECT "Player" FROM table_3123 WHERE "Vote percentage" = '7.85%'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Return a bar chart about the distribution of meter_200 and the average of ID , and group by attribute meter_200, sort Y-axis in asc order please.
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID)
nvbench
CREATE TABLE table_11203 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the Away team at Hawthorn?
SELECT "Home team" FROM table_11203 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_name_41 ( record VARCHAR, date VARCHAR )
What is the record of the cubs on July 19?
SELECT record FROM table_name_41 WHERE date = "july 19"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
哪些医务人员为患者何莹琇在12年2月15日到17年2月23日期间进行过检测指标048093的检查姓名和工号都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_314 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
Which school did the player then go to Auburn?
SELECT "School" FROM table_314 WHERE "College" = 'Auburn'
wikisql
CREATE TABLE table_6217 ( "Election date" real, "Party leader" text, "Number of votes received" text, "Percentage of votes" text, "Number of deputies" real )
What is the number of deputies with 94.2% of the votes?
SELECT SUM("Number of deputies") FROM table_6217 WHERE "Percentage of votes" = '94.2%'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
What course requirements does REES 395 have ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_16717 ( "Season" real, "Premier" text, "Runner Up" text, "Score" text, "Venue" text, "Attendance" real, "Premiership" text )
What is the other premiership when the runner up wis Geelong?
SELECT "Premiership" FROM table_16717 WHERE "Runner Up" = 'Geelong'
wikisql
CREATE TABLE table_44573 ( "Skip" text, "Third" text, "Second" text, "Lead" text, "City" text )
WHAT IS THE LEAD WITH THIRD AS JEANNA SCHRAEDER?
SELECT "Lead" FROM table_44573 WHERE "Third" = 'jeanna schraeder'
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...
医疗机构2488172使用次数top20的是哪些项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '2488172' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 20
css
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...
Evolution of the number of posts of a given type. Calculates a graph with the number of posts of a given type for each day between two chosen dates. Posts types are 1 for question, 2 for answers, and for more, see http://meta.stackexchange.com/q/2677/285933
SELECT TIME_TO_STR(CreationDate, '%d') AS DayDate, STR(YEAR(CreationDate)) + '-' + STR(MONTH(CreationDate)) + '-' + STR(DAY(CreationDate)) AS FullDate, COUNT(*) AS Total FROM Posts WHERE PostTypeId = 1 GROUP BY STR(YEAR(CreationDate)) + '-' + STR(MONTH(CreationDate)) + '-' + STR(DAY(CreationDate)), TIME_TO_STR(Creation...
sede
CREATE TABLE table_76964 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What top round has a pick smaller than 2?
SELECT MAX("Round") FROM table_76964 WHERE "Pick" < '2'
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...
从07年9月24日到19年9月4日患者钱建章的检测指标535180的情况是什么样的?
SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
what are the top three most frequent diagnoses which patients were given within the same month after undergoing non-invasive mech vent since 2105?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_name_83 ( location VARCHAR, school VARCHAR, year_joined VARCHAR, previous_conference VARCHAR )
Which Location has a Year Joined of 1966, and a Previous Conference of noble county, and a School of wawaka?
SELECT location FROM table_name_83 WHERE year_joined = 1966 AND previous_conference = "noble county" AND school = "wawaka"
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 North Carolina?
SELECT nfl_team FROM table_16376436_1 WHERE college = "North Carolina"
sql_create_context
CREATE TABLE table_name_89 ( silver INTEGER, rank VARCHAR, bronze VARCHAR )
How many silver medals when the bronze is more than 2 and having a rank more than 5?
SELECT MAX(silver) FROM table_name_89 WHERE rank > 5 AND bronze > 2
sql_create_context
CREATE TABLE table_27483 ( "No. in series" text, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (millions)" text, "Original U.S. air date" text, "Prod. code" text )
What number episode in the series had a production code of 110?
SELECT "No. in series" FROM table_27483 WHERE "Prod. code" = '110'
wikisql
CREATE TABLE table_name_35 ( reg_gp VARCHAR, player VARCHAR )
How many reg GP for mattias ohlund?
SELECT COUNT(reg_gp) FROM table_name_35 WHERE player = "mattias ohlund"
sql_create_context
CREATE TABLE table_35366 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Points have an Opponent of @ florida panthers, and a Game larger than 58?
SELECT MIN("Points") FROM table_35366 WHERE "Opponent" = '@ florida panthers' AND "Game" > '58'
wikisql
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_required varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CR...
i need a flight from MEMPHIS to TACOMA that goes through LOS ANGELES
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND CITY_...
atis
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, ...
病人许乐心在门诊诊断为慢性胃溃疡的茶碱的结果定量还有单位分别为什么?
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_name_31 ( wheels VARCHAR, railway VARCHAR, built VARCHAR, location VARCHAR )
Which Wheels has Built smaller than 1958, a Location of york, and a Railway of nsr?
SELECT wheels FROM table_name_31 WHERE built < 1958 AND location = "york" AND railway = "nsr"
sql_create_context
CREATE TABLE table_name_89 ( attendance VARCHAR, opponent VARCHAR )
What attendance has Washington redskins as the opponent?
SELECT attendance FROM table_name_89 WHERE opponent = "washington redskins"
sql_create_context
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...
Days I hit rep cap. Returns the days a user hit the rep cap
SELECT ROW_NUMBER() OVER (ORDER BY CreationDate) AS row, CreationDate, Votes FROM (SELECT SUM(CASE Votes.VoteTypeId WHEN 1 THEN 15 WHEN 2 THEN 10 WHEN 3 THEN -3 WHEN 9 THEN BountyAmount END) AS Votes, Votes.CreationDate AS CreationDate FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @Us...
sede
CREATE TABLE table_15872814_5 ( date VARCHAR, high_points VARCHAR )
What were the dates of the games where Jalen Rose (32) had the highest points?
SELECT date FROM table_15872814_5 WHERE high_points = "Jalen Rose (32)"
sql_create_context
CREATE TABLE table_26041144_11 ( player VARCHAR, average VARCHAR )
Who was the player with a 36.74 average?
SELECT player FROM table_26041144_11 WHERE average = "36.74"
sql_create_context
CREATE TABLE table_48703 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
How did the manager replaced by Michael Oenning depart?
SELECT "Manner of departure" FROM table_48703 WHERE "Replaced by" = 'michael oenning'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
has patient 030-47098 received a thrombocytopenia - heparin-induced diagnosis since 5 years ago.
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-47098')) AND diagnosis.diagnosisname = 'thrombocytopenia - heparin-induc...
eicu
CREATE TABLE table_name_56 ( title VARCHAR, riaa VARCHAR )
What is the title of the album that had a RIAA of gold?
SELECT title FROM table_name_56 WHERE riaa = "gold"
sql_create_context
CREATE TABLE table_35723 ( "Trim" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text, "Transmission" text, "Fuel Mileage (latest EPA mpg - US )" text )
What is the Removal that has a Trim of xe (2009)?
SELECT "Transmission" FROM table_35723 WHERE "Trim" = 'xe (2009)'
wikisql
CREATE TABLE table_40061 ( "Track" real, "Recorded" text, "Catalogue" text, "Release date" text, "Song title" text, "Writer(s)" text, "Time" text )
How long is the song titled burning love?
SELECT "Time" FROM table_40061 WHERE "Song title" = 'burning love'
wikisql
CREATE TABLE qualifying ( qualifyid number, raceid number, driverid number, constructorid number, number number, position number, q1 text, q2 text, q3 text ) CREATE TABLE laptimes ( raceid number, driverid number, lap number, position number, time text, milli...
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE position = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2
spider
CREATE TABLE table_name_62 ( date VARCHAR, record VARCHAR )
When was the record 3-14-6?
SELECT date FROM table_name_62 WHERE record = "3-14-6"
sql_create_context
CREATE TABLE debate ( debate_id number, date text, venue text, num_of_audience number ) CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_affirmative_win others ) CREATE TABLE people ( people_id number, district text, name text, part...
How many debates are there?
SELECT COUNT(*) FROM debate
spider
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Det...
Show budget type codes and the number of documents in each budget type. Show bar chart.
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code
nvbench
CREATE TABLE table_53503 ( "Location" text, "Londonborough" text, "Post town" text, "Postcodedistrict" text, "Dialcode" text )
Which Post Town has a Dialcode of 020 and is located in Hook?
SELECT "Post town" FROM table_53503 WHERE "Dialcode" = '020' AND "Location" = 'hook'
wikisql
CREATE TABLE table_1079 ( "Composition" text, "s Hindu" text, "s Muslim" text, "Christians" text, "s Sikh" text, "Buddhist" text, "s Jain" text, "Others" text )
What is the data point for s hindu where the buddhist data point is 73.0%?
SELECT COUNT("s Hindu") FROM table_1079 WHERE "Buddhist" = '73.0%'
wikisql
CREATE TABLE table_name_34 ( attendance VARCHAR, loss VARCHAR )
What was the attendance at the game that had a loss of Crabtree (0-1)?
SELECT attendance FROM table_name_34 WHERE loss = "crabtree (0-1)"
sql_create_context
CREATE TABLE table_43626 ( "Name" text, "Flag" text, "Cargo" text, "Fate" text, "Date of attack" text )
What is the Date of attack of the ship with iron ore sunk by u-101 *?
SELECT "Date of attack" FROM table_43626 WHERE "Fate" = 'sunk by u-101 *' AND "Cargo" = 'iron ore'
wikisql
CREATE TABLE table_50875 ( "Show" text, "Last Aired" real, "Previous Network" text, "Retitled as/Same" text, "New/Returning/Same Network" text, "Returning" text )
Which retitled network has a Show of supermarket sweep?
SELECT "Retitled as/Same" FROM table_50875 WHERE "Show" = 'supermarket sweep'
wikisql
CREATE TABLE table_name_94 ( scored INTEGER, result VARCHAR )
What is the scored figure when the result is 40-22?
SELECT SUM(scored) FROM table_name_94 WHERE result = "40-22"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 admissions...
when was the last time that patient 15986's arterial bp [diastolic] was measured or taken on this month/23?
SELECT chartevents.charttime 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 = 15986)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
Close Votes for Tag X by User (with Links).
SELECT COUNT(*) FROM ReviewTasks WHERE ReviewTaskTypeId = 2 AND ReviewTaskStateId = 1
sede
CREATE TABLE table_49605 ( "Place" text, "Country" text, "Qualifying Grand Prix" text, "Class" text, "Dates" text )
What is Country, when Class is 'club'?
SELECT "Country" FROM table_49605 WHERE "Class" = 'club'
wikisql
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE View_Unit_Status ...
What is the number of start date of each apartment booking for each weekday? Return a bar chart.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id
nvbench
CREATE TABLE table_10601843_2 ( tenant VARCHAR, city VARCHAR )
How many tenants are there in the city of Samsun?
SELECT COUNT(tenant) FROM table_10601843_2 WHERE city = "Samsun"
sql_create_context
CREATE TABLE table_76076 ( "Senator" text, "Party" text, "District" real, "Home Town" text, "Took Office" real )
What year did Senator Ken Armbrister take office?
SELECT "Took Office" FROM table_76076 WHERE "Senator" = 'ken armbrister'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by time, and sort by the y-axis in descending.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_40 ( name VARCHAR, home_venue VARCHAR, city VARCHAR )
What squad plays at comunale in darfo boario terme?
SELECT name FROM table_name_40 WHERE home_venue = "comunale" AND city = "darfo boario terme"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
specify the procedural and diagnosis icd9 codes for patient id 16438
SELECT diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "16438"
mimicsql_data
CREATE TABLE table_72110 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
Which Rd took place at the Indianapolis 500?
SELECT "Rd" FROM table_72110 WHERE "Name" = 'Indianapolis 500'
wikisql
CREATE TABLE table_train_148 ( "id" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "hematocrit_hct" float, "serum_creatinine" float, "albumin" float, "body_mass_index_bmi" float, "NOUSE" float )
hba1c > 6.49 and < 14.1
SELECT * FROM table_train_148 WHERE hemoglobin_a1c_hba1c > 6.49 AND hemoglobin_a1c_hba1c < 14.1
criteria2sql
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...
医疗记录中年龄高于20岁的患者的医疗费平均金额是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE >= 20)
css
CREATE TABLE table_55182 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
What is the kickoff time for week 3?
SELECT "Kickoff [a ]" FROM table_55182 WHERE "Week" = '3'
wikisql
CREATE TABLE table_60760 ( "Date" text, "Unit" real, "Aircraft" text, "Opponent" text, "Location" text )
What is the Unit for the Aircraft F.e.2b, located in Logeast?
SELECT SUM("Unit") FROM table_60760 WHERE "Aircraft" = 'f.e.2b' AND "Location" = 'logeast'
wikisql
CREATE TABLE table_name_55 ( november INTEGER, opponent VARCHAR, game VARCHAR )
What is the latest November date with an Opponent of @ Pittsburgh Pirates and the game is more than 3?
SELECT MAX(november) FROM table_name_55 WHERE opponent = "@ pittsburgh pirates" AND game > 3
sql_create_context
CREATE TABLE table_73620 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Table" text, "Incoming manager" text, "Date of appointment" text )
What team has an incoming manager named Kenny Dalglish?
SELECT "Team" FROM table_73620 WHERE "Incoming manager" = 'Kenny Dalglish'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId ...
Users with highest reputation-to-number-of-answers ratio.
SELECT u.Id AS "user_link", COUNT(*) AS NumPosts, u.Reputation AS Reputation, CAST(Reputation * 1.0 / COUNT(*) AS FLOAT(5, 2)) AS ratio FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId GROUP BY u.Reputation, u.Id, u.DisplayName HAVING COUNT(*) >= @MinPosts ORDER BY ratio DESC, NumPosts DESC LIMIT 200
sede
CREATE TABLE Customers ( customer_id INTEGER, customer_address_id INTEGER, customer_status_code VARCHAR(15), date_became_customer DATETIME, date_of_birth DATETIME, first_name VARCHAR(80), last_name VARCHAR(80), amount_outstanding DOUBLE, email_address VARCHAR(250), phone_number V...
For each customer status code, how many customers are classified that way. Show the proportion.
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
nvbench
CREATE TABLE table_name_85 ( to_par VARCHAR, country VARCHAR, player VARCHAR )
What is To par, when Country is 'United States', and when Player is 'Jay Haas'?
SELECT to_par FROM table_name_85 WHERE country = "united states" AND player = "jay haas"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
Who has taught APPPHYS 550 in the past ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE player ( player_id number, player text, team text, age number, position text, school_id number ) CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boar...
Find the team of each player and sort them in ascending alphabetical order.
SELECT team FROM player ORDER BY team
spider
CREATE TABLE table_name_74 ( moving_to VARCHAR, type VARCHAR, name VARCHAR )
Where is moving to the type loaned out under the name tragodara?
SELECT moving_to FROM table_name_74 WHERE type = "loaned out" AND name = "tragodara"
sql_create_context
CREATE TABLE table_name_65 ( opponent VARCHAR, attendance VARCHAR )
Which Opponent has an Attendance of 375?
SELECT opponent FROM table_name_65 WHERE attendance = 375
sql_create_context
CREATE TABLE table_18540104_1 ( japanese_title VARCHAR, average_ratings VARCHAR )
What is the Japanese title with an average rating of 11.6%?
SELECT japanese_title FROM table_18540104_1 WHERE average_ratings = "11.6%"
sql_create_context
CREATE TABLE table_32155 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
What was the venue of the competition that held the 1st position in 2011?
SELECT "Venue" FROM table_32155 WHERE "Position" = '1st' AND "Year" = '2011'
wikisql
CREATE TABLE table_18950570_2 ( live_births_per_year VARCHAR, deaths_per_year VARCHAR )
How many births per year are there for the period with 998 000 deaths per year?
SELECT live_births_per_year FROM table_18950570_2 WHERE deaths_per_year = "998 000"
sql_create_context
CREATE TABLE table_31025 ( "Artist" text, "Jaanu N\u0151gisto" real, "Iiris Vesik" real, "Erik Morna" real, "Veronika Portsmuth" real, "Chalice" real, "Kristo Rajasaare" real, "Hannaliisa Uusmaa" real, "Siim Nestor" real, "Peeter V\u00e4hi" real, "Helen Sildna" real, "Ott...
What is the maximum points received when Peeter V hl gave a 9?
SELECT MIN("Points") FROM table_31025 WHERE "Peeter V\u00e4hi" = '9'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTME...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and could you sort sum department id in descending order?
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_name_89 ( home_team VARCHAR )
What is Geelong's home team score?
SELECT home_team AS score FROM table_name_89 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE table_46564 ( "Year" real, "Championship" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
In which championship did the winner have a score of 9 (66-69-73-71=279)?
SELECT "Championship" FROM table_46564 WHERE "Winning score" = '−9 (66-69-73-71=279)'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Just show the employee's last name and their department's id using a bar chart, display by the DEPARTMENT_ID in descending.
SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID DESC
nvbench
CREATE TABLE photos ( id number, camera_lens_id number, mountain_id number, color text, name text ) CREATE TABLE mountain ( id number, name text, height number, prominence number, range text, country text ) CREATE TABLE camera_lens ( id number, brand text, name ...
List the id, color scheme, and name for all the photos.
SELECT id, color, name FROM photos
spider
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
Average Score of my Questions.
SELECT AVG(CAST(Score AS FLOAT)) AS "AverageScore" FROM Posts WHERE PostTypeId = 1 AND OwnerUserId = '##UserId##'
sede