context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_28884858_1 ( team VARCHAR, stadium VARCHAR )
What is the name of the team when the stadium is listed as Edward Jones Dome?
SELECT team FROM table_28884858_1 WHERE stadium = "Edward Jones Dome"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
what were the top three most commonly prescribed medications that patients were prescribed during the same hospital encounter after being diagnosed with septic arthritis?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic arthriti...
eicu
CREATE TABLE table_74276 ( "Year" real, "FBS Opponent" text, "Result" text, "Opponents Conference" text, "Opponents Head Coach" text, "Coastal Carolina Head Coach" text )
Who was the coastal Carolina head coach in 2013?
SELECT "Coastal Carolina Head Coach" FROM table_74276 WHERE "Year" = '2013'
wikisql
CREATE TABLE table_name_44 ( score VARCHAR, high_rebounds VARCHAR )
Name the score for howard (8) high rebounds
SELECT score FROM table_name_44 WHERE high_rebounds = "howard (8)"
sql_create_context
CREATE TABLE table_73516 ( "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 game in which Kevin Durant (25) did the most high points played?
SELECT "Location Attendance" FROM table_73516 WHERE "High points" = 'Kevin Durant (25)'
wikisql
CREATE TABLE table_name_91 ( second VARCHAR, third VARCHAR )
What is the Second when the third is don walchuk?
SELECT second FROM table_name_91 WHERE third = "don walchuk"
sql_create_context
CREATE TABLE table_1341472_15 ( result VARCHAR, district VARCHAR )
what's the result with district illinois 15
SELECT result FROM table_1341472_15 WHERE district = "Illinois 15"
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 allergy ( allergy...
was patient 030-31704 heartrate ever less than 61.0 until 303 days ago?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-31704')) AND vitalperiodic.heartrate < 61.0 AND NOT vitalperiodi...
eicu
CREATE TABLE table_name_2 ( entrant VARCHAR, chassis VARCHAR, points VARCHAR, year VARCHAR )
In the Formula One World Championships, which entrant had 0 points with a Ferrari 156 Chassis after 1961?
SELECT entrant FROM table_name_2 WHERE points = 0 AND year > 1961 AND chassis = "ferrari 156"
sql_create_context
CREATE TABLE table_50802 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the tie for the Crystal Palace team?
SELECT "Tie no" FROM table_50802 WHERE "Home team" = 'crystal palace'
wikisql
CREATE TABLE table_5769 ( "Date" text, "Time" text, "Opponent" text, "Result" text, "Attendance" text )
What time was the match that had an attendance of 22,329?
SELECT "Time" FROM table_5769 WHERE "Attendance" = '22,329'
wikisql
CREATE TABLE table_2840500_4 ( nationality VARCHAR, player VARCHAR )
What is the nationality of Christian Lefebvre?
SELECT nationality FROM table_2840500_4 WHERE player = "Christian Lefebvre"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose death status is 0 and diagnoses long title is delirium due to conditions classified elsewhere?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Delirium due to conditions classified elsewhere"
mimicsql_data
CREATE TABLE table_31504 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
What is the Poor Law Union for Coolkirky?
SELECT "Poor law union" FROM table_31504 WHERE "Townland" = 'Coolkirky'
wikisql
CREATE TABLE table_79412 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Series" text, "Arena" text )
Which Arena has an Opponent of @ oilers, and a Date of may 25?
SELECT "Arena" FROM table_79412 WHERE "Opponent" = '@ oilers' AND "Date" = 'may 25'
wikisql
CREATE TABLE table_50773 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
What day in March is the game with a 48-13-11 record and a game number less than 72?
SELECT SUM("March") FROM table_50773 WHERE "Record" = '48-13-11' AND "Game" < '72'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid numb...
first time patient 015-54876 got surgery in 2104?
SELECT 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 = '015-54876')) AND STRFTIME('%y', treatment.treatmenttime) = '2104'...
eicu
CREATE TABLE table_50853 ( "Name" text, "Other names" text, "Birth" text, "Death" text, "Death Place" text, "Mother" text )
when is death when death place is murshidabad and name is mir mehndi?
SELECT "Death" FROM table_50853 WHERE "Death Place" = 'murshidabad' AND "Name" = 'mir mehndi'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
mention the diagnosis long title of subject id 74463.
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "74463"
mimicsql_data
CREATE TABLE table_24291077_8 ( total VARCHAR, week VARCHAR )
What was the total rating on week 3?
SELECT total FROM table_24291077_8 WHERE week = 3
sql_create_context
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,...
查一下在2011-01-07到2019-04-03这一期间,编号为8962316的医疗机构一共处理过几次异地就诊
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8962316' AND IN_HOSP_DATE BETWEEN '2011-01-07' AND '2019-04-03' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, pape...
papers on semantic parsing
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_name_89 ( date VARCHAR, visitor VARCHAR )
What is the date of the game with toronto as the visitor?
SELECT date FROM table_name_89 WHERE visitor = "toronto"
sql_create_context
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, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '凤英发' AND NOT ...
css
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 allergy ( allergy...
had there been any organism found in the first urine, catheter specimen microbiology test of patient 031-15666 in a month before?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIM...
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose primary disease is ventricular tachycardia and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "VENTRICULAR TACHYCARDIA" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year...
List the types of competition and the number of competitions of each type in a bar chart.
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of price , and group by attribute name, order mean price in asc order.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score num...
Most popular StackOverflow/Stackexchange Tags in 2013, having been posted >10 times.
SELECT CURRENT_TIMESTAMP() AS DateTime, num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS RankSince2013, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsSince2012, num.Num AS TotalQuestions FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.I...
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the number of emergency hospital admission patients who were born before 2071?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2071"
mimicsql_data
CREATE TABLE table_77690 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did Geelong play as the home team?
SELECT "Venue" FROM table_77690 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE table_44135 ( "Poll" text, "Pre- season" text, "Mar 3" text, "Mar 17" text, "Mar 24" text, "Mar 31" text, "April 7" text, "April 14" text, "April 21" text, "April 28" text, "May 5" text, "May 12" text, "May 19" text, "May 26" text, "Final" text )
What is the Mar 24 rank when the May 26 is 13, and the May 12 is 6?
SELECT "Mar 24" FROM table_44135 WHERE "May 26" = '13' AND "May 12" = '6'
wikisql
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
How many distinct president votes are recorded?
SELECT COUNT(DISTINCT president_vote) FROM voting_record
spider
CREATE TABLE table_name_98 ( fastest_lap VARCHAR, race VARCHAR )
Who had the fastest lap in the Monaco Grand Prix?
SELECT fastest_lap FROM table_name_98 WHERE race = "monaco grand prix"
sql_create_context
CREATE TABLE table_name_58 ( year VARCHAR, edition VARCHAR )
Which Year has an Edition of 41st?
SELECT year FROM table_name_58 WHERE edition = "41st"
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...
为病人陶宏伯检测降钙素原的在06年5月31日到21年10月31日内的医务人员工号及姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W...
css
CREATE TABLE table_21336 ( "Department" text, "Projects" real, "Municipalities" real, "Farmers" real, "Irrigated Ha" real, "BID/PRONAR Investment (US$)" text, "Local Investment (US$)" text, "Total" text )
What was the BID/PRONAR investment (in $) in the department that included 1326 farmers in its projects?
SELECT "BID/PRONAR Investment (US$)" FROM table_21336 WHERE "Farmers" = '1326'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate ...
Top 5000 viewed Posts tagged with R.
SELECT Questions.Id AS "post_link", OwnerUserId FROM Posts AS Questions INNER JOIN PostTags ON PostTags.PostId = Questions.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = @Tag ORDER BY ViewCount DESC LIMIT 5000
sede
CREATE TABLE table_28078 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many episodes with the production code CA106 are there?
SELECT COUNT("Written by") FROM table_28078 WHERE "Production code" = 'CA106'
wikisql
CREATE TABLE table_name_26 ( goals_for INTEGER, lost VARCHAR )
What is the highest number of goals for for teams with 25 losses?
SELECT MAX(goals_for) FROM table_name_26 WHERE lost = 25
sql_create_context
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 medication ( medicationid number, pat...
what organism has been found in the last blood, venipuncture exam of patient 031-15417 until 08/2104?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND microlab.culturesite = 'blood, venipuncture' AND STRFTIM...
eicu
CREATE TABLE table_2181 ( "Pitcher" text, "Starts" real, "Wins" real, "Losses" real, "No decisions" real, "Winning %" text, "Seasons" text )
who was the pitcher in seasons 1982, 1984, 1985, 1987, 1988, 1989
SELECT "Pitcher" FROM table_2181 WHERE "Seasons" = '1982, 1984, 1985, 1987, 1988, 1989'
wikisql
CREATE TABLE table_name_75 ( clock_rate__mhz_ INTEGER, bandwidth__mb_s_ VARCHAR, bus_width__bits_ VARCHAR )
Bandwidth (MB/s) smaller than 4800, and a Bus width (bits) smaller than 16 has what highest Clock rate (MHz)?
SELECT MAX(clock_rate__mhz_) FROM table_name_75 WHERE bandwidth__mb_s_ < 4800 AND bus_width__bits_ < 16
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, ...
Posts Per Month Per Year #1.
SELECT TIME_TO_STR(CreationDate, '%Y') AS year, TIME_TO_STR(CreationDate, '%B') AS month, TIME_TO_STR(CreationDate, '%m') AS month_part, COUNT(*) AS post_count, 100.0 * COUNT(*) / SUM(COUNT(*)) OVER () AS post_percentage FROM Posts GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m'), TIME_TO_STR(C...
sede
CREATE TABLE table_name_9 ( match VARCHAR, player VARCHAR )
What match has Clem Hill (sa) as the player?
SELECT match FROM table_name_9 WHERE player = "clem hill (sa)"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
Show the name of each county along with the corresponding number of delegates from that county Plot them as bar chart, and I want to rank in asc by the bar please.
SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id ORDER BY County_name
nvbench
CREATE TABLE table_name_45 ( tsongas__d_ VARCHAR, date VARCHAR )
I want the tsongas of may 22, 2007
SELECT tsongas__d_ FROM table_name_45 WHERE date = "may 22, 2007"
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
统计出院诊断为持久的妄想性障碍在医院3249384的医疗记录中的最高和最低医疗费总额是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '3249384' AND qtb.OUT_DIAG_DIS_NM = '持久的妄想性障碍' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3249384' AND gyb.OUT_DIAG_DIS_NM = '持久的妄想性障碍' UNI...
css
CREATE TABLE table_2534387_10 ( time__et_ VARCHAR, entries VARCHAR )
Name the time for entries being 907
SELECT time__et_ FROM table_2534387_10 WHERE entries = "907"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
列出在医院4714216中名叫姜云英患者就诊科室名称不包含放射治疗的所有医疗就诊记录都有什么呢?
SELECT * FROM qtb WHERE qtb.PERSON_NM = '姜云英' AND qtb.MED_SER_ORG_NO = '4714216' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%放射治疗%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '姜云英' AND gyb.MED_SER_ORG_NO = '4714216' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%放射治疗%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '姜云英' AND zyb.MED_SER_...
css
CREATE TABLE table_45319 ( "Year" real, "Program Title" text, "Placement" text, "Score" real, "Class" text )
What class had a score of 95.1?
SELECT "Class" FROM table_45319 WHERE "Score" = '95.1'
wikisql
CREATE TABLE table_name_51 ( artist VARCHAR, place VARCHAR, points VARCHAR )
Which artist had a place larger than 1 with 229 points?
SELECT artist FROM table_name_51 WHERE place > 1 AND points = 229
sql_create_context
CREATE TABLE table_24925945_3 ( previous_school VARCHAR, height VARCHAR )
What was the previous school of the ft7in (m) tall player?
SELECT previous_school FROM table_24925945_3 WHERE height = "ft7in (m)"
sql_create_context
CREATE TABLE table_44817 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text )
In what Round was the Memphis Player drafted?
SELECT AVG("Round") FROM table_44817 WHERE "School/Club Team" = 'memphis'
wikisql
CREATE TABLE table_name_42 ( opponent VARCHAR, loss VARCHAR )
Who were they playing when Bird (1-4) had a loss?
SELECT opponent FROM table_name_42 WHERE loss = "bird (1-4)"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid n...
count the number of patients who had undergone oth endo proc oth vessel two or more times since 5 years ago.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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_title = 'oth endo proc oth ves...
mimic_iii
CREATE TABLE table_name_20 ( name VARCHAR, height VARCHAR )
What is the Name of the Player with a Height of m (ft 1in)?
SELECT name FROM table_name_20 WHERE height = "m (ft 1in)"
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank i...
For each headquarter, what are the headquarter and how many companies are centered there Visualize by bar chart, and I want to list in desc by the total number.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_33398 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the largest crowd at Arden Street Oval?
SELECT MAX("Crowd") FROM table_33398 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_204_441 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
how many games had more than 10,000 in attendance ?
SELECT COUNT(*) FROM table_204_441 WHERE "attendance" > 10000
squall
CREATE TABLE table_name_36 ( score VARCHAR, place VARCHAR, player VARCHAR )
What was the score that thomas levet got when he placed t10?
SELECT score FROM table_name_36 WHERE place = "t10" AND player = "thomas levet"
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 is patient 030-80604's weight for the last time since 08/2100?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-80604') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2100-08' ORDER BY patient.unitadmittime DESC LIMIT...
eicu
CREATE TABLE table_12919003_2 ( director VARCHAR, episode VARCHAR )
Who directed Episode 5?
SELECT director FROM table_12919003_2 WHERE episode = "episode 5"
sql_create_context
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, ...
在检测指标结果定量单位、检测指标名称和检验指标记录号码是13374209977的记录相同那些中筛选出检测指标结果定量不小于其的检验指标记录都有哪些呢?
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '13374209977') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '13374209977') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '13374209977')
css
CREATE TABLE table_name_91 ( title VARCHAR, developer VARCHAR, genre VARCHAR )
What is Title, when Developer is '2Play Mobile', and when Genre is 'Action'?
SELECT title FROM table_name_91 WHERE developer = "2play mobile" AND genre = "action"
sql_create_context
CREATE TABLE table_name_31 ( episode INTEGER, original_airdate VARCHAR )
What is the lowest episode number with an original airdate on 8 June 2008?
SELECT MIN(episode) FROM table_name_31 WHERE original_airdate = "8 june 2008"
sql_create_context
CREATE TABLE table_9074 ( "Country or territory" text, "Area (km\u00b2)" real, "Population" real, "Population density (per km\u00b2)" real, "Capital" text )
What's the sum of the population with a population density (per km ) of 24.8?
SELECT SUM("Population") FROM table_9074 WHERE "Population density (per km\u00b2)" = '24.8'
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...
参保人98736904在2007.1.26到2015.8.6这段时间,曾开出的药品中,单一药品最大购买次数查一下
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_53411 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text )
Who was the runner-up in the tournament in which Omar Camporese held third place?
SELECT "Runner-up" FROM table_53411 WHERE "Third Place" = 'omar camporese'
wikisql
CREATE TABLE table_name_30 ( english_title VARCHAR, director VARCHAR )
What is the English title with a Director named ang lee?
SELECT english_title FROM table_name_30 WHERE director = "ang lee"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday, and I want to order in ascending by the Y.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_62046 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Competition" text )
When the venue is away and the opponents are the bracknell bees, what is the competition?
SELECT "Competition" FROM table_62046 WHERE "Venue" = 'away' AND "Opponent" = 'bracknell bees'
wikisql
CREATE TABLE table_34224 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "Career SR" text, "Career Win-Loss" text )
What is the 1998 value with A in 1995, A in 1993, and 1r in 1996?
SELECT "1998" FROM table_34224 WHERE "1995" = 'a' AND "1993" = 'a' AND "1996" = '1r'
wikisql
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, find name and manufacturer , and group by attribute founder, and visualize them by a bar chart, sort bar from high to low order.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_name_48 ( set_2 VARCHAR, time VARCHAR, set_1 VARCHAR )
What is the score for set 2 when the time is 18:00 and the score of set 1 is 18 25?
SELECT set_2 FROM table_name_48 WHERE time = "18:00" AND set_1 = "18–25"
sql_create_context
CREATE TABLE table_25540 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" text, "Original air date" text )
How many # were written by david hoselton?
SELECT MAX("#") FROM table_25540 WHERE "Written by" = 'David Hoselton'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从2003年7月21日开始至2018年7月27日结束医疗机构1161667的检查费一共花了多少元?
SELECT SUM(t_kc22.AMOUNT) 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.MED_SER_ORG_NO = '1161667' AND t_kc22.STA_DATE BETWEEN '2003-07-21' AND '2018-07-27' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_train_36 ( "id" int, "do_not_resuscitate_dnr" bool, "active_infection" bool, "sepsis" bool, "vasospastic_diathesis" bool, "septic_shock" bool, "age" float, "NOUSE" float )
must have evidence of infection
SELECT * FROM table_train_36 WHERE active_infection = 1
criteria2sql
CREATE TABLE table_name_43 ( icao VARCHAR, airport VARCHAR )
Name the ICAO for lilongwe international airport
SELECT icao FROM table_name_43 WHERE airport = "lilongwe international airport"
sql_create_context
CREATE TABLE table_30126 ( "Catalogue number" text, "Artist" text, "Release title" text, "Format" text, "Release date" real )
What was the name of the album released by Heavy Winged?
SELECT "Release title" FROM table_30126 WHERE "Artist" = 'Heavy Winged'
wikisql
CREATE TABLE table_name_39 ( goals_against INTEGER, games_played INTEGER )
What is the mean number of goals against when there were fewer than 8 games played?
SELECT AVG(goals_against) FROM table_name_39 WHERE games_played < 8
sql_create_context
CREATE TABLE table_1553485_1 ( years_owned VARCHAR, station VARCHAR )
How many years has station KPIX been owned?
SELECT COUNT(years_owned) FROM table_1553485_1 WHERE station = "KPIX"
sql_create_context
CREATE TABLE table_38636 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Name the ICAO for lilongwe international airport
SELECT "ICAO" FROM table_38636 WHERE "Airport" = 'lilongwe international airport'
wikisql
CREATE TABLE media_types ( id INTEGER, name VARCHAR(120) ) CREATE TABLE genres ( id INTEGER, name VARCHAR(120) ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMEST...
List the top 10 customers by total gross sales. Compare the total gross sales of customers by their first name.
SELECT first_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10
nvbench
CREATE TABLE table_name_52 ( opponent VARCHAR, date VARCHAR )
Who did the Hawks play on 12/21/1973?
SELECT opponent FROM table_name_52 WHERE date = "12/21/1973"
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...
自零三年二月十六日起,截止到一一年五月二十二日,医院6771925在门诊就诊中开了6张以上的检验报告单的科室有多少
SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '6771925' AND zyjybgb.BGRQ BETWEEN '2003-02-16' AND '2011-05-22' GROUP BY zyjybgb.KSBM HAVING COUNT(*) > 6 UNION SELECT mzjybgb.KSBM FROM mzjzjl...
css
CREATE TABLE table_204_401 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "react" number, "time" number, "notes" text )
which player is from ireland ?
SELECT "name" FROM table_204_401 WHERE "nationality" = 'ireland'
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
count the number of patients who have already received the blood product administration - packed red blood cells two times since 2105.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'blood product administration - packed red blood cells' AND STRFTIME('%y', treatment.treatmenttime) >= '210...
eicu
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 drug type and drug code of drug name lactated ringers?
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Lactated Ringers"
mimicsql_data
CREATE TABLE table_train_236 ( "id" int, "renal_disease" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "hba1c" float, "fbg" int, "NOUSE" float )
hba1c 10 % or higher.
SELECT * FROM table_train_236 WHERE hba1c >= 10
criteria2sql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, 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,...
检验报告单24571107359是哪个患者门诊就诊中开出的
SELECT person_info.XM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '2...
css
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback...
Can 662 be taken on Mondays and Wednesdays ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
How many tags only have a single.
SELECT * FROM TagSynonyms
sede
CREATE TABLE table_67106 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Name the visiting team for stadium of ralph wilson stadium
SELECT "Visiting Team" FROM table_67106 WHERE "Stadium" = 'ralph wilson stadium'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, d...
A bar chart for what are the number of the dates with a maximum temperature higher than 85?, and could you display from low to high by the y axis?
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date)
nvbench
CREATE TABLE table_60123 ( "Name" text, "Volume" text, "Engine" text, "Fuel" text, "Output" text, "Torque" text, "Engine ID code(s)" text, "0\u2013100km/h,s" real, "Top speed" text, "CO 2" text, "Years" text )
Which Fuel has an Engine of 4cyl, and a 0 100km/h, s of 11.3?
SELECT "Fuel" FROM table_60123 WHERE "Engine" = '4cyl' AND "0\u2013100km/h,s" = '11.3'
wikisql
CREATE TABLE table_name_37 ( week VARCHAR, attendance VARCHAR )
Which week's game had an attendance of 90,138?
SELECT week FROM table_name_37 WHERE attendance = "90,138"
sql_create_context
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE competition ( Competition_ID in...
Give me a histogram for what is the number of players who have points less than 30 for each position?, and show X from low to high order.
SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position ORDER BY Position
nvbench
CREATE TABLE table_14724369_1 ( directed_by VARCHAR, written_by VARCHAR )
How many people directed the show written by Chris Sheridan?
SELECT COUNT(directed_by) FROM table_14724369_1 WHERE written_by = "Chris Sheridan"
sql_create_context
CREATE TABLE table_name_63 ( round INTEGER, college_junior_club_team__league_ VARCHAR, position VARCHAR )
Which Round has a College/Junior/Club Team (League) of hamilton red wings (oha), and a Position of rw?
SELECT AVG(round) FROM table_name_63 WHERE college_junior_club_team__league_ = "hamilton red wings (oha)" AND position = "rw"
sql_create_context