context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many of the patients with coronary artery disease were admitted on clinic referral (premature) basis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
mimicsql_data
CREATE TABLE table_name_11 ( year INTEGER, laps VARCHAR )
Name the average year with Laps of 6
SELECT AVG(year) FROM table_name_11 WHERE laps = 6
sql_create_context
CREATE TABLE table_38370 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
Who is the player with the PBA team of Barangay Ginebra Kings?
SELECT "Player" FROM table_38370 WHERE "PBA team" = 'barangay ginebra kings'
wikisql
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...
what is primary disease and procedure short title of subject name claude chipman?
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Claude Chipman"
mimicsql_data
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在2006年3月27日到2016年9月4日期间,医院4607031的科室在门诊就诊中开出不小于19张检验报告单的有多少
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '4607031' AND jybgb.BGRQ BETWEEN '2006-03-27' AND '2016-09-04' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 19 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb...
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
If I need to leave for work at 5:00 every day , can I take 571 and 775 and still be able to do that ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 571 OR course.number = 775) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ...
advising
CREATE TABLE table_60274 ( "Model" text, "Year" text, "Type" text, "Engine" text, "Displacement cc" text )
What year was the Grand Prix with an i8 engine and a cc displacement of 1500?
SELECT "Year" FROM table_60274 WHERE "Type" = 'grand prix' AND "Engine" = 'i8' AND "Displacement cc" = '1500'
wikisql
CREATE TABLE table_56497 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did Geelong play as the away team?
SELECT "Date" FROM table_56497 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE table_63595 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
What was the population of Green County?
SELECT MIN("Population") FROM table_63595 WHERE "County" = 'green'
wikisql
CREATE TABLE table_39395 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the average value for ERP W when frequency is more than 100.1?
SELECT AVG("ERP W") FROM table_39395 WHERE "Frequency MHz" > '100.1'
wikisql
CREATE TABLE table_51419 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many attended the game when the home team's score is 5.6 (36)?
SELECT "Crowd" FROM table_51419 WHERE "Home team score" = '5.6 (36)'
wikisql
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 d_icd_diag...
how many hours has it been since patient 10624 has been prescribed lidocaine-prilocaine first on the current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'lidocaine-prilocaine' ORDER BY prescriptions...
mimic_iii
CREATE TABLE drama_workshop_groups ( workshop_group_id number, address_id number, currency_code text, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text ) CREATE TABLE stores ( store_id text, address_id number, marketi...
Give me the description of the service type that offers not only the photo product but also the film product.
SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_name = 'photo' INTERSECT SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product...
spider
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
new answers from the last 48 hours to upvote.
SELECT a.Id AS "post_link", CAST((JULIANDAY(CreationDate) - JULIANDAY(CURRENT_TIMESTAMP())) * 24.0 AS INT) AS "time_difference" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE CAST((JULIANDAY(CreationDate) - JULIANDAY(CURRENT_TIMESTAMP())) * 24.0 AS INT) <= 48 ORDER BY RAND()
sede
CREATE TABLE table_1341577_36 ( party VARCHAR, incumbent VARCHAR )
Which party does Tom Luken belong to?
SELECT party FROM table_1341577_36 WHERE incumbent = "Tom Luken"
sql_create_context
CREATE TABLE table_name_72 ( political_party VARCHAR, name VARCHAR )
Which Political Party has a Name of ibrahim bej bi ak iu?
SELECT political_party FROM table_name_72 WHERE name = "ibrahim bej biçakçiu"
sql_create_context
CREATE TABLE hosting_city ( Year int, Match_ID int, Host_City text ) CREATE TABLE match ( Match_ID int, Date text, Venue text, Score text, Result text, Competition text ) CREATE TABLE city ( City_ID int, City text, Hanzi text, Hanyu_Pinyin text, Regional_Populat...
A pie chart for what are the number of the venues of all the matches? Sort them in the descending order of match date.
SELECT Venue, COUNT(Venue) FROM match GROUP BY Venue ORDER BY Date DESC
nvbench
CREATE TABLE table_23094 ( "Districts of Bihar" text, "Total Population 2001" real, "Male Population 2001" real, "Female Population 2001" real, "Growth Rate 1981-91" text, "Growth Rate 1991-01" text, "Sex Ratio \u2021 1991" real, "Sex Ratio \u2021 2001" real, "Population density \u20...
What is the least value for total population in 2001 with a growth rate in 1991-01 of 33.08?
SELECT MIN("Total Population 2001") FROM table_23094 WHERE "Growth Rate 1991-01" = '33.08'
wikisql
CREATE TABLE district ( district_id number, district_name text, headquartered_city text, city_population number, city_area number ) CREATE TABLE store_district ( store_id number, district_id number ) CREATE TABLE store ( store_id number, store_name text, type text, area_siz...
What are the products with the maximum page size eqal to A4 or a pages per minute color less than 5?
SELECT product FROM product WHERE max_page_size = "A4" OR pages_per_minute_color < 5
spider
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) ...
what are all the flights on DL in and out of FORT WORTH
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 ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'FORT WORTH') OR (flight.from_airp...
atis
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) ...
How many companies in each headquarter? Plot a bar chart, I want to order in descending by the Headquarters please.
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC
nvbench
CREATE TABLE table_77056 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
what is the Frequency that has a fairview City of license
SELECT "Frequency" FROM table_77056 WHERE "City of license" = 'fairview'
wikisql
CREATE TABLE table_13688489_1 ( matches VARCHAR, goals_olimpia VARCHAR )
What was the number of matches when the Goals Olimpia was 149?
SELECT matches FROM table_13688489_1 WHERE goals_olimpia = 149
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...
参保人86022614在二0一一年四月十九日到二0一二年三月一日内,在门诊产生了多少检查费
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '86022614' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2011-04-19' AND '2012-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg...
css
CREATE TABLE table_name_16 ( average INTEGER, caps VARCHAR, goals VARCHAR )
What is the sum of the averages when there are 68 caps and less than 9 goals?
SELECT SUM(average) FROM table_name_16 WHERE caps = 68 AND goals < 9
sql_create_context
CREATE TABLE table_36575 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
Which poles were there for the 8th position?
SELECT "Poles" FROM table_36575 WHERE "Position" = '8th'
wikisql
CREATE TABLE table_65184 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
what is the score for tom watson?
SELECT "Score" FROM table_65184 WHERE "Player" = 'tom watson'
wikisql
CREATE TABLE table_203_408 ( id number, "rd." number, "grand prix" text, "date" text, "location" text, "pole position" text, "fastest lap" text, "winning driver" text, "constructor" text, "report" text )
who placed first in round 8 ?
SELECT "winning driver" FROM table_203_408 WHERE "rd." = 8
squall
CREATE TABLE table_18879 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who was the high scorer in the game when the team was 1-4?
SELECT "High points" FROM table_18879 WHERE "Record" = '1-4'
wikisql
CREATE TABLE table_53666 ( "English" text, "Scots" text, "West Frisian" text, "Afrikaans" text, "Dutch" text, "Dutch ( Limburgish )" text, "Low German" text, "Low German ( Groningen )" text, "Middle German ( Luxemburgish )" text, "German" text, "Yiddish" text, "Gothic" te...
What is the Dutch waord for h vd / h vur?
SELECT "Dutch" FROM table_53666 WHERE "Low German ( Groningen )" = 'høvd / høvur'
wikisql
CREATE TABLE table_name_18 ( year_startup VARCHAR, operator VARCHAR, project_name VARCHAR )
What was the startup year for the Jackpine Mine (ph 2) project with an albian sands operator?
SELECT year_startup FROM table_name_18 WHERE operator = "albian sands" AND project_name = "jackpine mine (ph 2)"
sql_create_context
CREATE TABLE table_42320 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text )
When was construction completed that was listed on 09/21/1984 and a Deleted of 11/04/1999?
SELECT "Construction completed" FROM table_42320 WHERE "Listed" = '09/21/1984' AND "Deleted" = '11/04/1999'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, Owner...
Longest posts for user.
SELECT Id AS "post_link", LENGTH(Body) AS "body_length", CASE PostTypeId WHEN 1 THEN 'Question' WHEN 2 THEN 'Answer' END AS "post_type" FROM Posts WHERE (PostTypeId = 1 OR PostTypeId = 2) ORDER BY LENGTH(Body) DESC LIMIT 10
sede
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 zyjzjlb ( YLJGDM text, JZLSH ...
哪个机构是检验报告单33869497970的报告机构,其名称和代码分别是啥?
SELECT BGJGDM, BGJGMC FROM jybgb WHERE BGDH = '33869497970'
css
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...
Give me the number of patients under 80 years of age who had other body fluid lab tests done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by weekday, list Y-axis from low to high order please.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many of the patients aged below 86 were treated with d5ns?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "86" AND prescriptions.drug = "D5NS"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those products with a price between 60 and 120, visualize a bar chart about the distribution of name and price , order in ascending by the Y.
SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Price
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者49594927的检验报告如何?在91187445953那次的医疗就诊
SELECT * FROM zyjybgb WHERE zyjybgb.JZLSH = '91187445953' UNION SELECT * FROM mzjybgb WHERE mzjybgb.JZLSH = '91187445953'
css
CREATE TABLE table_name_59 ( date VARCHAR, country VARCHAR, perpetrator VARCHAR )
What is Date, when Country is 'China', and when Perpetrator is 'Shi Yuejun , 35'?
SELECT date FROM table_name_59 WHERE country = "china" AND perpetrator = "shi yuejun , 35"
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...
病人凤夏彤在2002年4月8日到2016年2月13日内自费金额高于3400元的药品量一共有多少?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '凤夏彤' AND t_kc22.STA_DATE BETWEEN '2002-04-08' AND '2016-02-13' AND t_kc22.SELF_PAY_AMO > 3400.0
css
CREATE TABLE table_71016 ( "Date" text, "Tournament" text, "Surface" text, "Tier" text, "Opponent in the final" text, "Score" text )
What surface was played on on October 3, 2010?
SELECT "Surface" FROM table_71016 WHERE "Date" = 'october 3, 2010'
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...
自01年12月21日起,到04年6月2日,医院0169842的哪些科室涉及的医疗费总额不少于7232.0元
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '0169842' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-12-21' AND '2004-06-02' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 7232.0) AS T
css
CREATE TABLE table_name_61 ( played VARCHAR, name VARCHAR, points VARCHAR )
What was the total number of games played by se freising when their points were larger than 13?
SELECT COUNT(played) FROM table_name_61 WHERE name = "se freising" AND points > 13
sql_create_context
CREATE TABLE table_38009 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What player from New Mexico plays the WR position?
SELECT "Player" FROM table_38009 WHERE "Position" = 'wr' AND "School/Club Team" = 'new mexico'
wikisql
CREATE TABLE table_62982 ( "Year" real, "Category" text, "Nominee(s)" text, "Episode" text, "Result" text )
What is the result for a year after 2003, when the nominee(s) is john wells?
SELECT "Result" FROM table_62982 WHERE "Year" > '2003' AND "Nominee(s)" = 'john wells'
wikisql
CREATE TABLE home_game ( year number, league_id text, team_id text, park_id text, span_first text, span_last text, games number, openings number, attendance number ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots number, needed n...
Find the full name and id of the college that has the most baseball players.
SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_50 ( earnings__ INTEGER, wins VARCHAR, rank VARCHAR )
Which player has the lowest earnings and has at least 4 wins and is ranked higher than 4?
SELECT MIN(earnings__) AS $__ FROM table_name_50 WHERE wins = 4 AND rank > 4
sql_create_context
CREATE TABLE table_21459 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the number of the game that was played on January 19?
SELECT MAX("Game") FROM table_21459 WHERE "Date" = 'January 19'
wikisql
CREATE TABLE table_1273 ( "School" text, "Nickname" text, "Colors" text, "League" text, "Class" text, "Division" text )
In what division will you find the team nicknamed the Silver Eagles
SELECT "Division" FROM table_1273 WHERE "Nickname" = 'Silver Eagles'
wikisql
CREATE TABLE table_9196 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What is the lowest game number that has attendance higher than 15,052, and more than 36 points?
SELECT MIN("Game") FROM table_9196 WHERE "Attendance" > '15,052' AND "Points" > '36'
wikisql
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film ( Film_ID int, Title text, Stud...
Visualize a bar chart for how films are produced by each studio?, and order Y-axis from low to high order.
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY COUNT(*)
nvbench
CREATE TABLE table_14982 ( "Stage" text, "Time" text, "Name" text, "Length" text, "Winner" text, "Rally leader" text )
What was Stage SS2's Winner?
SELECT "Winner" FROM table_14982 WHERE "Stage" = 'ss2'
wikisql
CREATE TABLE table_name_86 ( position VARCHAR, points VARCHAR, lost VARCHAR )
What is the position number when there were 29 points, and less than 2 is lost?
SELECT COUNT(position) FROM table_name_86 WHERE points = 29 AND lost < 2
sql_create_context
CREATE TABLE table_61851 ( "Poison/Klesha" text, "Sanskrit" text, "Pali" text, "Tibetan" text, "Alternate translations" text )
What is the pali word for phrag dog in tibetan?
SELECT "Pali" FROM table_61851 WHERE "Tibetan" = 'phrag dog'
wikisql
CREATE TABLE table_55326 ( "Player" text, "Games" real, "Goals" real, "First Games" text, "Last Games" text )
How many goals does mitsuo kato have?
SELECT MAX("Goals") FROM table_55326 WHERE "Player" = 'mitsuo kato'
wikisql
CREATE TABLE gwyjzb ( 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, ...
列出在医院4714216中名叫姜云英患者就诊科室名称不包含放射治疗的所有医疗就诊记录都有什么呢?
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '姜云英' AND gwyjzb.MED_SER_ORG_NO = '4714216' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%放射治疗%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '姜云英' AND fgwyjzb.MED_SER_ORG_NO = '4714216' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%放射治疗%'
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number...
Questions removed from HNQ list.
SELECT h52.PostId AS "post_link", h52.CreationDate AS "became_hot", h53.CreationDate AS "removed", h53.UserId AS "user_link", 'site://posts/' + CAST(h52.PostId AS TEXT) + '/revisions|Revisions' FROM PostHistory AS h52 LEFT OUTER JOIN PostHistory AS h53 ON h52.PostId = h53.PostId AND h53.PostHistoryTypeId = 53 WHERE h52...
sede
CREATE TABLE table_45634 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
When was the record 17-17?
SELECT "Date" FROM table_45634 WHERE "Record" = '17-17'
wikisql
CREATE TABLE table_name_79 ( result VARCHAR, week INTEGER )
What results has a week smaller than 2?
SELECT result FROM table_name_79 WHERE week < 2
sql_create_context
CREATE TABLE table_21535 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where was the location and what was the attendance in the game that Anthony Parker (7) earned high assists?
SELECT "Location Attendance" FROM table_21535 WHERE "High assists" = 'Anthony Parker (7)'
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 ...
患者任同和的地高辛情况在05年7月20日到2016年2月21日内啥样?
SELECT * 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.BGDH WHERE hz_info.person_i...
css
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 ...
病患何嘉悦在02年4月18日到2020年5月25日内所有的检验结果指标记录中检测人是冯婉娜时检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy...
css
CREATE TABLE table_name_91 ( record VARCHAR, time VARCHAR )
What is the record when the time is 1:11?
SELECT record FROM table_name_91 WHERE time = "1:11"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescription...
how many hours has passed since patient 8888 stayed in ward 14 for the first time on the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE table_name_87 ( ordered VARCHAR, name VARCHAR )
What ordered has helena as the name?
SELECT ordered FROM table_name_87 WHERE name = "helena"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, ...
what are the flights available after 1500 between DENVER and SAN FRANCISCO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1500 AND flight.to_airport = AIRPORT_SERVICE_1...
atis
CREATE TABLE table_78640 ( "Battle" text, "Date" text, "Bulgarian Commander" text, "Latin Commander" text, "Result" text )
On what Date was Henry I Latin Commander of the Battle of Boruy?
SELECT "Date" FROM table_78640 WHERE "Latin Commander" = 'henry i' AND "Battle" = 'battle of boruy'
wikisql
CREATE TABLE table_24074130_5 ( win_lose VARCHAR, against VARCHAR )
What is every entry in the win/lose against Sweden?
SELECT win_lose FROM table_24074130_5 WHERE against = "Sweden"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
how much did the hospital bill of patient 022-44805 since 2105 amount to?
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805') AND STRFTIME('%y', cost.chargetime) >= '2105'
eicu
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
Give me a histogram for what is total number of show times per dat for each cinema?, and show show times per day in asc order please.
SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day)
nvbench
CREATE TABLE table_33697 ( "Episode Number" real, "Title" text, "Podcast Date" text, "Run time" text, "Historical References" text )
What is the run time of the episode that aired on September 4, 2005?
SELECT "Run time" FROM table_33697 WHERE "Podcast Date" = 'september 4, 2005'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose admission location is emergency room admit and procedure icd9 code is 9229?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "9229"
mimicsql_data
CREATE TABLE table_71677 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Which record happened on the date of May 7?
SELECT "Record" FROM table_71677 WHERE "Date" = 'may 7'
wikisql
CREATE TABLE table_name_35 ( Id VARCHAR )
What is the 1995 value with a 2005 value bigger than 74, a 2008 value of 84, and a 2000 value less than 80?
SELECT SUM(1995) FROM table_name_35 WHERE 2005 > 74 AND 2008 = 84 AND 2000 < 80
sql_create_context
CREATE TABLE table_name_39 ( status VARCHAR, opposing_teams VARCHAR )
Who won the event against U.S.A.?
SELECT status FROM table_name_39 WHERE opposing_teams = "u.s.a."
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous...
Highest-voted first-word of question title.
SELECT REPLACE(LOWER(SUBSTRING(Title, 0, STR_POSITION(Title, ' ', 1))), '''s', '') AS FirstWord, AVG(Score) AS avgScore, SUM(Score) AS sumScore, COUNT(Id) AS num_Qs FROM Posts WHERE PostTypeId = 1 AND Score > 5 AND ViewCount > 50 GROUP BY REPLACE(LOWER(SUBSTRING(Title, 0, STR_POSITION(Title, ' ', 1))), '''s', '') HAVIN...
sede
CREATE TABLE table_7396 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
How many weeks have pittsburgh steelers as the opponent?
SELECT COUNT("Week") FROM table_7396 WHERE "Opponent" = 'pittsburgh steelers'
wikisql
CREATE TABLE table_26817 ( "Episode no." real, "Airdate" text, "Viewers" real, "BBC Three weekly ranking" text, "Cable rank" text )
When 656000 is the amount of viewers and n/a is the cable rank what is the airdate?
SELECT "Airdate" FROM table_26817 WHERE "Cable rank" = 'N/A' AND "Viewers" = '656000'
wikisql
CREATE TABLE table_name_60 ( chinese_title VARCHAR, hk_viewers VARCHAR, premiere VARCHAR )
What is the Chinese Title Premiering 32 with 2.07 million HK viewers?
SELECT chinese_title FROM table_name_60 WHERE hk_viewers = "2.07 million" AND premiere = 32
sql_create_context
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
自2015.6.29日起,至2017.12.17日止,把患者93103311这段时间被开出的所有检验报告单中的标本采集部位给一一列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '93103311' AND jybgb.BGRQ BETWEEN '2015-06-29' AND '201...
css
CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE ref_document_types ( docume...
Show ids for all documents in type CV without expense budgets.
SELECT document_id FROM documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM documents_with_expenses
spider
CREATE TABLE table_name_26 ( inhabitants_per_mep INTEGER, population_millions VARCHAR, meps VARCHAR, member_state VARCHAR )
What is the highest number of inhabitants per MEP that has MEPs larger than 50, a member of Germany, and a population less than 82.43 million?
SELECT MAX(inhabitants_per_mep) FROM table_name_26 WHERE meps > 50 AND member_state = "germany" AND population_millions < 82.43
sql_create_context
CREATE TABLE round ( Name VARCHAR, Member_ID VARCHAR ) CREATE TABLE member ( Name VARCHAR, Member_ID VARCHAR )
List the names of members who did not participate in any round.
SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round)
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...
give the diagnoses and procedure name of subject id 2560.
SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_28561455_1 ( no_in_season INTEGER )
What's the smallest season number?
SELECT MIN(no_in_season) FROM table_28561455_1
sql_create_context
CREATE TABLE table_79069 ( "Elimination" text, "Wrestler" text, "Team" text, "Eliminated by" text, "Elimination Move" text, "Time" text )
What is the Elimination move listed against Regal?
SELECT "Elimination Move" FROM table_79069 WHERE "Wrestler" = 'regal'
wikisql
CREATE TABLE table_39571 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
What is the highest number of wins of the player with less than $4,976,980 in earnings and a rank lower than 4?
SELECT MAX("Wins") FROM table_39571 WHERE "Earnings ( $ )" < '4,976,980' AND "Rank" > '4'
wikisql
CREATE TABLE table_19698421_1 ( change__percentage_points_ VARCHAR, average_voters_per_candidate VARCHAR )
How many elections had 1423 average voters per candidate?
SELECT COUNT(change__percentage_points_) FROM table_19698421_1 WHERE average_voters_per_candidate = 1423
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, fi...
what were the top three most frequently prescribed medicines since 3 years ago?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE table_name_68 ( pairing VARCHAR, binomial VARCHAR )
Binomial of (1) has what pairing?
SELECT pairing FROM table_name_68 WHERE binomial = "θ(1)"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients below the age of 62 have drug code furo40i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "62" AND prescriptions.formulary_drug_cd = "FURO40I"
mimicsql_data
CREATE TABLE table_70421 ( "Year" real, "Entrant" text, "Class" text, "Chassis" text, "Engine" text, "Rank" text, "Points" text )
Which class has a year prior to 2011 and audi r15 tdi as the chassis?
SELECT "Class" FROM table_70421 WHERE "Year" < '2011' AND "Chassis" = 'audi r15 tdi'
wikisql
CREATE TABLE table_name_95 ( number_of_cars INTEGER, car__number VARCHAR, year_started VARCHAR, current_car VARCHAR )
WHAT IS THE HIGHEST # OF CARS WITH A START YEAR LESS THAN 2012, TBA CURRENT CAR, AND MORE THAN 1 CAR?
SELECT MAX(number_of_cars) FROM table_name_95 WHERE year_started < 2012 AND current_car = "tba" AND car__number > 1
sql_create_context
CREATE TABLE table_20150 ( "Ring name" text, "Current rank" text, "Debut" text, "Stable" text, "Birthplace" text, "Career and other notes" text )
What are the debut year for wrestlers born in Nara?
SELECT "Debut" FROM table_20150 WHERE "Birthplace" = 'Nara'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Which classes are the MDE ones ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_name_59 ( year VARCHAR, laps VARCHAR, finish VARCHAR )
In what year were laps less than 64 and the finish at 25?
SELECT year FROM table_name_59 WHERE laps < 64 AND finish = "25"
sql_create_context
CREATE TABLE table_name_20 ( position INTEGER, goals_against VARCHAR, lost VARCHAR )
What position was the team who had less then 63 goals against and less than 6 losses?
SELECT AVG(position) FROM table_name_20 WHERE goals_against < 63 AND lost < 6
sql_create_context
CREATE TABLE student_course_attendance ( student_id VARCHAR ) CREATE TABLE student_course_registrations ( student_id VARCHAR )
What are the id of students who registered courses or attended courses?
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
sql_create_context
CREATE TABLE table_51603 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
What driver went 14 rounds with a 193 Chassis?
SELECT "Driver" FROM table_51603 WHERE "Chassis" = '193' AND "Rounds" = '14'
wikisql