context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_50 (
date VARCHAR,
venue VARCHAR
) | On what date was a match held at MCG? | SELECT date FROM table_name_50 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_2897457_5 (
position VARCHAR,
pick__number VARCHAR
) | What position did the #94 pick play? | SELECT position FROM table_2897457_5 WHERE pick__number = 94 | sql_create_context |
CREATE TABLE table_name_16 (
opponent VARCHAR,
date VARCHAR
) | What team did the Red Sox play against on June 3? | SELECT opponent FROM table_name_16 WHERE date = "june 3" | sql_create_context |
CREATE TABLE table_50168 (
"Cartridge" text,
"Bullet weight" text,
"Muzzle velocity" text,
"Muzzle energy" text,
"Max pressure" text
) | What is the max pressure for the 468ft lbf (634 j) muzzle energy? | SELECT "Max pressure" FROM table_50168 WHERE "Muzzle energy" = '468ft•lbf (634 j)' | wikisql |
CREATE TABLE table_60984 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
) | What is the original NFL team of the College of Oregon DT Player? | SELECT "Original NFL team" FROM table_60984 WHERE "College" = 'oregon' AND "Pos." = 'dt' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | when did patient 030-58018 first receive a diagnosis of cns abscess during the last hospital visit? | 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 = '030-58018' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_70733 (
"Model" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Prime mover" text,
"Power output" text
) | What is the average total produced when the prime mover is 12-251c? | SELECT AVG("Total produced") FROM table_70733 WHERE "Prime mover" = '12-251c' | wikisql |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTE... | How many documents for different location code? Plot a bar chart to show the proportion, and sort in desc by the Location_Code please. | SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC | nvbench |
CREATE TABLE table_58352 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
) | who is the runner-up when the winning score is 16 (68-70-65-65=268)? | SELECT "Runner-up" FROM table_58352 WHERE "Winning score" = '−16 (68-70-65-65=268)' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 自零一年十月七日到一三年八月二十八日,医疗机构0329082消耗了的统筹金额是多少 | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '0329082' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-10-07' AND '2013-08-28' | 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,
... | 患者谢修雅就诊科室名称不包含小儿在医院6550085中的所有门诊就诊记录的流水号各是什么? | SELECT mzjzjlb.JZLSH 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.person_info_XM = '谢修雅' AND hz_info.YLJGDM = '6550085' AND NOT mzjzjlb.JZKSMC LIKE '%小儿%' | css |
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... | Draw a scatter chart about the correlation between School_ID and ACC_Percent , and group by attribute All_Games. | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_2899987_2 (
network VARCHAR,
region VARCHAR
) | Which network serves the Guerrero region | SELECT network FROM table_2899987_2 WHERE region = "Guerrero" | sql_create_context |
CREATE TABLE table_name_42 (
opponent VARCHAR,
time VARCHAR
) | Which Opponent has a Time of 2:31? | SELECT opponent FROM table_name_42 WHERE time = "2:31" | sql_create_context |
CREATE TABLE table_71672 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Which Team 1 has a first leg of 1-0 and a second leg of 0-2? | SELECT "Team 1" FROM table_71672 WHERE "1st leg" = '1-0' AND "2nd leg" = '0-2' | wikisql |
CREATE TABLE table_6229 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What is the distance for the course Civitavecchia to San Vincenzo? | SELECT "Distance" FROM table_6229 WHERE "Course" = 'civitavecchia to san vincenzo' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients of white ethnicity were admitted before the year 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear < "2154" | mimicsql_data |
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... | For those employees who did not have any job in the past, find job_id and the sum of salary , and group by attribute job_id, and visualize them by a bar chart, rank in asc by the y axis. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_18176 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What's the first elected year of the district who's been the last one to do so? | SELECT MAX("First elected") FROM table_18176 | wikisql |
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... | 在2000年10月16日到2016年8月23日期间医疗机构5648027中公务员医疗就诊记录有多少个? | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5648027' AND qtb.IN_HOSP_DATE BETWEEN '2000-10-16' AND '2016-08-23' AND qtb.SERVANT_FLG = '公务员' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5648027' AND gyb.IN_HOSP_DATE BETWEEN '2000-10-16' AND '2016-08-23' AND gyb.SERVANT_FLG = '公务员' UNION SELECT COU... | css |
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... | 列出所有医疗就诊记录的大病支付与医疗费总额在医院1301114中的比值有哪些最小值,在不同科室编码和入院诊断疾病编码下? | SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1301114' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is the number of patients whose diagnoses long title is other b-complex deficiencies? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other B-complex deficiencies" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what was the medication that patient 021-50282 was prescribed for in the same day after receiving anticonvulsant - phenytoin until 11 months ago? | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-50282') AND treatment.treatme... | eicu |
CREATE TABLE table_58885 (
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | What is Winner, when City / State is 'Mallala , South Australia', and when Team is 'Elfin Sports Cars'? | SELECT "Winner" FROM table_58885 WHERE "City / State" = 'mallala , south australia' AND "Team" = 'elfin sports cars' | wikisql |
CREATE TABLE table_22362 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | Who directed season 1? | SELECT "Directed by" FROM table_22362 WHERE "No. in season" = '1' | wikisql |
CREATE TABLE table_64719 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
) | How many Episodes have a Romaji Title of dragon zakura? | SELECT COUNT("Episodes") FROM table_64719 WHERE "Romaji Title" = 'dragon zakura' | wikisql |
CREATE TABLE table_28980706_4 (
first_air_date VARCHAR,
episode VARCHAR
) | When 11 is the episode what is the air date? | SELECT first_air_date FROM table_28980706_4 WHERE episode = 11 | sql_create_context |
CREATE TABLE table_name_23 (
away_team VARCHAR,
home_team VARCHAR
) | Who was the away team when Hawthorn was the home team? | SELECT away_team AS score FROM table_name_23 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_3923 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the team's record against philadelphia? | SELECT "Record" FROM table_3923 WHERE "Team" = 'Philadelphia' | wikisql |
CREATE TABLE table_name_8 (
area__km²_ VARCHAR,
pop__km² VARCHAR
) | What is the area for a population of 0.58 km? | SELECT area__km²_ FROM table_name_8 WHERE pop__km² = 0.58 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | tell me what were the five most common intakes? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_74586 (
"Tournament" text,
"1940" text,
"1941" text,
"1942" text,
"1943" text,
"1944" text,
"1945" text,
"1946 1" text,
"1947 1" text,
"1948" text,
"1949" text,
"1950" text,
"1951" text,
"1952" text,
"1953" text,
"1954" text,
"Career... | What is the 1944 result for the U.S. Championships? | SELECT "1944" FROM table_74586 WHERE "Tournament" = 'u.s. championships' | wikisql |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Create a bar chart showing the total number across location, list y axis in ascending order please. | SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY COUNT(*) | nvbench |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | What have you tried?' Comments. | SELECT COUNT(*) FROM Comments WHERE Text LIKE '%whathaveyoutried%' OR Text LIKE '%what have you tried%' | sede |
CREATE TABLE table_name_46 (
type VARCHAR,
name VARCHAR
) | What is the type for Cassano? | SELECT type FROM table_name_46 WHERE name = "cassano" | sql_create_context |
CREATE TABLE table_46414 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | In what year was Lesli Margherita nominated? | SELECT SUM("Year") FROM table_46414 WHERE "Nominee" = 'lesli margherita' | wikisql |
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... | 这个医疗机构5503215从01年3月19日到14年4月30日内统筹金额消耗量情况是怎么样的? | SELECT SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5503215' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-03-19' AND '2014-04-30' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyj... | css |
CREATE TABLE table_name_17 (
airport VARCHAR
) | What is the 2003 rank for Los Angeles International airport? | SELECT 2003 AS rank FROM table_name_17 WHERE airport = "los angeles international airport" | sql_create_context |
CREATE TABLE table_13002 (
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"% Won" real
) | What is the largest % Won with a Lost smaller than 0? | SELECT MAX("% Won") FROM table_13002 WHERE "Lost" < '0' | wikisql |
CREATE TABLE table_1332 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name for the high rebounds when score is w 105 91 (ot) | SELECT "High rebounds" FROM table_1332 WHERE "Score" = 'W 105–91 (OT)' | 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,
... | 共在哪几次医疗记录中给病号25361581开出过药品金额不低于1538.07元的?医疗就诊编号是多少啊? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '25361581' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 1538.07) | css |
CREATE TABLE table_47770 (
"Name" text,
"Built" text,
"Listed" text,
"Location" text,
"Borough" text
) | What location was listed on 1977-09-15? | SELECT "Location" FROM table_47770 WHERE "Listed" = '1977-09-15' | wikisql |
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 number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 那个做上臂的各项指标检验的患者81668961结果怎么样? | SELECT * 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 jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_59388 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What place had a score of 67-67=134? | SELECT "Place" FROM table_59388 WHERE "Score" = '67-67=134' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Return a bar chart about the distribution of meter_300 and ID , and show y axis from high to low order. | SELECT meter_300, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE table_name_56 (
record VARCHAR,
team VARCHAR,
date VARCHAR
) | What is the Record with a Team that is detroit and a Date that is june 10? | SELECT record FROM table_name_56 WHERE team = "detroit" AND date = "june 10" | sql_create_context |
CREATE TABLE table_2942 (
"Rank" real,
"Building [A ]" text,
"City" text,
"Country" text,
"Height (m)" text,
"Height (ft)" text,
"Floors" real,
"Built" text
) | How many different numbers of floors are there for the Chongqing Poly Tower? | SELECT COUNT("Floors") FROM table_2942 WHERE "Building [A ]" = 'Chongqing Poly Tower' | wikisql |
CREATE TABLE table_2668347_14 (
first_elected VARCHAR,
candidates VARCHAR
) | when was the first elected when the candidates is thomas lawyer (dr) 54.9% william beekman (f) 45.1%? | SELECT first_elected FROM table_2668347_14 WHERE candidates = "Thomas Lawyer (DR) 54.9% William Beekman (F) 45.1%" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
... | when was the last time patient 8888 had a urine out foley output today? | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine... | mimic_iii |
CREATE TABLE table_12028 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | On which date was the Dodge Dealers Grand Prix GTS class race? | SELECT "Date" FROM table_12028 WHERE "Race" = 'dodge dealers grand prix' AND "Class" = 'gts' | wikisql |
CREATE TABLE table_1342270_5 (
district VARCHAR,
incumbent VARCHAR
) | William Fadjo Cravens serves the fourth district of Arkansas. | SELECT district FROM table_1342270_5 WHERE incumbent = "William Fadjo Cravens" | sql_create_context |
CREATE TABLE table_name_12 (
surname VARCHAR,
first VARCHAR
) | What is donovan's surname? | SELECT surname FROM table_name_12 WHERE first = "donovan" | sql_create_context |
CREATE TABLE table_name_42 (
wins VARCHAR,
last_win VARCHAR
) | How many wins did the club have with the last win in 2000? | SELECT wins FROM table_name_42 WHERE last_win = "2000" | sql_create_context |
CREATE TABLE table_79812 (
"Dish" text,
"Callsign" text,
"Network" text,
"Resolution" text,
"City of License" text,
"Official Website" text
) | Name the dish for resolution of sd 480i and network of bvb | SELECT "Dish" FROM table_79812 WHERE "Resolution" = 'sd 480i' AND "Network" = 'bvb' | wikisql |
CREATE TABLE table_train_206 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hematocrit_hct" float,
"diabetic" string,
"contraception" bool,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"NOUSE" float
) | serum creatinine below 1.7 mg / dl in female and 1.8 mg / dl in male ; | SELECT * FROM table_train_206 WHERE (serum_creatinine < 1.8 AND gender = 'male') OR (serum_creatinine < 1.7 AND gender = 'female') | criteria2sql |
CREATE TABLE table_name_4 (
attendance VARCHAR,
visitor VARCHAR,
date VARCHAR
) | What is the attendance of the game on 2007-04-07 with the Warriors as the visitor team? | SELECT attendance FROM table_name_4 WHERE visitor = "warriors" AND date = "2007-04-07" | sql_create_context |
CREATE TABLE table_204_897 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | how many games did the university of florida win by at least 10 points ? | SELECT COUNT(*) FROM table_204_897 WHERE "result" - "result" >= 10 | squall |
CREATE TABLE table_name_41 (
frequency_mhz VARCHAR,
city_of_license VARCHAR,
erp_w VARCHAR
) | What is the total Frequency MHz Port Charlotte, Florida, which has an ERP W larger than 10, has? | SELECT COUNT(frequency_mhz) FROM table_name_41 WHERE city_of_license = "port charlotte, florida" AND erp_w > 10 | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | How long are my posts?. | SELECT LENGTH(p.Body), Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 2 AND p.OwnerUserId = '##UserId##' ORDER BY LENGTH(p.Body) DESC | sede |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Show different types of ships and the average tonnage of ships of each type Show bar chart, and could you show x axis from high to low order please? | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY Type DESC | nvbench |
CREATE TABLE table_53340 (
"Season" text,
"Division" text,
"Position" text,
"Played" text,
"Lost" text,
"Points" text
) | What's the points when the division is ebl div1 with 22 played? | SELECT "Points" FROM table_53340 WHERE "Division" = 'ebl div1' AND "Played" = '22' | wikisql |
CREATE TABLE table_name_96 (
sail VARCHAR,
syndicate VARCHAR,
yacht VARCHAR
) | Which sail is in the America 3 Foundation syndicate on the America 3 yacht? | SELECT sail FROM table_name_96 WHERE syndicate = "america 3 foundation" AND yacht = "america 3" | sql_create_context |
CREATE TABLE table_4466 (
"Round" real,
"Track" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winner" text,
"Team" text
) | Before round 9, when Takashi Kogure held pole position, who was the team? | SELECT "Team" FROM table_4466 WHERE "Round" < '9' AND "Pole Position" = 'takashi kogure' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | what was the first output (ml)-urethral catheter 14 fr. output time of patient 006-169475 on the last intensive care unit visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-169475') AND NOT patient.unitdischargetime IS NUL... | eicu |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | how many places for french are there in palo alto ? | SELECT COUNT(*) FROM location, restaurant WHERE location.city_name = 'palo alto' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id | restaurants |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Probability of having answers accepted in 2013 by Reputation (in Hundreds). | SELECT Tot.Rep, Tot.TotalAnswers, Acc.AcceptedAnswers, (1.0 * Acc.AcceptedAnswers / Tot.TotalAnswers) FROM (SELECT Users.Reputation / 100 AS Rep, COUNT(Users.Id) AS TotalAnswers FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.PostTypeId = 2 AND YEAR(Posts.CreationDate) = 2013 GROUP BY Users.Reputation... | sede |
CREATE TABLE table_204_557 (
id number,
"#" number,
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text,
"pts" number
) | which date had the least amount of points listed ? | SELECT "date" FROM table_204_557 ORDER BY "pts" LIMIT 1 | squall |
CREATE TABLE table_47144 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the Attendance in Week 10? | SELECT "Attendance" FROM table_47144 WHERE "Week" = '10' | wikisql |
CREATE TABLE table_name_36 (
home_team VARCHAR
) | What is the average home team score for Footscray? | SELECT home_team AS score FROM table_name_36 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_44413 (
"Region" text,
"Name" text,
"Reported birth date" text,
"Reported death date" text,
"Reported age" text
) | Who has a reported age of 111 years, 66 days? | SELECT "Name" FROM table_44413 WHERE "Reported age" = '111 years, 66 days' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | what is the name of the drug that patient 022-100453 had been prescribed two or more times? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022... | eicu |
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sal... | What are the number of the purchase details of transactions with amount bigger than 10000?, and show by the names in ascending. | SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY purchase_details | nvbench |
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,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Has Lawrence Sanna ever taught the class ORALBIOL 852 ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'ORALBIOL' AND course.number = 852 AND instructor.name LIKE '%Lawrence Sanna%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instru... | advising |
CREATE TABLE table_43205 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What T9 Player had a Score of 70-74-69-70=283? | SELECT "Player" FROM table_43205 WHERE "Place" = 't9' AND "Score" = '70-74-69-70=283' | wikisql |
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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id n... | calculate the duration of patient 41014's first hospital stay. | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 41014 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_24339 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | Name the result for total attendance-regular season | SELECT "Result/Games" FROM table_24339 WHERE "Type of Record" = 'Total Attendance-Regular season' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,
airline_name t... | list all flights from BOSTON to SAN FRANCISCO with more than 3 stops | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.stops > 3 AND flight.to_airport = AIRPORT_SERVICE_1.airport_cod... | atis |
CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
Total_pounds real
)
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
... | Show all branch names with the number of members in each branch registered after 2015. Plot them as bar chart. | SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID | nvbench |
CREATE TABLE table_name_95 (
coach VARCHAR,
team VARCHAR
) | Who is the coach for the Adelaide Galaxy team? | SELECT coach FROM table_name_95 WHERE team = "adelaide galaxy" | sql_create_context |
CREATE TABLE table_41657 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What date was the match on a hard surface with a score of 6 4, 2 6, 3 6? | SELECT "Date" FROM table_41657 WHERE "Surface" = 'hard' AND "Score" = '6–4, 2–6, 3–6' | wikisql |
CREATE TABLE table_name_38 (
against INTEGER,
ntfa_div_2 VARCHAR
) | What is the lowest number of against of NTFA Div 2 Fingal Valley? | SELECT MIN(against) FROM table_name_38 WHERE ntfa_div_2 = "fingal valley" | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Compare the frequency of each type of bed by a bar chart, and I want to list by the y-axis in desc. | SELECT bedType, COUNT(bedType) FROM Rooms WHERE decor = "traditional" GROUP BY bedType ORDER BY COUNT(bedType) DESC | nvbench |
CREATE TABLE table_name_65 (
location VARCHAR,
championship VARCHAR
) | Which location held the Iron 8 Championship tournament? | SELECT location FROM table_name_65 WHERE championship = "iron 8 championship tournament" | sql_create_context |
CREATE TABLE table_14073 (
"Gothic Letter" text,
"Roman" text,
"Sound (phoneme)" text,
"Sound (allophone)" text,
"Proto-Germanic origin" text
) | What is the Roman entry for the allophone of [[[|k]]]? | SELECT "Roman" FROM table_14073 WHERE "Sound (allophone)" = '[[[|k]]]' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
h... | what is the average total cost of a hospital, including a procedure called debrid opn fx-tibia/fib? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'debrid opn fx-tibia/fib')) GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_name_30 (
week VARCHAR,
attendance INTEGER
) | How many weeks had an attendance larger than 84,816? | SELECT COUNT(week) FROM table_name_30 WHERE attendance > 84 OFFSET 816 | sql_create_context |
CREATE TABLE customer_policies (
policy_id number,
customer_id number,
policy_type_code text,
start_date time,
end_date time
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number... | Find the claims that led to more than two settlements or have the maximum claim value. For each of them, return the date the claim was made and the id of the claim. | SELECT T1.date_claim_made, T1.claim_id FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id HAVING COUNT(*) > 2 UNION SELECT T1.date_claim_made, T1.claim_id FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id WHERE T1.amount_claimed = (SELECT MAX(amount_claimed) F... | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose death status is 0 and procedure short title is ventricl shunt tube punc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Ventricl shunt tube punc" | mimicsql_data |
CREATE TABLE table_46675 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What was the average rank for south africa when they had more than 8 silver medals? | SELECT AVG("Rank") FROM table_46675 WHERE "Nation" = 'south africa' AND "Silver" > '8' | wikisql |
CREATE TABLE table_70910 (
"Player" text,
"Height" real,
"Position" text,
"Year born" real,
"Current Club" text
) | Who is the Player born in 1981? | SELECT "Player" FROM table_70910 WHERE "Year born" = '1981' | wikisql |
CREATE TABLE table_name_33 (
result VARCHAR,
alternate VARCHAR,
event VARCHAR
) | What was the result for the 2007 WCC when Sun Yue was the alternate? | SELECT result FROM table_name_33 WHERE alternate = "sun yue" AND event = "2007 wcc" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | how many days have passed since the admission of patient 017-88691 to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '017-88691' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_65 (
fcc_info VARCHAR,
city_of_license VARCHAR,
frequency_mhz VARCHAR
) | Which FCC info has a City of license of burley, idaho, and a Frequency MHz of 89.5? | SELECT fcc_info FROM table_name_65 WHERE city_of_license = "burley, idaho" AND frequency_mhz = 89.5 | sql_create_context |
CREATE TABLE table_67142 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | Which finish has 33 as a rank and 200 for laps? | SELECT "Finish" FROM table_67142 WHERE "Rank" = '33' AND "Laps" = '200' | wikisql |
CREATE TABLE table_68030 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What competition took place on 10 August 2011? | SELECT "Competition" FROM table_68030 WHERE "Date" = '10 august 2011' | wikisql |
CREATE TABLE table_69233 (
"Rank" text,
"Mine" text,
"County" text,
"Operator" text,
"Capacity (thousands of metric tons)" text
) | What is the capacity of the mine that is operated by Cyprus Amax minerals? | SELECT "Capacity (thousands of metric tons)" FROM table_69233 WHERE "Operator" = 'cyprus amax minerals' | wikisql |
CREATE TABLE table_204_385 (
id number,
"round" number,
"pick" number,
"player" text,
"nationality" text,
"college/junior/club team" text
) | what nationality picked the most players ? | SELECT "nationality" FROM table_204_385 GROUP BY "nationality" ORDER BY COUNT("player") DESC LIMIT 1 | squall |
CREATE TABLE table_29293 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | how many times is the week # is audition? | SELECT COUNT("Original artist") FROM table_29293 WHERE "Week #" = 'Audition' | wikisql |
CREATE TABLE table_name_77 (
tuesday VARCHAR,
monday VARCHAR
) | What is shown on Tuesday when Monday is showing Fox Sports Primetime? | SELECT tuesday FROM table_name_77 WHERE monday = "fox sports primetime" | sql_create_context |
CREATE TABLE table_name_85 (
played INTEGER,
lost VARCHAR,
points VARCHAR
) | How many games were played when the loss is less than 5 and points greater than 41? | SELECT SUM(played) FROM table_name_85 WHERE lost < 5 AND points > 41 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.