context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_530 ( id number, "type" text, "stage" number, "cyclist" text, "team" text, "reason" text )
daniel martin and joost posthuma both withdrew from the race because of what reason ?
SELECT "reason" FROM table_204_530 WHERE "cyclist" = 'daniel martin'
squall
CREATE TABLE table_52552 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did Carlton play as the home team?
SELECT "Venue" FROM table_52552 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Get My Reputation and Location Data.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Id = 1042848
sede
CREATE TABLE table_name_95 ( location VARCHAR )
What is the 2013 BAFA adult flag division in Aylesbury?
SELECT 2013 AS _bafa_adult_flag_division FROM table_name_95 WHERE location = "aylesbury"
sql_create_context
CREATE TABLE table_55084 ( "Series ^" text, "Model" text, "CPU clock ( MHz )" text, "CPU cores" real, "TDP ( W )" text, "L2 cache (KiB)" text, "Radeon cores" real, "DDR3 speed" real )
Name the series ^ when the CPU clock is 1500 and the model is t-52r
SELECT "Series ^" FROM table_55084 WHERE "CPU clock ( MHz )" = '1500' AND "Model" = 't-52r'
wikisql
CREATE TABLE table_66142 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
What is the I/O bus entry for the processor with a release price of $657?
SELECT "I/O bus" FROM table_66142 WHERE "Release price ( USD )" = '$657'
wikisql
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...
患者90955811自费金额高于1737.24元的药品量有多少,时间是在01年2月2日到07年3月1日内
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '90955811' AND t_kc22.STA_DATE BETWEEN '2001-02-02' AND '2007-03-01' AND t_kc22.SELF_PAY_AMO > 1737.24
css
CREATE TABLE table_name_89 ( opponent VARCHAR, date VARCHAR )
Who did the Indians play on April 23?
SELECT opponent FROM table_name_89 WHERE date = "april 23"
sql_create_context
CREATE TABLE table_76045 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average number of bronze medals for total of all nations?
SELECT AVG("Bronze") FROM table_76045 WHERE "Nation" = 'total'
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...
what is the number of patients whose admission type is elective and item id is 51265?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51265"
mimicsql_data
CREATE TABLE table_30711 ( "Sl. No" real, "Category wise" text, "Single lane" real, "Intermediate lane" real, "Double lane" real, "Multi lane" real, "Total" real )
What is the least total?
SELECT MIN("Total") FROM table_30711
wikisql
CREATE TABLE table_74518 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the average bronze for total less than 1
SELECT AVG("Bronze") FROM table_74518 WHERE "Total" < '1'
wikisql
CREATE TABLE vocals ( bandmate VARCHAR ) CREATE TABLE band ( id VARCHAR )
Which vocal type has the band mate with first name 'Solveig' played the most?
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_28 ( title VARCHAR, language VARCHAR )
Which title is in Portuguese?
SELECT title FROM table_name_28 WHERE language = "portuguese"
sql_create_context
CREATE TABLE table_23640 ( "County" text, "Obama %" text, "Obama #" real, "McCain %" text, "McCain #" real, "Others %" text, "Others #" real )
What percentage of voters chose McCain in the county where 1.1% of voters voted third party?
SELECT "McCain %" FROM table_23640 WHERE "Others %" = '1.1%'
wikisql
CREATE TABLE table_10333757_1 ( branding VARCHAR, calls VARCHAR )
What Branding does WRKO calls use?
SELECT branding FROM table_10333757_1 WHERE calls = "WRKO"
sql_create_context
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE...
count the number of patients that are prescribed 0.9% sodium chloride (mini bag plus) during the same hospital encounter after having been diagnosed with hy kid nos w cr kid i-iv.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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 d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_name_71 ( lecturers VARCHAR, total VARCHAR, associate_professors VARCHAR, assistant_professors VARCHAR, professors VARCHAR )
How may lecturers are there in the case when there are more than 8 assistant professors, fewer than 35 associate professors, more than 14 professors and total of more than 81?
SELECT COUNT(lecturers) FROM table_name_71 WHERE assistant_professors > 8 AND professors > 14 AND associate_professors < 35 AND total > 81
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
what time was the last time patient 015-59552 had the maximum systemicsystolic value on this month/22?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND NOT vitalperiodic.systemicsystolic...
eicu
CREATE TABLE table_2169966_2 ( avg_finish VARCHAR, avg_start VARCHAR )
What was his average finish when his average start was 27.7?
SELECT avg_finish FROM table_2169966_2 WHERE avg_start = "27.7"
sql_create_context
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose days of hospital stay is greater than 43 and drug name is bag?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "43" AND prescriptions.drug = "Bag"
mimicsql_data
CREATE TABLE table_34831 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text )
what series was on may 14
SELECT "Series" FROM table_34831 WHERE "Date" = 'may 14'
wikisql
CREATE TABLE table_1383 ( "Year" real, "January" text, "February" text, "March" text, "April" text, "May" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text, "Annual Additions(in millions)" text, "...
What september has 10.35 in November?
SELECT "September" FROM table_1383 WHERE "November" = '10.35'
wikisql
CREATE TABLE table_25565 ( "R" real, "Player" text, "Position" text, "League" real, "Champions League" real, "Copa del Rey" real, "Total" real )
Name the most copa del rey for karim benzema
SELECT MAX("Copa del Rey") FROM table_25565 WHERE "Player" = 'Karim Benzema'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
what was the first value of the arterial bp [diastolic] of patient 23070 on 12/04/this year.
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
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...
螺内酯片在医疗就诊21173614248里的社保三目录统一编码是啥
SELECT t_kc22.SOC_SRT_DIRE_CD FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '21173614248' AND t_kc22.SOC_SRT_DIRE_NM = '螺内酯片'
css
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 medication ( medi...
when was the last time patient 015-58787 had sodium chloride 0.9% 1000 ml pb prescribed this month?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-58787')) AND medication.drugname = 'sodium chloride 0.9% 1...
eicu
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
查一下编号为33793765856的住院就诊的出院病区、代码以及出院床位号
SELECT CYBQDM, CYBQMC, CYCWH FROM zyjzjlb WHERE JZLSH = '33793765856'
css
CREATE TABLE table_48884 ( "Team" text, "Make" text, "Drivers" text, "Tyre" text, "Rounds" text )
Which drives drove a lexus, made all rounds, had a tyre of B and was on the team of petronas toyota team tom's?
SELECT "Drivers" FROM table_48884 WHERE "Rounds" = 'all' AND "Make" = 'lexus' AND "Tyre" = 'b' AND "Team" = 'petronas toyota team tom''s'
wikisql
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
For those employees who did not have any job in the past, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE table_65876 ( "World record" text, "Snatch" text, "Andrei Rybakou ( BLR )" text, "187kg" text, "Chiang Mai , Thailand" text )
Who has 187kg and a Snatch of Clean & Jerk?
SELECT "187kg" FROM table_65876 WHERE "Snatch" = 'clean & jerk'
wikisql
CREATE TABLE table_203_165 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many more medals did india earn compared to pakistan ?
SELECT (SELECT "total" FROM table_203_165 WHERE "nation" = 'india') - (SELECT "total" FROM table_203_165 WHERE "nation" = 'pakistan')
squall
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_...
i would like an AA flight from TORONTO to SAN DIEGO with a stopover in DENVER please
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2...
atis
CREATE TABLE table_50534 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
What is the season with a Skip of Eve Muirhead and a third of Kerry Barr?
SELECT "Season" FROM table_50534 WHERE "Skip" = 'eve muirhead' AND "Third" = 'kerry barr'
wikisql
CREATE TABLE table_name_62 ( pick INTEGER, overall VARCHAR, college VARCHAR )
WHAT IS THE SUM OF PICK WITH AN OVERALL LARGER THAN 250, AND FOR FLORIDA COLLEGE?
SELECT SUM(pick) FROM table_name_62 WHERE overall > 250 AND college = "florida"
sql_create_context
CREATE TABLE table_18298 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What candidate is a member of the Republican party?
SELECT "Candidates" FROM table_18298 WHERE "Party" = 'Republican'
wikisql
CREATE TABLE table_52489 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the venue when the away team scored 15.9 (99)?
SELECT "Venue" FROM table_52489 WHERE "Away team score" = '15.9 (99)'
wikisql
CREATE TABLE table_41882 ( "Episode number" real, "Title" text, "Original airing on Channel 4" text, "Time of airing on Channel 4" text, "Original airing on E4" text, "Time of airing on E4" text, "Position in Channel 4 and Channel 4+1's ratings" text, "Position in E4 and E4+1's ratings" ...
What is Channel 4 and Channel 4+1's rating in E4 and E4+1 when the ratings were 780,200?
SELECT "Position in Channel 4 and Channel 4+1's ratings" FROM table_41882 WHERE "Position in E4 and E4+1's ratings" = '780,200'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descri...
Bad questions, based on vote score and closure and the like_title.
SELECT Score, CASE WHEN NOT ClosedDate IS NULL THEN 'N' ELSE 'Er' END AS "closed?", Title AS "post_link" FROM Posts WHERE PostTypeId = 1 AND (NOT ClosedDate IS NULL OR Score < -3) ORDER BY Score LIMIT 500
sede
CREATE TABLE head ( name VARCHAR, born_state VARCHAR )
What are the names of the heads who are born outside the California state?
SELECT name FROM head WHERE born_state <> 'California'
sql_create_context
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, ...
从20年3月29日到21年7月14日,患者周方方,总胆红素三代这个指标怎么样
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid tex...
what is the yearly average dose of enteral tube intake: orogastric oral given to patient 015-94542 until 1967 days ago?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND intakeoutput.celllabel = 'enter...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide the number of patients whose diagnoses long title is alkalosis and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Alkalosis" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
SAN FRANCISCO to 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_name_20 ( altitude__mslm_ INTEGER, density__inhabitants_km_2__ VARCHAR, area__km_2__ VARCHAR, population VARCHAR )
Which Altitude (mslm) is the highest one that has an Area (km 2) smaller than 13.01, and a Population of 74536, and a Density (inhabitants/km 2) larger than 5869?
SELECT MAX(altitude__mslm_) FROM table_name_20 WHERE area__km_2__ < 13.01 AND population = 74536 AND density__inhabitants_km_2__ > 5869
sql_create_context
CREATE TABLE table_name_24 ( against VARCHAR, opposing_team VARCHAR )
What was the Against when the Opposing Team was sheffield wednesday?
SELECT against FROM table_name_24 WHERE opposing_team = "sheffield wednesday"
sql_create_context
CREATE TABLE table_65671 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
Which Driver has a Grid smaller than 17, and Points larger than 0, and a Lapse of 87, and a Time/Retired of 1:48:11.023?
SELECT "Driver" FROM table_65671 WHERE "Grid" < '17' AND "Points" > '0' AND "Laps" = '87' AND "Time/Retired" = '1:48:11.023'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, chartti...
give me the total doses of etoh grams/hour given to patient 27362.
SELECT SUM(inputevents_cv.amount) 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 = 27362)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_62067 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
How many losses for the team with less than 4 wins, more than 0 byes and 2510 against?
SELECT AVG("Losses") FROM table_62067 WHERE "Wins" < '4' AND "Against" = '2510' AND "Byes" > '0'
wikisql
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
Show the names of climbers and the heights of mountains they climb by a bar chart, show from low to high by the Y-axis please.
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height
nvbench
CREATE TABLE table_23214055_2 ( district VARCHAR, others VARCHAR )
Name the district for others being 18.3
SELECT district FROM table_23214055_2 WHERE others = "18.3"
sql_create_context
CREATE TABLE table_1313 ( "Team" text, "Titles" real, "Runner-up" real, "Third place" real, "Fourth place" real, "Years participated" real )
When the team is yale what is max amount of times they placed fourth?
SELECT MAX("Fourth place") FROM table_1313 WHERE "Team" = 'Yale'
wikisql
CREATE TABLE table_49992 ( "Position" real, "Pilot" text, "Country" text, "Glider" text, "Points" real )
What is the average position of pilot petr krejcirik, who has less than 11 points?
SELECT AVG("Position") FROM table_49992 WHERE "Points" < '11' AND "Pilot" = 'petr krejcirik'
wikisql
CREATE TABLE table_1151 ( "Year (Ceremony)" text, "English title" text, "Hungarian title" text, "Director" text, "Result" text )
Who is the director for the witman boys?
SELECT "Director" FROM table_1151 WHERE "English title" = 'The Witman Boys'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
患者谢婉慧在二000年七月二十六日到二0一三年十二月三十一日期间,最常找的医生是哪位
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '谢婉慧' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-07-26' AND '2013-12-31' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, ...
A bar chart for showing the number of the countries that have managers of age above 50 or below 46, could you order x-axis from low to high order?
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_14622 ( "Player" text, "Country" text, "Caps" real, "Goals" text, "Years Active" text )
What were the years active of the player from New Zealand with more than 11 caps?
SELECT "Years Active" FROM table_14622 WHERE "Caps" > '11' AND "Country" = 'new zealand'
wikisql
CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_e...
How many distinct students are enrolled in courses?
SELECT COUNT(DISTINCT student_id) FROM student_course_enrolment
spider
CREATE TABLE table_38686 ( "Type" text, "Actual Exponent" text, "Exp (biased)" text, "Exponent field" text, "Significand (fraction field)" text, "Value" text )
What's the exponent field that has 255 exp and value of + ?
SELECT "Exponent field" FROM table_38686 WHERE "Exp (biased)" = '255' AND "Value" = '+∞'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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_da...
may i see all the flights from CLEVELAND to DALLAS
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 = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Stack bar chart of team_id vs ACC_Home based on all home, and could you display Y in asc order please?
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID
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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
What is the most easy class I can take to fulfill the Other requirement .
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_49301 ( "Trident" text, "Gecko" text, "WebKit" text, "KHTML" text, "Presto" text, "Prince XML" text )
For the item with a Prince XML value of 'font', what is the WebKit value?
SELECT "WebKit" FROM table_49301 WHERE "Prince XML" = 'font'
wikisql
CREATE TABLE table_26540 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What series number had an original airdate of March 1, 1991?
SELECT MIN("No. in series") FROM table_26540 WHERE "Original air date" = 'March 1, 1991'
wikisql
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 were the three most commonly performed procedures for patients 30s since 2102?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) >= '2102' GROUP BY treatment....
eicu
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
on 09/08/last year, what was the last value of arterial bp [diastolic] for patient 15754?
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15754)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_train_178 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "hiv_infection" bool, "hepatitis_c" bool, "renal_disease" bool, "hypoglycemia" bool, "serum_creatinine" float, "seizure_disorder" bool, "body_mass_index_bmi" float, "NOUSE" float )
impaired renal function defined as serum creatinine > 1.5 .
SELECT * FROM table_train_178 WHERE renal_disease = 1 OR serum_creatinine > 1.5
criteria2sql
CREATE TABLE table_name_41 ( years_in_orlando VARCHAR, position VARCHAR, school_club_team VARCHAR )
Which Years in Orlando has a Position of center, and a School/Club Team of louisiana state?
SELECT years_in_orlando FROM table_name_41 WHERE position = "center" AND school_club_team = "louisiana state"
sql_create_context
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, ...
among pateints who had a hospital stay for more than 17 days, how many of them were discharged to snf?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.days_stay > "17"
mimicsql_data
CREATE TABLE table_48575 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real )
What is the average Bike No, when Driver / Passenger is Joris Hendrickx / Kaspars Liepins, and when Position is greater than 4?
SELECT AVG("Bike No") FROM table_48575 WHERE "Driver / Passenger" = 'joris hendrickx / kaspars liepins' AND "Position" > '4'
wikisql
CREATE TABLE table_name_11 ( finish VARCHAR, qual VARCHAR )
What is the number of finish of the Qual of 159.384?
SELECT finish FROM table_name_11 WHERE qual = "159.384"
sql_create_context
CREATE TABLE table_17288869_7 ( high_assists VARCHAR, high_rebounds VARCHAR )
Who had the high assists while Erick Dampier (8) had the high rebounds?
SELECT high_assists FROM table_17288869_7 WHERE high_rebounds = "Erick Dampier (8)"
sql_create_context
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 bdmzjzjlb ( CYBQDM text, CYBQ...
列出患者奚经略所有检验结果指标记录中的检测方法在2007-09-21到2008-12-08内有什么?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyj...
css
CREATE TABLE table_name_3 ( away_team VARCHAR )
What did the Melbourne team score in their away game?
SELECT away_team AS score FROM table_name_3 WHERE away_team = "melbourne"
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_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_nam...
Return the apartment number and the number of rooms for each apartment, list in descending by the y-axis.
SELECT apt_number, room_count FROM Apartments ORDER BY room_count DESC
nvbench
CREATE TABLE table_53809 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
What is the high capacity that has an average under 489 and a highest over 778?
SELECT MAX("Capacity") FROM table_53809 WHERE "Average" < '489' AND "Highest" > '778'
wikisql
CREATE TABLE table_204_665 ( id number, "rank" number, "name" text, "notability" text, "birthplace" text, "advocate" text )
who is pictured on top of the list ?
SELECT "name" FROM table_204_665 WHERE id = 1
squall
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
how many times has patient 20441 received a po intake since 1987 days ago?
SELECT COUNT(*) 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 = 20441)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'po intake' A...
mimic_iii
CREATE TABLE table_43193 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real )
How many losses have a draw greater than 0?
SELECT SUM("Lost") FROM table_43193 WHERE "Draw" > '0'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
Report the number of patients who were admitted via physician referral/normal delivery and had a pleural fluid lab test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_46 ( set_5 VARCHAR, date VARCHAR, set_2 VARCHAR )
What is Set 5, when Date is Jun 26, and when Set 2 is 25-22?
SELECT set_5 FROM table_name_46 WHERE date = "jun 26" AND set_2 = "25-22"
sql_create_context
CREATE TABLE table_203_244 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number )
who was the only rider with more points than doriano romboni ?
SELECT "rider" FROM table_203_244 WHERE "points" > (SELECT "points" FROM table_203_244 WHERE "rider" = 'doriano romboni')
squall
CREATE TABLE table_name_83 ( call_sign VARCHAR, frequency_mhz VARCHAR, erp_w VARCHAR )
Tell me the call sign which has a frequency Mhz more than 90.1 and ERP W of 1
SELECT call_sign FROM table_name_83 WHERE frequency_mhz > 90.1 AND erp_w = 1
sql_create_context
CREATE TABLE table_name_45 ( venue VARCHAR, attendance INTEGER )
What venue has more than 50,715 attending?
SELECT venue FROM table_name_45 WHERE attendance > 50 OFFSET 715
sql_create_context
CREATE TABLE table_22771048_2 ( transit_connections VARCHAR, station VARCHAR )
What are the transit connections from Pioneer Square U?
SELECT transit_connections FROM table_22771048_2 WHERE station = "Pioneer Square U"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
Questions I've Answered with other answers.
SELECT Id AS "post_link", CreationDate, AnswerCount, Tags FROM Posts AS P WHERE P.Id IN (SELECT ParentId AS Post FROM Posts AS P WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2) AND AnswerCount > 1 ORDER BY CreationDate DESC
sede
CREATE TABLE table_50360 ( "Team" text, "Head Coach" text, "Team Captain" text, "Kitmaker" text, "Shirt sponsor" text )
For the team whose shirt sponsor is Evonik, who is the kitmaker?
SELECT "Kitmaker" FROM table_50360 WHERE "Shirt sponsor" = 'evonik'
wikisql
CREATE TABLE table_name_20 ( game VARCHAR, home_team VARCHAR )
Which games had Philadelphia as home team?
SELECT game FROM table_name_20 WHERE home_team = "philadelphia"
sql_create_context
CREATE TABLE table_name_23 ( league_cup_goals INTEGER, total_goals VARCHAR, league_apps VARCHAR, fa_cup_apps VARCHAR, position VARCHAR )
What is the maximum league cup goals when there has been 0 FA cup appearances, and MF is the position, with 1 league appearance, and smaller than 0 total goals?
SELECT MAX(league_cup_goals) FROM table_name_23 WHERE fa_cup_apps = "0" AND position = "mf" AND league_apps = "1" AND total_goals < 0
sql_create_context
CREATE TABLE table_204_468 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what was richie hearn 's race position ?
SELECT "pos" FROM table_204_468 WHERE "driver" = 'richie hearn'
squall
CREATE TABLE table_55574 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What venue is the home field of Richmond?
SELECT "Venue" FROM table_55574 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
Show the smallest enrollment of each state, and I want to sort Y-axis in descending order please.
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC
nvbench
CREATE TABLE all_star ( player_id TEXT, year INTEGER, game_num INTEGER, game_id TEXT, team_id TEXT, league_id TEXT, gp NUMERIC, starting_pos NUMERIC ) CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, ...
For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons. Visualize by line chart.
SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
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...
陶梦秋病人做的下肢各项指标的检验情况咋样
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_1876262_10 ( safari VARCHAR, internet_explorer VARCHAR )
If Internet Explorer is 47.22%, what is the Safari total?
SELECT safari FROM table_1876262_10 WHERE internet_explorer = "47.22%"
sql_create_context
CREATE TABLE table_name_54 ( hdtv VARCHAR, content VARCHAR )
What is the HDTV when the content shows a timeshift +1 di disney junior?
SELECT hdtv FROM table_name_54 WHERE content = "timeshift +1 di disney junior"
sql_create_context
CREATE TABLE table_name_4 ( away_team VARCHAR, venue VARCHAR )
For the game played at Windy Hill, who was the away team?
SELECT away_team FROM table_name_4 WHERE venue = "windy hill"
sql_create_context
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, ...
how many patients went through a sputum, expectorated test in 2104?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%y', microlab.culturetakentime) = '2104')
eicu
CREATE TABLE table_57923 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" real )
What is the date with identifying number of No. 37817?
SELECT "Date" FROM table_57923 WHERE "Number & name" = 'no. 37817'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) )
What is the name of the school that has the smallest enrollment in each state?, I want to list x-axis in ascending order.
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName
nvbench