context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_297 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which team -lrb- s -rrb- have the least amount of silver medals ?
SELECT "nation" FROM table_204_297 WHERE "silver" = (SELECT MIN("silver") FROM table_204_297)
squall
CREATE TABLE table_4633 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What venue features geelong as the away side?
SELECT "Venue" FROM table_4633 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE table_3219 ( "Season" text, "Winner" text, "Runner-up" text, "Final Score" text, "3rd place" text )
Who is the runner-up for season 2011 12?
SELECT "Runner-up" FROM table_3219 WHERE "Season" = '2011–12'
wikisql
CREATE TABLE table_80285 ( "Opponent" text, "Highest ranking" text, "Matches" real, "Lost" real, "Win %" text )
What is the smallest number of Matches with less than 97 losses and a Win rate of 28.68%?
SELECT MIN("Matches") FROM table_80285 WHERE "Win %" = '28.68%' AND "Lost" < '97'
wikisql
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, ...
How many trains in each name category, give me the result with a bar chart, and list bars in ascending order.
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
does YX serve 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 ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE') OR (flight.from_airpo...
atis
CREATE TABLE table_46092 ( "Country" text, "Population (July 2005 est.)" real, "Land Area (km\u00b2)" real, "% of arable land (2005 est.)" text, "Arable Land (km\u00b2)" real, "Population Density (pop per km\u00b2)" real )
What is the land area of Switzerland with a population density fewer than 188 km ?
SELECT AVG("Land Area (km\u00b2)") FROM table_46092 WHERE "Country" = 'switzerland' AND "Population Density (pop per km\u00b2)" < '188'
wikisql
CREATE TABLE table_70980 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text )
Name the award for nominated result and year after 2011
SELECT "Award" FROM table_70980 WHERE "Result" = 'nominated' AND "Year" > '2011'
wikisql
CREATE TABLE table_name_30 ( format VARCHAR, frequency VARCHAR )
WHich format has a Frequency of 99.3 fm?
SELECT format FROM table_name_30 WHERE frequency = "99.3 fm"
sql_create_context
CREATE TABLE table_38994 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What's the total Lost that has a Played that's larger than 42?
SELECT SUM("Lost") FROM table_38994 WHERE "Played" > '42'
wikisql
CREATE TABLE table_204_70 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text )
what nfl team had the last pick ?
SELECT "nfl team" FROM table_204_70 ORDER BY "pick #" DESC LIMIT 1
squall
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...
give me the number of patients whose admission location is transfer from hosp/extram and lab test name is iron binding capacity, total?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.label = "Iron Binding Capacity, Total"
mimicsql_data
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 text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
列出患者赵星波被开出的所有检验报告单在2011-11-25到2013-05-15期间的检验报告单号是什么?
(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 jyb...
css
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
how much does the LIMOUSINE service cost within PITTSBURGH
SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE'
atis
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 hz_info ( KH text, KLX number...
查查54720580552的检验报告单的检验类型是属于那一类的
SELECT zyjybgb.JYLX FROM zyjybgb WHERE zyjybgb.BGDH = '54720580552' UNION SELECT mzjybgb.JYLX FROM mzjybgb WHERE mzjybgb.BGDH = '54720580552'
css
CREATE TABLE table_22842 ( "Rank" real, "Race Number" real, "Name" text, "NOC" text, "- 250m" text, "- 500m" text, "- 750m" text, "- 1,000m" text )
If -750 is 45.505, what is the maximum rank?
SELECT MAX("Rank") FROM table_22842 WHERE "- 750m" = '45.505'
wikisql
CREATE TABLE table_201_46 ( id number, "name" text, "position" text, "length\n[km]" number, "drainage basin area\n[km2]" number, "confluence\n[by lahn-km]" number, "mouth elevation\n[m above msl]" number )
which lahn that exceeds 300 m also has a length that exceeds 10 km ?
SELECT "name" FROM table_201_46 WHERE "mouth elevation\n[m above msl]" > 300 AND "length\n[km]" > 10
squall
CREATE TABLE table_31048 ( "City/Municipality" text, "Population (2010)" real, "Area (km\u00b2)" text, "Pop. density (per km\u00b2)" text, "Income Classification" text )
When 82.74 is the area in kilometers squared what is the pop.density (per km2)?
SELECT "Pop. density (per km\u00b2)" FROM table_31048 WHERE "Area (km\u00b2)" = '82.74'
wikisql
CREATE TABLE table_44200 ( "NTSC M" text, "PAL B,G,H" text, "PAL I" text, "PAL N" text, "PAL M" text )
What is the PAL M for the NTSC M 4.5mhz?
SELECT "PAL M" FROM table_44200 WHERE "NTSC M" = '4.5mhz'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
how much did patient 25997 spend for their hospital stay in 2100?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25997) AND STRFTIME('%y', cost.chargetime) = '2100'
mimic_iii
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
what is the monthly minimum lactate dehydrogenase (ld) level of patient 14397 since 03/2104?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate dehydrogenase (ld)') AND STRFTIME('%y-%m', labevents.charttime) >= ...
mimic_iii
CREATE TABLE table_name_56 ( date VARCHAR, opponents VARCHAR )
When was the game played against Astley Bridge 'a'?
SELECT date FROM table_name_56 WHERE opponents = "astley bridge 'a'"
sql_create_context
CREATE TABLE table_25308 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cowboys points" real, "Opponents" real, "Record" text )
What was the result against the team which the Cowboys have a 6-2 record against?
SELECT "Result" FROM table_25308 WHERE "Record" = '6-2'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
Up vs Down votes by week day.
SELECT TIME_TO_STR(CreationDate, 'WEEKDA%Y') AS Day, COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLO...
sede
CREATE TABLE table_name_34 ( termination_of_mission VARCHAR, title VARCHAR, representative VARCHAR )
What is the Termination of Mission date for Marsha E. Barnes, the Ambassador Extraordinary and Plenipotentiary?
SELECT termination_of_mission FROM table_name_34 WHERE title = "ambassador extraordinary and plenipotentiary" AND representative = "marsha e. barnes"
sql_create_context
CREATE TABLE table_15367 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
Which nominating festival did Bosnia and Herzegovina enter?
SELECT "Nominating Festival" FROM table_15367 WHERE "Country" = 'bosnia and herzegovina'
wikisql
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 fzzmzjzjlb ( HXPLC number, HZ...
以往患者32467373有哪些门诊诊断还记得吗?
SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '32467373' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AN...
css
CREATE TABLE table_1180228_1 ( dvd_name VARCHAR, num_of_discs INTEGER )
What is the name of the DVD where the number of discs is greater than 2.0
SELECT dvd_name FROM table_1180228_1 WHERE num_of_discs > 2.0
sql_create_context
CREATE TABLE table_22669375_1 ( location VARCHAR, race_name VARCHAR )
Name the location for trenton 300
SELECT location FROM table_22669375_1 WHERE race_name = "Trenton 300"
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...
65516243这位患者的223859指标在一四年十一月十二日至一六年九月四日期间的情况
SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hig...
give me flights from CHICAGO to SEATTLE on saturday morning
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND ...
atis
CREATE TABLE table_12579 ( "Version" text, "Fairing" text, "CCBs" real, "SRBs" text, "Upper stage" text, "Payload to LEO" text, "Payload to GTO" text, "Launches to date" real )
What Payload to GTO has CCBs larger than 1, and a Payload to LEO of 29,400kg?
SELECT "Payload to GTO" FROM table_12579 WHERE "CCBs" > '1' AND "Payload to LEO" = '29,400kg'
wikisql
CREATE TABLE table_204_374 ( id number, "event" text, "gold" number, "silver" number, "bronze" number, "total" number, "ranking" text )
how many medals has switzerland won in the gold category ?
SELECT SUM("gold") FROM table_204_374
squall
CREATE TABLE table_13762472_4 ( high_assists VARCHAR, record VARCHAR )
how many high assists with record being 15-11
SELECT COUNT(high_assists) FROM table_13762472_4 WHERE record = "15-11"
sql_create_context
CREATE TABLE table_30906 ( "Episode" real, "Title" text, "Writer" text, "Director" text, "Original airdate" text, "Ratings (Kanto)" text )
What was the original airdate for the episode written by daisuke habara and directed by akimitsu sasaki
SELECT "Original airdate" FROM table_30906 WHERE "Writer" = 'Daisuke Habara' AND "Director" = 'Akimitsu Sasaki'
wikisql
CREATE TABLE table_28960 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Name the production code for 60 number in series
SELECT "Production code" FROM table_28960 WHERE "No. in series" = '60'
wikisql
CREATE TABLE table_name_1 ( margin_of_victory VARCHAR, runner_s__up VARCHAR )
Which Margin of victory has a Runner(s)-up of buddy gardner?
SELECT margin_of_victory FROM table_name_1 WHERE runner_s__up = "buddy gardner"
sql_create_context
CREATE TABLE table_dev_43 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "hemoglobin_a1c_hba1c" float, "point_of_care_blood_glucose_poc" int, "diabetic" string, "temperature" float, "creatinine_clearance_cl" float...
electrolyte imbalances ( serum bicarbonate level < 20 meq / l, serum sodium < 125 or > 150 meq / l, serum potassium < 3.5 or > 5.5 meq / l ) , serum creatinine more than 1.5 in male and 1.4 in female , creatinine clearance less than 60 ml / min, liver enzymes 3 times above upper limit of normal range.
SELECT * FROM table_dev_43 WHERE electrolyte_imbalances = 1 OR serum_bicarbonate < 20 OR (serum_sodium_concentration < 125 OR serum_sodium_concentration > 150) OR (serum_potassium < 3.5 OR serum_potassium > 5.5) OR (serum_creatinine > 1.5 AND gender = 'male') OR (serum_creatinine > 1.4 AND gender = 'female') OR creatin...
criteria2sql
CREATE TABLE table_name_98 ( identifier VARCHAR, power VARCHAR )
What identifier has 100000 watts as the power?
SELECT identifier FROM table_name_98 WHERE power = "100000 watts"
sql_create_context
CREATE TABLE table_33858 ( "Name" text, "Caps" real, "Goals" real, "First cap" text, "Latest cap" text )
Caps of 93 had how many goals?
SELECT "Goals" FROM table_33858 WHERE "Caps" = '93'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
Look for the diagnoses short title and long title of icd9 code 42823.
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "42823"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevent...
list the top three most frequent diagnoses that had been given to patients during the same month after they were diagnosed with history of tobacco use since 3 years ago.
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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...
mimic_iii
CREATE TABLE table_name_55 ( record VARCHAR, score VARCHAR )
What is Record, when Score is 104-99?
SELECT record FROM table_name_55 WHERE score = "104-99"
sql_create_context
CREATE TABLE table_39853 ( "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Success Rate" text )
When the team had more than 46 wins, what were the average losses?
SELECT AVG("Losses") FROM table_39853 WHERE "Wins" > '46'
wikisql
CREATE TABLE table_25042332_30 ( e_vap_ratio_total VARCHAR, men_of_voting_age VARCHAR )
what is the percentage of male voters where the level of maturity is 123726
SELECT e_vap_ratio_total FROM table_25042332_30 WHERE men_of_voting_age = 123726
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what were the four most frequent drugs that were prescribed to ascites - with liver disease female patients 50s within the same month after having been diagnosed with ascites - with liver disease until 3 years ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ascites - with liver disease' AND DATETIME(diagnos...
eicu
CREATE TABLE employees ( job_id VARCHAR, salary INTEGER )
Find the job ID for those jobs which average salary is above 8000.
SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000
sql_create_context
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, ...
因疾病O27.911在科室514住院的人在2000年2月3日到2005年12月31间的平均费用?
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '514' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-02-03' AND '2005-12-31' AND gwyjzb.IN_DIAG_DIS_CD = 'O27.911' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '514' AND fgwyjzb.IN_HOSP_DATE ...
css
CREATE TABLE table_43593 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What is the Date of the game against Christo Van Rensburg?
SELECT "Date" FROM table_43593 WHERE "Opponent" = 'christo van rensburg'
wikisql
CREATE TABLE table_1617 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
What is the Area KM 2 of the place that has a Census ranking of 1,016 of 5,008?
SELECT "Area km 2" FROM table_1617 WHERE "Census Ranking" = '1,016 of 5,008'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
when had patient 739 had the last urine out foley output on the current intensive care unit visit?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items ...
mimic_iii
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Faculty ( FacID INTEGER, Lname...
How many faculty members do we have for each rank and gender? Plot them as bar chart.
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank
nvbench
CREATE TABLE table_29077 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
How many times was #7 Oregon a visiting team?
SELECT "Time" FROM table_29077 WHERE "Visiting team" = '#7 Oregon'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, j...
li dong semantic parsing paper
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori...
scholar
CREATE TABLE table_17659 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Total viewers (in millions)" text )
How many millions of total viewers watched season #8?
SELECT "Total viewers (in millions)" FROM table_17659 WHERE "Season #" = '8'
wikisql
CREATE TABLE table_49837 ( "Rank" real, "Player" text, "Country" text, "Events" real, "Prize money( $ )" real )
What is the largest event number for player from Norway with prize money less than $2,241,847?
SELECT MAX("Events") FROM table_49837 WHERE "Country" = 'norway' AND "Prize money( $ )" < '2,241,847'
wikisql
CREATE TABLE table_name_45 ( venue VARCHAR, position_in_2004 VARCHAR )
Which venue was number 9 for 2004?
SELECT venue FROM table_name_45 WHERE position_in_2004 = "9"
sql_create_context
CREATE TABLE table_56833 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real )
What place has a draw smaller than 2?
SELECT AVG("Place") FROM table_56833 WHERE "Draw" < '2'
wikisql
CREATE TABLE table_2889300_6 ( crashandride_cymbalpads VARCHAR, drumset_name VARCHAR )
what is the crashandride cymbalpads for the drumset name td-9k2
SELECT crashandride_cymbalpads FROM table_2889300_6 WHERE drumset_name = "TD-9K2"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
Next semester , is there an RCLANG 293 section not on Monday ?
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'RCLANG' AND course.number = 293 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester...
advising
CREATE TABLE table_203_497 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many more gold medals has nepal won than pakistan ?
SELECT (SELECT "gold" FROM table_203_497 WHERE "nation" = 'nepal') - (SELECT "gold" FROM table_203_497 WHERE "nation" = 'pakistan')
squall
CREATE TABLE table_44633 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What country was Ernie Els from?
SELECT "Country" FROM table_44633 WHERE "Player" = 'ernie els'
wikisql
CREATE TABLE table_31721 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
What is the branding frequency of cbc radio 2?
SELECT "Frequency" FROM table_31721 WHERE "Branding" = 'cbc radio 2'
wikisql
CREATE TABLE table_75546 ( "Longi- tude" text, "Usual translation" text, "Chinese name \u00b9" text, "Japanese name" text, "Korean name \u00b2" text, "Vietnamese name" text, "Date \u00b3" text )
WHich Usual translation is on sep 23?
SELECT "Usual translation" FROM table_75546 WHERE "Date \u00b3" = 'sep 23'
wikisql
CREATE TABLE exhibition ( theme VARCHAR, YEAR VARCHAR, ticket_price INTEGER )
Show theme and year for all exhibitions with ticket prices lower than 15.
SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15
sql_create_context
CREATE TABLE table_31347 ( "Rank" real, "Country" text, "UNWTO Region" text, "International tourist arrivals (2012)" text, "International tourist arrivals (2011)" text, "Change (2011 to 2012)" text, "Change (2010 to 2011)" text )
How many international tourists visited Russia in 2012?
SELECT "International tourist arrivals (2012)" FROM table_31347 WHERE "Country" = 'Russia'
wikisql
CREATE TABLE table_38937 ( "Season" real, "Bowl game" text, "Result" text, "Opponent" text, "Stadium" text, "Location" text, "Attendance" text )
What was the Bowl game in San Francisco, CA after 1968?
SELECT "Bowl game" FROM table_38937 WHERE "Season" > '1968' AND "Location" = 'san francisco, ca'
wikisql
CREATE TABLE table_16884579_1 ( judges VARCHAR, host_s_ VARCHAR )
Name the number of judges for dr steemans ann van elsen
SELECT COUNT(judges) FROM table_16884579_1 WHERE host_s_ = "Dré Steemans Ann Van Elsen"
sql_create_context
CREATE TABLE table_54560 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
What platform is nds4droid on for the nintendo ds?
SELECT "Platform" FROM table_54560 WHERE "System" = 'nintendo ds' AND "Name" = 'nds4droid'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Return a bar chart about the distribution of Sex and the sum of Height , and group by attribute Sex.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_33651 ( "Rank" real, "All-time Rank" text, "Name" text, "Debut Year" real, "Current Club" text, "Apps" real )
What is the highest rank that corresponds to an all-time rank of 86 and a debut year before 1995?
SELECT MAX("Rank") FROM table_33651 WHERE "All-time Rank" = '86' AND "Debut Year" < '1995'
wikisql
CREATE TABLE table_56681 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Which score has a Decision of johnson?
SELECT "Score" FROM table_56681 WHERE "Decision" = 'johnson'
wikisql
CREATE TABLE table_11206916_1 ( highest VARCHAR, team VARCHAR )
What was the highest amount of people that attended the elgin city team?
SELECT COUNT(highest) FROM table_11206916_1 WHERE team = "Elgin City"
sql_create_context
CREATE TABLE table_51678 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real )
What was the total number of wins with player Mike Hill with a rank bigger than 2?
SELECT COUNT("Wins") FROM table_51678 WHERE "Rank" > '2' AND "Player" = 'mike hill'
wikisql
CREATE TABLE table_name_76 ( surface VARCHAR, partner VARCHAR )
What surface was used when she played with Remi Tezuka?
SELECT surface FROM table_name_76 WHERE partner = "remi tezuka"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
38758660的患者之前会有哪些不良反应
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_204_539 ( id number, "date" text, "name" text, "moving from" text, "moving to" text, "fee" text )
kamani hill was the first person to be transferred to which team ?
SELECT "moving to" FROM table_204_539 WHERE "name" = 'kamani hill'
squall
CREATE TABLE table_name_45 ( away_team VARCHAR, venue VARCHAR )
What Away Team's venue is Arden Street Oval?
SELECT away_team FROM table_name_45 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 te...
之前,患者22973171有哪些异常情况?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_name_30 ( to_par VARCHAR, country VARCHAR )
What is the player from Japan's To Par?
SELECT to_par FROM table_name_30 WHERE country = "japan"
sql_create_context
CREATE TABLE table_256 ( "Driver" text, "No." real, "Team" text, "Car" text, "Race 1" text, "GP 100" text, "Race 3" text, "Points" real )
For driver Mark Skaife what is the result for race 1?
SELECT "Race 1" FROM table_256 WHERE "Driver" = 'Mark Skaife'
wikisql
CREATE TABLE table_56393 ( "Product" text, "2004" text, "2003" text, "2002" text, "2001" text )
What is the 2002 statistic for the product that had 452,000 tonnes in 2001?
SELECT "2002" FROM table_56393 WHERE "2001" = '452,000 tonnes'
wikisql
CREATE TABLE table_2360 ( "Round" real, "Choice" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text )
Which position has 225lb as weight?
SELECT "Position" FROM table_2360 WHERE "Weight" = '225lb'
wikisql
CREATE TABLE table_70187 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
What is the division record for Woodbridge?
SELECT "Division Record" FROM table_70187 WHERE "School" = 'woodbridge'
wikisql
CREATE TABLE table_22815265_1 ( opponents VARCHAR, cowboys_points VARCHAR )
How many opponents are there when cowboy points were 10?
SELECT opponents FROM table_22815265_1 WHERE cowboys_points = 10
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
give me the number of patients whose primary disease is pneumonia and age is less than 85?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_53673 ( "Name" text, "Nation" text, "Points" real, "Games" real, "Pts/game" real )
what is the average points when the nation is wales and the pts/game is more than 5?
SELECT AVG("Points") FROM table_53673 WHERE "Nation" = 'wales' AND "Pts/game" > '5'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of s/p hanging primary disease patients who have stayed more than 20 days in hospital.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.days_stay > "20"
mimicsql_data
CREATE TABLE table_236 ( "Power Source" text, "Number of Generators" real, "Power Capacity (GW)" text, "% of total Capacity" text, "Capacity factor" text, "Annual Energy (billion kWh)" text, "% of annual production" text )
What is the power capacity when the generators were 781?
SELECT "Power Capacity (GW)" FROM table_236 WHERE "Number of Generators" = '781'
wikisql
CREATE TABLE table_name_11 ( role VARCHAR, title VARCHAR, studio VARCHAR, leading_lady VARCHAR )
Name the role for studio of rep with sheila mannors leading lady and title of westward ho
SELECT role FROM table_name_11 WHERE studio = "rep" AND leading_lady = "sheila mannors" AND title = "westward ho"
sql_create_context
CREATE TABLE table_name_37 ( Id VARCHAR )
What is 1989, when 1982 is 'SF'?
SELECT 1989 FROM table_name_37 WHERE 1982 = "sf"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_cours...
When Prof. Anne Greenberg teaches 663 are there classes on Friday ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.number = 663 AND c...
advising
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, ...
calculate the total number of patients who had regional lymph node exc
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Regional lymph node exc"
mimicsql_data
CREATE TABLE table_69386 ( "Name" text, "League" real, "FA Cup" real, "League Cup" real, "Other" real, "Total" real )
What is the sum of League Cup, when the Other is less than 1, when the Name is Gareth Farrelly Category:Articles with hCards, and when the League is greater than 1?
SELECT SUM("League Cup") FROM table_69386 WHERE "Other" < '1' AND "Name" = 'gareth farrelly category:articles with hcards' AND "League" > '1'
wikisql
CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE ...
What is the count of cities with more than 3 airports?
SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3)
spider
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE city ...
What are the statuses and average populations of each city Plot them as bar chart, and list by the y-axis in asc.
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population)
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and department_id .
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_56006 ( "Player" text, "Team" text, "Opponent" text, "Year" real, "Score" text, "Outcome" text )
Which team got a Behind outcome and had an opponent of Brisbane Bears?
SELECT "Team" FROM table_56006 WHERE "Outcome" = 'behind' AND "Opponent" = 'brisbane bears'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
when was the first time in the last hospital visit patient 64292 is prescribed levetiracetam?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64292 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'levetiracetam' ORDER BY prescriptions.startdate LIMIT...
mimic_iii
CREATE TABLE table_14185 ( "Number & Name" text, "Description" text, "Livery" text, "Owner(s)" text, "Date" real )
Which Owner(s) has a Description of hunslet engine company 0-6-0st?
SELECT "Owner(s)" FROM table_14185 WHERE "Description" = 'hunslet engine company 0-6-0st'
wikisql