context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_44132 ( "Country" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" real )
What is the highest number of ends won of 47 Ends Lost and a Shot % less than 73?
SELECT MAX("Ends Won") FROM table_44132 WHERE "Ends Lost" = '47' AND "Shot %" < '73'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean...
Top Android users in South Africa.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
How many users does this database contain.
SELECT COUNT(*) FROM Posts WHERE PostTypeId = (SELECT Id FROM PostTypes WHERE Name LIKE 'Question') AND OwnerUserId = (SELECT Id FROM Users WHERE DisplayName LIKE 'Mat Mannion')
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutput...
what was the drug that was prescribed to patient 012-35670 for the last time until 34 months ago via the intravenou route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35670')) AND medication.routeadmin = 'intravenou' AND DATETIME(...
eicu
CREATE TABLE table_name_8 ( born_died VARCHAR, entered_office VARCHAR )
What is the born-died that has office of 13 September 1229 as the entered?
SELECT born_died FROM table_name_8 WHERE entered_office = "13 september 1229"
sql_create_context
CREATE TABLE table_34387 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
How much Overall has a Pick # smaller than 20, and a Round smaller than 6?
SELECT SUM("Overall") FROM table_34387 WHERE "Pick #" < '20' AND "Round" < '6'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
what was the number of patients that were given a tobramycin - peak test since 3 years ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'tobramycin - peak' AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
CREATE TABLE table_68362 ( "Race Title" text, "Circuit" text, "Location / State" text, "Date" text, "Winner" text, "Team" text )
What is the team of winner Dick Johnson?
SELECT "Team" FROM table_68362 WHERE "Winner" = 'dick johnson'
wikisql
CREATE TABLE table_name_61 ( Severe INTEGER, season VARCHAR, tropical_lows VARCHAR )
What is the least amount of severe tropical cyclones for the 1992 93 season and the tropical Lows smaller than 6?
SELECT MIN(Severe) AS tropical_cyclones FROM table_name_61 WHERE season = "1992–93" AND tropical_lows < 6
sql_create_context
CREATE TABLE table_train_44 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "corticosteroid_therapy" bool, "immune_suppression" bool, "hepatic_disease" bool, "septic_shock" bool, "age" float, "NOUSE" float )
diagnosis, suspected or confirmed, of severe sepsis or septic shock
SELECT * FROM table_train_44 WHERE severe_sepsis = 1 OR septic_shock = 1
criteria2sql
CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE written_by ( id int, msid int, wid int ) CREATE TABLE company ( id int, name text, country_code varchar ) CREATE TABLE genre ( gid int, genre...
List ' James Bond ' directors
SELECT director.name FROM directed_by, director, movie WHERE director.did = directed_by.did AND movie.mid = directed_by.msid AND movie.title = 'James Bond'
imdb
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...
what is the number of patients whose admission location is emergency room admit and diagnoses icd9 code is 311?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "311"
mimicsql_data
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
what are the four most frequently given diagnoses for patients who have had exploratory laparotomy previously within 2 months until 2103?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
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 jyjgzbb ( BGDH text, BGRQ tim...
病患奚白云所有检验报告单中时间在09年9月21日到12年11月3日内的审核日期时间都是什么时候?
SELECT jybgb.SHSJ 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 jybg...
css
CREATE TABLE table_name_72 ( date VARCHAR, home VARCHAR )
When was the game at the home of the Los Angeles Kings?
SELECT date FROM table_name_72 WHERE home = "los angeles kings"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
Get number of users by location.
SELECT COUNT(1) FROM Users WHERE LOWER(Location) LIKE '%##LocationInLowercase##%'
sede
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
患者任书萱在医院4688366出院的诊断是由姓王的医生开出出院诊断结果是啥样的呢?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '任书萱' AND t_kc21.MED_SER_ORG_NO = '4688366' AND t_kc21.OUT_DIAG_DOC_NM LIKE '王%'
css
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text ) CRE...
How many courses are there in total?
SELECT COUNT(*) FROM courses
spider
CREATE TABLE table_66912 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Intergiro classification" text, "Trofeo Fast Team" text )
Who was the winner in stage 7 with a general classification of Pavel Tonkov?
SELECT "Winner" FROM table_66912 WHERE "General classification" = 'pavel tonkov' AND "Stage" = '7'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
show me the flights from ATLANTA to DENVER on friday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 25 AND date_day.month_number = 6 AND da...
atis
CREATE TABLE table_17417 ( "Train No." text, "Train Name" text, "Origin" text, "Destination" text, "Frequency" text )
What's the name of train number 15647/48?
SELECT "Train Name" FROM table_17417 WHERE "Train No." = '15647/48'
wikisql
CREATE TABLE table_44461 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Player that has a To standard of 4?
SELECT "Player" FROM table_44461 WHERE "To par" = '–4'
wikisql
CREATE TABLE table_name_88 ( ground VARCHAR, home VARCHAR )
What ground has etobicoke kangaroos as the home?
SELECT ground FROM table_name_88 WHERE home = "etobicoke kangaroos"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
show me the flights from WESTCHESTER COUNTY to CINCINNATI
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 = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam...
atis
CREATE TABLE table_14109 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
Which TV Time has a Result of w 24 17?
SELECT "TV Time" FROM table_14109 WHERE "Result" = 'w 24–17'
wikisql
CREATE TABLE mzb ( 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...
根据不相同的入院诊断疾病编码还有科室编码,列出病患的平均年龄在这所医院5766627内所有的医疗就诊记录中都是多少?
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5766627' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5766627' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
CREATE TABLE table_name_91 ( title VARCHAR, season VARCHAR, attendance VARCHAR, runner_up VARCHAR )
What was the title for the game with an attendance of n/a with the runner-up being Waseda, and a season of 1995-6 details?
SELECT title FROM table_name_91 WHERE attendance = "n/a" AND runner_up = "waseda" AND season = "1995-6 details"
sql_create_context
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_len...
Bar chart x axis color y axis the number of color
SELECT color, COUNT(color) FROM photos GROUP BY color
nvbench
CREATE TABLE table_4804 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the opposing team's score at the match that was played at Victoria Park?
SELECT "Away team score" FROM table_4804 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_70645 ( "Player" text, "Date" text, "Original Team" text, "Offer Team" text, "Result" text )
What is the Result that has the New York Rangers as the Offer Team and Adam Graves as the Player?
SELECT "Result" FROM table_70645 WHERE "Offer Team" = 'new york rangers' AND "Player" = 'adam graves'
wikisql
CREATE TABLE table_47457 ( "Election" text, "Candidate" text, "Number of votes" text, "Share of votes" text, "Outcome of election" text )
Who is the candidate in the 2012 election?
SELECT "Candidate" FROM table_47457 WHERE "Election" = '2012'
wikisql
CREATE TABLE table_68290 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which place has United States as the country and Craig Wood as the player?
SELECT "Place" FROM table_68290 WHERE "Country" = 'united states' AND "Player" = 'craig wood'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
what were the four drugs prescribed most frequently to the patients aged 40s within 2 months after they had been diagnosed with single lb in-hosp w/o cs since 2105?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
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...
从二零零四年八月二十九日到二零一四年五月二十二日这段时间里,患者苗慧捷的哪些药品自付比例低于0.71的,把数量提供出来
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '苗慧捷' AND t_kc22.STA_DATE BETWEEN '2004-08-29' AND '2014-05-22' AND t_kc22.SELF_PAY_PRO < 0.71
css
CREATE TABLE table_17171 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
What years for the rockets did the player ford, phil phil ford play?
SELECT "Years for Rockets" FROM table_17171 WHERE "Player" = 'Ford, Phil Phil Ford'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
How many questions have been asked on July 18, 2013?.
SELECT COUNT(Id) AS "questions_posted" FROM Posts WHERE CreationDate > '2013-12-18 00:00' AND CreationDate < '2013-12-18 23:59:59' AND PostTypeId = 1
sede
CREATE TABLE table_1603807_2 ( operator VARCHAR, line VARCHAR )
Which operator runs the Mamariga shuttle line?
SELECT operator FROM table_1603807_2 WHERE line = "Mamariga Shuttle"
sql_create_context
CREATE TABLE table_11931 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which is least lap is mika salo in?
SELECT MIN("Laps") FROM table_11931 WHERE "Driver" = 'mika salo'
wikisql
CREATE TABLE table_6024 ( "Rank" real, "Rider" text, "Manufacturer" text, "Points" real, "Wins" real )
Points of 26, and a Rank smaller than 27 had what sum of wins?
SELECT SUM("Wins") FROM table_6024 WHERE "Points" = '26' AND "Rank" < '27'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
患者韩曼冬在2002年2月11日到2014年2月3日内都做了什么检验把检验结果指标记录中的仪器编号以及名称列出来
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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_MZJZ...
css
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 with diagnoses icd9 code 5781 who have been admitted for more than 16 days in hospital.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "16" AND diagnoses.icd9_code = "5781"
mimicsql_data
CREATE TABLE table_name_60 ( round VARCHAR, position VARCHAR, overall VARCHAR )
Which round has more than 79 overall and a position of QB?
SELECT round FROM table_name_60 WHERE position = "qb" AND overall > 79
sql_create_context
CREATE TABLE table_48913 ( "Team" text, "Driver" text, "Chassis" text, "Engine" text, "Rounds" text )
Which engine is in all rounds with Tsugio Matsuda driving?
SELECT "Engine" FROM table_48913 WHERE "Rounds" = 'all' AND "Driver" = 'tsugio matsuda'
wikisql
CREATE TABLE table_name_57 ( outcome VARCHAR, date VARCHAR )
What is the outcome on June 9, 1997?
SELECT outcome FROM table_name_57 WHERE date = "june 9, 1997"
sql_create_context
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...
从2009年2月14日到2016年4月20日,算一下7490542这个医疗机构的患者对医疗项目自付比例的平均值
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '7490542' AND t_kc22.STA_DATE BETWEEN '2009-02-14' AND '2016-04-20'
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
give me a flight from BALTIMORE to NEWARK that arrives as early as possible
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW...
atis
CREATE TABLE table_30616 ( "IME Exchange (Including spot, credit and forward transactions)" text, "2007/08" text, "2008/09" text, "2009/10" text, "2010/11" text )
When ime exchange (including spot, credit and forward transactions) is oil products - value (billion rials) what is the 2008/09 number?
SELECT COUNT("2008/09") FROM table_30616 WHERE "IME Exchange (Including spot, credit and forward transactions)" = 'Oil Products - Value (billion rials)'
wikisql
CREATE TABLE table_14058433_5 ( won VARCHAR, tries_for VARCHAR )
what's the won with tries for being 84
SELECT won FROM table_14058433_5 WHERE tries_for = "84"
sql_create_context
CREATE TABLE table_name_47 ( winners VARCHAR, third_place VARCHAR, team VARCHAR )
How many winners did Minas, which has 0 third places, have?
SELECT winners FROM table_name_47 WHERE third_place = "0" AND team = "minas"
sql_create_context
CREATE TABLE table_50186 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
Can you tell me the Wins that has the Starts larger than 1, and the Top 5 of 3?
SELECT "Wins" FROM table_50186 WHERE "Starts" > '1' AND "Top 5" = '3'
wikisql
CREATE TABLE table_name_57 ( avg INTEGER, fuml INTEGER )
What was the highest average when Fuml was 0?
SELECT MAX(avg) FROM table_name_57 WHERE fuml < 0
sql_create_context
CREATE TABLE table_name_86 ( alternate VARCHAR, nation VARCHAR )
Who was Switzerland's alternate?
SELECT alternate FROM table_name_86 WHERE nation = "switzerland"
sql_create_context
CREATE TABLE table_name_67 ( november INTEGER, record VARCHAR )
What is the earliest day in November with a record of 15-7-1?
SELECT MIN(november) FROM table_name_67 WHERE record = "15-7-1"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
what is the latest flight leaving WASHINGTON for DENVER
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DE...
atis
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Most viewed questions with no votes.
SELECT * FROM Posts WHERE ViewCount >= 100 AND Score = 0 ORDER BY ViewCount DESC
sede
CREATE TABLE table_47878 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" text )
What is the smallest grid value that had 16 points and a team of Mi-Jack Conquest Racing?
SELECT MIN("Grid") FROM table_47878 WHERE "Team" = 'mi-jack conquest racing' AND "Points" = '16'
wikisql
CREATE TABLE table_name_5 ( city VARCHAR, results¹ VARCHAR )
What city held that game with a 5:2 result?
SELECT city FROM table_name_5 WHERE results¹ = "5:2"
sql_create_context
CREATE TABLE table_name_51 ( date_departed VARCHAR, navy VARCHAR, name VARCHAR )
What's the departed date that the HMS Leith of the Royal Navy?
SELECT date_departed FROM table_name_51 WHERE navy = "royal navy" AND name = "hms leith"
sql_create_context
CREATE TABLE table_name_28 ( m60a3_patton VARCHAR, leclerc VARCHAR )
What is the M60A3 that has 40 rounds as Leclerc?
SELECT m60a3_patton FROM table_name_28 WHERE leclerc = "40 rounds"
sql_create_context
CREATE TABLE table_16162581_1 ( simplified_characters VARCHAR, wade_giles VARCHAR )
Name the simplified characters for wade giles is ch'ing-y an i-ma
SELECT simplified_characters FROM table_16162581_1 WHERE wade_giles = "ch'ing-yüan … i-ma"
sql_create_context
CREATE TABLE table_36036 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Which Outcome has a Score of 3 6 2 6?
SELECT "Outcome" FROM table_36036 WHERE "Score" = '3–6 2–6'
wikisql
CREATE TABLE table_52585 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the average crowd size for the home team essendon?
SELECT AVG("Crowd") FROM table_52585 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_name_10 ( grid VARCHAR, driver VARCHAR )
What Grid has Driver Cristiano da Matta?
SELECT grid FROM table_name_10 WHERE driver = "cristiano da matta"
sql_create_context
CREATE TABLE savings ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text ) CREATE TABLE checking ( custid number, balance number )
Find the name and checking balance of the account with the lowest saving balance.
SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1
spider
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
what was the name of the first intake of patient 28443 that they had during yesterday?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND DATETIME(inputevents_cv....
mimic_iii
CREATE TABLE table_203_174 ( id number, "rank" number, "film" text, "year" number, "opening weekend\n(three day)" text, "inflation-adjusted\n(2014 usd)" text )
the biggest worldwide opening since 2002 is held by what movie ?
SELECT "film" FROM table_203_174 ORDER BY "opening weekend\n(three day)" DESC LIMIT 1
squall
CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE team ( team_id ...
Who are the different players and how many years has each played?
SELECT player, years_played FROM player
spider
CREATE TABLE table_37773 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the total number of weeks that were on September 25, 1955 with more than 16,901 people in attendance?
SELECT COUNT("Week") FROM table_37773 WHERE "Attendance" > '16,901' AND "Date" = 'september 25, 1955'
wikisql
CREATE TABLE table_name_48 ( year INTEGER, notes VARCHAR )
What was the earliest year with a note of 18.04 m wl?
SELECT MIN(year) FROM table_name_48 WHERE notes = "18.04 m wl"
sql_create_context
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restrict...
what flights are there from NEW YORK to LAS VEGAS
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V...
atis
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...
哪些工号及姓名的医务人员在患者94520266就诊过程中为他检测指标994830的,时间是从0三年十二月十四日到0八年十二月二十五日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
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, ...
提供检验报告单18891516065的是什么科室它的编码还有名称是啥啊?
SELECT jybgb.KSBM, jybgb.KSMC FROM jybgb WHERE jybgb.BGDH = '18891516065'
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
How popular are Python, R and SAS.
SELECT YEAR(q.CreationDate) AS Year, MONTH(q.CreationDate) AS Month, t.TagName, COUNT(DISTINCT q.Id) AS countOfPosts, COUNT(*) AS c, SUM(q.ViewCount) AS countOfViews FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName IN ('sas', 'python', 'r') GROUP BY YEAR(q.Creati...
sede
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...
What is the name of every city that has at least 15 stations and how many stations does it have Visualize by bar chart, rank in desc by the Y.
SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY COUNT(*) DESC
nvbench
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...
give me the age and procedure short title of the patient with patient id 2560.
SELECT demographic.age, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_66013 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" text, "Year Left" text )
Which year did the school with the mascot of the Vikings join?
SELECT "Year Joined" FROM table_66013 WHERE "Mascot" = 'vikings'
wikisql
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm_amenity ( amenid number, amenity_...
Find the average age of students living in each dorm and the name of dorm.
SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name
spider
CREATE TABLE table_name_60 ( grid INTEGER, time VARCHAR )
What is the sum of Grid, when Time is '+16.687'?
SELECT SUM(grid) FROM table_name_60 WHERE time = "+16.687"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose year of birth is less than 2197 and diagnoses short title is neutropenia nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2197" AND diagnoses.short_title = "Neutropenia NOS"
mimicsql_data
CREATE TABLE table_10309 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text )
During the Australian Grand Prix and the fastest lap was driven by Jacques Villeneuve, what's the report recorded?
SELECT "Report" FROM table_10309 WHERE "Fastest Lap" = 'jacques villeneuve' AND "Grand Prix" = 'australian grand prix'
wikisql
CREATE TABLE table_name_23 ( school VARCHAR, hometown VARCHAR )
Which school is in Raleigh, NC?
SELECT school FROM table_name_23 WHERE hometown = "raleigh, nc"
sql_create_context
CREATE TABLE table_41809 ( "Year" real, "Income" real, "Expenditure" real, "Surplus(Deficit)" text, "% GDP" text )
Which % GDP has an Expenditure larger than 50.9, and a Year larger than 2009, and an Income of 39.3?
SELECT "% GDP" FROM table_41809 WHERE "Expenditure" > '50.9' AND "Year" > '2009' AND "Income" = '39.3'
wikisql
CREATE TABLE zyb ( 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...
患者谢昊昊在二00五年一月二十七日到二0一四年八月十一日期间,最常去的是哪家医院
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '谢昊昊' AND qtb.IN_HOSP_DATE BETWEEN '2005-01-27' AND '2014-08-11' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '谢昊昊' AND gyb.IN_HOSP_DATE BETWEEN '2005-01-27' AND '2014-08-11' GROUP BY gy...
css
CREATE TABLE table_name_34 ( team_2 VARCHAR, team_1 VARCHAR )
What is the team 2 for the match with a team 1 of Panathinaikos?
SELECT team_2 FROM table_name_34 WHERE team_1 = "panathinaikos"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, ...
Questions and Answers per month.
SELECT DATEADD(month, DATEDIFF(month, @start, CreationDate), @start) AS "month", SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS "answers" FROM Posts WHERE (PostTypeId = 1 OR PostTypeId = 2) AND CreationDate >= @start AND CreationDate < @stop AND Score ...
sede
CREATE TABLE table_10818465_1 ( ga_date VARCHAR, processor_frequency VARCHAR )
What ga date do the models with 1.0, 1.2, 1.4ghz processor frequencies have?
SELECT ga_date FROM table_10818465_1 WHERE processor_frequency = "1.0, 1.2, 1.4GHz"
sql_create_context
CREATE TABLE table_name_28 ( entrepreneur_s_ VARCHAR, first_aired VARCHAR )
Which Entrepreneur(s) first aired on 24 August 2006?
SELECT entrepreneur_s_ FROM table_name_28 WHERE first_aired = "24 august 2006"
sql_create_context
CREATE TABLE table_35333 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
What is the rank of the United States player Davis Love III with earnings under $12,487,463?
SELECT MAX("Rank") FROM table_35333 WHERE "Country" = 'united states' AND "Player" = 'davis love iii' AND "Earnings ( $ )" < '12,487,463'
wikisql
CREATE TABLE table_75766 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Which Date has a Runner(s)-up of bernhard langer, and a Tournament of at&t championship?
SELECT "Date" FROM table_75766 WHERE "Runner(s)-up" = 'bernhard langer' AND "Tournament" = 'at&t championship'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
Top 10 answers for year-in-review.
SELECT Id AS "post_link", Score FROM Posts AS p WHERE YEAR(CreationDate) = '##year?2018##' AND p.PostTypeId = 2 ORDER BY Score DESC LIMIT 10
sede
CREATE TABLE table_33841 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
December smaller than 14, and a Game smaller than 28, and a Score of 6 - 6 involved what opponent?
SELECT "Opponent" FROM table_33841 WHERE "December" < '14' AND "Game" < '28' AND "Score" = '6 - 6'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, X...
检验报告单的编码为06020436225的检验申请机构名称和检验机构名称都分别叫什么?
SELECT jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '06020436225'
css
CREATE TABLE table_204_91 ( id number, "year" number, "original title" text, "english title" text, "role" text, "notes" text )
in how many films did henrik malberg appear ?
SELECT COUNT("original title") FROM table_204_91
squall
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
Was ENVIRON 310 ever taught by Craig Wuthrich ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'ENVIRON' AND course.number = 310 AND instructor.name LIKE '%Craig Wuthrich%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instruc...
advising
CREATE TABLE table_237757_3 ( winner__number_of_titles_ VARCHAR, runners_up VARCHAR )
If the runner-up is the Fort Lauderdale Strikers, what is the winner (number of titles)?
SELECT winner__number_of_titles_ FROM table_237757_3 WHERE runners_up = "Fort Lauderdale Strikers"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of department_id bin hire_date by weekday in a bar chart.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_5547 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who is the rider who did less than 20 laps on a grid number greater than 23?
SELECT "Rider" FROM table_5547 WHERE "Laps" < '20' AND "Grid" > '23'
wikisql
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...
把2002年10月16日到2006年1月26日期间患者喻思聪主要患的是什么疾病查看一下
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '喻思聪' AND IN_HOSP_DATE BETWEEN '2002-10-16' AND '2006-01-26' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE publication ( Publication_Date VARCHAR )
Please show the most common publication date.
SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_17185 ( "Unit" text, "Commander" text, "Complement" text, "Killed" text, "Wounded" text, "Missing" text )
How many where killed under Major-General Jean Victor de Constant Rebecque's command?
SELECT "Killed" FROM table_17185 WHERE "Commander" = 'Major-General Jean Victor de Constant Rebecque'
wikisql