context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_61251 ( "Team" text, "Average" real, "Points" real, "Played" real, "1986-87" text, "1987-88" text, "1988-89" real )
What is 1987-88, when Points is '136'?
SELECT "1987-88" FROM table_61251 WHERE "Points" = '136'
wikisql
CREATE TABLE table_70612 ( "Poll" text, "Pre- season" text, "Mar. 3" text, "May 5" text, "May 12" text, "May 19" text, "May 26" text, "Final Poll" text )
Which pre-season has a Mar. 3 of nr, and a Poll of usa today/espn coaches' poll (top 25)?
SELECT "Pre- season" FROM table_70612 WHERE "Mar. 3" = 'nr' AND "Poll" = 'usa today/espn coaches'' poll (top 25)'
wikisql
CREATE TABLE table_name_19 ( type VARCHAR, lt_nos VARCHAR, bldr VARCHAR, year VARCHAR )
Bldr of mcw&f, and a Year smaller than 1927, and a LT Nos of 9820-9821 has what type?
SELECT type FROM table_name_19 WHERE bldr = "mcw&f" AND year < 1927 AND lt_nos = "9820-9821"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
在住院就诊83482640652中,入院途径名是什么?还有代码呢
SELECT zyjzjlb.RYTJDM, zyjzjlb.RYTJMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '83482640652'
css
CREATE TABLE table_name_91 ( laps INTEGER, grid VARCHAR, time_retired VARCHAR )
What is the high lap total for cards with a grid larger than 21, and a Time/Retired of +2 laps?
SELECT MAX(laps) FROM table_name_91 WHERE grid > 21 AND time_retired = "+2 laps"
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...
这位褚泰鸿的患者在11年1月20日到21年4月6日期间医保的医疗总消费金额有多少
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '褚泰鸿' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-01-20' AND '2021-04-06'
css
CREATE TABLE table_name_92 ( podiums INTEGER, races VARCHAR, final_placing VARCHAR, season VARCHAR )
What is the sum of podiums of the teams with a final placing of 14th, seasons after 2008, and less than 1 races?
SELECT SUM(podiums) FROM table_name_92 WHERE final_placing = "14th" AND season > 2008 AND races < 1
sql_create_context
CREATE TABLE table_15647838_3 ( attendance VARCHAR, bowl_game VARCHAR )
How many values for attendance correspond to the 1986 Peach Bowl?
SELECT COUNT(attendance) FROM table_15647838_3 WHERE bowl_game = "1986 Peach Bowl"
sql_create_context
CREATE TABLE table_train_52 ( "id" int, "pregnancy_or_lactation" bool, "consent" bool, "surgery" bool, "hemodynamic_instability" bool, "age" float, "NOUSE" float )
invasive hemodynamic monitoring
SELECT * FROM table_train_52 WHERE hemodynamic_instability = 1
criteria2sql
CREATE TABLE table_204_364 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many races did she run after the 2008 olympics ?
SELECT COUNT("competition") FROM table_204_364 WHERE "year" > 2008
squall
CREATE TABLE table_49248 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the date of the match when Phoenix is the home team?
SELECT "Date" FROM table_49248 WHERE "Home" = 'phoenix'
wikisql
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
Show the name of each party and the corresponding number of delegates from that party by a pie chart.
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
nvbench
CREATE TABLE Staff_Roles ( role_description VARCHAR, role_code VARCHAR )
What is the complete description of the researcher role.
SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'
sql_create_context
CREATE TABLE table_name_35 ( code INTEGER, name VARCHAR, regional_county_municipality VARCHAR, type VARCHAR )
What is the code for Saint-Damien in Matawinie with a type p?
SELECT AVG(code) FROM table_name_35 WHERE regional_county_municipality = "matawinie" AND type = "p" AND name = "saint-damien"
sql_create_context
CREATE TABLE table_name_77 ( result VARCHAR, date VARCHAR )
What was the Result on November 9, 1958?
SELECT result FROM table_name_77 WHERE date = "november 9, 1958"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
query for top (high-rep) users without gold badge.
SELECT Id, DisplayName, Reputation, UpVotes, DownVotes FROM Users WHERE Users.Id NOT IN (SELECT DISTINCT UserId FROM Badges WHERE Name IN ('Copy Editor', 'Electorate', 'Famous Question', 'Fanatic', 'Great Answer', 'Great Question', 'Legendary', 'Marshal', 'Populist', 'Publicist', 'Reversal', 'Stellar Question', 'Stewar...
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
what were the four most common procedures until 3 years ago for those 40s?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 yea...
eicu
CREATE TABLE table_63376 ( "Model" text, "Years" text, "Engine code" text, "Power" text, "Torque" text )
What is the engine code for the Xdrive25i?
SELECT "Engine code" FROM table_63376 WHERE "Model" = 'xdrive25i'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
脂蛋白(a)二代的参考值界线在被诊断为矽肺(硅肺)I期的患者身上下限和上限是多些?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '矽肺(硅肺)I期' AND jyjgzbb.JCZBMC = '脂蛋白(a)二代'
css
CREATE TABLE table_4013 ( "Ethnic group" text, "2001 population" real, "2001 %" text, "2011 population" real, "2011 %" text )
What is the highest 2011 population when the ethnic group is asian or asian british: asian other?
SELECT MAX("2011 population") FROM table_4013 WHERE "Ethnic group" = 'Asian or Asian British: Asian Other'
wikisql
CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, dr...
Show the season, the player, and the name of the team that players belong to.
SELECT T1.season, T1.player, T2.name FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
what is the count of times that patient 009-424 had received a sodium lab test during this year.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-424')) AND lab.labname = 'sodium' AND DATETIME(lab.labresulttime, 'start of year') = DAT...
eicu
CREATE TABLE table_14603212_1 ( school_year VARCHAR, class_a VARCHAR, class_aAA VARCHAR, Cuero VARCHAR )
Which school years have a class a being lindsay and a class aaa being cuero?
SELECT school_year FROM table_14603212_1 WHERE class_a = "Lindsay" AND class_aAA = Cuero
sql_create_context
CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL tex...
what are the draft pick numbers and draft classes for players who play the Defender position?, could you sort by the y-axis in asc?
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number
nvbench
CREATE TABLE table_name_33 ( drivers VARCHAR, position VARCHAR )
Which drivers have the position of 27?
SELECT drivers FROM table_name_33 WHERE position = 27
sql_create_context
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 all employees who have the letters D or S in their first name, draw a scatter chart about the correlation between employee_id and commission_pct .
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_25764073_3 ( episode__number INTEGER, writer_s_ VARCHAR )
Name the least episode number for anne brooksbank and vicki madden
SELECT MIN(episode__number) FROM table_25764073_3 WHERE writer_s_ = "Anne Brooksbank and Vicki Madden"
sql_create_context
CREATE TABLE table_68276 ( "Value" text, "Khmer" text, "Word form" text, "UNGEGN" text, "ALA-LC" text, "Notes" text )
what notes have the khmer ?
SELECT "Notes" FROM table_68276 WHERE "Khmer" = '២៨'
wikisql
CREATE TABLE table_name_25 ( clubs_remaining INTEGER, new_entries_this_round VARCHAR, clubs_involved VARCHAR )
What is the sum of the clubs remaining with 34 new entries this round and more than 34 clubs involved?
SELECT SUM(clubs_remaining) FROM table_name_25 WHERE new_entries_this_round = "34" AND clubs_involved > 34
sql_create_context
CREATE TABLE table_29690363_3 ( fastest_lap VARCHAR, pole_position VARCHAR )
Who had the fastest lap(s) when stefan wilson had the pole?
SELECT fastest_lap FROM table_29690363_3 WHERE pole_position = "Stefan Wilson"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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 num...
08218858这个病人在二零年十月十七日以后有哪些住院就诊的检验报告单?看看这些住院就诊的流水编码
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE table_name_25 ( reign VARCHAR, date_of_birth VARCHAR )
What was the Reign of the person whose Date of Birth was 22 March 1459?
SELECT reign FROM table_name_25 WHERE date_of_birth = "22 march 1459"
sql_create_context
CREATE TABLE table_name_44 ( tickets_sold___available VARCHAR, venue VARCHAR )
What is the amount of Tickets Sold/ Available at the Venue of hippodrome?
SELECT tickets_sold___available FROM table_name_44 WHERE venue = "hippodrome"
sql_create_context
CREATE TABLE table_16848 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
What is the nationality of bill robinzine?
SELECT "Nationality" FROM table_16848 WHERE "Player" = 'Bill Robinzine'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Parent...
Tag edits to add grammar.
SELECT DISTINCT I.PostId AS "post_link", I.CreationDate FROM (SELECT * FROM PostHistory WHERE PostHistoryTypeId = 3) AS I INNER JOIN (SELECT * FROM PostHistory WHERE PostHistoryTypeId = 6) AS E ON I.PostId = E.PostId WHERE e.Text LIKE '%bare-role%' AND NOT i.Text LIKE '%bare-role%'
sede
CREATE TABLE table_name_60 ( cash_on_hand VARCHAR, after_debt VARCHAR )
What is the amount of cash on hand that has an after debt of $327,094
SELECT cash_on_hand FROM table_name_60 WHERE after_debt = "$327,094"
sql_create_context
CREATE TABLE table_10678 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home score at the Princes Park game?
SELECT "Home team score" FROM table_10678 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) 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, ...
now list for me only the UA flights that flight from OAKLAND to BOSTON
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 = 'OAKLAN...
atis
CREATE TABLE table_name_25 ( rank VARCHAR, swing_to_gain VARCHAR, constituency VARCHAR )
What rank was caerphilly with a Swing smaller than 6.92?
SELECT COUNT(rank) FROM table_name_25 WHERE swing_to_gain < 6.92 AND constituency = "caerphilly"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
active users by calendar year.
SELECT COUNT(UserId) AS usercount, period FROM (SELECT UserId, YEAR(CreationDate) AS period FROM Comments UNION SELECT UserId, YEAR(CreationDate) AS period FROM PostHistory UNION SELECT OwnerUserId, YEAR(CreationDate) AS period FROM Posts) AS t GROUP BY period ORDER BY period
sede
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paper...
keyphrases used by Luke S Zettlemoyer
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Luke S Zettlemoyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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 prescription...
what is the number of patients whose admission year is less than 2190 and procedure long title is formation of cutaneous uretero-ileostomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2190" AND procedures.long_title = "Formation of cutaneous uretero-ileostomy"
mimicsql_data
CREATE TABLE table_name_2 ( high_points VARCHAR, team VARCHAR )
Name the high points for charlotte
SELECT high_points FROM table_name_2 WHERE team = "charlotte"
sql_create_context
CREATE TABLE table_6996 ( "Locomotive" text, "Serial No" text, "Entered service" text, "Owner" text, "Operator" text, "Livery" text, "Gauge" text, "Status" text )
What is the Serial number of the Locomotive that Entered Service in November 1984 and has an Owner of Chicago Freight Car Leasing Australia?
SELECT "Serial No" FROM table_6996 WHERE "Entered service" = 'november 1984' AND "Owner" = 'chicago freight car leasing australia'
wikisql
CREATE TABLE table_1720 ( "COMPANY NAME" text, "Holding Companies" real, "Subsidiaries" real, "Description of activities" text, "Parent (holding) company" text )
How many companies have Postermobile Limited as a parent company?
SELECT COUNT("COMPANY NAME") FROM table_1720 WHERE "Parent (holding) company" = 'POSTERMOBILE LIMITED'
wikisql
CREATE TABLE table_9642 ( "Lane" real, "Name" text, "Country" text, "Mark" real, "React" real )
What is the average React, when Mark is less than 7.93?
SELECT AVG("React") FROM table_9642 WHERE "Mark" < '7.93'
wikisql
CREATE TABLE table_203_1 ( id number, "entrant" text, "constructor" text, "chassis" text, "engine" text, "no" number, "driver" text )
what is the last chassis listed ?
SELECT "chassis" FROM table_203_1 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_24940 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What is the name of episode number 41 in the series?
SELECT "Title" FROM table_24940 WHERE "No. in series" = '41'
wikisql
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...
从2010年2月7日到2014年5月21日内医院1521051科室涉及医疗费总额超过1941.65元的有多少?
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1521051' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-07' AND '2014-05-21' GROUP B...
css
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,...
在09年3月14日到2019年9月13日内患者周才英花了多少医保金额?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '周才英' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-14' AND '2019-09-13'
css
CREATE TABLE table_name_25 ( opponent VARCHAR, rockets_score VARCHAR )
Which Opponent has a Rockets score of 107?
SELECT opponent FROM table_name_25 WHERE rockets_score = 107
sql_create_context
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE COURSE ( CRS_CODE...
Bar chart of sum crs credit from each dept code, I want to order from low to high by the bars.
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE table_8982 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
Which Director has a Rank of 12?
SELECT "Director" FROM table_8982 WHERE "Rank" = '12'
wikisql
CREATE TABLE table_name_72 ( college VARCHAR, position VARCHAR, round VARCHAR )
What college was the defensive end pick that was picked in round 2?
SELECT college FROM table_name_72 WHERE position = "defensive end" AND round = 2
sql_create_context
CREATE TABLE table_204_643 ( id number, "release" number, "artist" text, "title" text, "notes" text, "album" text )
which year had the most titles released ?
SELECT "release" FROM table_204_643 GROUP BY "release" ORDER BY COUNT("title") DESC LIMIT 1
squall
CREATE TABLE table_name_66 ( swimsuit INTEGER, state VARCHAR, average VARCHAR )
What is the lowest swimsuit score a contestant from Rhode Island with an average larger than 9.235 has?
SELECT MIN(swimsuit) FROM table_name_66 WHERE state = "rhode island" AND average > 9.235
sql_create_context
CREATE TABLE table_3698 ( "Position" text, "Nationality" text, "Name" text, "League apps" real, "League goals" real, "FA Cup apps" real, "FA Cup goals" real, "Total apps" real, "Total goals" real )
Name the total apps for league apps being 4
SELECT "Total apps" FROM table_3698 WHERE "League apps" = '4'
wikisql
CREATE TABLE table_name_24 ( chapter INTEGER, chinese VARCHAR )
Name the highest chapter with chinese of
SELECT MAX(chapter) FROM table_name_24 WHERE chinese = "釋言"
sql_create_context
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
What are all the friends of Alice who are female?
SELECT T2.friend FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'
spider
CREATE TABLE table_2818164_2 ( title VARCHAR, production_code VARCHAR )
What's the title of the episode with production code 104?
SELECT title FROM table_2818164_2 WHERE production_code = 104
sql_create_context
CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pag...
Draw a bar chart for how many stores are headquarted in each city?, and I want to rank by the Y in desc.
SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_69625 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
How many years did the team place 2nd in Antwerp, Belgium?
SELECT COUNT("Year") FROM table_69625 WHERE "Venue" = 'antwerp, belgium' AND "Result" = '2nd'
wikisql
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...
what is primary disease and discharge time of subject name heather vineyard?
SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.name = "Heather Vineyard"
mimicsql_data
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 i...
how many days does it have been since patient 004-79017's last analgesics - non-narcotic analgesic in this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017'...
eicu
CREATE TABLE table_33096 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team score for the game where the home team scored 11.13 (79)?
SELECT "Away team score" FROM table_33096 WHERE "Home team score" = '11.13 (79)'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about All_Games_Percent over the All_Games , could you list bar in asc order please?
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose ethnicity is white - russian and drug route is ou?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "OU"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
how much is the hco3 difference for patient 005-11182 second measured on the last hospital visit compared to the value first measured on the last hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
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 code , and group by attribute founder, and sort y-axis in ascending order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( so...
How many songs were released for each format Show bar chart, and order by the formats from low to high.
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
when patient 3229 arterial bp [systolic] last measured since 08/01/2103?
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 = 3229)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_63572 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many bronze medals for Romania when the silver count is more than 1?
SELECT AVG("Bronze") FROM table_63572 WHERE "Nation" = 'romania' AND "Silver" > '1'
wikisql
CREATE TABLE table_name_55 ( nadal INTEGER, round VARCHAR, tournament VARCHAR )
What was the nadal in Miami in the final round?
SELECT MAX(nadal) FROM table_name_55 WHERE round = "final" AND tournament = "miami"
sql_create_context
CREATE TABLE table_68042 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What was the date of the week 13 game?
SELECT "Date" FROM table_68042 WHERE "Week" = '13'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
Owners of the most badges.
SELECT Users.Id AS "user_link", Users.Id, Users.Reputation, COUNT(*) OVER (PARTITION BY Users.Id) AS Count, Badges.Date FROM Badges, Users WHERE Badges.Name = '##BadgeName:string##' AND Badges.UserId = Users.Id ORDER BY Count DESC, Users.Reputation, Users.Id, Badges.Date
sede
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
Give me the comparison about ID over the meter_700 , I want to show by the Y-axis from low to high.
SELECT meter_700, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE table_52684 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text, "Attendance" real, "Record" text )
What is the score against the indians after game 2?
SELECT "Score" FROM table_52684 WHERE "Game" > '2' AND "Opponent" = 'indians'
wikisql
CREATE TABLE table_72390 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many parties were for candidates newt gingrich (r) 59.1% dock h. davis (d) 40.9%?
SELECT COUNT("Party") FROM table_72390 WHERE "Candidates" = 'Newt Gingrich (R) 59.1% Dock H. Davis (D) 40.9%'
wikisql
CREATE TABLE table_16494 ( "#" real, "Episode" text, "Air Date" text, "Rating" text, "Share" real, "18\u201349 (Rating/Share)" text, "Viewers (m)" text, "Weekly Rank" real )
What is the episode where 18-49 has a rating/share of 3.5/9
SELECT "Episode" FROM table_16494 WHERE "18\u201349 (Rating/Share)" = '3.5/9'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
Find the type and route of administration of Avapro?
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Avapro"
mimicsql_data
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE sta...
Plot season by how many season as a line chart, and could you sort by the x-axis in ascending?
SELECT Season, COUNT(Season) FROM game ORDER BY Season
nvbench
CREATE TABLE table_name_23 ( partner VARCHAR, surface VARCHAR, date VARCHAR )
What is the name of a partner that played on a hard surface on 18 April 2011?
SELECT partner FROM table_name_23 WHERE surface = "hard" AND date = "18 april 2011"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
how many times does patient 2518 have a d5w intake on 12/29/this year?
SELECT COUNT(*) 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 = 2518)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5w' AND d_it...
mimic_iii
CREATE TABLE table_name_20 ( island VARCHAR, population VARCHAR )
Which island has a population of 9,520 (2000)?
SELECT island FROM table_name_20 WHERE population = "9,520 (2000)"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Before taking GREEKMOD 503 , what other courses are useful ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'GREEKMOD' AND number = 503
advising
CREATE TABLE table_name_15 ( builder VARCHAR, number VARCHAR, date VARCHAR, length VARCHAR )
Which Builder has a Date smaller than 1913, and a Length of feet (m), and a Number of 15?
SELECT builder FROM table_name_15 WHERE date < 1913 AND length = "feet (m)" AND number = "15"
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...
被开出苯巴比妥片的患者张温书在2004年11月1日到2006年9月7日期间开了多少次?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '张温书' AND t_kc22.STA_DATE BETWEEN '2004-11-01' AND '2006-09-07' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz...
css
CREATE TABLE table_name_32 ( format VARCHAR, label VARCHAR )
Which format was under the London Records label?
SELECT format FROM table_name_32 WHERE label = "london records"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom t...
how many patients have received dx ultrasound-heart after the first contrast aortogram procedure in the same hospital visit?
SELECT COUNT(DISTINCT t1.subject_id) 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 procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
mimic_iii
CREATE TABLE table_name_16 ( time_retired VARCHAR, driver VARCHAR, grid VARCHAR, constructor VARCHAR )
Which Time/Retired has a grid smaller than 9, a Ferrari construct, and is driven by Rubens Barrichello?
SELECT time_retired FROM table_name_16 WHERE grid < 9 AND constructor = "ferrari" AND driver = "rubens barrichello"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
calculate the minimum days for which patients with rash primary disease were hospitalized.
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "RASH"
mimicsql_data
CREATE TABLE table_name_21 ( runner_s__up VARCHAR, tournament VARCHAR )
Who was the Runner-up for the merrill lynch/golf digest commemorative pro-am tournament?
SELECT runner_s__up FROM table_name_21 WHERE tournament = "merrill lynch/golf digest commemorative pro-am"
sql_create_context
CREATE TABLE table_44591 ( "Season" real, "Series" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
If the Races is Test Driver what is the Position?
SELECT "Position" FROM table_44591 WHERE "Races" = 'test driver'
wikisql
CREATE TABLE table_24846 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "NBC Airdate" text, "Code" real )
How man seasons have the air date of October 2, 2001?
SELECT COUNT("Season #") FROM table_24846 WHERE "NBC Airdate" = 'October 2, 2001'
wikisql
CREATE TABLE table_name_47 ( country VARCHAR, score VARCHAR )
what is the country when the score is 71-65-69=205?
SELECT country FROM table_name_47 WHERE score = 71 - 65 - 69 = 205
sql_create_context
CREATE TABLE table_49589 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text, "Man of the Match" text )
Who did the Flames play against when Stephen Lee was the man of the match?
SELECT "Opponent" FROM table_49589 WHERE "Man of the Match" = 'stephen lee'
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...
what were the three most frequently prescribed drugs at the same time in 2100 for patients who were prescribed roxicodone?
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 = 'roxicodone' AND STRFTIME('%y', medication.drugstart...
eicu
CREATE TABLE table_204_607 ( id number, "season" number, "date" text, "location" text, "discipline" text, "place" text )
the final race finishing place was not 1st but what other place ?
SELECT "place" FROM table_204_607 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_name_79 ( crowd VARCHAR, away_team VARCHAR )
What was the crowd size when Essendon was the away team?
SELECT COUNT(crowd) FROM table_name_79 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_19669 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
WHAT IS THE NAME OF THE MENS DOUBLES PLAYER WHEN THE WOMENS DOUBLES PLAYER IS HELEN REINO KAI-RIIN SALUSTE?
SELECT "Mens doubles" FROM table_19669 WHERE "Womens doubles" = 'Helen Reino Kai-Riin Saluste'
wikisql