context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_2279413_1 ( pct_route_available VARCHAR, type_of_protection VARCHAR )
For short patent type of protections, what type of PCT route is available?
SELECT pct_route_available FROM table_2279413_1 WHERE type_of_protection = "short patent"
sql_create_context
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 item id is 51455?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51455"
mimicsql_data
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, ...
what is the number of patients whose marital status is single and gender is m?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.gender = "M"
mimicsql_data
CREATE TABLE table_dev_21 ( "id" int, "gender" string, "leukopenia" int, "dialysis" bool, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "renal_disease" bool, "fasting_triglycerides" int, "hyperlipidemia" bool, "lymphopenia" int, "hba1c" float, "fasti...
triglycerides greater than or equal to 500 mg / dl
SELECT * FROM table_dev_21 WHERE triglyceride_tg >= 500
criteria2sql
CREATE TABLE table_name_43 ( laps INTEGER, driver VARCHAR )
what is the most laps for driver jackie stewart?
SELECT MAX(laps) FROM table_name_43 WHERE driver = "jackie stewart"
sql_create_context
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...
医生59997347在2014-05-11到2016-10-25期间的门诊病人数是多少
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '59997347' AND mzjzjlb.JZKSRQ BETWEEN '2014-05-11' AND '2016-10-25'
css
CREATE TABLE table_4292 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
In which townlands is the civil parish Monkstown?
SELECT "Townland" FROM table_4292 WHERE "Civil parish" = 'Monkstown'
wikisql
CREATE TABLE table_name_86 ( save VARCHAR, opponent VARCHAR, date VARCHAR )
Name the save for braves for may 15
SELECT save FROM table_name_86 WHERE opponent = "braves" AND date = "may 15"
sql_create_context
CREATE TABLE table_17467447_1 ( written_by VARCHAR, production_code VARCHAR )
Who were the writers for production code 2t6268?
SELECT written_by FROM table_17467447_1 WHERE production_code = "2T6268"
sql_create_context
CREATE TABLE table_11335 ( "Manufacturer" text, "Type" text, "Quantity" real, "SHT Nos." text, "GWR Nos." text )
How many have SHT number 5?
SELECT MAX("Quantity") FROM table_11335 WHERE "SHT Nos." = '5'
wikisql
CREATE TABLE table_name_47 ( pop_density_people_km_2 INTEGER, population_in_millions VARCHAR, population__percentage_of_eu VARCHAR, area__percentage_of_eu VARCHAR )
What is the sum of the pop density people/km2 with a population % of EU of 0.1%, an area % of EU of 0.1%, and has more than 0.5 population in millions?
SELECT SUM(pop_density_people_km_2) FROM table_name_47 WHERE population__percentage_of_eu = "0.1%" AND area__percentage_of_eu = "0.1%" AND population_in_millions > 0.5
sql_create_context
CREATE TABLE research_staff ( staff_id number, employer_organisation_id number, staff_details text ) CREATE TABLE documents ( document_id number, document_type_code text, grant_id number, sent_date time, response_received_date time, other_details text ) CREATE TABLE research_outcom...
Show the role description and the id of the project staff involved in most number of project outcomes?
SELECT T1.role_description, T2.staff_id FROM staff_roles AS T1 JOIN project_staff AS T2 ON T1.role_code = T2.role_code JOIN project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_46237 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Series" text )
What was the score of game 2?
SELECT "Score" FROM table_46237 WHERE "Game" = '2'
wikisql
CREATE TABLE table_name_24 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on April 21?
SELECT opponent FROM table_name_24 WHERE date = "april 21"
sql_create_context
CREATE TABLE table_name_97 ( model VARCHAR, engine_type VARCHAR )
What is the model with a engine type with b5244 s2?
SELECT model FROM table_name_97 WHERE engine_type = "b5244 s2"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
count the number of patients whose admission year is less than 2150 and drug route is tp?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_35087 ( "Pos." real, "Mark" text, "Athlete" text, "Nationality" text, "Venue" text, "Date" text )
Which venue had a nationality of Belgium?
SELECT "Venue" FROM table_35087 WHERE "Nationality" = 'belgium'
wikisql
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients less than 89 years who have lab test item id 50953.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "89" AND lab.itemid = "50953"
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 records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the amount of founder , and group by attribute founder, I want to sort by the x axis in asc.
SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE table_10431 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score for the home team when the away team, Melbourne, scored 6.6 (42)?
SELECT "Home team score" FROM table_10431 WHERE "Away team score" = '6.6 (42)' AND "Away team" = 'melbourne'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
结束日期的时间,在门诊就诊43308617358是几号?
SELECT JZJSSJ FROM mzjzjlb WHERE JZLSH = '43308617358'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
名叫孔红艳的病人在2002年11月10日至2007年9月10日内测验人为13231895的所有检验结果指标记录的检验指数的流水号是啥?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
CREATE TABLE races ( raceid VARCHAR, name VARCHAR ) CREATE TABLE results ( raceid VARCHAR )
How many drivers participated in the race Australian Grand Prix held in 2009?
SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
sql_create_context
CREATE TABLE table_67218 ( "Year" real, "Award" text, "Category" text, "Title" text, "Result" text )
What is the total number of Year for the Title of The Queen, has an Award of British Academy Film Award, and has a Result of Won?
SELECT COUNT("Year") FROM table_67218 WHERE "Title" = 'the queen' AND "Award" = 'british academy film award' AND "Result" = 'won'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
手术量排名第一与手术量排名倒数第一的科室在15年2月24日到21年12月9日这段时间的手术量差多少?
SELECT (SELECT COUNT(*) FROM t_kc22 WHERE STA_DATE BETWEEN '2015-02-24' AND '2021-12-09' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 1) - (SELECT COUNT(*) FROM t_kc22 WHERE STA_DATE BETWEEN '2015-02-24' AND '2021-12-09' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients whose diagnoses short title is surg compl-heart and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Surg compl-heart" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_1342256_10 ( incumbent VARCHAR, first_elected VARCHAR )
Which incumbent was first elected in 1940?
SELECT incumbent FROM table_1342256_10 WHERE first_elected = 1940
sql_create_context
CREATE TABLE table_name_39 ( total INTEGER, average VARCHAR, rank_by_average VARCHAR )
Name the most total with average less than 36.5 and rank by average of 14
SELECT MAX(total) FROM table_name_39 WHERE average < 36.5 AND rank_by_average = 14
sql_create_context
CREATE TABLE table_name_56 ( founded INTEGER, named_after VARCHAR )
When is the earliest year founded for houses named after the river benue?
SELECT MIN(founded) FROM table_name_56 WHERE named_after = "river benue"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
patient 029-7028 has produced tube feeding residual discarded (ml) in 09/last year?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput...
eicu
CREATE TABLE table_69750 ( "Year" text, "Team" text, "Tackles" text, "Solo" real, "Sacks" real, "INT YDS" real )
What is the total value for Solo, when the value of Sacks is 2, and when the Team is New York Jets?
SELECT COUNT("Solo") FROM table_69750 WHERE "Sacks" = '2' AND "Team" = 'new york jets'
wikisql
CREATE TABLE table_name_14 ( first_round VARCHAR, members VARCHAR )
What was the first round time for member Kenny Smith?
SELECT first_round FROM table_name_14 WHERE members = "kenny smith"
sql_create_context
CREATE TABLE table_name_48 ( college_junior_club_team__league_ VARCHAR, player VARCHAR )
What college or club team did Dale Mitchell play for?
SELECT college_junior_club_team__league_ FROM table_name_48 WHERE player = "dale mitchell"
sql_create_context
CREATE TABLE table_name_54 ( player VARCHAR, total VARCHAR, country VARCHAR )
What is Player, when Total is greater than 288, and when Country is 'South Africa'?
SELECT player FROM table_name_54 WHERE total > 288 AND country = "south africa"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
医生87598615一共诊治过多少门诊病人,在05-03-01到11-02-19期间
SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '87598615' AND mzjzjlb.JZKSRQ BETWEEN '2005-03-01' AND '2011-02-19'
css
CREATE TABLE table_203_382 ( id number, "date" text, "opponent" text, "site" text, "result" text )
on october 17th , what was the difference of the game 's scores ?
SELECT ABS("result" - "result") FROM table_203_382 WHERE "date" = 'october 17'
squall
CREATE TABLE table_2383 ( "\u2116" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many directors for #15?
SELECT COUNT("Directed by") FROM table_2383 WHERE "#" = '15'
wikisql
CREATE TABLE table_901 ( "Region" text, "Total Population" real, "Hindus" real, "% of Hindus" text, "% of Hindu total" text )
What is the entire inhabitants in Southeast Asia?
SELECT MIN("Total Population") FROM table_901 WHERE "Region" = 'Southeast Asia'
wikisql
CREATE TABLE table_23521 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Name the opponets for 6 4, 3 6, 6 2
SELECT "Opponents" FROM table_23521 WHERE "Score" = '6–4, 3–6, 6–2'
wikisql
CREATE TABLE table_11965481_13 ( series VARCHAR, date VARCHAR )
Name the series on june 5
SELECT series FROM table_11965481_13 WHERE date = "June 5"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE i...
patient 1417 had received any laboratory test during the first hospital encounter?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1417 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart, and show total number in ascending order.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE table_30120664_1 ( area__acres__ VARCHAR, civil_parish VARCHAR, townland VARCHAR )
Name the area for civil parish ballynoe and killasseragh
SELECT area__acres__ FROM table_30120664_1 WHERE civil_parish = "Ballynoe" AND townland = "Killasseragh"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
Links to my comments by score.
SELECT COUNT(*) AS CommentCount, Score FROM Comments WHERE UserId = @UserId GROUP BY Score ORDER BY Score DESC
sede
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHA...
Find the number of dorms for each gender in a bar chart, and list from high to low by the total number.
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_78221 ( "Stellar mass ( M\u2609 )" real, "Planetary mass ( M\u2295 )" real, "Lum. (L 0 )" text, "Type" text, "RHAB ( AU )" real, "RV (cm/s)" real, "Period (days)" real )
What is the smallest period (days) to have a planetary mass of 1, a stellar mass greater than 0.21 and of the type M0?
SELECT MIN("Period (days)") FROM table_78221 WHERE "Planetary mass ( M\u2295 )" = '1' AND "Stellar mass ( M\u2609 )" > '0.21' AND "Type" = 'm0'
wikisql
CREATE TABLE table_name_84 ( quantity INTEGER, ptrd_nos VARCHAR )
What is the highest Quantity for PTRD Nos. 3, 15?
SELECT MAX(quantity) FROM table_name_84 WHERE ptrd_nos = "3, 15"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
What classes should I take before enrolling in DHYGRACK 685 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'DHYGRACK' AND number = 685
advising
CREATE TABLE table_28138035_6 ( womens_doubles VARCHAR, womens_singles VARCHAR, mens_singles VARCHAR )
How many times did li ju win the womens singles and wang liqin win the mens singles?
SELECT COUNT(womens_doubles) FROM table_28138035_6 WHERE womens_singles = "Li Ju" AND mens_singles = "Wang Liqin"
sql_create_context
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...
在2017-05-28之前,患者24453147有哪些门诊就诊的检验报告单?看一下门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '24453147' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2017-05-28')
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
在2016年3月3日到2017年3月19日这段时间里,统计医院7038262的科室0541涉及的医疗费一共是多少钱?
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7038262' AND t_kc21.MED_ORG_DEPT_CD = '0541') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-03-03' AND '2017-03-19'
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose marital status is divorced and with admission year before 2115?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2115"
mimicsql_data
CREATE TABLE table_name_53 ( champion VARCHAR, runner_up VARCHAR )
Who won when Elon was the runner-up?
SELECT champion FROM table_name_53 WHERE runner_up = "elon"
sql_create_context
CREATE TABLE table_18624 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what is the maximum first elected with district being alabama 5
SELECT MAX("First elected") FROM table_18624 WHERE "District" = 'Alabama 5'
wikisql
CREATE TABLE table_50114 ( "Game" real, "Date" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text )
Who had the decision goal when the date was 1?
SELECT "Decision" FROM table_50114 WHERE "Date" = '1'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTa...
Worst 100 Askers from the top 1500 by question count on the site. A list of the bottom 100 askers of questions ordered by average answer score excluding community wiki / closed posts, from the top 1500 by question count
SELECT * FROM (SELECT OwnerUserId AS "user_link", COUNT(Posts.Id) AS Questions, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_question_score" FROM Posts WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY OwnerUserId ORDER BY COUNT(Posts.Id) DESC LIMIT 1500) AS D ORDER BY 'a...
sede
CREATE TABLE table_76142 ( "Title" text, "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text, "Attendance" text )
What is the Attendance number when the runner-up was suntory sungoliath, and a Title of 46th?
SELECT "Attendance" FROM table_76142 WHERE "Runner-up" = 'suntory sungoliath' AND "Title" = '46th'
wikisql
CREATE TABLE table_12457 ( "year" text, "opus" text, "town" text, "kind" text, "manuals" text, "stops" text )
What are the manuals with an opus of 147?
SELECT "manuals" FROM table_12457 WHERE "opus" = '147'
wikisql
CREATE TABLE table_34652 ( "Number of Decks" real, "Non-Suited Match" text, "Double Non-Suited Match" text, "Suited Match" text, "Suited + Non-Suited Match" text, "Double Suited Match" text, "House Edge" text )
With a Suited Match of 13:1, what is the Double Non-Suited Match?
SELECT "Double Non-Suited Match" FROM table_34652 WHERE "Suited Match" = '13:1'
wikisql
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 event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Draw a bar chart about the distribution of Time and ID , and display x-axis in desc order.
SELECT Time, ID FROM swimmer ORDER BY Time DESC
nvbench
CREATE TABLE table_name_75 ( season VARCHAR, club VARCHAR )
In what season was there a club of South Melbourne?
SELECT season FROM table_name_75 WHERE club = "south melbourne"
sql_create_context
CREATE TABLE table_43611 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
What date was the opponent the Portland Trail Blazers?
SELECT "Date" FROM table_43611 WHERE "Opponent" = 'portland trail blazers'
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, ...
请分别列出医疗就诊09954947689与医疗费总费用相同的医疗就诊记录的ID、人员ID、人员姓名、人员性别、公民身份号码、人员年龄分别是什么呢?
SELECT gwyjzb.MED_CLINIC_ID, gwyjzb.PERSON_ID, gwyjzb.PERSON_NM, gwyjzb.IDENTITY_CARD, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '09954947689') UNION SELECT fgwyjz...
css
CREATE TABLE table_36540 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
What is the episode number where Jim Sweeney was performer 1 and Mike Mcshane was performer 4?
SELECT SUM("Episode") FROM table_36540 WHERE "Performer 1" = 'jim sweeney' AND "Performer 4" = 'mike mcshane'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
flight leaving CHICAGO to NASHVILLE
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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NASHVI...
atis
CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREAT...
What is the name of the course that has the most student enrollment?
SELECT T1.course_name FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Show all allergy types and the number of allergies in each type in a bar chart.
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType
nvbench
CREATE TABLE table_203_280 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "game site" text, "tv time" text, "attendance" number, "bye" text )
which stadium had their highest attendance ?
SELECT "game site" FROM table_203_280 ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
how many patients diagnosed with s/p hanging died in or before the year 2111?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dod_year <= "2111.0"
mimicsql_data
CREATE TABLE table_name_36 ( pick VARCHAR, player VARCHAR )
What was Moe Gardner's pick?
SELECT pick FROM table_name_36 WHERE player = "moe gardner"
sql_create_context
CREATE TABLE table_17637 ( "Record" text, "Date and Time" text, "Competition" text, "Home or Away" text, "Opponent" text, "Score" text )
For the competition Mithras Cup 2nd Rd (2nd Leg), what is the date and time?
SELECT "Date and Time" FROM table_17637 WHERE "Competition" = 'Mithras Cup 2nd Rd (2nd Leg)'
wikisql
CREATE TABLE table_19153 ( "Month" text, "Week" real, "Overall" text, "Offensive" text, "Defensive" text, "Transition" text, "Rookie" text )
Who won the rookie award the week the transition award was given to Brodie Merrill and the offensive award was given to Pat Maddalena?
SELECT "Rookie" FROM table_19153 WHERE "Transition" = 'Brodie Merrill' AND "Offensive" = 'Pat Maddalena'
wikisql
CREATE TABLE table_203_313 ( id number, "name" text, "pennant" text, "builder" text, "launched" text, "original name" text, "fate" text )
how many ships were launched in the year 1944 ?
SELECT COUNT("name") FROM table_203_313 WHERE "launched" = 1944
squall
CREATE TABLE table_name_22 ( serial_no INTEGER, headquartered_city VARCHAR )
What is the sum of the serial numbers for narowal city?
SELECT SUM(serial_no) FROM table_name_22 WHERE headquartered_city = "narowal city"
sql_create_context
CREATE TABLE table_name_98 ( sodium VARCHAR, rubidium VARCHAR )
what is the properties of sodium when rubidium is nacl (2.1)?
SELECT sodium FROM table_name_98 WHERE rubidium = "nacl (2.1)"
sql_create_context
CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Des...
Show all role codes and the number of employees in each role by a bar chart, could you sort from low to high by the names?
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY Role_Code
nvbench
CREATE TABLE table_name_7 ( nhl_team VARCHAR, round VARCHAR, overall VARCHAR )
What is the NHL team for Round 5 and an overall ranking of #154?
SELECT nhl_team FROM table_name_7 WHERE round = "5" AND overall = "#154"
sql_create_context
CREATE TABLE table_44129 ( "Continent" text, "Structure" text, "Height" text, "Year" real, "Country" text )
Listed with a continent of Africa and before 2009 this structure is called what?
SELECT "Structure" FROM table_44129 WHERE "Year" < '2009' AND "Continent" = 'africa'
wikisql
CREATE TABLE table_42028 ( "Rank" real, "Mark" real, "Athlete" text, "Place" text, "Date" text )
What is the lowest mark of the rank 8 record?
SELECT MIN("Mark") FROM table_42028 WHERE "Rank" = '8'
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...
Top 100 answers for a tag.
WITH TaggedQuestions AS (SELECT Posts.* FROM Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE PostTypes.Name = 'Question' AND Tags.TagName = '##tag##'), TaggedAnswers AS (SELECT Posts.* FROM Posts JOIN TaggedQuestions ON Post...
sede
CREATE TABLE table_name_53 ( color_commentator_s_ VARCHAR, year VARCHAR, network VARCHAR )
Who were the collor commentator(s) for ESPN before 2012?
SELECT color_commentator_s_ FROM table_name_53 WHERE year < 2012 AND network = "espn"
sql_create_context
CREATE TABLE Student ( StuID VARCHAR ) CREATE TABLE Participates_in ( StuID VARCHAR )
Show the ids of the students who don't participate in any activity.
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
sql_create_context
CREATE TABLE table_name_52 ( pick VARCHAR, college VARCHAR, pba_team VARCHAR )
What is the pick number for the College of Perpetual help with the Coca-Cola Tigers as a PBA team?
SELECT COUNT(pick) FROM table_name_52 WHERE college = "perpetual help" AND pba_team = "coca-cola tigers"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName te...
Your downvoted questions what you can't delete. Buggy - after the daily mirror is ready, I will be able to fix it
WITH Raw AS (SELECT Q.Id AS QId, A.Id AS AId, Votes.Id AS VoteId FROM Posts AS Q INNER JOIN Posts AS A ON Q.Id = A.ParentId LEFT JOIN Votes ON Votes.PostId = A.Id WHERE Q.OwnerUserId = '##UserId:int##' AND Q.Score < 0 AND A.OwnerUserId != '##UserId##') SELECT QId FROM Raw WHERE NOT VoteId IS NULL
sede
CREATE TABLE table_61101 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What was the grid for rider Russell Holland, riding a Honda CBR1000rr?
SELECT "Grid" FROM table_61101 WHERE "Bike" = 'honda cbr1000rr' AND "Rider" = 'russell holland'
wikisql
CREATE TABLE table_1014319_1 ( dixon VARCHAR, dance_song VARCHAR, result VARCHAR )
What score did Dixon give to the song 'samba / young hearts run free', which was in second place?
SELECT dixon FROM table_1014319_1 WHERE dance_song = "Samba / Young Hearts Run Free" AND result = "Second place"
sql_create_context
CREATE TABLE table_65303 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What Tournament had a Score of 4 6, 6 7, 3 6?
SELECT "Tournament" FROM table_65303 WHERE "Score" = '4–6, 6–7, 3–6'
wikisql
CREATE TABLE table_13385 ( "2002/ 03" text, "2003/ 04" text, "2004/ 05" text, "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
what is 2010/11 when 2003/04 is former ranking tournaments?
SELECT "2010/ 11" FROM table_13385 WHERE "2003/ 04" = 'former ranking tournaments'
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 ...
患者俞安安为疾病V29.354,门诊诊断的神经元特异性烯醇化酶的结果定量是什么?单位是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, ...
tell me what the top five most common output events were last year?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY intakeoutput.celllabel) AS ...
eicu
CREATE TABLE table_79004 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
WHAT IS THE SUM PLAYED WITH POINTS 1 OF 53, AND POSITION LARGER THAN 3?
SELECT SUM("Played") FROM table_79004 WHERE "Points 1" = '53' AND "Position" > '3'
wikisql
CREATE TABLE table_31592 ( "Member" text, "Electorate" text, "Province" text, "MP's term" text, "Election date" text )
What is the election date for the city of auckland category:articles with hcards?
SELECT "Election date" FROM table_31592 WHERE "Electorate" = 'city of auckland category:articles with hcards'
wikisql
CREATE TABLE table_19897294_10 ( no_in_season INTEGER, no_in_series VARCHAR )
What's the season number of the episode with series number US6?
SELECT MIN(no_in_season) FROM table_19897294_10 WHERE no_in_series = "US6"
sql_create_context
CREATE TABLE table_name_31 ( winner VARCHAR, semi_finalists VARCHAR )
What is the Winner when anke huber chanda rubin was semi finalist?
SELECT winner FROM table_name_31 WHERE semi_finalists = "anke huber chanda rubin"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
i would like to arrange a flight from DENVER to PITTSBURGH
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
atis
CREATE TABLE table_35061 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
What's the average year Charles N. Felton was re-elected?
SELECT AVG("First elected") FROM table_35061 WHERE "Result" = 're-elected' AND "Incumbent" = 'charles n. felton'
wikisql
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 the title and highest price for each film in a bar chart, I want to display from high to low by the bars.
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title DESC
nvbench
CREATE TABLE table_75800 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Location" text, "Notes" text )
What is the Name of the dinosaur that was discovered in the Location, China, and whose Notes are, 'described from a single tooth'?
SELECT "Name" FROM table_75800 WHERE "Location" = 'china' AND "Notes" = 'described from a single tooth'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, Crea...
Open Questions that I've closed.
SELECT 'site://posts/' + CAST(P.Id AS TEXT) + '/revisions|' + 'Revision History for Post ' + CAST(P.Id AS TEXT) AS "revision_link", P.Id AS "post_link", H.CreationDate AS "closed_date" FROM Posts AS P INNER JOIN PostHistory AS H ON H.PostId = P.Id WHERE P.PostTypeId = 1 AND H.PostHistoryTypeId = 10 AND H.UserId = @user...
sede
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
what are the ground transportation services in PHILADELPHIA
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code
atis