context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_98 ( nickname VARCHAR, location VARCHAR )
What is the nickname of the school located in Fairfax, VA?
SELECT nickname FROM table_name_98 WHERE location = "fairfax, va"
sql_create_context
CREATE TABLE table_name_31 ( location VARCHAR, altitude__metres_ INTEGER )
Tell me the location for altitude being less thaan 6102
SELECT location FROM table_name_31 WHERE altitude__metres_ < 6102
sql_create_context
CREATE TABLE table_17769 ( "Day: (see Irregularities )" text, "Sunday S\u014dl (Sun)" text, "Monday Luna (Moon)" text, "Tuesday Mars (Mars)" text, "Wednesday Mercurius (Mercury)" text, "Thursday Iuppiter (Jupiter)" text, "Friday Venus (Venus)" text, "Saturday Saturnus ( Saturn)" text )
what's the thursday iuppiter (jupiter) with friday venus (venus) being vendredi
SELECT "Thursday Iuppiter (Jupiter)" FROM table_17769 WHERE "Friday Venus (Venus)" = 'vendredi'
wikisql
CREATE TABLE table_25810656_3 ( no_in_series VARCHAR, production_code VARCHAR )
Name the number in series for production code being 204
SELECT no_in_series FROM table_25810656_3 WHERE production_code = 204
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 jybgb ( BBCJBW text, BBDM tex...
凤雨筠这位患者之前会有哪些异常反应
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ...
css
CREATE TABLE table_11054 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
Who was the runner-up in the Michelob Light Open at Kingsmill?
SELECT "Runner(s)-up" FROM table_11054 WHERE "Tournament" = 'michelob light open at kingsmill'
wikisql
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...
which primary disease is the patient stephanie suchan suffering from?
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_6986 ( "Year" text, "Film title used in nomination" text, "Original title" text, "Main Language(s)" text, "Result" text )
What is the nomination title used for the original film, Zwartboek?
SELECT "Film title used in nomination" FROM table_6986 WHERE "Original title" = 'zwartboek'
wikisql
CREATE TABLE table_16061 ( "Round" real, "Choice" real, "Overall" real, "Player name" text, "Position" text, "College" text )
Which overall pick number went to college at Youngstown State?
SELECT MIN("Overall") FROM table_16061 WHERE "College" = 'Youngstown State'
wikisql
CREATE TABLE table_19648 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
Name the number of draws for when conceded is 25
SELECT COUNT("Draws") FROM table_19648 WHERE "Conceded" = '25'
wikisql
CREATE TABLE table_name_85 ( score VARCHAR, surface VARCHAR, outcome VARCHAR )
what is the score when the surface is hard and outcome is runner-up?
SELECT score FROM table_name_85 WHERE surface = "hard" AND outcome = "runner-up"
sql_create_context
CREATE TABLE table_28243 ( "Metropolitan ring" text, "Localities" real, "Total" real, "Jews and others 1" real, "Thereof: Jews" real, "Arabs" real, "Population density (per km\u00b2)" text, "Annual Population growth rate" text )
What is the highest localities?
SELECT MAX("Localities") FROM table_28243
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, ...
自二零零五年六月十六日开始,截止到二零二一年八月二十四日,患者花新梅通过医保花了多少钱
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '花新梅' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-16' AND '2021-08-24'
css
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, ...
在病患55299978的医疗记录中,有哪几次的医疗费总额在6461.54元以上,列出入院诊断疾病的名称和编码
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '55299978' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6461.54) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '55299978' AN...
css
CREATE TABLE table_204_778 ( id number, "code" number, "county" text, "former province" text, "area (km2)" number, "population\ncensus 2009" number, "capital" text )
which county is the only one to have an area less than 1,000 square kilometers ?
SELECT "county" FROM table_204_778 WHERE "area (km2)" < 1000
squall
CREATE TABLE table_name_24 ( week INTEGER, date VARCHAR )
What week of the season had a date of october 5, 1975?
SELECT MIN(week) FROM table_name_24 WHERE date = "october 5, 1975"
sql_create_context
CREATE TABLE table_52250 ( "Team" text, "Location" text, "Joined" real, "Conference" text, "Division" text, "Previous Conference" text )
Which team is located in Westland and was previously in the Western Lakes Activities Association?
SELECT "Team" FROM table_52250 WHERE "Previous Conference" = 'western lakes activities association' AND "Location" = 'westland'
wikisql
CREATE TABLE table_34526 ( "Club" text, "Wins" text, "Last win" text, "Runners-up" text, "Last final lost" text )
When was the last win of Celtic?
SELECT "Last win" FROM table_34526 WHERE "Club" = 'celtic'
wikisql
CREATE TABLE table_40058 ( "Club" text, "Wins" real, "Loses" real, "Points For" real, "Points Against" real, "Percentage" text, "Points" real )
How many losses have points against greater than 592, with high park demons as the club, and points for greater than 631?
SELECT COUNT("Loses") FROM table_40058 WHERE "Points Against" > '592' AND "Club" = 'high park demons' AND "Points For" > '631'
wikisql
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 ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, ...
A bar chart for finding the number of the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties?, I want to list by the total number from high to low.
SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) DESC
nvbench
CREATE TABLE table_51863 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text )
Name the country moving to chelsea
SELECT "Country" FROM table_51863 WHERE "Moving to" = 'chelsea'
wikisql
CREATE TABLE table_name_14 ( points INTEGER, driver VARCHAR, top_10 VARCHAR )
What are the highest points for Justin Lofton when his top 10 is lower than 5?
SELECT MAX(points) FROM table_name_14 WHERE driver = "justin lofton" AND top_10 < 5
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Subjects ( subject_id INTEGER, subje...
Show me about the distribution of family_name and author_id in a bar chart.
SELECT family_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_203_187 ( id number, "conference" text, "bids" number, "record" text, "win %" number, "quarterfinals" number, "semifinals" number, "final" number, "champions" number )
did atlantic coast conference have more or less bids than colonial athletic association ?
SELECT (SELECT "bids" FROM table_203_187 WHERE "conference" = 'atlantic coast conference') > (SELECT "bids" FROM table_203_187 WHERE "conference" = 'colonial athletic association')
squall
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
Bar graph to show the average of product price from different product category code
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code
nvbench
CREATE TABLE table_name_33 ( against INTEGER, wins VARCHAR, wimmera_fl VARCHAR )
What is the lowest against of the wimmera fl warrack eagles, which have less than 16 wins?
SELECT MIN(against) FROM table_name_33 WHERE wins < 16 AND wimmera_fl = "warrack eagles"
sql_create_context
CREATE TABLE procedures ( 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 male patients who were admitted in hospital before 2127.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2127"
mimicsql_data
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), ...
How many accounts for different account details? Draw a bar chart, sort X-axis in asc order please.
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details ORDER BY other_account_details
nvbench
CREATE TABLE table_10274 ( "Tie no" text, "Home team" text, "Score 1" text, "Away team" text, "Attendance" text )
What was the score of the match in which Portsmouth was the Away team?
SELECT "Score 1" FROM table_10274 WHERE "Away team" = 'portsmouth'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
has patient 005-4471 excreted output (ml)-chest tube #2 midaxillary left mid;lateral today?
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 = '005-4471')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput...
eicu
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, ...
麻醉科在07年12月19日至19年8月10日这段时间药品7623总共开掉了多少
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '麻醉科' AND t_kc22.STA_DATE BETWEEN '2007-12-19' AND '2019-08-10' AND t_kc22.SOC_SRT_DIRE_CD = '7623'
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 cost ( row_id nu...
what was the name of the organism detected in patient 5849's last microbiological urine test since 05/2103?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5849) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) >=...
mimic_iii
CREATE TABLE table_19854 ( "Category" text, "Type" text, "Attribute" text, "Description" text, "Bubbles" text, "Cancelable" text )
When the type is 'reset' what is the description?
SELECT "Description" FROM table_19854 WHERE "Type" = 'reset'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
calculate the total amount of input of patient 006-65715 on 01/23/last year.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-65715')) AND intakeoutput.cellpath LIKE '%in...
eicu
CREATE TABLE table_24667 ( "Team" text, "Truck(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Listed Owner(s)" text, "Crew Chief" text )
Name the crew chief for ricky craven
SELECT "Crew Chief" FROM table_24667 WHERE "Driver(s)" = 'Ricky Craven'
wikisql
CREATE TABLE table_name_30 ( winner VARCHAR, surface VARCHAR, week VARCHAR )
Who was the winner on a hard surface on the week of November 13?
SELECT winner FROM table_name_30 WHERE surface = "hard" AND week = "november 13"
sql_create_context
CREATE TABLE table_13259009_2 ( game_site VARCHAR, opponent VARCHAR )
Where did they play the San Diego Chargers?
SELECT game_site FROM table_13259009_2 WHERE opponent = "San Diego Chargers"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id...
Questions (id, title) of a given user.
SELECT Id AS "post_link", Title, CreationDate, Score FROM Posts WHERE OwnerUserId = '##user?36688##' AND PostTypeId = 1 ORDER BY CreationDate DESC
sede
CREATE TABLE table_18804 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who are the mens singles and womens singles with sun yu?
SELECT "Mens singles" FROM table_18804 WHERE "Womens singles" = 'Sun Yu'
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...
count the number of patients whose marital status is married and procedure icd9 code is 4611?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "4611"
mimicsql_data
CREATE TABLE table_name_46 ( year VARCHAR, formula VARCHAR )
How many years had a formula of Grand Prix?
SELECT COUNT(year) FROM table_name_46 WHERE formula = "grand prix"
sql_create_context
CREATE TABLE table_20353 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many teams are listed for February 18?
SELECT COUNT("Team") FROM table_20353 WHERE "Date" = 'February 18'
wikisql
CREATE TABLE table_name_29 ( bronze INTEGER, total VARCHAR, silver VARCHAR, rank VARCHAR )
What is the average Bronze, when Silver is 0, when Rank is 19, and when Total is greater than 2?
SELECT AVG(bronze) FROM table_name_29 WHERE silver = 0 AND rank = "19" AND total > 2
sql_create_context
CREATE TABLE table_14976504_2 ( location VARCHAR, institution VARCHAR )
Where is California Lutheran University located?
SELECT COUNT(location) FROM table_14976504_2 WHERE institution = "California Lutheran University"
sql_create_context
CREATE TABLE table_19819 ( "Ido" text, "English" text, "Italian" text, "French" text, "German" text, "Russian" text, "Spanish" text )
What is the French word for the Italian word nazione?
SELECT "French" FROM table_19819 WHERE "Italian" = 'nazione'
wikisql
CREATE TABLE table_204_577 ( id number, "name" text, "first operational" text, "numeral system" text, "computing mechanism" text, "programming" text, "turing complete" text )
what name is above may 1944
SELECT "name" FROM table_204_577 WHERE "first operational" < (SELECT "first operational" FROM table_204_577 WHERE "first operational" = 'may 1944') ORDER BY "first operational" DESC LIMIT 1
squall
CREATE TABLE table_204_184 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "length" text )
is dem boyz or felonies have the featured guest p. diddy ?
SELECT "title" FROM table_204_184 WHERE "title" IN ('"dem boyz"', '"felonies"') AND "featured guest(s)" = 'p. diddy'
squall
CREATE TABLE table_38768 ( "Entrants" real, "Winner" text, "Prize" text, "Runner-up" text, "Results" text )
How many entrants did the events won by Frank Gary average?
SELECT AVG("Entrants") FROM table_38768 WHERE "Winner" = 'frank gary'
wikisql
CREATE TABLE table_204_513 ( id number, "date" text, "time" text, "opponent#" text, "site" text, "tv" text, "result" text, "attendance" number )
which game has the least attendance ?
SELECT "opponent#" FROM table_204_513 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE table_name_8 ( saturday VARCHAR, thursday VARCHAR )
Which Saturday has a Thursday of mokuy bi
SELECT saturday FROM table_name_8 WHERE thursday = "木曜日 mokuyōbi"
sql_create_context
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
For those dates that have the 5 highest cloud cover rates, please bin the date into the day of week interval and count their frequency.
SELECT date, COUNT(date) FROM weather
nvbench
CREATE TABLE table_8744 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
On what date was the opponent the Miami Dolphins?
SELECT "Date" FROM table_8744 WHERE "Opponent" = 'miami dolphins'
wikisql
CREATE TABLE table_name_53 ( reaction INTEGER, heat VARCHAR, name VARCHAR )
What is the average reaction for brigitte foster-hylton after heat 1?
SELECT AVG(reaction) FROM table_name_53 WHERE heat > 1 AND name = "brigitte foster-hylton"
sql_create_context
CREATE TABLE procedures ( 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 ) ...
count the number of patients whose diagnoses icd9 code is 6826?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "6826"
mimicsql_data
CREATE TABLE table_16258 ( "Rnd" text, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Winning driver" text, "Winning team" text, "Report" text )
what is the name of the race where newman/haas racing is the winning team and rick mears is at the pole position?
SELECT "Race Name" FROM table_16258 WHERE "Winning team" = 'Newman/Haas Racing' AND "Pole position" = 'Rick Mears'
wikisql
CREATE TABLE table_23382 ( "Rank" real, "Dismissals" real, "Player" text, "Caught" real, "Stumped" real, "Matches" real, "Innings" real )
what is the rank of adam gilchrist
SELECT COUNT("Rank") FROM table_23382 WHERE "Player" = 'Adam Gilchrist'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
when did patient 20862 get a d5w intake for the last time on 02/19/last year?
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20862)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
mimic_iii
CREATE TABLE table_60260 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Name the Player which has a To par of 6?
SELECT "Player" FROM table_60260 WHERE "To par" = '–6'
wikisql
CREATE TABLE table_2551 ( "Season" text, "Player" text, "Nationality" text, "Team" text, "Points" real, "Average" text, "Played" real )
How many games were played by the player with 927 points?
SELECT "Played" FROM table_2551 WHERE "Points" = '927'
wikisql
CREATE TABLE table_name_43 ( crowd INTEGER, venue VARCHAR )
How many people were in attendance at Glenferrie Oval?
SELECT MIN(crowd) FROM table_name_43 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_39978 ( "Species" text, "Indole" text, "Methyl Red" text, "Voges-Proskauer" text, "Citrate" text )
What is the Voges-Proskauer reading for proteus mirabilis?
SELECT "Voges-Proskauer" FROM table_39978 WHERE "Species" = 'proteus mirabilis'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
what are patient 12775's genders?
SELECT patients.gender FROM patients WHERE patients.subject_id = 12775
mimic_iii
CREATE TABLE table_204_140 ( id number, "round" number, "#" number, "player" text, "position" text, "nationality" text, "college/junior/club team (league)" text )
are there more players from sweden or canada ?
SELECT "nationality" FROM table_204_140 WHERE "nationality" IN ('sweden', 'canada') GROUP BY "nationality" ORDER BY COUNT("player") DESC LIMIT 1
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
what is the name of the drug which has been prescribed to patient 030-34260 two times since 12/2105?
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030...
eicu
CREATE TABLE table_name_72 ( seats VARCHAR, election VARCHAR, share_of_votes VARCHAR )
How many seats did the election before 2004 with 3.4% share of votes have?
SELECT seats FROM table_name_72 WHERE election < 2004 AND share_of_votes = "3.4%"
sql_create_context
CREATE TABLE table_42616 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the total of wins when the evens is less than 3?
SELECT SUM("Wins") FROM table_42616 WHERE "Events" < '3'
wikisql
CREATE TABLE table_68248 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?
SELECT AVG("Bronze") FROM table_68248 WHERE "Nation" = 'uganda' AND "Total" > '2'
wikisql
CREATE TABLE table_name_36 ( agg VARCHAR )
What was the 1st leg score for the team with an Agg score of 151-134?
SELECT 1 AS st_leg FROM table_name_36 WHERE agg = "151-134"
sql_create_context
CREATE TABLE table_name_65 ( title VARCHAR, producer VARCHAR )
What is the title of the film when the producer was 2003?
SELECT title FROM table_name_65 WHERE producer = "2003"
sql_create_context
CREATE TABLE table_name_57 ( money___ INTEGER, score VARCHAR )
What is the Money ($) of the game with a score of 69-74-70-73=286?
SELECT MAX(money___) AS $__ FROM table_name_57 WHERE score = 69 - 74 - 70 - 73 = 286
sql_create_context
CREATE TABLE table_3985 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What is the title when the director is Maynard C. Virgil i ?
SELECT "Title" FROM table_3985 WHERE "Directed by" = 'Maynard C. Virgil I'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
Visualize a bar chart about the distribution of Nationality and the average of meter_100 , and group by attribute Nationality, and I want to show by the Nationality from high to low.
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_name_80 ( segment_a VARCHAR, segment_d VARCHAR )
Which segment A item that has a Segment D of wigs?
SELECT segment_a FROM table_name_80 WHERE segment_d = "wigs"
sql_create_context
CREATE TABLE table_18646111_13 ( round_1 VARCHAR )
Name the 1/8 finals for round 1 n/a
SELECT 1 AS _8_finals FROM table_18646111_13 WHERE round_1 = "N/A"
sql_create_context
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text )
Bar graph to show how many result from different result
SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result
nvbench
CREATE TABLE table_47116 ( "Game" real, "3PM-A" text, "Percent Made" real, "Total Made" real, "Total Attempted" real, "Series Percent" real )
what is the total attempted with a total made 16
SELECT COUNT("Total Attempted") FROM table_47116 WHERE "Total Made" = '16'
wikisql
CREATE TABLE physician ( employeeid number, name text, position text, ssn number ) CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable boolean ) CREATE TABLE block ( blockfloor number, blockcode number ) CREATE TABLE affil...
Find the patient who has the most recent undergoing treatment?
SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
spider
CREATE TABLE table_46415 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text )
Who was nominated for Best Theatre Choreographer?
SELECT "Nominee" FROM table_46415 WHERE "Category" = 'best theatre choreographer'
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...
喻秀敏这个患者的医疗记录中哪几次被开过金额超过8393.94元的药品?查一下这个医疗就诊的编码
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '喻秀敏' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8393.94)
css
CREATE TABLE table_62100 ( "Name" text, "Confederation" text, "International goals" real, "Caps" real, "Goals per Match" real )
How many caps does Jon Dahl Tomasson, who has less than 0.46 goals per match, have?
SELECT COUNT("Caps") FROM table_62100 WHERE "Name" = 'jon dahl tomasson' AND "Goals per Match" < '0.46'
wikisql
CREATE TABLE table_12570207_1 ( livingstone VARCHAR, fitzroy VARCHAR )
what's the livingstone with fitzroy being 9499
SELECT livingstone FROM table_12570207_1 WHERE fitzroy = 9499
sql_create_context
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE section ( course_id varchar(8), sec_id...
Find the number of courses provided in each year with a line chart, could you display X in descending order?
SELECT year, COUNT(*) FROM section GROUP BY year ORDER BY year DESC
nvbench
CREATE TABLE table_20428 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? Panelists" text, "Coat Of Cash Wearing Celebrity" text )
What song was performed when Barbara Windsor was the guest host?
SELECT "Musical Guest (Song performed)" FROM table_20428 WHERE "Guest Host" = 'Barbara Windsor'
wikisql
CREATE TABLE table_name_83 ( circuit VARCHAR, fastest_lap VARCHAR )
What was the circuit for alberto ascari jos froil n gonz lez?
SELECT circuit FROM table_name_83 WHERE fastest_lap = "alberto ascari josé froilán gonzález"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
how many patients whose primary disease is sepsis and admission year is less than 2203?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_13096 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What is the total points for a place less than 2 with a played greater than 18?
SELECT SUM("Points") FROM table_13096 WHERE "Place" < '2' AND "Played" > '18'
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...
列出患者章恺乐医疗记录中医疗费总额多过3006.5元的入院诊断疾病编码和名称
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '章恺乐' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3006.5) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '章恺乐' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_C...
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
what are the five most frequently prescribed drugs for patients that have been prescribed famotidine (pf) at the same time, in a year before?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'famotidine (pf)' AND DATETIME(medication.drugstartt...
eicu
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...
tell me the birth date and long title of diagnoses of patient jerry deberry.
SELECT demographic.dob, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jerry Deberry"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients who had rash as primary disease and died in 2155 or before that?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.dod_year <= "2155.0"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of patients whose ethnicity is black/haitian and item id is 50904?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.itemid = "50904"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title te...
what were the three most frequently given specimen tests for patients who have previously been diagnosed with cardiac dysrhythmias nec within 2 months,?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TA...
Find the id and local authority of the station whose maximum precipitation is higher than 50 Visualize by bar chart, and display by the id in asc.
SELECT local_authority, id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id ORDER BY id
nvbench
CREATE TABLE table_name_88 ( population VARCHAR, _number_of_phones_as__percentage_of_population VARCHAR )
How many people live where there are 118% of people have phones?
SELECT population FROM table_name_88 WHERE _number_of_phones_as__percentage_of_population = 118
sql_create_context
CREATE TABLE table_name_74 ( crowd INTEGER, venue VARCHAR )
what was the largest attendance at kardinia park?
SELECT MAX(crowd) FROM table_name_74 WHERE venue = "kardinia park"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
Post Views Histogram (Regular Scale).
WITH PostScores AS (SELECT p.ViewCount, p.PostTypeId, COUNT(*) * 1.0 AS PostCount FROM Posts AS p WHERE p.PostTypeId IN (1) AND ClosedDate IS NULL AND DATEDIFF(day, p.CreationDate, GETDATE()) > '##minAge:int?7##' GROUP BY ViewCount, p.PostTypeId) SELECT ViewCount, CASE WHEN PostTypeId = '1' THEN 'Questions' ELSE 'Answe...
sede
CREATE TABLE table_name_79 ( date VARCHAR, result VARCHAR )
On what date was the result Eng by 1 wkt?
SELECT date FROM table_name_79 WHERE result = "eng by 1 wkt"
sql_create_context
CREATE TABLE table_203_750 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
for each winning game , what was their score ?
SELECT "score" FROM table_203_750 WHERE "result" = 'win'
squall
CREATE TABLE table_70405 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
How many years did barclay nordica arrows bmw enter with a bmw str-4 t/c engine with less than 1 point?
SELECT SUM("Year") FROM table_70405 WHERE "Engine" = 'bmw str-4 t/c' AND "Entrant" = 'barclay nordica arrows bmw' AND "Points" < '1'
wikisql
CREATE TABLE table_52232 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the date of the Capitals game when Columbus was the home team?
SELECT "Date" FROM table_52232 WHERE "Home" = 'columbus'
wikisql