context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE VOTING_RECORD ( Id VARCHAR )
Find the number of voting records in total.
SELECT COUNT(*) FROM VOTING_RECORD
sql_create_context
CREATE TABLE table_28891101_3 ( census_2006_population VARCHAR, area__km_2__ VARCHAR )
What is the 2006 census population when the area is 159?
SELECT COUNT(census_2006_population) FROM table_28891101_3 WHERE area__km_2__ = 159
sql_create_context
CREATE TABLE table_52412 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What was the biggest draws, for wins under 4, and points of 20-18?
SELECT MAX("Draws") FROM table_52412 WHERE "Points" = '20-18' AND "Wins" < '4'
wikisql
CREATE TABLE table_41784 ( "Year" real, "Country" text, "Team" text, "Individual" text, "Location" text )
What is the Team when the match was in buenos aires , argentina?
SELECT "Team" FROM table_41784 WHERE "Location" = 'buenos aires , argentina'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
count the number of times that patient 005-46456 had received a protein - csf test during the previous month?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND lab.labname = 'protein - csf' AND DATETIME(lab.labresulttime, 'start of mon...
eicu
CREATE TABLE table_22178 ( "Season" real, "Average Attendance Home" text, "Highest Attendance Home" text, "Average Attendance Away" text, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" text )
When the average away attendance is 1.889 in the Superettan, what's the average home attendance?
SELECT "Average Attendance Home" FROM table_22178 WHERE "Division / Section" = 'Superettan' AND "Average Attendance Away" = '1.889'
wikisql
CREATE TABLE table_name_85 ( round INTEGER, position VARCHAR )
what is the round when the position is (c)?
SELECT MAX(round) FROM table_name_85 WHERE position = "(c)"
sql_create_context
CREATE TABLE table_62451 ( "Class" text, "Number(s)" text, "Quantity" text, "Year(s) of Manufacture" text, "Type" text )
What is the quantity of class B V?
SELECT "Quantity" FROM table_62451 WHERE "Class" = 'b v'
wikisql
CREATE TABLE table_name_39 ( date_of_attack VARCHAR, fate VARCHAR, cargo VARCHAR )
What is the Date of attack of the ship with iron ore sunk by u-101 *?
SELECT date_of_attack FROM table_name_39 WHERE fate = "sunk by u-101 *" AND cargo = "iron ore"
sql_create_context
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
名叫孔红艳的病人在2002年11月10日至2007年9月10日内测验人为13231895的所有检验结果指标记录的检验指数的流水号是啥?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_name_75 ( game_site VARCHAR, opponent VARCHAR )
Which game site has an Opponent of buffalo bills?
SELECT game_site FROM table_name_75 WHERE opponent = "buffalo bills"
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
how many patients stayed in hospital for more than 10 days and procedured for coronary arteriography using two catheters?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "Coronary arteriography using two catheters"
mimicsql_data
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_i...
For each station, just simply show its longitude and the average duration of trips that started from the station using a scatter chart.
SELECT long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id
nvbench
CREATE TABLE table_68760 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which tournament has a Date of april 20, 1987?
SELECT "Tournament" FROM table_68760 WHERE "Date" = 'april 20, 1987'
wikisql
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
How many players played each position. Plot them as bar chart.
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
nvbench
CREATE TABLE table_204_603 ( id number, "pos" text, "no" number, "rider" text, "bike" text, "laps" number, "time" text, "grid" number, "points" number )
what rider finished next after jonas folger ?
SELECT "rider" FROM table_204_603 WHERE "pos" = (SELECT "pos" FROM table_204_603 WHERE "rider" = 'jonas folger') + 1
squall
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 txmzjzjlb ( HXPLC number, HZX...
患有疾病V27.340的人在被门诊确诊时其检测指标043045的参考值范围下限和上限都是多些?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'V27.340' AND jyjgzbb.JCZBDM = '043045' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE table_18069 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
Name the number of shows when there was 2 million views
SELECT COUNT("U.S. viewers (million)") FROM table_18069 WHERE "No. in season" = '2'
wikisql
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the correlation between salary and manager_id in a scatter chart.
SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
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...
医疗记录中患者年龄不高于20岁的平均医疗费总额是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 20)
css
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
列出病人入住的病区代码和名称和入院的床位号,主要针对住院就诊57073431477的病患
SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '57073431477'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
had patient 016-1459's systemicdiastolic been normal.
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 = '016-1459')) AND vitalperiodic.systemicdiastolic BETWEEN diastolic_bp...
eicu
CREATE TABLE table_name_11 ( width__inches_ VARCHAR, length__feet_ VARCHAR, engine VARCHAR, retired VARCHAR )
For a vehicle below 25 feet, that was retired in 2005 and had a navistar t444e engine, what was the total width?
SELECT COUNT(width__inches_) FROM table_name_11 WHERE engine = "navistar t444e" AND retired = "2005" AND length__feet_ < 25
sql_create_context
CREATE TABLE table_name_5 ( fa_cup_goals INTEGER, league_goals VARCHAR )
What is the sum of FA Cup goals when there are 19 league goals?
SELECT SUM(fa_cup_goals) FROM table_name_5 WHERE league_goals = "19"
sql_create_context
CREATE TABLE table_2009095_2 ( year INTEGER, opponents VARCHAR )
Name the least year for evonne goolagong helen gourlay
SELECT MIN(year) FROM table_2009095_2 WHERE opponents = "Evonne Goolagong Helen Gourlay"
sql_create_context
CREATE TABLE table_32745 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What laps have a Time of +28.778?
SELECT "Laps" FROM table_32745 WHERE "Time" = '+28.778'
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 event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Visualize a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, and I want to display from high to low by the y-axis.
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) DESC
nvbench
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE T...
Highest and lowest voted posts.
SELECT 'site://questions/' + CAST(Id AS TEXT) AS "question_with_highest_score" FROM Posts ORDER BY Score DESC LIMIT 1
sede
CREATE TABLE table_79764 ( "Tournament" text, "Wins" real, "Top-25" real, "Events" real, "Cuts made" real )
How many cuts did he make at the PGA championship in 3 events?
SELECT MAX("Cuts made") FROM table_79764 WHERE "Tournament" = 'pga championship' AND "Events" > '3'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE T...
JavaScript MVC Framework Trends (Bottom-Tier, from TodoMVC) (# of Questions per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE table_28485 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What is the order # for the original artist sarah mclachlan?
SELECT "Order #" FROM table_28485 WHERE "Original artist" = 'Sarah McLachlan'
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, ...
医疗机构1195150的患者对医疗项目自付比例的平均值在2003年2月4日到2004年12月30日内都是多少?
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1195150' AND t_kc22.STA_DATE BETWEEN '2003-02-04' AND '2004-12-30'
css
CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE video...
Show all advisors who have at least two students.
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) >= 2
spider
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...
for how many days did the subject id 64208 stay in the hospital?
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "64208"
mimicsql_data
CREATE TABLE table_204_384 ( id number, "#" number, "air date" text, "timeslot (est)" text, "season" text, "rating" number, "share" number, "18-49 (rating/share)" text, "viewers (m)" number, "weekly rank (#)" number )
what episode had the highest rating ?
SELECT "air date" FROM table_204_384 ORDER BY "rating" DESC LIMIT 1
squall
CREATE TABLE table_68093 ( "Name" text, "Position" text, "Club career" text, "League apps" real, "League goals" real, "Total apps" real, "Total goals" real )
What is the fewest total goals scored for players with under 171 league appearances, 151 total appearances, and the DF position?
SELECT MIN("Total goals") FROM table_68093 WHERE "League apps" < '171' AND "Total apps" = '151' AND "Position" = 'df'
wikisql
CREATE TABLE table_name_76 ( potassium VARCHAR, lithium VARCHAR, sodium VARCHAR )
what is the properties of potassium when lithium is h a l o g e n s and sodium is bromine?
SELECT potassium FROM table_name_76 WHERE lithium = "h a l o g e n s" AND sodium = "bromine"
sql_create_context
CREATE TABLE table_name_7 ( loss VARCHAR, record VARCHAR )
Which loss had a record of 79-49?
SELECT loss FROM table_name_7 WHERE record = "79-49"
sql_create_context
CREATE TABLE table_9281 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
Which Record has a Date of june 26?
SELECT "Record" FROM table_9281 WHERE "Date" = 'june 26'
wikisql
CREATE TABLE table_36262 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real )
Opponent of chicago bears involved what date?
SELECT "Date" FROM table_36262 WHERE "Opponent" = 'chicago bears'
wikisql
CREATE TABLE table_name_77 ( blagojevich__d_ VARCHAR, date VARCHAR )
Which Blagojevich (D) happened on october 16, 2006?
SELECT blagojevich__d_ FROM table_name_77 WHERE date = "october 16, 2006"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
葛心怡这个患者之前在哪个医院看病啊
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '葛心怡' UNION SELECT wdmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = ...
css
CREATE TABLE table_66513 ( "Year" real, "Category" text, "Nominee(s)" text, "Episode" text, "Result" text )
What was the result for the years after 2001?
SELECT "Result" FROM table_66513 WHERE "Year" > '2001'
wikisql
CREATE TABLE table_27061 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
When 120 is the number in series who is the writer?
SELECT "Written by" FROM table_27061 WHERE "No. in series" = '120'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 ) ...
Give me the comparison about meter_100 over the meter_500 by a bar chart, rank in asc by the bar.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500
nvbench
CREATE TABLE table_34133 ( "Year" text, "Title" text, "Director" text, "Distributor(s)" text, "Box office" text )
What is the movie that Paul Schneider directed?
SELECT "Title" FROM table_34133 WHERE "Director" = 'paul schneider'
wikisql
CREATE TABLE table_18894 ( "Title and Source" text, "Developer(s)/Publisher(s)" text, "JP -210-" text, "NA -350-" text, "PAL -295-" text, "Wii Points" text )
what's the wii points with title and source being ts shin taikyoku: igo d j 2700-mon
SELECT "Wii Points" FROM table_18894 WHERE "Title and Source" = 'Tsūshin Taikyoku: Igo Dōjō 2700-Mon'
wikisql
CREATE TABLE table_name_30 ( score VARCHAR, date VARCHAR )
WHich Score has a Date on november 11?
SELECT score FROM table_name_30 WHERE date = "november 11"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
个人自费在医疗就诊33531671277中的金额为多少?
SELECT t_kc24.PER_EXP FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '33531671277'
css
CREATE TABLE table_train_108 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "deficiency_to_iga" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "NOUSE" float )
body mass index >= 18 and <= 32 kg / m2 at screening
SELECT * FROM table_train_108 WHERE body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 32
criteria2sql
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
Give me a histogram for what are the different names and credit scores of customers who have taken a loan?, and I want to order X in asc order please.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name
nvbench
CREATE TABLE table_name_87 ( city___state VARCHAR, winner VARCHAR )
What is the city/state of the circuit where Russell Ingall Larry Perkins was the winner?
SELECT city___state FROM table_name_87 WHERE winner = "russell ingall larry perkins"
sql_create_context
CREATE TABLE table_20624 ( "No." real, "Name" text, "Mi from Kingston" text, "Km from Kingston" text, "Parish" text, "Length feet" real, "Length meters" text )
How many feet in length are there when the length is 106.1 meters?
SELECT COUNT("Length feet") FROM table_20624 WHERE "Length meters" = '106.1'
wikisql
CREATE TABLE table_203_8 ( id number, "player" text, "rec." number, "yards" number, "avg." number, "td's" number, "long" number )
which player did not have positive yardage ?
SELECT "player" FROM table_203_8 WHERE "yards" <= 0
squall
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20),...
What is the lowest salary in departments with average salary greater than the overall average. Plot them as bar chart.
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name
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, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart, could you list by the total number in ascending?
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer)
nvbench
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, ...
在2008年10月2日到2019年11月28日内医生65472198有多少门诊病人?
SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '65472198' AND mzjzjlb.JZKSRQ BETWEEN '2008-10-02' AND '2019-11-28'
css
CREATE TABLE table_3186 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
When dennis ross (r) unopposed is the candidate what is the party?
SELECT "Party" FROM table_3186 WHERE "Candidates" = 'Dennis Ross (R) unopposed'
wikisql
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Subject...
Find the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and could you list y axis in ascending order?
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon)
nvbench
CREATE TABLE table_name_17 ( scorer VARCHAR, club VARCHAR, league_goals VARCHAR )
Which scorer plays for Aldershot and has scored a total of 19 League goals?
SELECT scorer FROM table_name_17 WHERE club = "aldershot" AND league_goals = "19"
sql_create_context
CREATE TABLE table_name_41 ( score VARCHAR, opponent_in_the_final VARCHAR )
What is the score of the tournament with olivier dela tre as the opponent in the final?
SELECT score FROM table_name_41 WHERE opponent_in_the_final = "olivier delaître"
sql_create_context
CREATE TABLE table_43669 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
Which Match has a Competition of Group Stage on 2000-09-17?
SELECT "Match" FROM table_43669 WHERE "Competition" = 'group stage' AND "Date" = '2000-09-17'
wikisql
CREATE TABLE table_name_8 ( deleted VARCHAR, name VARCHAR )
On what date was Anniston Army Depot (SE Industrial Area) deleted?
SELECT deleted FROM table_name_8 WHERE name = "anniston army depot (se industrial area)"
sql_create_context
CREATE TABLE table_name_79 ( score VARCHAR, opponent VARCHAR )
what is the score when the opponent is ann grossman?
SELECT score FROM table_name_79 WHERE opponent = "ann grossman"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
Do any classes not have lab sessions ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
CREATE TABLE table_14577 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" real, "Final round" text )
What is the pos for the New York Knicks?
SELECT "Pos." FROM table_14577 WHERE "Team" = 'new york knicks'
wikisql
CREATE TABLE table_30923 ( "Stage" real, "Winner" text, "General classification" text, "Mountains Classification" text, "Points classification" text, "Sprints Classification" text, "Team Classification" text )
Name the points classification for levi leipheimer
SELECT "Points classification" FROM table_30923 WHERE "General classification" = 'Levi Leipheimer'
wikisql
CREATE TABLE table_32389 ( "Player" text, "Home Town" text, "College/Prior" text, "Drafting Team" text, "Graduated" real )
From what town was Steve Zakuani?
SELECT "Home Town" FROM table_32389 WHERE "Player" = 'steve zakuani'
wikisql
CREATE TABLE table_69565 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which loss has a Date of april 26?
SELECT "Loss" FROM table_69565 WHERE "Date" = 'april 26'
wikisql
CREATE TABLE table_name_19 ( opponent VARCHAR, record VARCHAR )
Name the opponent with record of 6-2
SELECT opponent FROM table_name_19 WHERE record = "6-2"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CR...
what flights has CO from ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIR...
atis
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of email and employee_id , sort in ascending by the EMAIL.
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
nvbench
CREATE TABLE table_203_330 ( id number, "year of election" number, "candidates elected" number, "# of seats available" number, "# of votes" number, "% of popular vote" text )
what was the smallest number of votes before 2003 ?
SELECT MIN("# of votes") FROM table_203_330 WHERE "year of election" < 2003
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what is the total average cost of a hospital that includes a drug called insulin regular human 100 unit/ml ij soln until 2103?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'insulin regular human 100 unit/ml ij soln')) A...
eicu
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Class 746 has been taught by Prof. Beth Wilensky how many times ?
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 746 AND instructor.name LIKE '%Beth Wilensky%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offer...
advising
CREATE TABLE table_21150 ( "Religion" text, "Suriname" text, "Paramaribo" text, "Wanica" text, "Nickerie" text, "Coronie" text, "Saramacca" text, "Commewijne" text, "Marowijne" text, "Para" text, "Brokopondo" text, "Sipaliwini" text )
Name the para for 1.5% commewijne
SELECT "Para" FROM table_21150 WHERE "Commewijne" = '1.5%'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients are discharged to disc-tran cancer/chldrn h and lab tested for basophils?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND lab.label = "Basophils"
mimicsql_data
CREATE TABLE table_name_94 ( date VARCHAR, opponent VARCHAR )
when is the opponent lyoto machida?
SELECT date FROM table_name_94 WHERE opponent = "lyoto machida"
sql_create_context
CREATE TABLE table_name_9 ( points INTEGER, club VARCHAR, goal_difference VARCHAR )
Which Points have a Club of cf calvo sotelo, and a Goal Difference larger than -3?
SELECT MAX(points) FROM table_name_9 WHERE club = "cf calvo sotelo" AND goal_difference > -3
sql_create_context
CREATE TABLE table_name_12 ( team__number1 VARCHAR )
Which 1st leg that has hemofarm?
SELECT 1 AS st_leg FROM table_name_12 WHERE team__number1 = "hemofarm"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Users who downvoted you the most.
SELECT Score FROM Posts WHERE Id = 298680
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 demographic ( subject_id text, hadm_id t...
How many patients admitted before the year 2144 had a lab test named heparin and Imw?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW"
mimicsql_data
CREATE TABLE table_name_12 ( country VARCHAR, place VARCHAR, player VARCHAR )
From what Country is T6 Place Player Tom Weiskopf?
SELECT country FROM table_name_12 WHERE place = "t6" AND player = "tom weiskopf"
sql_create_context
CREATE TABLE table_27158 ( "Tie no" real, "Home team" text, "Score 1" text, "Away team" text, "Attendance" real, "Date" text )
Who was the home team who played plymouth argyle?
SELECT "Home team" FROM table_27158 WHERE "Away team" = 'Plymouth Argyle'
wikisql
CREATE TABLE table_21919 ( "Year" real, "Date" text, "Driver" text, "Manufacturer" text, "Laps" real, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text )
What manufacturer won the race on November 2?
SELECT "Manufacturer" FROM table_21919 WHERE "Date" = 'November 2'
wikisql
CREATE TABLE table_26998135_2 ( manner_of_departure VARCHAR, date_of_appointment VARCHAR )
What is the manner of departure for the date of appointment 24 may 2010?
SELECT manner_of_departure FROM table_26998135_2 WHERE date_of_appointment = "24 May 2010"
sql_create_context
CREATE TABLE table_68809 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
What position had notes of 20km and a year earlier than 2002?
SELECT "Position" FROM table_68809 WHERE "Notes" = '20km' AND "Year" < '2002'
wikisql
CREATE TABLE table_37303 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
At which games did Tunisia win a bronze in the men's 1500 m freestyle?
SELECT "Games" FROM table_37303 WHERE "Medal" = 'bronze' AND "Event" = 'men''s 1500 m freestyle'
wikisql
CREATE TABLE table_72211 ( "Taxonomy" text, "Species in the world" real, "Species in Peru" real, "Species in the Peruvian Amazon" real, "Peru Vs. world (Percent)" real, "Peruvian Amazon Vs. Peru (Percent)" real )
what's the total number of species in the peruvian amazon with 8411 species in the world
SELECT COUNT("Species in the Peruvian Amazon") FROM table_72211 WHERE "Species in the world" = '8411'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
when was the first time in 12/this year that patient 015-59552 was prescribed for a medication?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND DATETIME(medication.drugstarttime, 'start of ...
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, ...
0869043医院的住院记录中,最短医疗住院时长高于21天的科室有多少
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0869043' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 21) AS T
css
CREATE TABLE table_46242 ( "School" text, "Location" text, "Founded" real, "Enrollment" real, "Nickname" text )
What is the most recent year founded with an enrollment of 42,708?
SELECT MAX("Founded") FROM table_46242 WHERE "Enrollment" = '42,708'
wikisql
CREATE TABLE table_test_29 ( "id" int, "bleeding" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "trauma" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "hemorrhagic_stroke" ...
systolic blood pressure ( supine ) <= 90 mmhg;
SELECT * FROM table_test_29 WHERE systolic_blood_pressure_sbp <= 90
criteria2sql
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, ...
在11年9月23日到2013年3月8日期间医疗机构8653860下属的科室289处理的住院就诊数统共有多少?
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '8653860' AND JZKSDM = '289' AND RYDJSJ BETWEEN '2011-09-23' AND '2013-03-08'
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
从16年10月7日到20年12月24日948这个科室的住院量的情况如何?
SELECT COUNT(*) FROM zyjzjlb WHERE JZKSDM = '948' AND RYDJSJ BETWEEN '2016-10-07' AND '2020-12-24'
css
CREATE TABLE table_name_2 ( slalom VARCHAR, country VARCHAR )
What Slalom was Switzerland in?
SELECT slalom FROM table_name_2 WHERE country = "switzerland"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
Calculate the average age of patients with aortic insufficiency re-do sternotomy aortic valve replacement who stayed in hospital for 10 days.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "10"
mimicsql_data
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, cata...
What are the names of catalog entries with level number 8, and count them by a bar chart, and order by the X in descending.
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name DESC
nvbench
CREATE TABLE table_69264 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Name the date for hard surface and tournament of fort walton beach
SELECT "Date" FROM table_69264 WHERE "Surface" = 'hard' AND "Tournament" = 'fort walton beach'
wikisql
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) )...
How many departments for each building? Draw a bar chart, show Y from high to low order.
SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY COUNT(building) DESC
nvbench