context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_32522 ( "Year" real, "Champion" text, "Score" text, "Runner-Up" text, "Arena" text, "City" text, "Tournament MVP" text )
Which player from Tucson, Arizona won the Championship?
SELECT "Champion" FROM table_32522 WHERE "City" = 'tucson, arizona'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Show me about the distribution of All_Home and School_ID , and group by attribute ACC_Home in a bar chart, and sort by the y-axis from high to low.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID DESC
nvbench
CREATE TABLE table_204_500 ( id number, "year" number, "title" text, "peak chart positions\nus country" number, "peak chart positions\nus" number, "album" text )
which album produced the most singles ?
SELECT "album" FROM table_204_500 GROUP BY "album" ORDER BY COUNT("title") DESC LIMIT 1
squall
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 ( ...
provide the number of patients whose year of birth is less than 2065 and diagnoses short title is int inf clstrdium dfcile?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Int inf clstrdium dfcile"
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 prescription...
among patients who stayed at hospital for more than 14 days, how many of them had item id 51200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.itemid = "51200"
mimicsql_data
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, ...
All my posts from 2016.
SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = 263693 AND TIME_TO_STR(CreationDate, '%YEAR') = 2016
sede
CREATE TABLE table_204_169 ( id number, "athlete" text, "event" text, "race 1\ntime" text, "race 2\ntime" text, "total\ntime" text, "total\nrank" number )
who was last in the slalom overall ?
SELECT "athlete" FROM table_204_169 WHERE "event" = 'slalom' ORDER BY "total\ntime" DESC LIMIT 1
squall
CREATE TABLE table_41485 ( "Date" text, "Location" text, "Country" text, "Event" text, "Winner" text, "Runner-up" text )
What was the location of the tournament held in Spain?
SELECT "Location" FROM table_41485 WHERE "Country" = 'spain'
wikisql
CREATE TABLE table_6466 ( "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text )
What's the old Bulgarian word for avgust?
SELECT "Old Bulgarian name - Meaning" FROM table_6466 WHERE "Bulgarian name ( Transliteration )" = 'avgust'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
when was patient 009-11964 last tested in 07/last year for alkaline phos.?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11964')) AND lab.labname = 'alkaline phos.' AND DATETIME(lab.labresulttime, 'st...
eicu
CREATE TABLE table_name_64 ( fa_cup INTEGER, malaysia_cup INTEGER )
What was the lowest FA Cup for a Malaysia Cup of 0?
SELECT MIN(fa_cup) FROM table_name_64 WHERE malaysia_cup < 0
sql_create_context
CREATE TABLE table_22879323_10 ( high_rebounds VARCHAR, date VARCHAR )
What were the high rebounds on April 4?
SELECT high_rebounds FROM table_22879323_10 WHERE date = "April 4"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
Which 2 -credit courses are available that are on the SW 100 -level ?
SELECT DISTINCT department, name, number FROM course WHERE credits = 2 AND department = 'SW' AND number < 100 + 100 AND number >= 100
advising
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
How many papers does Alvin C Haver have in Iv Infusion area ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Alvin C Haver' AND keyphrase.keyphrasename = 'Iv Infusion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varc...
Show the number of courses each instructor taught with a bar chart grouping by course code, show y axis from low to high order.
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY COUNT(CRS_CODE)
nvbench
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
what are the four most frequent laboratory tests patients had in the same hospital visit after they were diagnosed with cl skul base fx-coma nos until 2 years ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_34789 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
To which college/junior/club team did the player that was Pick 16 belong?
SELECT "College/junior/club team" FROM table_34789 WHERE "Pick #" = '16'
wikisql
CREATE TABLE table_79870 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
Name the result for kingdome game site and opponent of denver broncos
SELECT "Result" FROM table_79870 WHERE "Game site" = 'kingdome' AND "Opponent" = 'denver broncos'
wikisql
CREATE TABLE table_21012786_2 ( length_weight_of_missile VARCHAR, diameter_of_torsion_spring VARCHAR )
When the torsion spring diameter is 38.4cm what would be the length or weight of the missile
SELECT length_weight_of_missile FROM table_21012786_2 WHERE diameter_of_torsion_spring = "38.4cm"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC...
把患者云成双在医院5772837住院的就诊记录列出来,选择入院时的科室名字有免疫科的记录
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
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...
有多少外地门诊记录是医疗机构4755541在06年2月16日到10年3月24日内来就诊的?
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '4755541' AND mzjzjlb.JZKSRQ BETWEEN '2006-02-16' AND '2010-03-24' AND mzjzjlb.WDBZ > 0
css
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...
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, and show by the Y-axis from low to high.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
nvbench
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
在2021年10月7日之前这个病号87778893一共有哪些门诊就诊记录对应的检验报告单?就诊时门诊诊断的流水号是多少?
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '87778893' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2021-10-07' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_444 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
What was the women's singles were men's doubles were steen fladberg jens peter nierhoff?
SELECT "Womens singles" FROM table_444 WHERE "Mens doubles" = 'Steen Fladberg Jens Peter Nierhoff'
wikisql
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
What is the average account balance of customers with credit score below 50 for the different account types Visualize by bar chart, and order by the names in ascending please.
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type
nvbench
CREATE TABLE table_43414 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the High assists when the record was 28 40?
SELECT "High assists" FROM table_43414 WHERE "Record" = '28–40'
wikisql
CREATE TABLE table_63274 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the highest rank when the lane is larger than 6, and the heat is 3, and the nationality is colombia?
SELECT MAX("Rank") FROM table_63274 WHERE "Lane" > '6' AND "Heat" = '3' AND "Nationality" = 'colombia'
wikisql
CREATE TABLE table_name_96 ( bronze INTEGER, gold VARCHAR, silver VARCHAR )
What is the average number of bronze of the nation with more than 1 gold and 1 silver medal?
SELECT AVG(bronze) FROM table_name_96 WHERE gold > 1 AND silver = 1
sql_create_context
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, ...
在2001年4月23日到2010年8月18日这段时间在医院7841691的科室中医疗费的总数少于2085.24元有多少次?
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7841691' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-04-23' AND '2010-08-18' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 2085.24) AS T
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what was patient 010-38092's weight the last time since 150 months ago?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-38092') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-150 month') ORDER BY patient.unit...
eicu
CREATE TABLE table_11690135_1 ( interview VARCHAR, swimsuit VARCHAR )
Who scored a 9.72 in the swimsuit?
SELECT interview FROM table_11690135_1 WHERE swimsuit = "9.72"
sql_create_context
CREATE TABLE table_203_612 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country has the most silver medals ?
SELECT "nation" FROM table_203_612 ORDER BY "silver" DESC LIMIT 1
squall
CREATE TABLE table_name_60 ( year INTEGER, number_in_entourage VARCHAR, mission_type VARCHAR )
What is the latest year of a gratitude type mission with 99 in the entourage?
SELECT MAX(year) FROM table_name_60 WHERE number_in_entourage = "99" AND mission_type = "gratitude"
sql_create_context
CREATE TABLE table_2076608_3 ( enrollment VARCHAR, location_s_ VARCHAR )
Where are the Alexandria enrollment locations?
SELECT enrollment FROM table_2076608_3 WHERE location_s_ = "Alexandria"
sql_create_context
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...
For the attribute Sex and the sum of Height, show their proportion by a pie chart.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_34854 ( "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text )
Socket of without quickassist has what release price?
SELECT "Release price ( USD )" FROM table_34854 WHERE "Socket" = 'without quickassist'
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 number of patients with brain mass intracranial hemorrhage as their primary disease who were born before 2180.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dob_year < "2180"
mimicsql_data
CREATE TABLE table_name_99 ( points INTEGER, home VARCHAR )
What is the lowest amount of points of the game with toronto as the home team?
SELECT MIN(points) FROM table_name_99 WHERE home = "toronto"
sql_create_context
CREATE TABLE table_33988 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Where was home on April 3?
SELECT "Home" FROM table_33988 WHERE "Date" = 'april 3'
wikisql
CREATE TABLE table_name_35 ( d_41_√ VARCHAR, d_43_√ VARCHAR )
Name the D 41 when it has D 43 of r 18
SELECT d_41_√ FROM table_name_35 WHERE d_43_√ = "r 18"
sql_create_context
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
SELECT flno, origin, destination FROM flight ORDER BY origin
spider
CREATE TABLE table_72860 ( "1st throw" real, "2nd throw" real, "3rd throw" text, "Equation" text, "Result" real )
If the equation is all equal, what is the 3rd throw?
SELECT "3rd throw" FROM table_72860 WHERE "Equation" = 'all equal'
wikisql
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
Which club has the most female students as their members? Give me the name of the club.
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_23248940_9 ( score VARCHAR, game VARCHAR )
How did the game number 50 end?
SELECT score FROM table_23248940_9 WHERE game = 50
sql_create_context
CREATE TABLE table_69820 ( "Cyclist" text, "Nation" text, "Team" text, "Time" text, "UCI Points" real )
Who was the cyclist from Belgium?
SELECT "Cyclist" FROM table_69820 WHERE "Nation" = 'belgium'
wikisql
CREATE TABLE table_name_89 ( opponent VARCHAR, h_a_n VARCHAR, score VARCHAR )
What is the Opponent of the game with a H/A/N of H and Score of 120-99?
SELECT opponent FROM table_name_89 WHERE h_a_n = "h" AND score = "120-99"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
For all employees who have the letters D or S in their first name, return a line chart about the change of department_id over hire_date .
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
give me the number of patients whose age is less than 68 and lab test fluid is pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
Visualize a bar chart for simply displaying the email address of the employee and the corresponding salary, display in descending by the y-axis.
SELECT EMAIL, SALARY FROM employees ORDER BY SALARY DESC
nvbench
CREATE TABLE table_78167 ( "Number" real, "Name" text, "Team" text, "Position" text, "Years with franchise" text, "Year retired" text )
Which team is number 14 and had a franchise in 1993-2000?
SELECT "Team" FROM table_78167 WHERE "Number" = '14' AND "Years with franchise" = '1993-2000'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datase...
keyphrases used by ras bodik
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'ras bodik' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_name_14 ( game INTEGER, opponent VARCHAR )
Which Game has an Opponent of @ pittsburgh penguins?
SELECT MAX(game) FROM table_name_14 WHERE opponent = "@ pittsburgh penguins"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
give me the cheapest round trip flights from INDIANAPOLIS to ORLANDO around 12 25
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 25 AND DATE_DAYalias0.month_number = 12 AND DATE_DAYalias0.year = 1991)) AND f...
atis
CREATE TABLE table_name_82 ( game INTEGER, date VARCHAR )
What is the mean game played on January 9?
SELECT AVG(game) FROM table_name_82 WHERE date = "january 9"
sql_create_context
CREATE TABLE table_name_59 ( driver VARCHAR, grid VARCHAR )
I want the driver for grid of 9
SELECT driver FROM table_name_59 WHERE grid = 9
sql_create_context
CREATE TABLE table_name_89 ( high_school VARCHAR, utah_mr_basketball VARCHAR, year VARCHAR )
Where did Tyler Haws, 2009 Utah Mr. Basketball, go to high school?
SELECT high_school FROM table_name_89 WHERE utah_mr_basketball = "tyler haws" AND year = 2009
sql_create_context
CREATE TABLE table_name_95 ( game INTEGER, opponent VARCHAR, february VARCHAR )
What is the lowest numbered game with an opponent of Minnesota North Stars earlier than February 25?
SELECT MIN(game) FROM table_name_95 WHERE opponent = "minnesota north stars" AND february < 25
sql_create_context
CREATE TABLE bdmzjzjlb ( 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...
哪些工号及姓名的医务人员在患者沈云梦就诊过程中为他检测地高辛的,时间是从0二年二月六日到0四年五月十二日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
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, return a bar chart about the distribution of name and revenue , and group by attribute founder, could you show total number in ascending order?
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
What is the card type code with most number of cards?
SELECT card_type_code FROM customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_40876 ( "Year" real, "Winning team" text, "Losing team" text, "Score" text, "Site" text )
What is the Score with a Winning team that is san antonio spurs?
SELECT "Score" FROM table_40876 WHERE "Winning team" = 'san antonio spurs'
wikisql
CREATE TABLE table_name_2 ( place VARCHAR, player VARCHAR, score VARCHAR, country VARCHAR )
When Jim Thorpe of United States has a score of 71, what is the place?
SELECT place FROM table_name_2 WHERE score = 71 AND country = "united states" AND player = "jim thorpe"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
what are the four most common diagnoses during this year.
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_name_49 ( ends INTEGER, name VARCHAR )
What is the lowest ends for Dani Alves?
SELECT MIN(ends) FROM table_name_49 WHERE name = "dani alves"
sql_create_context
CREATE TABLE table_6504 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What is the position Bill Campbell played before round 6?
SELECT "Position" FROM table_6504 WHERE "Round" < '6' AND "Player" = 'bill campbell'
wikisql
CREATE TABLE table_33281 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
When was the pre-Week 10 game that had an attendance of over 38,865?
SELECT "Date" FROM table_33281 WHERE "Week" < '10' AND "Attendance" = '38,865'
wikisql
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, ...
posaconazole suspension is administered via which route?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Posaconazole Suspension"
mimicsql_data
CREATE TABLE table_23114 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Persian title" text, "Director" text, "Result" text )
If the film title nominated is Baran, what was the result?
SELECT "Result" FROM table_23114 WHERE "Film title used in nomination" = 'Baran'
wikisql
CREATE TABLE table_72718 ( "City/town" text, "Municipality" text, "County" text, "City/town status" real, "Population" real )
What are the cities/towns located in the municipality of Horten?
SELECT "City/town" FROM table_72718 WHERE "Municipality" = 'Horten'
wikisql
CREATE TABLE table_22654073_6 ( team VARCHAR, record VARCHAR )
Name the team for record 3-2
SELECT team FROM table_22654073_6 WHERE record = "3-2"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
tell me the number of patients admitted before the year 2172 who had other phototherapy procedure.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2172" AND procedures.long_title = "Other phototherapy"
mimicsql_data
CREATE TABLE table_name_44 ( to_par VARCHAR, country VARCHAR, score VARCHAR )
What is the to par of the player from the United States with a score of 69-68-65=202?
SELECT to_par FROM table_name_44 WHERE country = "united states" AND score = 69 - 68 - 65 = 202
sql_create_context
CREATE TABLE table_204_779 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number )
what is the total number of affiliates among all the networks ?
SELECT SUM("affiliates") FROM table_204_779
squall
CREATE TABLE table_203_33 ( id number, "conference" text, "date" text, "place" text, "attendance" number, "archive of presentations" text )
which wikimania conference has the least number of attendees ?
SELECT "conference" FROM table_203_33 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE table_27258 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F.L." real, "Podiums" real, "Points" text, "Position" text )
How many wins were listed when he had 112 points?
SELECT "Wins" FROM table_27258 WHERE "Points" = '112'
wikisql
CREATE TABLE table_191105_2 ( lyrics_by VARCHAR, subject VARCHAR )
When interjection is the subject who are the lyrics by?
SELECT lyrics_by FROM table_191105_2 WHERE subject = "interjection"
sql_create_context
CREATE TABLE table_204_90 ( id number, "rank" number, "name" text, "nationality" text, "time" text )
the total number of ethiopian runners
SELECT COUNT("name") FROM table_204_90 WHERE "nationality" = 'ethiopia'
squall
CREATE TABLE table_name_41 ( division_record VARCHAR, school VARCHAR )
What is the division record of Sussex Central?
SELECT division_record FROM table_name_41 WHERE school = "sussex central"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those products with a price between 60 and 120, return a scatter chart about the correlation between code and manufacturer , and group by attribute name.
SELECT Code, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
nvbench
CREATE TABLE table_14681 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which score has a competition of 1997 dunhill cup malaysia and february 23, 1997 as the date?
SELECT "Score" FROM table_14681 WHERE "Competition" = '1997 dunhill cup malaysia' AND "Date" = 'february 23, 1997'
wikisql
CREATE TABLE table_74578 ( "Lane" real, "Name" text, "Nationality" text, "Split (50m)" real, "Time" real )
What is the total of lane(s) for swimmers from Sweden with a 50m split of faster than 26.25?
SELECT SUM("Lane") FROM table_74578 WHERE "Nationality" = 'sweden' AND "Split (50m)" < '26.25'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what new prescriptions did patient 006-76924 have today compared to the prescription given yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-76924') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_32169 ( "Date" text, "Venue" text, "Result" text, "Scored" real, "Competition" text )
What is the highest scored in the 2010 east asian football championship?
SELECT MAX("Scored") FROM table_32169 WHERE "Competition" = '2010 east asian football championship'
wikisql
CREATE TABLE table_23394920_1 ( branding VARCHAR, power_kw VARCHAR, station_type VARCHAR )
When relay is the station type and 5kw is the power kw what is the branding?
SELECT branding FROM table_23394920_1 WHERE power_kw = "5kW" AND station_type = "Relay"
sql_create_context
CREATE TABLE customers ( customer_id VARCHAR, customer_name VARCHAR )
List all the customers in increasing order of IDs.
SELECT customer_id, customer_name FROM customers ORDER BY customer_id
sql_create_context
CREATE TABLE table_name_23 ( capacity INTEGER, kitmaker VARCHAR )
What is umbro's highest capacity?
SELECT MAX(capacity) FROM table_name_23 WHERE kitmaker = "umbro"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
重酒石酸卡巴拉汀胶囊的使用频率和每一次用量在病栋就诊序列号01570275256中都使用几次?
SELECT USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '01570275256' AND SOC_SRT_DIRE_NM = '重酒石酸卡巴拉汀胶囊'
css
CREATE TABLE table_name_49 ( decile VARCHAR, roll VARCHAR, authority VARCHAR, area VARCHAR )
What is the total Decile that has a state authority, fairlie area and roll smarter than 206?
SELECT COUNT(decile) FROM table_name_49 WHERE authority = "state" AND area = "fairlie" AND roll < 206
sql_create_context
CREATE TABLE table_63686 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" real, "Year Left" real, "Conference Joined" text )
what is the mascot for moores hill that joined later than 1952?
SELECT "Mascot" FROM table_63686 WHERE "Year Joined" > '1952' AND "School" = 'moores hill'
wikisql
CREATE TABLE table_name_63 ( railway VARCHAR, built VARCHAR )
Which railway was built in 1909?
SELECT railway FROM table_name_63 WHERE built = "1909"
sql_create_context
CREATE TABLE appointment ( patient VARCHAR ) CREATE TABLE patient ( ssn VARCHAR )
what are name and phone number of patients who had more than one appointment?
SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1
sql_create_context
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Products ( product_id ...
Show the product ids and the number of unique orders containing each product by a scatter chart.
SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items
nvbench
CREATE TABLE table_train_113 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float )
body mass index ( bmi ) of approximately 18 to 33 kg / m2; and a total body weight > 50 kg ( 110 lbs ) .
SELECT * FROM table_train_113 WHERE (body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 33) AND body_weight > 50
criteria2sql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id...
Downvoted posts with no comment.
SELECT PostId AS "post_link", SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS "dvs", Score FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id WHERE COALESCE(p.CommentCount, 0) = 0 AND v.VoteTypeId = 3 GROUP BY PostId, Score
sede
CREATE TABLE table_name_20 ( time VARCHAR, rider VARCHAR, grid VARCHAR, laps VARCHAR, manufacturer VARCHAR )
what is the time when laps is less than 21, manufacturer is aprilia, grid is less than 17 and the rider is thomas luthi?
SELECT time FROM table_name_20 WHERE laps < 21 AND manufacturer = "aprilia" AND grid < 17 AND rider = "thomas luthi"
sql_create_context
CREATE TABLE table_10903 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did the team play when they scored 10.10 (70)?
SELECT "Venue" FROM table_10903 WHERE "Away team score" = '10.10 (70)'
wikisql
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...
从2012年10月17日到2017年12月25日之间名叫张静雅的患者就诊过多少个医生?
SELECT COUNT(mzjzjlb.ZZYSGH) 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 = '张静雅' AND mzjzjlb.JZKSRQ BETWEEN '2012-10-17' AND '2017-12-25'
css
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 prescriptions ( subject_id text, hadm_id...
give me the number of patients whose gender is m and drug name is xopenex neb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Xopenex Neb"
mimicsql_data
CREATE TABLE table_78116 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
what is at 10:00 when at 9:00 it is lost (#19, 4.6 rating) and at 8:30 it is lost (reruns)?
SELECT "10:00" FROM table_78116 WHERE "9:00" = 'lost (#19, 4.6 rating)' AND "8:30" = 'lost (reruns)'
wikisql
CREATE TABLE table_33299 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "Facility ID" real, "ERP W" real, "Height m ( ft )" text, "Class" text, "FCC info" text )
What is the lowest ERP W of the 67829 Facility ID?
SELECT MIN("ERP W") FROM table_33299 WHERE "Facility ID" = '67829'
wikisql