context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_7730 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
Which date's margin of victory was 3 and 2?
SELECT "Date" FROM table_7730 WHERE "Margin of victory" = '3 and 2'
wikisql
CREATE TABLE table_name_81 ( date VARCHAR, winning_drivers VARCHAR )
What date was the race won by Louis Chiron?
SELECT date FROM table_name_81 WHERE winning_drivers = "louis chiron"
sql_create_context
CREATE TABLE table_24359 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text )
When 255627 is the attendance what is the stadium?
SELECT "Stadium" FROM table_24359 WHERE "Attendance" = '255627'
wikisql
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
in this year, when did patient 95057 go to the hospital for the last time?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 95057 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, ...
What is the first and last name of the faculty participating in the most activities?
SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid GROUP BY T1.facid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_69294 ( "Island" text, "Group" text, "Area ( ha )" text, "Population" text, "Height (m)" real )
What group has a Population of see hoy?
SELECT "Group" FROM table_69294 WHERE "Population" = 'see hoy'
wikisql
CREATE TABLE table_2032 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
What was the team's status in the USISL Pro League playoffs?
SELECT "Playoffs" FROM table_2032 WHERE "League" = 'USISL Pro League'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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, depart...
how many FIRST class flights are provided by AA
SELECT COUNT(DISTINCT flight.flight_id) FROM fare, fare_basis, flight, flight_fare WHERE fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'AA' AND flight.flight_id = flight_fare.flight_id
atis
CREATE TABLE table_18143 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
What are the results in the county with Peter Deutsch as a candidate?
SELECT "Results" FROM table_18143 WHERE "Incumbent" = 'Peter Deutsch'
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...
统计患者的医疗记录年龄低于9岁的平均医疗费总额是多少?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE < 9 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE < 9 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE < 9 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON_AG...
css
CREATE TABLE table_15067 ( "Tournament" text, "2009" text, "2010" text, "2011" text, "2012" text )
what is the 2012 performance when in 2011 is qf and 2010 is 3r?
SELECT "2012" FROM table_15067 WHERE "2011" = 'qf' AND "2010" = '3r'
wikisql
CREATE TABLE table_name_47 ( position VARCHAR, overall VARCHAR, college VARCHAR )
What is the position of the player from the college of North Carolina with an overall less than 100?
SELECT position FROM table_name_47 WHERE overall < 100 AND college = "north carolina"
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...
在14年6月18日到14年12月24日间叫做彭哲茂的病患开出了氟哌噻吨美利曲辛片总共多少次?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '彭哲茂' AND t_kc22.STA_DATE BETWEEN '2014-06-18' AND '2014-12-24' AND t_kc22.SOC_SRT_DIRE_NM = '氟哌噻吨美利曲辛片'
css
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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( ...
how much is patient 10855's different heart rate last measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?
SELECT (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 = 10855) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE table_53041 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School" text )
What is the mean pick when the play is Marc Lewis (lhp) and the round is less than 20?
SELECT AVG("Pick") FROM table_53041 WHERE "Player" = 'marc lewis (lhp)' AND "Round" < '20'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX num...
赵婉仪这个病人现在的身高和体重分别是多少?
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX...
css
CREATE TABLE table_name_70 ( avg INTEGER, long VARCHAR )
What is the sum of averages with a long value of 32?
SELECT SUM(avg) FROM table_name_70 WHERE long = 32
sql_create_context
CREATE TABLE table_64387 ( "Rank" real, "Heat" real, "Athlete" text, "Country" text, "Time" real )
who is the athlete when the rank is less than 13, time more than 11.13, country is bahamas and the heat more than 2?
SELECT "Athlete" FROM table_64387 WHERE "Rank" < '13' AND "Time" > '11.13' AND "Country" = 'bahamas' AND "Heat" > '2'
wikisql
CREATE TABLE table_name_60 ( drawn VARCHAR, tries_against VARCHAR, points VARCHAR )
Name the Drawn for tries against of 36 and points of 66
SELECT drawn FROM table_name_60 WHERE tries_against = "36" AND points = "66"
sql_create_context
CREATE TABLE table_37908 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text )
When did kim woodburn enter?
SELECT "Entered" FROM table_37908 WHERE "Celebrity" = 'kim woodburn'
wikisql
CREATE TABLE table_49298 ( "Trident" text, "Gecko" text, "WebKit" text, "KHTML" text, "Presto" text, "Prince XML" text )
What is the Gecko value for the item that has a Trident value of 'font'?
SELECT "Gecko" FROM table_49298 WHERE "Trident" = 'font'
wikisql
CREATE TABLE table_name_95 ( nominated_for VARCHAR, category VARCHAR, year VARCHAR, award VARCHAR )
Name what was nominated in years before 2002 for most popular comedy performer at the national television awards
SELECT nominated_for FROM table_name_95 WHERE year < 2002 AND award = "national television awards" AND category = "most popular comedy performer"
sql_create_context
CREATE TABLE table_20592 ( "Season #" real, "Series #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Original airdate" text )
What is the season number of the episode directed by Donald Crombie and the series number is 40?
SELECT "Season #" FROM table_20592 WHERE "Director(s)" = 'Donald Crombie' AND "Series #" = '40'
wikisql
CREATE TABLE phone ( chip_model VARCHAR, screen_mode VARCHAR, Hardware_Model_name VARCHAR )
What are the chip model and screen mode of the phone with hardware model name 'LG-P760'?
SELECT chip_model, screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760"
sql_create_context
CREATE TABLE table_name_45 ( canadian_championship VARCHAR, name VARCHAR )
What Canadian Championship has Ashtone Morgan Category:Articles with hcards as the name?
SELECT canadian_championship FROM table_name_45 WHERE name = "ashtone morgan category:articles with hcards"
sql_create_context
CREATE TABLE people ( people_id number, name text, height number, weight number, home town text ) CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number )
What are the names of perpetrators?
SELECT T1.name FROM people AS T1 JOIN perpetrator AS T2 ON T1.people_id = T2.people_id
spider
CREATE TABLE table_23183195_5 ( three_pointers INTEGER, player VARCHAR )
Name the most three pointers for dewanna bonner
SELECT MAX(three_pointers) FROM table_23183195_5 WHERE player = "DeWanna Bonner"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
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, a bar chart shows the distribution of job_id and the average of manager_id , and group by attribute job_id, and rank in asc by the X-axis please.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_52 ( first_elected VARCHAR, results VARCHAR, party VARCHAR )
In what year did the Democratic incumbent that was re-elected first take office?
SELECT first_elected FROM table_name_52 WHERE results = "re-elected" AND party = "democratic"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what is the number of patients until 3 years ago that glucose is prescribed to?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'glucose' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
calculate how many times patient 003-54468 received a laboratory test for tv in 06/this year.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54468')) AND lab.labname = 'tv' AND DATETIME(lab.labresulttime, 'start of year') = DATET...
eicu
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
list DAILY flights from OAKLAND to BOSTON using DL
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST...
atis
CREATE TABLE table_13640 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text )
What is the stage of winner Carlos Sastre when the general classification was Denis Menchov?
SELECT "Stage" FROM table_13640 WHERE "General classification" = 'denis menchov' AND "Winner" = 'carlos sastre'
wikisql
CREATE TABLE table_31294 ( "Eliminated" real, "Wrestler" text, "Entered" real, "Eliminated by" text, "Method of elimination" text, "Time" text )
Who was eliminated by being pinned after a spear at 22:50?
SELECT "Wrestler" FROM table_31294 WHERE "Method of elimination" = 'Pinned after a spear' AND "Time" = '22:50'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
provide the number of patients whose procedure icd9 code is 4523 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4523" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_33872 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the highest attendance for week 1?
SELECT MAX("Attendance") FROM table_33872 WHERE "Week" < '1'
wikisql
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
A pie chart about how many regions were affected by each storm?
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
nvbench
CREATE TABLE table_80106 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" text, "Description of product" text, "Investing Dragon(s)" text )
When did episode 6 first air with entrepreneur Guy Portelli?
SELECT "First aired" FROM table_80106 WHERE "Episode" = 'episode 6' AND "Entrepreneur(s)" = 'guy portelli'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
when patient 010-15363 was first diagnosed with intracranial injury - with intracerebral hemorrhage?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-15363')) AND diagnosis.diagnosisname = 'intracranial injury -...
eicu
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
科室903的住院量在11年5月15日到19年1月20日期间是多少?
SELECT COUNT(*) FROM zyjzjlb WHERE JZKSDM = '903' AND RYDJSJ BETWEEN '2011-05-15' AND '2019-01-20'
css
CREATE TABLE table_name_89 ( ship VARCHAR, hull_no VARCHAR )
Name the ship with hull number of aor-6
SELECT ship FROM table_name_89 WHERE hull_no = "aor-6"
sql_create_context
CREATE TABLE table_name_1 ( constructor VARCHAR, fastest_lap VARCHAR )
What is the constructor for the race with Nigel Mansell as the fastest lap?
SELECT constructor FROM table_name_1 WHERE fastest_lap = "nigel mansell"
sql_create_context
CREATE TABLE table_28932 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
What was the result for Pennsylvania 8?
SELECT "Result" FROM table_28932 WHERE "District" = 'Pennsylvania 8'
wikisql
CREATE TABLE table_name_32 ( date VARCHAR, venue VARCHAR )
What is Date, when Venue is 'Weserstadion , Bremen'?
SELECT date FROM table_name_32 WHERE venue = "weserstadion , bremen"
sql_create_context
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...
Visualize a bar chart for what are the total enrollments of universities of each affiliation type?, sort y axis in ascending order.
SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment)
nvbench
CREATE TABLE table_name_56 ( loss VARCHAR, total_games VARCHAR, draw VARCHAR )
What is the total number of losses for less than 48 games, and less than 7 draws?
SELECT COUNT(loss) FROM table_name_56 WHERE total_games < 48 AND draw < 7
sql_create_context
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( Fac...
Show all the buildings along with the number of faculty members the buildings have Plot them as bar chart, show in descending by the total number.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
列出在医院0621051中患者04455332门诊诊断名称包含形式的门诊有什么就诊记录?
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '04455332' AND hz_info.YLJGDM = '0621051' AND mzjzjlb.JZZDSM LIKE '%形式%'
css
CREATE TABLE table_203_356 ( id number, "type" text, "diagonal (mm)" text, "width (mm)" text, "height (mm)" text, "area (mm2)" text, "stops (area)" number, "crop factor" text )
what is the first sensor size in the table ?
SELECT "type" FROM table_203_356 WHERE id = 1
squall
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,...
参与了04488736077这次医疗就诊的人有哪些?他们叫什么名字?性别、年龄、公民身份号码分别是什么
SELECT PERSON_NM, PERSON_SEX, PERSON_AGE, IDENTITY_CARD FROM t_kc21 WHERE MED_CLINIC_ID = '96681951393'
css
CREATE TABLE table_48207 ( "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text )
What is the score of the game with Falkirk as the runner-up?
SELECT "Score" FROM table_48207 WHERE "Runner-up" = 'falkirk'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
count the number of patients that have been diagnosed with acute coronary syndrome - acute myocardial infarction (with st elevation) and didn't come back to the hospital within the same month since 5 years ago.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome - acute myocardial infarction (with st elevation)' AND DATETIME(diagnosis.di...
eicu
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
A bar chart for listing the number of grapes, whose score is higher than 93 ordered by Name.
SELECT Grape, COUNT(Grape) FROM wine WHERE Score > 93 GROUP BY Grape ORDER BY Name
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 number of patients whose age is less than 71 and lab test name is epithelial cells?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.label = "Epithelial Cells"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
on 03/08/2100, had patient 002-52932 excreted any voided amount?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE table_name_36 ( bodyweight INTEGER, snatch VARCHAR, clean_ VARCHAR, _jerk VARCHAR )
What is the least Bodyweight for the Clean & jerk of 145.0, and a Snatch smaller than 122.5?
SELECT MIN(bodyweight) FROM table_name_36 WHERE clean_ & _jerk = "145.0" AND snatch < 122.5
sql_create_context
CREATE TABLE table_name_65 ( career_win_loss VARCHAR, tournament VARCHAR )
What is the win-loss when 2008 has a value of Q1 at Australian Open?
SELECT career_win_loss FROM table_name_65 WHERE 2008 = "q1" AND tournament = "australian open"
sql_create_context
CREATE TABLE table_25242 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
Can you tell me the manufacturer behind Race Hill Farm Team?
SELECT "Manufacturer" FROM table_25242 WHERE "Team" = 'Race Hill Farm Team'
wikisql
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...
在编码是2082704的医院中列出患者54865219入院科室名称不包含精神科的住院就诊记录共是哪些?
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '54865219' AND hz_info.YLJGDM = '2082704' AND NOT wdmzjzjlb.JZKSMC LIKE '%精神科%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
i mean what was patient 031-23724's first mch value in 08/last year?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of year') =...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
mention the number of patients below 68 years of age have procedure icd9 code 4573.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "68" AND procedures.icd9_code = "4573"
mimicsql_data
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
indicate the monthly maximum amount of .45ns + .5:1 heparin patient 3369 has received until 02/20/2103.
SELECT MAX(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 = 3369)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE table_name_26 ( notes VARCHAR, country VARCHAR )
What is the notes for the rowers from denmark?
SELECT notes FROM table_name_26 WHERE country = "denmark"
sql_create_context
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
what was the highest four diagnosis, which had the highest four year mortality rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
Bar chart x axis name y axis the number of name, sort by the Y-axis in asc.
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_42329 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What tournament had a Winning score of 9 (69-72-68-70=279)?
SELECT "Tournament" FROM table_42329 WHERE "Winning score" = '–9 (69-72-68-70=279)'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
What classes will have Prof. Oleg Tsodikov instructing over the next year ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Oleg Tsodikov%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off...
advising
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress ...
Find NAAs older than a given date using Natty Blacklist. Title
SELECT P.Id AS "post_link", P.Score FROM Posts AS P WHERE (P.PostTypeId = 2 AND P.Score <= 0 AND LENGTH(P.Body) < 350 AND P.CreationDate < '##date##' AND (LOWER(P.Body) LIKE '%sorry for posting this as an answer%' OR LOWER(P.Body) LIKE '%don''t have enough reputation to post a comment%' OR LOWER(P.Body) LIKE '%how did ...
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
tell me the number of female patients for whom o2 flow lab test order was placed.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "O2 Flow"
mimicsql_data
CREATE TABLE table_2562572_30 ( largest_ethnic_group__2002_ VARCHAR, cyrillic_name_other_names VARCHAR )
What is the largest ethnic group of the settlement with the cyrillic name of ?
SELECT largest_ethnic_group__2002_ FROM table_2562572_30 WHERE cyrillic_name_other_names = "Банатско Аранђелово"
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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 tim...
患者朱湛英曾经去过什么地方看病?
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '朱湛英' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzj...
css
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text...
awt', 'swing', 'javafx', 'wpf', 'qt', 'swt', 'jsf', 'gwt', 'vaadin', 'wicket'.
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('awt', 'swing', 'javafx', 'wpf', 'qt', 'swt', 'jsf', 'gwt', 'vaadin', 'wicket') GROUP BY DATEADD(month, DATEDIFF(month, 0, Creati...
sede
CREATE TABLE table_name_39 ( original_channel VARCHAR, b_mountain_channel VARCHAR )
What original channel is associated with B Mountain Channel 9?
SELECT original_channel FROM table_name_39 WHERE b_mountain_channel = "9"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Comments with the same text.
SELECT SUBSTRING(c.Text, STR_POSITION(c.Text, '@'), LENGTH(c.Text)) AS "text" FROM Comments AS c GROUP BY 'text'
sede
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
Do I need to take EMBA 640 to take EMBA 604 ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'EMBA' AND COURSE_0.number = 640 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'EMBA' AND COURSE_1.number = 604
advising
CREATE TABLE table_name_86 ( song VARCHAR, release_info VARCHAR )
Which song released on heavenly (hvn152)?
SELECT song FROM table_name_86 WHERE release_info = "heavenly (hvn152)"
sql_create_context
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
Find the city and state of the bank branch named morningside.
SELECT city, state FROM bank WHERE bname = 'morningside'
spider
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, a...
What are the names of gymnasts, ordered by their heights ascending?
SELECT T2.name FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T2.height
spider
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...
找一下患者52953159在医院3607978从一五年的八月十二到国庆这段时间里开的所有的药和药品编码
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '52953159' AND t_kc21.MED_SER_ORG_NO = '3607978' AND t_kc21.IN_HOSP_DATE BETWEEN '2015-08-12' AND '2015-10-01')
css
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在医院7830669中,根据出院诊断疾病编码列出不同疾病的患者平均年龄是多少岁
SELECT OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '7830669' GROUP BY OUT_DIAG_DIS_CD
css
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, ...
What is the number of players who have points less than 30 for each position.
SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position
nvbench
CREATE TABLE table_79136 ( "Date" text, "Result" text, "Score" text, "Opponent" text, "Record" text, "Attendance" text )
What score has October 31 as the date?
SELECT "Score" FROM table_79136 WHERE "Date" = 'october 31'
wikisql
CREATE TABLE table_name_99 ( points INTEGER, year INTEGER )
How many points total are there later than 2003?
SELECT SUM(points) FROM table_name_99 WHERE year > 2003
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
看看编号78816326020的检验结果指标记录,记录的是什么结果定性和结果定量以及定量单位
SELECT JCZBJGDX, JCZBJGDL, JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '78816326020'
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, ...
Total Posts by Database Server Per Month.
SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'SQLServer' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'sql-server%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) OR...
sede
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...
mention the drug name of the drug code digo25?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "DIGO25"
mimicsql_data
CREATE TABLE table_name_25 ( round INTEGER, college VARCHAR, pick VARCHAR )
What is the lowest Round, when College is 'Washington State', and when Pick is less than 48?
SELECT MIN(round) FROM table_name_25 WHERE college = "washington state" AND pick < 48
sql_create_context
CREATE TABLE table_20048 ( "2000 :" text, "January" text, "February" text, "March" text, "April" text, "May" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text )
Name the julys
SELECT "July" FROM table_20048
wikisql
CREATE TABLE table_47155 ( "Title" text, "Writer" text, "Format" text, "Company" text, "release date" text )
Who was the writer of The Year of the Cat from the BBV?
SELECT "Writer" FROM table_47155 WHERE "Company" = 'bbv' AND "Title" = 'the year of the cat'
wikisql
CREATE TABLE table_name_19 ( class VARCHAR, facility_id VARCHAR, call_sign VARCHAR )
Which Class has a Facility ID greater than 85076 and a Call Sign of K289au?
SELECT class FROM table_name_19 WHERE facility_id > 85076 AND call_sign = "k289au"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
when has patient 006-232560 been given bicarbonate test for the last time since 08/2104?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-232560')) AND lab.labname = 'bicarbonate' AND STRFTIME('%y-%m', lab.labresultti...
eicu
CREATE TABLE table_name_95 ( notes VARCHAR, tournament VARCHAR, year VARCHAR )
What is the notes for the hypo-meeting tournament in 2012?
SELECT notes FROM table_name_95 WHERE tournament = "hypo-meeting" AND year = 2012
sql_create_context
CREATE TABLE table_65165 ( "Album#" text, "English Title" text, "Chinese (Traditional)" text, "Chinese (Simplified)" text, "Release date" text, "Label" text )
What would be the traditional Chinese name tat is simplified as ?
SELECT "Chinese (Traditional)" FROM table_65165 WHERE "Chinese (Simplified)" = '崇拜'
wikisql
CREATE TABLE table_39352 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" text )
How many fans attended the game at Bye?
SELECT "Attendance" FROM table_39352 WHERE "Game Site" = 'bye'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
oh what is the minimum value of tv on patient 021-95970 in 12/2105?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970')) AND lab.labname = 'tv' AND STRFTIME('%y-%m', lab.labresulttime) = '21...
eicu
CREATE TABLE table_35526 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real )
Which Date has a Result of l 14 13?
SELECT "Date" FROM table_35526 WHERE "Result" = 'l 14–13'
wikisql
CREATE TABLE table_1342249_32 ( result VARCHAR, district VARCHAR )
Name the result for new york 1
SELECT result FROM table_1342249_32 WHERE district = "New York 1"
sql_create_context
CREATE TABLE table_61565 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "2012 club" text )
Name the Weight of d m steinmetz category:articles with hcards?
SELECT "Weight" FROM table_61565 WHERE "Name" = 'ádám steinmetz category:articles with hcards'
wikisql
CREATE TABLE table_name_82 ( tries INTEGER, team VARCHAR, games VARCHAR )
What is the average number of tries for British and Irish Lions with less than 2 games?
SELECT AVG(tries) FROM table_name_82 WHERE team = "british and irish lions" AND games < 2
sql_create_context
CREATE TABLE table_11787 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what date was essendon the away team?
SELECT "Date" FROM table_11787 WHERE "Away team" = 'essendon'
wikisql