context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId numb...
Number of deleted posts for user.
SELECT * FROM PostHistory WHERE PostHistory.UserId = @UserId
sede
CREATE TABLE table_name_31 ( bronze VARCHAR, gold VARCHAR, total VARCHAR, nation VARCHAR )
How many bronzes have 1 as the total, with spain (esp) as the nation, and a gold greater than 0?
SELECT COUNT(bronze) FROM table_name_31 WHERE total = 1 AND nation = "spain (esp)" AND gold > 0
sql_create_context
CREATE TABLE table_name_42 ( score VARCHAR, date VARCHAR )
What was the score on March 5 at Vancouver?
SELECT score FROM table_name_42 WHERE date = "march 5"
sql_create_context
CREATE TABLE table_39301 ( "Nationality" text, "Matches" real, "Drawn" real, "Lost" real, "Win %" real )
Win % larger than 47.1, and a Matches smaller than 145 had what lowest lost?
SELECT MIN("Lost") FROM table_39301 WHERE "Win %" > '47.1' AND "Matches" < '145'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the sum of code , and group by attribute founder, display total number of code from high to low order.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
nvbench
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 course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
What is the BIOMEDE 556 course about ?
SELECT DISTINCT description, name FROM course WHERE department = 'BIOMEDE' AND number = 556
advising
CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE departmen...
What are the full names and department ids for the lowest paid employees across all departments.
SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)
spider
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight_fare ...
i need information on flights from TORONTO to SAN DIEGO
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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DI...
atis
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of salary over the job_id , and group by attribute job_id.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text )
Show teams that have suffered more than three eliminations.
SELECT team FROM elimination GROUP BY team HAVING COUNT(*) > 3
spider
CREATE TABLE table_name_62 ( opponent VARCHAR, location VARCHAR, round VARCHAR )
Who was the opponent in London, England in a round less than 2?
SELECT opponent FROM table_name_62 WHERE location = "london, england" AND round < 2
sql_create_context
CREATE TABLE table_47688 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Name the country with a score of 69-71=140.
SELECT "Country" FROM table_47688 WHERE "Score" = '69-71=140'
wikisql
CREATE TABLE table_name_86 ( nominee VARCHAR, category VARCHAR )
What's the nominee for best supporting actress?
SELECT nominee FROM table_name_86 WHERE category = "best supporting actress"
sql_create_context
CREATE TABLE table_name_25 ( episode INTEGER, performer_1 VARCHAR, performer_4 VARCHAR )
What is the episode number where Jim Sweeney was performer 1 and Mike Mcshane was performer 4?
SELECT SUM(episode) FROM table_name_25 WHERE performer_1 = "jim sweeney" AND performer_4 = "mike mcshane"
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, ...
在2010年12月15日到2018-年5月30日这期间患者76284316总共检查了几次?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '76284316' AND t_kc22.STA_DATE BETWEEN '2010-12-15' AND '2018-05-30' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE f...
css
CREATE TABLE Document_Structures ( document_structure_code VARCHAR(15), parent_document_structure_code VARCHAR(15), document_structure_description VARCHAR(80) ) CREATE TABLE Documents ( document_code VARCHAR(15), document_structure_code VARCHAR(15), document_type_code VARCHAR(15), access_co...
What are the names of all the documents, as well as the access counts of each, ordered alphabetically.
SELECT document_name, access_count FROM Documents ORDER BY document_name
nvbench
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...
自02年3月3日起,截止到06年2月9日,查一下患者72776229在医疗机构7840461的门诊看过几次病
SELECT COUNT(*) 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 = '72776229' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-03-03' AND '2006-02-09' AND zzmzjzjlb.YLJGDM = '7840461' UNION SELECT COUNT(*) FROM hz_info JOIN fzzmzjzjlb ON...
css
CREATE TABLE table_name_14 ( score VARCHAR, opponent VARCHAR )
What was the score for the game against the New Jersey Nets?
SELECT score FROM table_name_14 WHERE opponent = "new jersey nets"
sql_create_context
CREATE TABLE table_58537 ( "Engine" text, "Power, continuous" text, "Power, takeoff" text, "Compression ratio" text, "Supercharger gear ratio" text, "Octane rating" text, "Dry weight" text )
Which supercharger gear ratio has a Octane rating of 68?
SELECT "Supercharger gear ratio" FROM table_58537 WHERE "Octane rating" = '68'
wikisql
CREATE TABLE table_72431 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
how many candidates with district being california 7
SELECT COUNT("Candidates") FROM table_72431 WHERE "District" = 'California 7'
wikisql
CREATE TABLE table_name_94 ( country VARCHAR, to_par VARCHAR, score VARCHAR )
What is the Country of the Player with a To par of +4 and Score of 73-71-73=217?
SELECT country FROM table_name_94 WHERE to_par = "+4" AND score = 73 - 71 - 73 = 217
sql_create_context
CREATE TABLE table_name_33 ( game VARCHAR, date VARCHAR )
What is the Game number on March 30?
SELECT game FROM table_name_33 WHERE date = "march 30"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Posts ...
Top users by skills in a given location.
SELECT Users.Id AS "user_link", SUM(CASE WHEN Tags.TagName = '##Skill1##' THEN Answers.Score ELSE 0 END) AS Score1, SUM(CASE WHEN Tags.TagName = '##Skill2##' THEN Answers.Score ELSE 0 END) AS Score2 FROM Posts AS Answers INNER JOIN Posts AS ParentQuestions ON ParentQuestions.Id = Answers.ParentId INNER JOIN Users AS Us...
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
看看病人朱泰和在10.8.21到16.12.05内所有检验报告单中的标本采集部位,把这些采集部位都列出来
SELECT jybgb.BBCJBW 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 jy...
css
CREATE TABLE table_203_834 ( id number, "rank" number, "census subdivision" text, "province" text, "type" text, "land area\n(km2, 2011)" number, "population 2011" number, "population 2006" number, "population 2001" number, "population 1996" number, "change in % 2006-2011" num...
of the top 10 most heavily populated census subdivisions in 2011 , how many located were in ontario ?
SELECT COUNT("census subdivision") FROM table_203_834 WHERE "population 2011" IN (SELECT "population 2011" FROM table_203_834 ORDER BY "population 2011" DESC LIMIT 10) AND "province" = 'ontario'
squall
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 )
tg ( triglyceride ) greater than 400 mg / dl
SELECT * FROM table_train_113 WHERE triglyceride_tg >= 400
criteria2sql
CREATE TABLE table_14366 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
Name the drawn with lost of 3 and points of 88
SELECT "Drawn" FROM table_14366 WHERE "Lost" = '3' AND "Points" = '88'
wikisql
CREATE TABLE table_43937 ( "Rank" text, "Event" text, "Place" text, "Name" text, "Prize" text )
What is Name, when Prize is '$279.330'?
SELECT "Name" FROM table_43937 WHERE "Prize" = '$279.330'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose primary disease is stemi and days of hospital stay is greater than 4?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STEMI" AND demographic.days_stay > "4"
mimicsql_data
CREATE TABLE table_1226 ( "Round #" real, "Pick #" real, "Player" text, "Position" text, "College" text )
Who was the highest picked defensive end
SELECT MAX("Pick #") FROM table_1226 WHERE "Position" = 'Defensive end'
wikisql
CREATE TABLE table_65229 ( "[ 3 H]CFT" real, "[ 3 H]Nisoxetine" text, "[ 3 H]Paroxetine" text, "N \u00f7 D" real, "S \u00f7 D" real )
What is the highest S D with a 2420 (220) [3H] paroxetine and an N D less than 393.8?
SELECT MAX("S \u00f7 D") FROM table_65229 WHERE "[ 3 H]Paroxetine" = '2420 (220)' AND "N \u00f7 D" < '393.8'
wikisql
CREATE TABLE wdmzjzjlb ( 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...
从07-7-22到15-4-15,哪几位工号及姓名的医务人员在患者韩嘉玉就诊时为其提供检测指标303131服务的
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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar...
what flights takeoff and land at MKE
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
atis
CREATE TABLE mediatype ( mediatypeid number, name text ) CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, addres...
How many tracks belong to rock genre?
SELECT COUNT(*) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock"
spider
CREATE TABLE table_74932 ( "Circuit" text, "Date" text, "Pole position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Winning manufacturer" text )
What is the fastest lap in the Le Mans Bugatti circuit?
SELECT "Fastest Lap" FROM table_74932 WHERE "Circuit" = 'le mans bugatti'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
did patient 54825 undergo until 1 year ago a rt/left heart card cath procedure?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND DATETIME(pro...
mimic_iii
CREATE TABLE table_6042 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text )
What is the pick number for the player Chris Gomez?
SELECT SUM("Pick #") FROM table_6042 WHERE "Player" = 'chris gomez'
wikisql
CREATE TABLE table_79718 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the total of Sweden (SWE) having less than 1 silver?
SELECT MIN("Total") FROM table_79718 WHERE "Nation" = 'sweden (swe)' AND "Silver" < '1'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
give me the number of patients whose primary disease is left femur fracture and year of birth is less than 2071?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND demographic.dob_year < "2071"
mimicsql_data
CREATE TABLE table_79605 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What home team had 2 ties?
SELECT "Home team" FROM table_79605 WHERE "Tie no" = '2'
wikisql
CREATE TABLE table_name_18 ( year INTEGER, role VARCHAR, title VARCHAR )
What's the earliest year with a role of alvin seville simon seville david 'dave' seville, and a Title of alvin and the chipmunks meet the wolfman?
SELECT MIN(year) FROM table_name_18 WHERE role = "alvin seville simon seville david 'dave' seville" AND title = "alvin and the chipmunks meet the wolfman"
sql_create_context
CREATE TABLE table_34197 ( "Club" text, "Nickname" text, "Years in Competition" text, "No. of Premierships" real, "Premiership Years" text )
What was the Nickname that had a No. 0, and Years in Competition of 1982-2003?
SELECT "Nickname" FROM table_34197 WHERE "No. of Premierships" = '0' AND "Years in Competition" = '1982-2003'
wikisql
CREATE TABLE table_22198 ( "HD designation" text, "Constellation" text, "Distance ( ly )" text, "Spectral type" text, "Signal power ( kW )" real, "Date sent" text, "Arrival date" text )
If the distance is 55.7, what is the name of the constellation?
SELECT "Constellation" FROM table_22198 WHERE "Distance ( ly )" = '55.7'
wikisql
CREATE TABLE table_27057070_3 ( outgoing_manager VARCHAR, team VARCHAR )
Who is the outgoing manager when the team is simurq pfc?
SELECT outgoing_manager FROM table_27057070_3 WHERE team = "Simurq PFC"
sql_create_context
CREATE TABLE table_name_63 ( location VARCHAR, runner_up VARCHAR, year VARCHAR )
What is the location where ed c. kingsley was the runner-up in 1939?
SELECT location FROM table_name_63 WHERE runner_up = "ed c. kingsley" AND year = "1939"
sql_create_context
CREATE TABLE table_32597 ( "Rank" real, "Player" text, "Nation" text, "Assist" real, "Games" real, "Years" text )
Which year or years did a team win 174 games and had an assist number less than 17?
SELECT "Years" FROM table_32597 WHERE "Assist" < '17' AND "Games" = '174'
wikisql
CREATE TABLE table_name_29 ( type VARCHAR, quantity VARCHAR )
Which type has a quantity of 11?
SELECT type FROM table_name_29 WHERE quantity = 11
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number by a bar chart, list from low to high by the names.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE table_2850912_3 ( pick__number VARCHAR, player VARCHAR )
What is Michal Pivonka's pick number?
SELECT COUNT(pick__number) FROM table_2850912_3 WHERE player = "Michal Pivonka"
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
出院诊断医师负责医疗就诊95748539104,他的编号及名称分别是什么?
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '95748539104' UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '95748539104' UNION SELECT zyb.OUT_DIAG_DOC_CD, zyb.OUT_DIAG_DOC_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '95748539104' UNION SELECT mzb....
css
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
Bar chart x axis nationality y axis the total number
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( row_id number, s...
when was the first time patient 27703 had a chest tubes cticu ct 1 output on last month/04?
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 = 27703)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ches...
mimic_iii
CREATE TABLE table_204_349 ( id number, "year" number, "conservative\ncouncillors" number, "labour\ncouncillors" number, "independent\ncouncillors" number, "liberal\ncouncillors" number )
what was the number of labor councillors in 1964 ?
SELECT "labour\ncouncillors" FROM table_204_349 WHERE "year" = 1964
squall
CREATE TABLE table_name_81 ( prominence VARCHAR, mountain_peak VARCHAR )
Name the Prominence of the Mountain Peak of matchless mountain pb?
SELECT prominence FROM table_name_81 WHERE mountain_peak = "matchless mountain pb"
sql_create_context
CREATE TABLE table_204_939 ( id number, "year" number, "chassis" text, "engine" text, "start" text, "finish" text )
what is the average engine type listed ?
SELECT "engine" FROM table_204_939 GROUP BY "engine" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_20 ( outcome VARCHAR, score VARCHAR )
Which Outcome has a Score of 6 2, 6 2?
SELECT outcome FROM table_name_20 WHERE score = "6–2, 6–2"
sql_create_context
CREATE TABLE table_12373 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
Which Goals against has Wins of 13, and Goals for larger than 42, and more than 9 Losses?
SELECT AVG("Goals against") FROM table_12373 WHERE "Wins" = '13' AND "Goals for" > '42' AND "Losses" > '9'
wikisql
CREATE TABLE table_name_37 ( try_bonus VARCHAR, points_against VARCHAR )
What shows for Try bonus when the points against are 451?
SELECT try_bonus FROM table_name_37 WHERE points_against = "451"
sql_create_context
CREATE TABLE table_train_119 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "hypotension" bool, "allergy_to_milk" bool, "allergy_to_soy" bool, "body_mass_index_bmi" float, "plasma_creatinine" float, "NOUSE" float )
known allergy or hypersensitivity to milk or soy products
SELECT * FROM table_train_119 WHERE allergy_to_milk = 1 OR allergy_to_soy = 1
criteria2sql
CREATE TABLE table_204_49 ( id number, "city" text, "country" text, "iata" text, "icao" text, "airport" text, "commenced" number, "ended" text )
what year was the last time tigerair offered flights to xiamen ?
SELECT "ended" FROM table_204_49 WHERE "city" = 'xiamen'
squall
CREATE TABLE table_train_244 ( "id" int, "fasting_venous_plasma_glucose" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "capillary_glycated_hemoglobin" float, "fasting_capillary_glucose" int, "borderline_fasting_capillary_glucose_level" int, "body_mass_index_bmi" float, "fasti...
body mass index 25 _ 39.9 kg / m2
SELECT * FROM table_train_244 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 39.9
criteria2sql
CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME ) CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thi...
Group and count the move in date in a bar chart, and bin the X-axis into week day interval.
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events
nvbench
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 ( ...
find out the number of urgent hospital admission patients who had neutrophil lab test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Neutrophils"
mimicsql_data
CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages...
Find the number of stores in each city Plot them as bar chart, show by the x-axis in ascending.
SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY Headquartered_City
nvbench
CREATE TABLE table_name_58 ( games INTEGER, lost VARCHAR, points VARCHAR, drawn VARCHAR )
What is the highest games from a game with points less than 4, drawn of 1 and a lost less than 6?
SELECT MAX(games) FROM table_name_58 WHERE points < 4 AND drawn = 1 AND lost < 6
sql_create_context
CREATE TABLE table_71908 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Which year did Aya Ohori play in the Women's Singles?
SELECT "Year" FROM table_71908 WHERE "Women's singles" = 'aya ohori'
wikisql
CREATE TABLE table_31389 ( "Season" text, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" text, "Viewers (in millions)" text )
What TV season was the 1st season?
SELECT "TV season" FROM table_31389 WHERE "Season" = '1st'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Give me the comparison about the sum of ID over the Nationality , and group by attribute Nationality by a bar chart, could you order by the y axis in asc?
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY SUM(ID)
nvbench
CREATE TABLE table_name_11 ( event VARCHAR, winning_skip VARCHAR )
What event did Patti Lank have the winning skip?
SELECT event FROM table_name_11 WHERE winning_skip = "patti lank"
sql_create_context
CREATE TABLE table_name_22 ( placings INTEGER, rank VARCHAR, points VARCHAR )
What is the Place of the couple with a Rank smaller than 7 and 514.55 Points?
SELECT SUM(placings) FROM table_name_22 WHERE rank < 7 AND points = 514.55
sql_create_context
CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details text ) CREATE TABLE ref_characteristic_types ( characteristic_type_code t...
What are the different product names for products that have the 'warm' characteristic:?
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm"
spider
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
how many days has passed since patient 30826 was admitted into the hospital?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
医院1943196的医疗记录中,入院诊断为慢性支气管炎的最低医疗费总额是多少?最高的金额又是多少
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '1943196' AND IN_DIAG_DIS_NM = '慢性支气管炎')
css
CREATE TABLE table_59688 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What was the average money for United States when Lanny Wadkins played?
SELECT AVG("Money ( $ )") FROM table_59688 WHERE "Country" = 'united states' AND "Player" = 'lanny wadkins'
wikisql
CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) C...
What are the names of the activities Mark Giuliano is involved in
SELECT T3.activity_name FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
spider
CREATE TABLE table_19069 ( "District" text, "Counties Represented" text, "Delegate" text, "Party" text, "First Elected" real, "Committee" text )
Name the delegate first elected in 2003?
SELECT "Delegate" FROM table_19069 WHERE "First Elected" = '2003'
wikisql
CREATE TABLE table_65109 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text )
What is the Series of the Filmography with a Release date of 1946-03-16?
SELECT "Series" FROM table_65109 WHERE "Release date" = '1946-03-16'
wikisql
CREATE TABLE table_52851 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Places" text )
What nation has 187.84 points?
SELECT "Nation" FROM table_52851 WHERE "Points" = '187.84'
wikisql
CREATE TABLE table_name_93 ( crowd INTEGER, home_team VARCHAR )
What was total size of the crowd at a home game for north melbourne?
SELECT SUM(crowd) FROM table_name_93 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_28464 ( "Year" real, "FBS Opponent" text, "Result" text, "Opponents Conference" text, "Opponents Head Coach" text, "Charleston Southerns Head Coach" text )
Who was the opponents head coach with the result L, 56-6?
SELECT "Opponents Head Coach" FROM table_28464 WHERE "Result" = 'L, 56-6'
wikisql
CREATE TABLE table_27547668_3 ( no VARCHAR, written_by VARCHAR, directed_by VARCHAR )
What episode number in the season was written by Greg nelson and directed by Keith samples?
SELECT no FROM table_27547668_3 WHERE written_by = "Greg Nelson" AND directed_by = "Keith Samples"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top 1000 StackOverflow users from South Africa.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, WebsiteUrl AS Website, Location FROM Users WHERE Location LIKE '%South Africa%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_name_7 ( team_2 VARCHAR )
What was the 1st leg when team 2 was nov milenium?
SELECT 1 AS st_leg FROM table_name_7 WHERE team_2 = "nov milenium"
sql_create_context
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildi...
What is the number of booking start dates of the apartments with more than 2 bedrooms for each weekday? Show me a bar chart.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creatio...
Answers by the given user with the given phrase in the title (case, accent insensitive).
SELECT a.Id AS "post_link", a.Score, q.Tags FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE (a.OwnerUserId = '##userid?25510##') AND (q.Title LIKE '%##word?urgent##%' COLLATE Latin1_General_CI_AI) ORDER BY a.Id
sede
CREATE TABLE table_68115 ( "Player" text, "Overs" real, "Figures" text, "Opponent" text, "Ground" text )
How many overs occurred at Waca Ground against Queensland?
SELECT "Overs" FROM table_68115 WHERE "Ground" = 'waca ground' AND "Opponent" = 'queensland'
wikisql
CREATE TABLE table_name_22 ( pick INTEGER, college VARCHAR )
Which Pick has a College of ohio state?
SELECT MIN(pick) FROM table_name_22 WHERE college = "ohio state"
sql_create_context
CREATE TABLE table_73627 ( "Year" real, "Tournament" text, "Winner" text, "Margin of victory" text, "Winners share ( $ )" real, "Par" real, "Course length" text )
When gary player is the winner what is the lowest winners share in dollars?
SELECT MIN("Winners share ( $ )") FROM table_73627 WHERE "Winner" = 'Gary Player'
wikisql
CREATE TABLE table_18556 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who is the candidate for the district Arkansas 2?
SELECT "Candidates" FROM table_18556 WHERE "District" = 'Arkansas 2'
wikisql
CREATE TABLE table_name_65 ( against INTEGER, byes VARCHAR, losses VARCHAR, wins VARCHAR )
Which Against has Losses larger than 2, and Wins of 8, and Byes smaller than 0?
SELECT SUM(against) FROM table_name_65 WHERE losses > 2 AND wins = 8 AND byes < 0
sql_create_context
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
how many entries are of each type?
SELECT COUNT(*), releasetype FROM torrents GROUP BY releasetype
whatcdhiphop
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 the number of patients whose admission location is phys referral/normal deli and admission year is before 2178.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE table_17242 ( "Date of Issue" text, "Theme" text, "Denomination" text, "Design" text, "Illustration" text, "Printing Process" text, "Paper Type" text, "First Day Cover Cancellation" text )
What was the first day cover cancellation for the University of Saskatchewan themed stamp?
SELECT "First Day Cover Cancellation" FROM table_17242 WHERE "Theme" = 'University of Saskatchewan'
wikisql
CREATE TABLE table_name_40 ( player VARCHAR, position VARCHAR )
What Player is a Wide Receiver?
SELECT player FROM table_name_40 WHERE position = "wide receiver"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose drug code is lans30st and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LANS30ST" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_358 ( "Launch Vehicle" text, "Launch date" text, "Mission" text, "Institutional authority" text, "Launch site" text, "Results" text )
Where did Test Mission: War Heads and Missile Payload launch when there was a partial failure?
SELECT "Launch site" FROM table_358 WHERE "Mission" = 'Test Mission: war heads and Missile payload' AND "Results" = 'Partial Failure'
wikisql
CREATE TABLE table_2231241_1 ( seat_no_6 VARCHAR, seat_no_1 VARCHAR, seat_no_5 VARCHAR )
Who was seat no 6 when seat no 1 and seat no 5 were jacques lachapelle and donald s. dutton
SELECT seat_no_6 FROM table_2231241_1 WHERE seat_no_1 = "Jacques Lachapelle" AND seat_no_5 = "Donald S. Dutton"
sql_create_context
CREATE TABLE table_name_12 ( score VARCHAR, venue VARCHAR )
in riyadh, saudi arabia, what is the score?
SELECT score FROM table_name_12 WHERE venue = "riyadh, saudi arabia"
sql_create_context
CREATE TABLE table_name_82 ( series VARCHAR, year VARCHAR, actor VARCHAR )
What was actor Teresa Graves's series before the year 1993?
SELECT series FROM table_name_82 WHERE year < 1993 AND actor = "teresa graves"
sql_create_context
CREATE TABLE table_60805 ( "Episode" text, "1 season" text, "2 season" text, "3 season" text, "4 season" text, "5 season" text, "6 season" text )
What is 1st Season, when 4 Season is '3 273 440 (17 March 2009)'?
SELECT "1 season" FROM table_60805 WHERE "4 season" = '3 273 440 (17 march 2009)'
wikisql