context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_77892 ( "Name" text, "City" text, "Stadium" text, "First season in first division" text, "First season after most recent promotion" text )
Which city is Alianza?
SELECT "City" FROM table_77892 WHERE "Name" = 'alianza'
wikisql
CREATE TABLE table_35635 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What date had an opponent of Sweden and a friendly type game?
SELECT "Date" FROM table_35635 WHERE "Type of game" = 'friendly' AND "Opponent" = 'sweden'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
when is the last time that patient 42396 has received a venous cath nec until 4 years ago?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42396) AND DATETIME...
mimic_iii
CREATE TABLE table_24271 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
David Kasouf plays for how many colleges?
SELECT COUNT("College") FROM table_24271 WHERE "Player" = 'David Kasouf'
wikisql
CREATE TABLE table_name_71 ( points VARCHAR, club VARCHAR )
What are the points for the Seven Sisters RFC club?
SELECT points FROM table_name_71 WHERE club = "seven sisters rfc"
sql_create_context
CREATE TABLE table_4846 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team was Geelong, what was the home team score?
SELECT "Home team score" FROM table_4846 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE table_222771_1 ( alpha_2_code VARCHAR, alpha_3_code VARCHAR )
What is the Alpha 2 code for the area also known as TCA?
SELECT alpha_2_code FROM table_222771_1 WHERE alpha_3_code = "TCA"
sql_create_context
CREATE TABLE table_28463 ( "Year" real, "FBS Opponent" text, "Result" text, "Opponents Conference" text, "Opponents Head Coach" text, "Charleston Southerns Head Coach" text )
Which opponents conference has the result L, 62-10?
SELECT "Opponents Conference" FROM table_28463 WHERE "Result" = 'L, 62-10'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
count the number of patients whose admission year is less than 2157 and procedure long title is endoscopic sphincterotomy and papillotomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2157" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy"
mimicsql_data
CREATE TABLE table_79206 ( "Country" text, "Event" text, "Time" text, "Date" text, "Place" text )
What is the Event labeled Country of (local competition)?
SELECT "Event" FROM table_79206 WHERE "Country" = '(local competition)'
wikisql
CREATE TABLE table_name_25 ( method VARCHAR, round VARCHAR, location VARCHAR )
What method was there in round 1 when the location was Aruba?
SELECT method FROM table_name_25 WHERE round = "1" AND location = "aruba"
sql_create_context
CREATE TABLE table_29273390_1 ( no_in_season INTEGER )
What is the least amount in each season?
SELECT MIN(no_in_season) FROM table_29273390_1
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of salary bin hire_date by time, and visualize them by a bar chart.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
what number of patients with government insurance had lab test named po2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "pO2"
mimicsql_data
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_jybgb ( YLJGDM_ZYJZJLB te...
在2015年11月6日到2021年10月2日内列出患者编号02589232所有检验结果指标记录的检验人为昌飞烟的检验指标流水序列号有多少?
SELECT jyjgzbb.JYZBLSH 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.BGDH WHERE hz...
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
查一下病患葛映波的医疗记录,分别列出医疗费总额高于6981.35元的入院诊断疾病名和编码
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '葛映波' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6981.35)
css
CREATE TABLE table_train_33 ( "id" int, "active_infection" bool, "allergy_to_thiamine" bool, "receiving_vasopressor" bool, "liver_disease" bool, "allergy_to_vitamin_c" bool, "allergy_to_hydrocortisone" bool, "hypertension" bool, "age" float, "serum_aminotransferase_level_alt_ast"...
suspected infection
SELECT * FROM table_train_33 WHERE active_infection = 1
criteria2sql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what was patient 025-30850's last intake since 02/17/2104.
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850')) AND intakeoutput.cellpath LIKE '%intake%' AND S...
eicu
CREATE TABLE table_30384 ( "Team" text, "P" real, "W" real, "D" real, "L" real, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text, "Pts" real )
Name the tries for when L is less than 2.0
SELECT "Tries for" FROM table_30384 WHERE "L" < '2.0'
wikisql
CREATE TABLE table_72496 ( "City" text, "Station" text, "Year acquired" real, "Primary programming source" text, "Other programming sources" text, "Current status" text )
which station is located in edmonton
SELECT "Station" FROM table_72496 WHERE "City" = 'Edmonton'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
what is the total output (ml)-urethral catheter chasity yates, rnfa latex;temperature probe 16 fr. output of patient 030-31704 until 802 days ago?
SELECT SUM(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 = '030-31704')) AND intakeoutput.celllabel = 'outpu...
eicu
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,...
在医院9379599患者潘弘义的出院诊断疾病名字包含心脏病的是哪些编号的医疗就诊记录?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '潘弘义' AND MED_SER_ORG_NO = '9379599' AND OUT_DIAG_DIS_NM LIKE '%心脏病%'
css
CREATE TABLE table_name_71 ( elimination VARCHAR, wrestler VARCHAR )
What's Jorge Santana's elimination?
SELECT elimination FROM table_name_71 WHERE wrestler = "jorge santana"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
Show how many delegates in each party with a bar chart, and show by the Party in ascending please.
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party
nvbench
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...
自2002-09-25到2006-02-25,编号9853882的医疗机构的医疗费总额是多少
SELECT SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9853882' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-09-25' AND '2006-02-25' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE f...
css
CREATE TABLE table_15040 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What was the latest year that a Bardahl entrant had a Kurtis Kraft 500c chassis with no more than 0 points?
SELECT MAX("Year") FROM table_15040 WHERE "Chassis" = 'kurtis kraft 500c' AND "Entrant" = 'bardahl' AND "Points" < '0'
wikisql
CREATE TABLE table_12720275_1 ( rank__csa_ VARCHAR, percent_change__1990_2000_ VARCHAR )
What is the rank (csa) for the percentage change (1990-2000) was a034 +8.71%?
SELECT rank__csa_ FROM table_12720275_1 WHERE percent_change__1990_2000_ = "A034 +8.71%"
sql_create_context
CREATE TABLE table_44015 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Which Round has a Position of lw, and a College/Junior/Club Team (League) of swift current broncos (wchl)?
SELECT AVG("Round") FROM table_44015 WHERE "Position" = 'lw' AND "College/Junior/Club Team (League)" = 'swift current broncos (wchl)'
wikisql
CREATE TABLE table_18340 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who are the candidates where the district is florida 8?
SELECT "Candidates" FROM table_18340 WHERE "District" = 'Florida 8'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the name , and group by attribute name by a bar chart, show x axis in asc order please.
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
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...
Top score in answer between two dates.
SELECT RANK() OVER (ORDER BY SUM(Score) DESC) AS "rank", OwnerUserId AS "user_link", SUM(Score) AS "total_score", COUNT(Id) AS "count" FROM Posts WHERE (CreationDate >= '##Date1?2020-01-01##') AND (CreationDate <= '##Date2?2021-01-01##') AND (PostTypeId = 2) GROUP BY OwnerUserId ORDER BY SUM(Score) DESC LIMIT 500
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
门诊诊断给患者29164002的诊断为前列腺增生,他000470这个检测指标的结果定量及其单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
Which courses need to be taken before taking PUBPOL 490 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE gyb ( 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...
按照不同的出院诊断疾病编码和科室编码,列出患者的平均年龄在医院9480840中所有医疗就诊记录里是多大岁数?
SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9480840' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9480840' GROUP BY gyb.MED_ORG_DEPT_CD, gyb....
css
CREATE TABLE table_14672 ( "Type" text, "Fleet numbers" text, "Quantity made" text, "Date made" text, "GSR Class" text, "Inchicore Class" text, "GSR Nos." text, "Withdrawn" text )
What was the GSR number on the date 1883?
SELECT "GSR Nos." FROM table_14672 WHERE "Date made" = '1883'
wikisql
CREATE TABLE table_name_78 ( try_bonus VARCHAR, lost VARCHAR )
What i the try bonus with 12 losses?
SELECT try_bonus FROM table_name_78 WHERE lost = "12"
sql_create_context
CREATE TABLE table_train_83 ( "id" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "iq" int, "geriatric_depression_scale_gds" int, "NOUSE" float )
iq below 85
SELECT * FROM table_train_83 WHERE iq < 85
criteria2sql
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Guests ( guest_id INTEGER, ...
How many apartment bookings for each year? Draw a bar chart binning booking start date by year interval, I want to order in desc by the Y-axis.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime tim...
what was first lab test time a month before for patient 5142?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY labevents.charttime LIMIT 1
mimic_iii
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
what are the four most frequently prescribed drugs for patients in the same hospital encounter after having received a entral infus nutrit sub procedure in the last year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_76236 ( "Season" text, "Appearance" real, "Tries" real, "Goals" real, "Points" real )
what is the average tries for the season 2008 warrington wolves with an appearance more than 7?
SELECT AVG("Tries") FROM table_76236 WHERE "Season" = '2008 warrington wolves' AND "Appearance" > '7'
wikisql
CREATE TABLE table_76684 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text )
What was the record for the game before game 6 against the chicago black hawks?
SELECT "Record" FROM table_76684 WHERE "Game" < '6' AND "Opponent" = 'chicago black hawks'
wikisql
CREATE TABLE table_9687 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the result for November 25, 2001?
SELECT "Result" FROM table_9687 WHERE "Date" = 'november 25, 2001'
wikisql
CREATE TABLE table_name_19 ( guest_host VARCHAR, episode_number VARCHAR )
What kind of Guest Host has a Episode Number of 7?
SELECT guest_host FROM table_name_19 WHERE episode_number = 7
sql_create_context
CREATE TABLE table_33896 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the Competition on September 29, 2003?
SELECT "Competition" FROM table_33896 WHERE "Date" = 'september 29, 2003'
wikisql
CREATE TABLE table_name_34 ( score VARCHAR, country VARCHAR, player VARCHAR )
What is Score, when Country is 'United States', and when Player is 'Mark Brooks'?
SELECT score FROM table_name_34 WHERE country = "united states" AND player = "mark brooks"
sql_create_context
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 number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
列出03034293病患的出院科室名称不包含神经内科在医院9851419中的住院就诊记录都是哪几条?
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 = '03034293' AND hz_info.YLJGDM = '9851419' AND NOT wdmzjzjlb.CYKSMC LIKE '%神经内科%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AN...
css
CREATE TABLE table_14465924_1 ( name_of_administrative_unit VARCHAR, population__people_ VARCHAR )
Name the name of administrative unit for 3464 people
SELECT name_of_administrative_unit FROM table_14465924_1 WHERE population__people_ = 3464
sql_create_context
CREATE TABLE table_57870 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What Away team scored 14.17 (101) and had a crowd attendance larger than 14,000?
SELECT "Away team" FROM table_57870 WHERE "Crowd" > '14,000' AND "Home team score" = '14.17 (101)'
wikisql
CREATE TABLE table_49174 ( "Year" text, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text )
What time contains the owner of maine chance farm?
SELECT "Time" FROM table_49174 WHERE "Owner" = 'maine chance farm'
wikisql
CREATE TABLE table_61667 ( "Pick #" real, "Player" text, "Nationality" text, "Position" text, "Team from" text, "League from" text )
What pick number was player Greg McKegg?
SELECT AVG("Pick #") FROM table_61667 WHERE "Player" = 'greg mckegg'
wikisql
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 varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
Bar chart of department_id from each first name, order by the x-axis in descending.
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
list all flights please from WASHINGTON to SAN FRANCISCO
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 = 'SAN...
atis
CREATE TABLE table_25773116_2 ( location VARCHAR, winning_team VARCHAR )
Where did Audette Racing win?
SELECT location FROM table_25773116_2 WHERE winning_team = "Audette Racing"
sql_create_context
CREATE TABLE table_67231 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Name the partner for opponents of alexandra dulgheru magdal na ryb rikov
SELECT "Partner" FROM table_67231 WHERE "Opponents" = 'alexandra dulgheru magdaléna rybáriková'
wikisql
CREATE TABLE table_35173 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
What team was Andrew Ranger in?
SELECT "Team" FROM table_35173 WHERE "Name" = 'andrew ranger'
wikisql
CREATE TABLE table_name_75 ( age_group VARCHAR, event VARCHAR, time VARCHAR )
What age group has a time of 6:37.73 at the 200m breaststroke?
SELECT age_group FROM table_name_75 WHERE event = "200m breaststroke" AND time = "6:37.73"
sql_create_context
CREATE TABLE table_name_19 ( played INTEGER, points VARCHAR, against VARCHAR, team VARCHAR )
How many games played for team bangu with under 15 against, and over 9 points?
SELECT MAX(played) FROM table_name_19 WHERE against < 15 AND team = "bangu" AND points > 9
sql_create_context
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 maximum age of patients whose days of hospital stay is 13 and admission year is greater than or equal to 2115?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "13" AND demographic.admityear >= "2115"
mimicsql_data
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...
specify the ethnic origin and age of patient jerry deberry
SELECT demographic.age, demographic.ethnicity FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_name_85 ( result VARCHAR, opponent_number VARCHAR )
What was the result when the opponent was at 2 usc?
SELECT result FROM table_name_85 WHERE opponent_number = "at 2 usc"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, 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,...
病人任阳焱在门诊诊断为2型糖尿病的检测指标983934的结果定量和单位是多少啊?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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...
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, ...
患者朱湛英曾经去过什么地方看病?
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 zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_i...
css
CREATE TABLE table_name_34 ( opponents VARCHAR, nuggets_points VARCHAR, result VARCHAR, game VARCHAR )
How many Opponents have a Result of loss, and a Game smaller than 49, and Nuggets points of 108?
SELECT COUNT(opponents) FROM table_name_34 WHERE result = "loss" AND game < 49 AND nuggets_points = 108
sql_create_context
CREATE TABLE table_203_129 ( id number, "finalist" text, "age" number, "from" text, "dress colour" text, "status" text )
simona armstrong is how much older than leanne dobinson ?
SELECT (SELECT "age" FROM table_203_129 WHERE "finalist" = 'simona armstrong') - (SELECT "age" FROM table_203_129 WHERE "finalist" = 'leanne dobinson')
squall
CREATE TABLE table_55983 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
What is the License when the Platform is windows and the Name is Altirra?
SELECT "License" FROM table_55983 WHERE "Platform" = 'windows' AND "Name" = 'altirra'
wikisql
CREATE TABLE table_train_265 ( "id" int, "systolic_blood_pressure_sbp" int, "fasting_blood_glucose_fbg" float, "diastolic_blood_pressure_dbp" int, "hba1c" float, "body_mass_index_bmi" float, "NOUSE" float )
resting blood pressure _ systolic blood pressure greater than 159 mmhg or diastolic blood pressure greater than 99 mmhg
SELECT * FROM table_train_265 WHERE systolic_blood_pressure_sbp > 159 OR diastolic_blood_pressure_dbp > 99
criteria2sql
CREATE TABLE table_70897 ( "Year" text, "Category" text, "Genre" text, "Recording" text, "Result" text )
Name the category for 2013
SELECT "Category" FROM table_70897 WHERE "Year" = '2013'
wikisql
CREATE TABLE table_name_57 ( team_1 VARCHAR )
What was the 2nd leg when Team 1 was Chicago Croatian?
SELECT 2 AS nd_leg FROM table_name_57 WHERE team_1 = "chicago croatian"
sql_create_context
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 patient ( uniquep...
tell me the name of the output patient 010-32698 had last on the last icu visit?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698') AND NOT patient.unitdischargetime IS NULL ORDER ...
eicu
CREATE TABLE table_1341865_44 ( party VARCHAR, district VARCHAR )
what's party with district being tennessee 3
SELECT party FROM table_1341865_44 WHERE district = "Tennessee 3"
sql_create_context
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...
Top Android Users in Barcelona.
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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CRE...
Questions posted together with an answer. Find all questions that were posted together with an answer by the same user
SELECT q.Score AS Score, u.Id AS "user_link", q.Id AS "post_link" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id AND a.OwnerUserId = q.OwnerUserId INNER JOIN Users AS u ON u.Id = q.OwnerUserId ORDER BY Score DESC
sede
CREATE TABLE table_60998 ( "Semi-closed initial unstressed vowels" text, "17th c." text, "American" text, "Australian" text, "Examples" text )
For the 17th century entry of , what is Semi-closed initial unstressed vowels?
SELECT "Semi-closed initial unstressed vowels" FROM table_60998 WHERE "17th c." = 'ɐ'
wikisql
CREATE TABLE table_23375 ( "Year" text, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
When divisional finals are the playoffs what is the regular season?
SELECT "Regular Season" FROM table_23375 WHERE "Playoffs" = 'Divisional Finals'
wikisql
CREATE TABLE table_16279520_1 ( series VARCHAR, release VARCHAR )
Under what series was the 3.5 release?
SELECT series FROM table_16279520_1 WHERE release = "3.5"
sql_create_context
CREATE TABLE table_name_9 ( mintage INTEGER, year VARCHAR, artist VARCHAR, issue_price VARCHAR )
What is the lowest Mintage for the Artist Royal Canadian Mint Engravers, in the Year 2009, with an Issue Price of $10,199.95?
SELECT MIN(mintage) FROM table_name_9 WHERE artist = "royal canadian mint engravers" AND issue_price = "$10,199.95" AND year > 2009
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 te...
在2007年12月12日到2020年1月21日内患者34563100就诊过多少个医生?
SELECT COUNT(mzjzjlb.ZZYSGH) 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 = '34563100' AND mzjzjlb.JZKSRQ BETWEEN '2007-12-12' AND '2020-01-21'
css
CREATE TABLE table_31615 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text )
What is the pick # for Dimelon Westfield?
SELECT MIN("Pick #") FROM table_31615 WHERE "Player" = 'dimelon westfield'
wikisql
CREATE TABLE table_name_32 ( away_team VARCHAR )
What was the away team score, when the away team was Fitzroy?
SELECT away_team AS score FROM table_name_32 WHERE away_team = "fitzroy"
sql_create_context
CREATE TABLE table_39576 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the average number of top-5s for the major with 5 top-10s and fewer than 12 cuts made?
SELECT AVG("Top-5") FROM table_39576 WHERE "Top-10" = '5' AND "Cuts made" < '12'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGR...
门诊就诊41844036771的医生是谁?把首诊医生以及其他所有接诊医生的工号列出来
SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '41844036771'
css
CREATE TABLE table_15190346_2 ( stadium VARCHAR, attendance VARCHAR )
What is the stadium where the attendance was 75,406?
SELECT stadium FROM table_15190346_2 WHERE attendance = "75,406"
sql_create_context
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, ...
在编号为6465172的医院就诊的病患36808605在入院时科室名称中含有优生的住院就诊记录都有哪几条?
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '36808605' AND hz_info.YLJGDM = '6465172' AND zyjzjlb.JZKSMC LIKE '%优生%'
css
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
Show aircraft names and number of flights for each aircraft, and rank from high to low by the y-axis.
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
Questions which were closed after a suggested edit was approved.
SELECT DISTINCT (p.Id) AS "post_link" FROM SuggestedEdits AS se INNER JOIN Posts AS p ON se.PostId = p.Id WHERE NOT se.ApprovalDate IS NULL AND p.ClosedDate > se.CreationDate
sede
CREATE TABLE table_name_27 ( home_team VARCHAR )
What was fitzroy's score at home?
SELECT home_team AS score FROM table_name_27 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_name_41 ( october VARCHAR, february VARCHAR, june VARCHAR, september VARCHAR, year VARCHAR )
What is the total number in October with less than 2.48 in September, after 2002, more than 1.42 in June, and smaller than 7.44 in February?
SELECT COUNT(october) FROM table_name_41 WHERE september < 2.48 AND year > 2002 AND june > 1.42 AND february < 7.44
sql_create_context
CREATE TABLE table_3190 ( "Episode #" real, "Production Count" real, "Original Airdate" text, "Prod. Code" text, "Title" text, "Viewing figures millions" text )
What is the lowest episode number with 6.19 million viewers and a production code of icec487y?
SELECT MIN("Episode #") FROM table_3190 WHERE "Viewing figures millions" = '6.19' AND "Prod. Code" = 'ICEC487Y'
wikisql
CREATE TABLE table_24192190_1 ( latitude VARCHAR, time__utc_ VARCHAR )
When 9:47:38 is the time (utc) how many measurements of latitude are there?
SELECT COUNT(latitude) FROM table_24192190_1 WHERE time__utc_ = "9:47:38"
sql_create_context
CREATE TABLE table_name_30 ( year VARCHAR, town VARCHAR )
What year was it the town of Eugene?
SELECT year FROM table_name_30 WHERE town = "eugene"
sql_create_context
CREATE TABLE table_203_34 ( id number, "season" text, "appearance" number, "interchange" number, "tries" number, "goals" number, "f/g" number, "points" number )
which team name had the most goals in a year -lrb- bulldogs , roosters , tigers -rrb-
SELECT "season" FROM table_203_34 WHERE "season" IN ('bulldogs', 'roosters', 'tigers') GROUP BY "season" ORDER BY SUM("goals") DESC LIMIT 1
squall
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is gender and language of subject id 74345?
SELECT demographic.gender, demographic.language FROM demographic WHERE demographic.subject_id = "74345"
mimicsql_data
CREATE TABLE table_42085 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Which position was in Orlando in 2000?
SELECT "Position" FROM table_42085 WHERE "Years in Orlando" = '2000'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
查查患者陶惜雪在医院9853107看病的记录里,出院时候的科室名字里不带有老年病的住院看病记录
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '陶惜雪' AND hz_info.YLJGDM = '9853107' AND NOT zyjzjlb.CYKSMC LIKE '%老年病%'
css
CREATE TABLE table_64454 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
What is the highest col for the prominence of 1,834 meters and elevation higher than 1,834 meters?
SELECT MAX("Col (m)") FROM table_64454 WHERE "Prominence (m)" = '1,834' AND "Elevation (m)" > '1,834'
wikisql
CREATE TABLE table_1990 ( "Stage (Winner)" text, "General Classification" text, "Points Classification" text, "Mountains Classification" text, "Young Rider Classification" text, "Team Classification" text )
Name the mountains classification for team columbia
SELECT "Mountains Classification" FROM table_1990 WHERE "Team Classification" = 'Team Columbia'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE month ( month_number int, month_name tex...
on tuesday what flights leave PHOENIX to ST. PAUL MINNESOTA and leave after 1200
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, state WHERE ((date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departu...
atis
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, ...
在17年6月24日到17年11月6日期间,鲁丽泽这位参保人门诊西药费有多少元
SELECT SUM(t_kc22.AMOUNT) 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_NM = '鲁丽泽' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2017-06-24' AND '2017-11-06' AND t_kc22.MED_INV_IT...
css
CREATE TABLE table_2259502_2 ( opponents VARCHAR, championship VARCHAR )
Who were the opponents in the Tokyo championships?
SELECT opponents FROM table_2259502_2 WHERE championship = "Tokyo"
sql_create_context