context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_81 ( rettö VARCHAR, linke VARCHAR, fritz VARCHAR )
What percent did RETT get in the state where LINKE got 0.1%, and FRITZ got 1.3%?
SELECT rettö FROM table_name_81 WHERE linke = "0.1%" AND fritz = "1.3%"
sql_create_context
CREATE TABLE table_67292 ( "Year" real, "Award Ceremony" text, "Category" text, "Nominee" text, "Result" text )
What category was Brian D'arcy James nominated for?
SELECT "Category" FROM table_67292 WHERE "Nominee" = 'brian d''arcy james' AND "Result" = 'nominated'
wikisql
CREATE TABLE table_19412902_2 ( pos INTEGER, points__total_500_ VARCHAR )
At what position is the association with 279 points?
SELECT MIN(pos) FROM table_19412902_2 WHERE points__total_500_ = 279
sql_create_context
CREATE TABLE table_name_96 ( year VARCHAR, rank VARCHAR )
In what year was the rank 24?
SELECT year FROM table_name_96 WHERE rank = "24"
sql_create_context
CREATE TABLE table_10705060_1 ( points VARCHAR, team_name VARCHAR )
what is the score for the dams?
SELECT points FROM table_10705060_1 WHERE team_name = "DAMS"
sql_create_context
CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
Find the title and score of the movie with the lowest rating among all movies directed by each director.
SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T2.director
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
does patient 012-31752 get admitted to hospital in 2105?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '012-31752' AND STRFTIME('%y', patient.hospitaladmittime) = '2105'
eicu
CREATE TABLE table_80015 ( "Model" text, "Code name" text, "CPU support" text, "FSB / HT (MHz)" text, "Southbridge" text )
What is the code name when the FSB / HT (MHz) is 100 (fsb)?
SELECT "Code name" FROM table_80015 WHERE "FSB / HT (MHz)" = '100 (fsb)'
wikisql
CREATE TABLE table_70284 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What is Chitwood's lowest completed number of laps with a qualifying time of 124.619?
SELECT MIN("Laps") FROM table_70284 WHERE "Qual" = '124.619'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, Mark...
Questions Jon Skeet has accepted answers on..
WITH Jons_wins AS (SELECT Id, Score FROM Posts WHERE AcceptedAnswerId IN (SELECT Id FROM Posts WHERE OwnerUserId IN ('##UserId?22656##'))) SELECT AVG(p.Score), COUNT(*) FROM Jons_wins AS p JOIN Comments AS c ON (p.Id = PostId)
sede
CREATE TABLE table_name_86 ( total INTEGER, gold VARCHAR, silver VARCHAR, sport VARCHAR )
With more than 1 Gold and Silver and Total Sport, what is the Total?
SELECT AVG(total) FROM table_name_86 WHERE silver > 1 AND sport = total AND gold > 1
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
找出和检验指标记录78584375516都相同的检测指标名称与检测指标结果定量单位,并且检测指标结果定量小于其的检验指标记录有哪些呢?
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '78584375516') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '78584375516') AND JCZBJGDL < (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '78584375516')
css
CREATE TABLE table_75951 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What is the name of the driver with 6 points?
SELECT "Driver" FROM table_75951 WHERE "Points" = '6'
wikisql
CREATE TABLE table_19780 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How many losses did 12 de Octubre have ?
SELECT MIN("Losses") FROM table_19780 WHERE "Team" = '12 de Octubre'
wikisql
CREATE TABLE table_10284385_1 ( party VARCHAR, date_of_birth VARCHAR )
Which politican party has a birthday of November 10, 1880
SELECT party FROM table_10284385_1 WHERE date_of_birth = "November 10, 1880"
sql_create_context
CREATE TABLE table_8549 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
Which Tries against has Points for of 564?
SELECT "Tries against" FROM table_8549 WHERE "Points for" = '564'
wikisql
CREATE TABLE table_59984 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
The game with home team Crowborough Athletic, with an attendance less than 848 had what as the score?
SELECT "Score" FROM table_59984 WHERE "Attendance" < '848' AND "Home team" = 'crowborough athletic'
wikisql
CREATE TABLE table_name_22 ( displacement VARCHAR, code VARCHAR )
What displacement has the code yd22ddt?
SELECT displacement FROM table_name_22 WHERE code = "yd22ddt"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Rev...
Questions that have been unprotected at some point.
SELECT ph.PostId, p.Id AS "post_link", ph.CreationDate AS "unprotected_at" FROM PostHistory AS ph INNER JOIN Posts AS p ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 20 ORDER BY 'unprotected_at' DESC
sede
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the average of employee_id bin hire_date by time in a bar chart, display in ascending by the y axis.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_name_75 ( result VARCHAR, match VARCHAR )
What was the result of the napoli-roma match?
SELECT result FROM table_name_75 WHERE match = "napoli-roma"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of manufacturer , and group by attribute name, show by the names in desc.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_59999 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What place is the player with a score of 69-68=137?
SELECT "Place" FROM table_59999 WHERE "Score" = '69-68=137'
wikisql
CREATE TABLE table_name_7 ( opposing_team VARCHAR, against VARCHAR )
What opposing team has 20 against?
SELECT opposing_team FROM table_name_7 WHERE against = 20
sql_create_context
CREATE TABLE table_11677100_15 ( school VARCHAR, player VARCHAR )
What high school did Jeff Malm attend?
SELECT school FROM table_11677100_15 WHERE player = "Jeff Malm"
sql_create_context
CREATE TABLE table_8216 ( "University" text, "Common short form and abbreviation" text, "Location" text, "Enrollment" real, "Athletics nickname" text, "School Colors" text, "Founded" text, "Student newspaper" text )
What was the university of akron's enrollment?
SELECT "Enrollment" FROM table_8216 WHERE "University" = 'university of akron'
wikisql
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...
Number of posts vs. total bounty amount.
WITH bounties_cte AS (SELECT SUM(v.BountyAmount) AS bnt, p.Id AS pid, p.ViewCount AS vc FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 8 GROUP BY p.Id, p.ViewCount) SELECT bnt AS "bounties_count", COUNT(pid) FROM bounties_cte GROUP BY bnt ORDER BY bnt
sede
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many of the patients treated with meth10sy had a lab test for cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "METH10SY" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
Calculate the minimum age of patients with inpatient hospital admission and s/p fall as their primary disease.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "S/P FALL"
mimicsql_data
CREATE TABLE table_10710364_2 ( sex_ratio__child_ INTEGER, work_participation___percentage_ VARCHAR )
What is the lowest child sex ratio in groups where employment is 31.3%?
SELECT MIN(sex_ratio__child_) FROM table_10710364_2 WHERE work_participation___percentage_ = "31.3%"
sql_create_context
CREATE TABLE table_15040_8 ( french VARCHAR, german VARCHAR )
What is the French word where the German word is filtern?
SELECT french FROM table_15040_8 WHERE german = "filtern"
sql_create_context
CREATE TABLE table_203_94 ( id number, "year" number, "player" text, "country" text, "score" text, "to par" number, "margin\nof victory" text, "course" text, "location" text, "purse ($)" number, "winner's\nshare ($)" number )
after justin rose won in 2011 who won next ?
SELECT "player" FROM table_203_94 WHERE "year" > (SELECT "year" FROM table_203_94 WHERE "player" = 'justin rose') ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_16409745_1 ( dpi VARCHAR, max_page_size VARCHAR )
What is the dpi for the scanner with a max page size of 216mm x 355mm?
SELECT dpi FROM table_16409745_1 WHERE max_page_size = "216mm x 355mm"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
Christianity Questions to Answer (custom). Good questions, custom tags, without great answers or any accepted answers, or answers by a particular user, that have been around for at least X months.
SELECT Id AS "post_link", CreationDate AS "Creation Date", Score AS "Question Score" FROM Posts WHERE PostTypeId = 1 AND OwnerUserId NOT IN (@Exclude) AND (Tags LIKE '%##Tag1?protestant##%' OR Tags LIKE '%##Tag2?NULL##%' OR Tags LIKE '%##Tag3?NULL##%') AND Score >= 3 AND AcceptedAnswerId IS NULL AND (SELECT MAX(Score) ...
sede
CREATE TABLE ship ( ship_id number, name text, type text, nationality text, tonnage number ) CREATE TABLE mission ( mission_id number, ship_id number, code text, launched_year number, location text, speed_knots number, fate text )
What is the most common type of ships?
SELECT type FROM ship GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_29418619_1 ( former_school VARCHAR, hometown VARCHAR )
What is the former school of the player from Detroit, MI?
SELECT former_school FROM table_29418619_1 WHERE hometown = "Detroit, MI"
sql_create_context
CREATE TABLE table_69409 ( "!Race name" real, "Grade" text, "Racecourse" text, "Distance" text, "Priority-entry-rights to Derby" text )
What is the Grade that has Turf 1600m?
SELECT "Grade" FROM table_69409 WHERE "Priority-entry-rights to Derby" = 'turf 1600m'
wikisql
CREATE TABLE table_name_17 ( start VARCHAR, year VARCHAR, team VARCHAR )
What start has a year later than 2010, and chip ganassi racing as the team?
SELECT start FROM table_name_17 WHERE year > 2010 AND team = "chip ganassi racing"
sql_create_context
CREATE TABLE table_76886 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
On what date did a game higher than 10 have a score of 99-89?
SELECT "Date" FROM table_76886 WHERE "Game" > '10' AND "Score" = '99-89'
wikisql
CREATE TABLE table_24850487_5 ( blocks VARCHAR, rebounds VARCHAR )
How many blocks did the player who had 59 rebounds have?
SELECT blocks FROM table_24850487_5 WHERE rebounds = 59
sql_create_context
CREATE TABLE table_name_98 ( points_2 INTEGER, goals_for VARCHAR, team VARCHAR )
What is the sum of Altrincham's Points 2 when they had more than 52 Goals For?
SELECT SUM(points_2) FROM table_name_98 WHERE goals_for > 52 AND team = "altrincham"
sql_create_context
CREATE TABLE table_5700 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real )
Who was the opponent at memorial stadium?
SELECT "Opponent" FROM table_5700 WHERE "Venue" = 'memorial stadium'
wikisql
CREATE TABLE table_name_84 ( time_retired VARCHAR, grid VARCHAR, driver VARCHAR )
What is the time/retired for eddie irvine with a grid of greater than 3?
SELECT time_retired FROM table_name_84 WHERE grid > 3 AND driver = "eddie irvine"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Count answers by presence of keywords.
SELECT COUNT(*) AS total FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = 'r'
sede
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
tell me the name of the intake that patient 23066 had for the first time until 617 days ago?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23066)) AND DATETIME(inputevents_cv....
mimic_iii
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
列出开出的检验报告单在医院4651944中,不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值在2006-10-08到2007-11-01内是多少,保留平均值最小的1项?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '4651944' AND BGRQ BETWEEN '2006-10-08' AND '2007-11-01' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) LIMIT 1
css
CREATE TABLE Assets ( asset_id VARCHAR, asset_details VARCHAR, asset_make VARCHAR, asset_model VARCHAR )
List the asset id, details, make and model for every asset.
SELECT asset_id, asset_details, asset_make, asset_model FROM Assets
sql_create_context
CREATE TABLE table_22246 ( "Name" text, "Notability" text, "Reason for Seeking Refuge" text, "Country" text, "City" text, "Missions Country" text, "Start Date" text, "End Date" text, "Resolution" text )
Which city has a resolution that is negotiated exile in Austria?
SELECT "City" FROM table_22246 WHERE "Resolution" = 'Negotiated exile in Austria'
wikisql
CREATE TABLE table_name_9 ( score VARCHAR, attendance VARCHAR )
What is the score for the game that has an attendance of 5,298?
SELECT score FROM table_name_9 WHERE attendance = "5,298"
sql_create_context
CREATE TABLE table_name_13 ( score VARCHAR, opponent VARCHAR )
What is Score, when Opponent is 'Tampa Bay Lightning'?
SELECT score FROM table_name_13 WHERE opponent = "tampa bay lightning"
sql_create_context
CREATE TABLE gyb ( 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...
年龄不高于19岁的病人的医疗记录的医疗费总额的平均值是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE <= 19 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE <= 19 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE <= 19 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER...
css
CREATE TABLE table_79524 ( "Date" text, "Internet Explorer" text, "Firefox" text, "Safari" text, "Opera" text )
What is the firefox value with a 1.9% safari?
SELECT "Firefox" FROM table_79524 WHERE "Safari" = '1.9%'
wikisql
CREATE TABLE table_52374 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the Date of the game of the Home team of melbourne?
SELECT "Date" FROM table_52374 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many days have passed since patient 027-154299 has received a phosphate test for the first time on their current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-154299' AND patient.hosp...
eicu
CREATE TABLE table_42574 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "2000 n South Korea population *" real )
What is the McCune-Reischauer when the 2000 n South Korea population * is more than 6,796,227 people, and a Hangul of ?
SELECT "McCune-Reischauer" FROM table_42574 WHERE "2000 n South Korea population *" > '6,796,227' AND "Hangul" = '송'
wikisql
CREATE TABLE table_12168 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" text )
What is the 2000 figure when 2010 is 3R and 2001 is A?
SELECT "2000" FROM table_12168 WHERE "2001" = 'a' AND "2010" = '3r'
wikisql
CREATE TABLE table_name_69 ( date VARCHAR, game VARCHAR )
What is the Date, when Game is 17?
SELECT date FROM table_name_69 WHERE game = 17
sql_create_context
CREATE TABLE table_204_970 ( id number, "year" number, "award" text, "category" text, "title" text, "result" text )
an nbr award and a nyfcc award were both given to this actor for his role in what film ?
SELECT "title" FROM table_204_970 WHERE "award" = 'nbr award'
squall
CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id...
What is the average age of all artists?
SELECT AVG(age) FROM artist
spider
CREATE TABLE table_name_89 ( opponent VARCHAR, week VARCHAR, attendance VARCHAR )
Which opponent, before Week 10, had an attendance of 63,672?
SELECT opponent FROM table_name_89 WHERE week < 10 AND attendance = "63,672"
sql_create_context
CREATE TABLE table_34327 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Played has a Lost larger than 2, and a Team of am rica?
SELECT "Played" FROM table_34327 WHERE "Lost" > '2' AND "Team" = 'américa'
wikisql
CREATE TABLE table_60856 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What rank was the country with no bronze but at least 1 silver medals?
SELECT AVG("Rank") FROM table_60856 WHERE "Bronze" < '1' AND "Silver" > '1'
wikisql
CREATE TABLE table_16710541_2 ( pts VARCHAR, team VARCHAR )
How many points did kiefer-bos-castrol honda have?
SELECT pts FROM table_16710541_2 WHERE team = "Kiefer-Bos-Castrol Honda"
sql_create_context
CREATE TABLE table_name_9 ( draws INTEGER, goal_difference VARCHAR, played VARCHAR )
What is the average number of draws that has a played entry of less than 30 and a goal difference greater than 2?
SELECT AVG(draws) FROM table_name_9 WHERE goal_difference > 2 AND played < 30
sql_create_context
CREATE TABLE table_name_18 ( new_entries_this_round VARCHAR, round VARCHAR )
What is the New entries this round when the round is the semi-finals?
SELECT new_entries_this_round FROM table_name_18 WHERE round = "semi-finals"
sql_create_context
CREATE TABLE table_name_50 ( genre VARCHAR, game VARCHAR )
What is the genre of Super Mario Galaxy?
SELECT genre FROM table_name_50 WHERE game = "super mario galaxy"
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...
查一下水宏茂这位患者就诊结算日期在2008年1月30日到2008年6月28日内的所有医疗就诊记录编号,列出这些编号
SELECT qtb.MED_CLINIC_ID FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '水宏茂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-01-30' AND '2008-06-28' UNION SELECT gyb.MED_CLINIC_ID FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '水宏茂' AND t_kc24.CL...
css
CREATE TABLE table_53614 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Who was the visitor when vancouver was at home?
SELECT "Visitor" FROM table_53614 WHERE "Home" = 'vancouver'
wikisql
CREATE TABLE table_name_66 ( member VARCHAR, party VARCHAR, electorate VARCHAR )
Who is the Member when the Party is Alp, and when the Electorate is Grey?
SELECT member FROM table_name_66 WHERE party = "alp" AND electorate = "grey"
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...
从17年1月25日开始,直到19年12月2日的这段时间里,医院2498476给患者褚勇男开出的所有药的名字和编号
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '褚勇男' AND t_kc22.t_kc21_MED_SER_ORG_NO = '2498476' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2017-01-25' AND '2019-12-02')
css
CREATE TABLE table_204_796 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number )
which owner has the most networks ?
SELECT "owner" FROM table_204_796 GROUP BY "owner" ORDER BY COUNT("network name") DESC LIMIT 1
squall
CREATE TABLE table_45955 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
How many Laps have Grid larger than 14, and a Rider of sylvain guintoli?
SELECT COUNT("Laps") FROM table_45955 WHERE "Grid" > '14' AND "Rider" = 'sylvain guintoli'
wikisql
CREATE TABLE table_name_97 ( date VARCHAR, opponent VARCHAR )
When was andrea g miz the opponent?
SELECT date FROM table_name_97 WHERE opponent = "andrea gámiz"
sql_create_context
CREATE TABLE table_31887 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text )
What was the latest round with a running back from a California college?
SELECT MAX("Round") FROM table_31887 WHERE "Position" = 'running back' AND "College" = 'california'
wikisql
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 demographic ( subject_id text, hadm_id t...
how many patients whose drug code is gent60pm?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "GENT60PM"
mimicsql_data
CREATE TABLE table_name_43 ( proto_oceanic VARCHAR, verb VARCHAR )
What is the Proto-Oceanic verb for the verb to sew?
SELECT proto_oceanic FROM table_name_43 WHERE verb = "to sew"
sql_create_context
CREATE TABLE table_48775 ( "Title" text, "Season" real, "Director" text, "Teleplay" text, "First Broadcast" text )
What is Teleplay, when Season is greater than 1.1, and when First Broadcast is 'February 20, 1981'?
SELECT "Teleplay" FROM table_48775 WHERE "Season" > '1.1' AND "First Broadcast" = 'february 20, 1981'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, ...
list the top three most frequent prescriptions that a patient has been prescribed with within 2 months after being diagnosed with gout nos since 4 years ago.
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_24409 ( "Name" text, "Career" text, "Matches" real, "Innings" real, "Not Out" real, "Runs scored" real, "High Score" text, "50s" real, "100s" real, "Average" text )
Name the least matches for not out being 44
SELECT MIN("Matches") FROM table_24409 WHERE "Not Out" = '44'
wikisql
CREATE TABLE table_12307 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the Date of Tie no 3?
SELECT "Date" FROM table_12307 WHERE "Tie no" = '3'
wikisql
CREATE TABLE table_name_14 ( to_par VARCHAR, player VARCHAR )
What was the to par score for Mike Weir?
SELECT to_par FROM table_name_14 WHERE player = "mike weir"
sql_create_context
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, ...
查询医院9564037全部诊疗记录中患者就诊时的平均年纪,按照科室的不同和病人出院时诊断的疾病编码来分别计算
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9564037' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
count the number of patients that have received lactulose until 2 years ago.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'lactulose' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 year'))
eicu
CREATE TABLE table_name_4 ( years VARCHAR, duration VARCHAR, actor VARCHAR )
What are the years for Eileen Derbyshire with a duration of 52 years?
SELECT years FROM table_name_4 WHERE duration = "52 years" AND actor = "eileen derbyshire"
sql_create_context
CREATE TABLE table_name_95 ( location VARCHAR, rank_final VARCHAR, score_qualifying VARCHAR )
What was the location of the competition with a Rank-Final of 1st and a Score-Qualifying under 28.975?
SELECT location FROM table_name_95 WHERE rank_final = "1st" AND score_qualifying < 28.975
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Course_Enrolment ( registration_...
A bar chart for what are the number of the completion dates of all the tests that have result 'Fail'?, and list Y in ascending order.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion)
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
has the arterial bp [systolic] of patient 10855 been on the current intensive care unit visit ever greater than 111.0?
SELECT COUNT(*) > 0 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 = 10855) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_ite...
mimic_iii
CREATE TABLE table_27714985_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR )
What was the broadcast date of episodes that were watched by 23.2 million viewers?
SELECT original_air_date FROM table_27714985_1 WHERE us_viewers__millions_ = "23.2"
sql_create_context
CREATE TABLE table_54490 ( "Player" text, "Pos." text, "From" text, "School/Country" text, "Rebs" real, "Asts" real )
What player has under 357 assists and is from 2001?
SELECT "Player" FROM table_54490 WHERE "Asts" < '357' AND "From" = '2001'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
how many times during their first hospital visit is patient 24762 getting a ptt test?
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24762 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
CREATE TABLE table_47074 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text )
What was the category that sheridan smith was nominated for in 2011?
SELECT "Category" FROM table_47074 WHERE "Year" = '2011'
wikisql
CREATE TABLE Ref_budget_codes ( Id VARCHAR )
How many budget types do we have?
SELECT COUNT(*) FROM Ref_budget_codes
sql_create_context
CREATE TABLE table_71864 ( "Team" text, "1st Match" text, "Matches" text, "Lost" text, "% Won" text )
Name the matches for the first match being 30 march 1997
SELECT "Matches" FROM table_71864 WHERE "1st Match" = '30 march 1997'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airli...
show me the most expensive one way FIRST class fare from BALTIMORE to DALLAS
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code ...
atis
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...
在病人鲁烨烨的医疗记录中开出了多少次价格不超过809.11元的药品?是多少就诊编号?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '鲁烨烨' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 809.11)
css
CREATE TABLE table_name_34 ( gecko VARCHAR, trident VARCHAR )
What is the Gecko value for the item that has a Trident value of 'font'?
SELECT gecko FROM table_name_34 WHERE trident = "font"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and salary in a bar chart, and order by the x-axis in desc.
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE table_name_86 ( round INTEGER, pick__number VARCHAR, position VARCHAR )
Which is the lowest round to have a pick of 12 and position of linebacker?
SELECT MIN(round) FROM table_name_86 WHERE pick__number = 12 AND position = "linebacker"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
How many patients with drug code beth5 died in or before the year 2122?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "BETH5"
mimicsql_data
CREATE TABLE table_1359212_2 ( location VARCHAR, winner VARCHAR )
how many locations has spain as the winner?
SELECT COUNT(location) FROM table_1359212_2 WHERE winner = "Spain"
sql_create_context