context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_46 (
stadium VARCHAR,
host_team VARCHAR,
final_score VARCHAR
) | Name the stadium with host team of san diego chargers and final score of 23-45 | SELECT stadium FROM table_name_46 WHERE host_team = "san diego chargers" AND final_score = "23-45" | 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... | tell me the maximum hospital cost that involves phosphate how much does it cost? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'phosphate')) GROUP BY cost.patienthealthsystemstayid) AS t1 | eicu |
CREATE TABLE table_203_467 (
id number,
"year" number,
"numer of jamaicans\ngranted british\ncitizenship" number,
"naturalisation\nby residence" number,
"naturalisation\nby marriage" number,
"registration\nof a minor child" number,
"registration\nby other means" number
) | in which year were the least amount of jamaicans granted british citizenship ? | SELECT "year" FROM table_203_467 ORDER BY "numer of jamaicans\ngranted british\ncitizenship" LIMIT 1 | squall |
CREATE TABLE table_name_19 (
driver VARCHAR,
time_retired VARCHAR
) | What driver has a Time/Retired of 2:16:38.0? | SELECT driver FROM table_name_19 WHERE time_retired = "2:16:38.0" | sql_create_context |
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 ... | 检验报告单在门诊就诊10755698211中开出了几份? | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '10755698211' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '10755698211' | css |
CREATE TABLE table_name_20 (
result VARCHAR,
year VARCHAR,
tournament VARCHAR
) | What is the result of the World Race Walking Cup tournament played before the year 2010? | SELECT result FROM table_name_20 WHERE year > 2010 AND tournament = "world race walking cup" | sql_create_context |
CREATE TABLE table_32833 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponent" text,
"Score" text
) | What was the outcome of the Tournament in Buenos Aires? | SELECT "Outcome" FROM table_32833 WHERE "Tournament" = 'buenos aires' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients whose insurance is self pay and procedure long title is replacement of tube or enterostomy device of small intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Replacement of tube or enterostomy device of small intestine" | mimicsql_data |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who did not have any job in the past, return a line chart about the change of department_id over hire_date . | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_203_77 (
id number,
"album title" text,
"format" text,
"year" number,
"original label" text,
"chart positions" text
) | how many years after 1999 did merge records release their next album ? | SELECT (SELECT MIN("year") FROM table_203_77 WHERE "year" > 1999) - 1999 | squall |
CREATE TABLE table_14655985_1 (
position VARCHAR,
college VARCHAR
) | what's the position with college being usc | SELECT position FROM table_14655985_1 WHERE college = "USC" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday, I want to rank by the total number in desc. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 能告诉我病人邹清舒所有医疗记录中医疗费总额超过1552.66元的入院诊断名称是什么吗?疾病编码呢 | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '邹清舒' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 1552.66) | css |
CREATE TABLE table_50614 (
"Athlete" text,
"Time" text,
"Country" text,
"Year" real,
"Place" real
) | Which Time has a Year larger than 1985, and a Place smaller than 2, and an Athlete of riochy sekiya? | SELECT "Time" FROM table_50614 WHERE "Year" > '1985' AND "Place" < '2' AND "Athlete" = 'riochy sekiya' | wikisql |
CREATE TABLE table_name_65 (
score VARCHAR,
date VARCHAR
) | What is Score, when Date is May 7, 2006? | SELECT score FROM table_name_65 WHERE date = "may 7, 2006" | sql_create_context |
CREATE TABLE table_203_54 (
id number,
"selected\nlatin american\ncountries" text,
"internl.\ntourism\narrivals\n2010\n(x 1000)" number,
"internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number,
"average\nreceipt\nper visitor\n2009\n(usd/turista)" number,
"tourist\narrivals\nper\n1000 inhab\n(... | how many international tourism arrivals in 2010 -lrb- x1000 -rrb- did mexico have ? | SELECT "internl.\ntourism\narrivals\n2010\n(x 1000)" FROM table_203_54 WHERE "selected\nlatin american\ncountries" = 'mexico' | squall |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
... | 看看之前患者97868786有哪些异常反应 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.... | css |
CREATE TABLE table_1215 (
"Municipality" text,
"League of Communists" real,
"Peoples Party" real,
"Union of Reform Forces" real,
"Democratic Coalition" real,
"DSSP" real,
"Total seats" real
) | Tell me the least amount of democratic colation | SELECT MIN("Democratic Coalition") FROM table_1215 | wikisql |
CREATE TABLE table_203_812 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who won more gold medals than the united states ? | SELECT "nation" FROM table_203_812 WHERE "gold" > (SELECT "gold" FROM table_203_812 WHERE "nation" = 'united states') | squall |
CREATE TABLE table_name_5 (
pick__number VARCHAR,
affiliation VARCHAR
) | Tell me the total number of pick for university of portland | SELECT COUNT(pick__number) FROM table_name_5 WHERE affiliation = "university of portland" | sql_create_context |
CREATE TABLE table_name_44 (
parish__prestegjeld_ VARCHAR,
church_name VARCHAR
) | Which parish has a church named Vangsnes Kyrkje? | SELECT parish__prestegjeld_ FROM table_name_44 WHERE church_name = "vangsnes kyrkje" | sql_create_context |
CREATE TABLE table_name_11 (
date VARCHAR,
opponent VARCHAR,
match VARCHAR,
ground VARCHAR
) | On what date is there a match lower than 14 with a ground of H and the opponent Aston Villa under 18s? | SELECT date FROM table_name_11 WHERE match < 14 AND ground = "h" AND opponent = "aston villa under 18s" | sql_create_context |
CREATE TABLE table_203_81 (
id number,
"date" text,
"constituency" text,
"gain" text,
"loss" text,
"note" text
) | how many times is fine gael listed for gain ? | SELECT COUNT(*) FROM table_203_81 WHERE "gain" = 'fine gael' | squall |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | The MDE requirement can be fulfilled with which easiest class ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE table_44544 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What place was Gary Player after two rounds? | SELECT "Place" FROM table_44544 WHERE "Player" = 'gary player' | 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... | 患者吴永嘉金额超过2273.34元的药品在哪几次医疗记录中被开出过?医疗就诊编号分别是多少? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '吴永嘉' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2273.34) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '吴永嘉' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2273.... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid nu... | until 2100, how many patients were admitted to the hospital? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) <= '2100' | eicu |
CREATE TABLE table_name_63 (
number INTEGER,
name VARCHAR,
weight VARCHAR
) | Name of byron geis, and a Weight smaller than 195 involves what average number? | SELECT AVG(number) FROM table_name_63 WHERE name = "byron geis" AND weight < 195 | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number... | what flights go from BOSTON to PITTSBURGH after 600 next tuesday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((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.departure_time... | atis |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 医疗记录中医院0869256的出院诊断,统计其急性支气管炎的最低和最高医疗费总数目都是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0869256' AND t_kc21.OUT_DIAG_DIS_NM = '急性支气管炎') | css |
CREATE TABLE table_203_713 (
id number,
"s.no." number,
"name of kingdom" text,
"name of king" text,
"no. of villages" number,
"capital" text,
"names of districts" text
) | does punia have more or less villages than godara ? | SELECT (SELECT "no. of villages" FROM table_203_713 WHERE "name of kingdom" = 'punia') > (SELECT "no. of villages" FROM table_203_713 WHERE "name of kingdom" = 'godara') | 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
)
... | Calculate the number of patients with a blood fluid lab test who were diagnosed with mechanical complication of colostomy and enterostomy. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Colosty/enter comp-mech" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Suggeste... | Top 20 users from Noida. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%noida' OR UPPER(Location) LIKE '%NOIDA' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_66 (
"Rank" real,
"Member Association" text,
"Points" text,
"Group stage" real,
"Play-off" real,
"AFC Cup" real
) | How many countries got 796.7 points? | SELECT COUNT("Rank") FROM table_66 WHERE "Points" = '796.7' | 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... | what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_41201 (
"Year" real,
"Competition" text,
"Club" text,
"Nation" text,
"Result" text
) | What is the average Year when the Competition was friendly, and a Club of everton? | SELECT AVG("Year") FROM table_41201 WHERE "Competition" = 'friendly' AND "Club" = 'everton' | wikisql |
CREATE TABLE table_44727 (
"Internet Plan" text,
"Downstream" text,
"Upstream" text,
"Bandwidth Included" text,
"Price" text
) | What is the price of 150 mbps downstread? | SELECT "Price" FROM table_44727 WHERE "Downstream" = '150 mbps' | wikisql |
CREATE TABLE table_72493 (
"City" text,
"Station" text,
"Year acquired" real,
"Primary programming source" text,
"Other programming sources" text,
"Current status" text
) | how any were gained as the chan | SELECT COUNT("Year acquired") FROM table_72493 WHERE "Station" = 'CHAN' | wikisql |
CREATE TABLE table_20142 (
"Ecozone" text,
"Area (km\u00b2)" real,
"Percentage of total area" text,
"Percentage of land area" text,
"Percentage protected" text
) | How large is the Boreal Shield in km2? | SELECT COUNT("Area (km\u00b2)") FROM table_20142 WHERE "Ecozone" = 'Boreal Shield' | wikisql |
CREATE TABLE phone_market (
market_id number,
phone_id text,
num_of_stock number
)
CREATE TABLE market (
market_id number,
district text,
num_of_employees number,
num_of_shops number,
ranking number
)
CREATE TABLE phone (
name text,
phone_id number,
memory_in_g number,
... | Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. | SELECT T2.name FROM phone_market AS T1 JOIN phone AS T2 ON T1.phone_id = T2.phone_id GROUP BY T2.name HAVING SUM(T1.num_of_stock) >= 2000 ORDER BY SUM(T1.num_of_stock) DESC | spider |
CREATE TABLE table_35406 (
"Year" real,
"Jewish" real,
"Muslim" real,
"Christian" real,
"Druze" real,
"Total" real
) | How many jewish have a muslim less than 36,041, a total less than 161,042, a year after 2006, with a druze greater than 2,534? | SELECT SUM("Jewish") FROM table_35406 WHERE "Muslim" < '36,041' AND "Total" < '161,042' AND "Year" > '2006' AND "Druze" > '2,534' | 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 patient (
uniquep... | when did patient 016-1459 last receive an atrial flutter - 1:1 conduction diagnosis during their first hospital encounter? | 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 = '016-1459' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ... | eicu |
CREATE TABLE table_76800 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Heat points" real,
"Opponents" real,
"Record" text,
"Streak" text
) | What is Streak, when Heat Points is '101', and when Game is '16'? | SELECT "Streak" FROM table_76800 WHERE "Heat points" = '101' AND "Game" = '16' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what number of prescriptions of 0.9%nacl 1,000 ml were issued since 6 years ago? | SELECT COUNT(*) FROM medication WHERE medication.drugname = '0.9%nacl 1,000 ml' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-6 year') | eicu |
CREATE TABLE table_12094609_1 (
preliminaries VARCHAR,
evening_gown VARCHAR
) | what's the preliminaries where evening gown is 8.988 | SELECT preliminaries FROM table_12094609_1 WHERE evening_gown = "8.988" | sql_create_context |
CREATE TABLE table_203_506 (
id number,
"opponent" text,
"played" number,
"won" number,
"lost" number,
"drawn" number,
"% won overall" text
) | name the only team they had a losing record against . | SELECT "opponent" FROM table_203_506 ORDER BY "lost" DESC LIMIT 1 | squall |
CREATE TABLE table_58705 (
"Year" real,
"Binibining Pilipinas-Universe" text,
"Binibining Pilipinas-International" text,
"Miss Maja Pilipinas" text,
"Binibining Pilipinas-Tourism" text,
"First runner-up" text,
"Second runner-up" text
) | What Binibining Pilipinas-International has a Year larger than 1990, and a Binibining Pilipinas-Universe of maria lourdes gonzalez? | SELECT "Binibining Pilipinas-International" FROM table_58705 WHERE "Year" > '1990' AND "Binibining Pilipinas-Universe" = 'maria lourdes gonzalez' | wikisql |
CREATE TABLE table_11585 (
"Name" text,
"Election Year" real,
"Party" text,
"Birth State" text,
"Resident State" text
) | What is the resident state for the president elected in 1864? | SELECT "Resident State" FROM table_11585 WHERE "Election Year" = '1864' | wikisql |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 从14年12月31日到21年1月18日当中头颈肿瘤外科的门诊量有多少吗? | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSMC = '头颈肿瘤科' AND zzmzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSMC = '头颈肿瘤科' AND fzzmzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18' | css |
CREATE TABLE table_name_3 (
laps INTEGER,
driver VARCHAR
) | What is the highest number of laps completed by driver Joe Nemechek? | SELECT MAX(laps) FROM table_name_3 WHERE driver = "joe nemechek" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport va... | US next wednesday from CLEVELAND to MIAMI | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da... | atis |
CREATE TABLE table_11780179_1 (
gdp__nominal_ VARCHAR,
country VARCHAR
) | What is the GDP (nominal) for Uzbekistan? | SELECT gdp__nominal_ FROM table_11780179_1 WHERE country = "Uzbekistan" | sql_create_context |
CREATE TABLE table_name_67 (
player VARCHAR,
college_junior_club_team VARCHAR
) | What player is from canterbury (ushs)? | SELECT player FROM table_name_67 WHERE college_junior_club_team = "canterbury (ushs)" | sql_create_context |
CREATE TABLE table_65774 (
"Voting order" real,
"Country" text,
"Spokespersons" text,
"Commentator" text,
"Broadcaster" text
) | Who was the commentator when the spokesperson was michael aspel? | SELECT "Commentator" FROM table_65774 WHERE "Spokespersons" = 'michael aspel' | wikisql |
CREATE TABLE table_203_153 (
id number,
"stamp issue date" text,
"stamp set" text,
"#cards" text,
"card set ref" text,
"qty. issued" number
) | which year had the most stamps issued ? | SELECT "stamp issue date" FROM table_203_153 GROUP BY "stamp issue date" ORDER BY SUM("qty. issued") DESC LIMIT 1 | squall |
CREATE TABLE table_17352 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) | what's the leading scorer where home is sacramento kings | SELECT "Leading scorer" FROM table_17352 WHERE "Home" = 'Sacramento Kings' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what are the hospitals admission times of patient 008-186 last year? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '008-186' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
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 bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, and I want to list Y-axis in desc order please. | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC | nvbench |
CREATE TABLE table_17919342_1 (
director VARCHAR,
original_title VARCHAR
) | How many directors were there for the film with the original title of The Moises Padilla Story? | SELECT COUNT(director) FROM table_17919342_1 WHERE original_title = "The Moises Padilla Story" | sql_create_context |
CREATE TABLE table_name_38 (
longitude INTEGER,
county VARCHAR,
water__sqmi_ VARCHAR
) | what is the highest longitude for county mountrail and the water (sqmi) is less than 0.075? | SELECT MAX(longitude) FROM table_name_38 WHERE county = "mountrail" AND water__sqmi_ < 0.075 | sql_create_context |
CREATE TABLE table_62949 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What country has a time of 6:49.28? | SELECT "Country" FROM table_62949 WHERE "Time" = '6:49.28' | wikisql |
CREATE TABLE table_19329117_1 (
version VARCHAR,
official_name VARCHAR
) | What's the version of AutoCAD Architectural Desktop 3? | SELECT version FROM table_19329117_1 WHERE official_name = "AutoCAD Architectural Desktop 3" | sql_create_context |
CREATE TABLE table_74484 (
"Date" text,
"Track" text,
"Event Name" text,
"Pole Winner" text,
"Race Winner" text
) | Tell me the pole winner of may 12 | SELECT "Pole Winner" FROM table_74484 WHERE "Date" = 'may 12' | wikisql |
CREATE TABLE table_58448 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the score on 22 january 2008? | SELECT "Score" FROM table_58448 WHERE "Date" = '22 january 2008' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TAB... | These techs should you learn. Estimates, which technologies will be most synergic to your most well known technologies in the next DayDelta days. Use your network-wide account id, not your site account id! The result is 10-base logarithmic! | WITH TagScores AS (SELECT PostTags.TagId, COUNT(*) AS Count FROM Posts, PostTags, Votes WHERE Posts.ParentId = PostTags.PostId AND Votes.PostId = Posts.Id AND Posts.OwnerUserId = @UserId AND Votes.VoteTypeId = 2 GROUP BY PostTags.TagId) SELECT * FROM TagScores, Tags WHERE Tags.Id = TagScores.TagId | sede |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show team id vs acc_percent as scatter plot use a different color for each ACC_Road | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE table_62893 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Time/Retired" text,
"Grid" real
) | When the entrant is fred saunders what is the driver? | SELECT "Driver" FROM table_62893 WHERE "Entrant" = 'fred saunders' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | Questions with exactly 1 Tag. | SELECT pt.PostId AS "post_link", t.TagName FROM PostTags AS pt LEFT JOIN Tags AS t ON t.Id = pt.TagId WHERE EXISTS(SELECT 1 FROM PostTags AS pt2 WHERE pt2.PostId = pt.PostId GROUP BY pt2.PostId HAVING COUNT(pt2.TagId) = 1) LIMIT 50 | sede |
CREATE TABLE table_name_24 (
finish VARCHAR,
rank VARCHAR,
laps VARCHAR
) | Which finish has 33 as a rank and 200 for laps? | SELECT finish FROM table_name_24 WHERE rank = "33" AND laps = 200 | sql_create_context |
CREATE TABLE table_60869 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What Club has 13 wins, goals against less than 48, and a position of 4? | SELECT "Club" FROM table_60869 WHERE "Wins" = '13' AND "Goals against" < '48' AND "Position" = '4' | wikisql |
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,
... | 患者苏正诚在2021-04-10之前有哪些门诊就诊的检验报告单?列出门诊就诊流水号 | SELECT mzjzjlb.JZLSH 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 = '苏正诚' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2021-04-10' UNI... | css |
CREATE TABLE table_name_52 (
length VARCHAR,
country VARCHAR,
year VARCHAR
) | Which Length has a Country of soviet union, and a Year larger than 1975? | SELECT length FROM table_name_52 WHERE country = "soviet union" AND year > 1975 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | RPG.SE Beta Users Still Active In Last Month. | SELECT DisplayName, Reputation FROM Users WHERE CreationDate < '2012/04/11' AND LastAccessDate > DATEADD(m, -1, GETDATE()) ORDER BY Reputation DESC | sede |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE... | when did patient 13528 visit the hospital via transfer from skilled nur, the last time since 2104? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 13528 AND admissions.admission_location = 'transfer from skilled nur' AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_14994 (
"Position" real,
"Song Title" text,
"Artist" text,
"Highest Position" real,
"Sales" real
) | What were the total number of sales for the song 21 Seconds? | SELECT COUNT("Sales") FROM table_14994 WHERE "Song Title" = '21 seconds' | wikisql |
CREATE TABLE table_name_47 (
position VARCHAR,
player VARCHAR
) | What Position has a Player named kenneth udjus? | SELECT position FROM table_name_47 WHERE player = "kenneth udjus" | sql_create_context |
CREATE TABLE table_16457934_5 (
Id VARCHAR
) | What is the minimum if 40 to 44? | SELECT MIN(40 AS _to_44) FROM table_16457934_5 | sql_create_context |
CREATE TABLE Restaurant_Type (
ResTypeID INTEGER,
ResTypeName VARCHAR(40),
ResTypeDescription VARCHAR(100)
)
CREATE TABLE Type_Of_Restaurant (
ResID INTEGER,
ResTypeID INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR... | List how many students in each last name who majored in 600 using a bar chart, and sort by the bars from low to high. | SELECT LName, COUNT(LName) FROM Student WHERE Major = 600 GROUP BY LName ORDER BY LName | nvbench |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients of white ethnicity followed the procedure dx ultrasound-heart? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Dx ultrasound-heart" | mimicsql_data |
CREATE TABLE table_name_48 (
league VARCHAR,
venue VARCHAR
) | What kind of League has a Venue of billesley common? | SELECT league FROM table_name_48 WHERE venue = "billesley common" | sql_create_context |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
a... | Return a bar chart on what are the apartment number and the room count of each apartment?, and rank in ascending by the y axis. | SELECT apt_number, room_count FROM Apartments ORDER BY room_count | nvbench |
CREATE TABLE table_80340 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the catalog of the release from January 23, 2002? | SELECT "Catalog" FROM table_80340 WHERE "Date" = 'january 23, 2002' | wikisql |
CREATE TABLE table_59590 (
"Name" text,
"E-mail server" text,
"Faxing" text,
"Instant messaging" text,
"Telephony" text,
"Videoconferencing" text,
"Web conferencing" text,
"Data conferencing" text,
"Application sharing" text,
"Electronic meeting system" text,
"Synchronous con... | What is Application Sharing, when Web Conferencing is 'Web Conferencing'? | SELECT "Application sharing" FROM table_59590 WHERE "Web conferencing" = 'web conferencing' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 02563283756的名称还有入院科室代码在住院就诊里都是什么呢? | SELECT JZKSDM, JZKSMC FROM zyjzjlb WHERE JZLSH = '02563283756' | css |
CREATE TABLE table_22056184_1 (
team VARCHAR,
position VARCHAR
) | How many teams have 7th position? | SELECT COUNT(team) FROM table_22056184_1 WHERE position = "7th" | sql_create_context |
CREATE TABLE table_35490 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won by 2 or more goals difference" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How many values for a win by 2 or more goals correspond to a difference of 2, more than 9 points, and the America-RJ team when more than 7 are played? | SELECT COUNT("Won by 2 or more goals difference") FROM table_35490 WHERE "Difference" = '2' AND "Points" > '9' AND "Team" = 'america-rj' AND "Played" > '7' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewT... | Top StackOverflow users in Singapore. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%singapore%' OR LOWER(Location) LIKE '%singapore%') AND Reputation >= 10000 ORDER BY Reputation DESC | sede |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4... | How many accounts for each customer? Show a bar chart that groups by customer's first name, could you order in ascending by the X? | SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_first_name | nvbench |
CREATE TABLE table_76002 (
"Rank" real,
"Republic" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total number of bronzes associated with 1 silver, ranks under 6 and under 6 golds? | SELECT SUM("Bronze") FROM table_76002 WHERE "Silver" = '1' AND "Rank" < '6' AND "Gold" < '6' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 10 stackoverflow users from Himachal. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%himachal%' OR UPPER(Location) LIKE '%HIMACHAL%' OR Location LIKE '%Himachal%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 10 | sede |
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 (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose year of birth is less than 2101 and procedure long title is closed biopsy of skin and subcutaneous tissue? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2101" AND procedures.long_title = "Closed biopsy of skin and subcutaneous tissue" | mimicsql_data |
CREATE TABLE table_22916979_2 (
metropolitan_area VARCHAR,
rank VARCHAR
) | which area has a rank of 60? | SELECT metropolitan_area FROM table_22916979_2 WHERE rank = 60 | sql_create_context |
CREATE TABLE table_203_490 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) | number of wins in the season . | SELECT COUNT(*) FROM table_203_490 WHERE "result" = 'w' | squall |
CREATE TABLE table_5070 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Years" text,
"Goals" real
) | What name is the goals of 25? | SELECT "Name" FROM table_5070 WHERE "Goals" = '25' | wikisql |
CREATE TABLE table_24381 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Name the number for margin of victory being 3 strokes | SELECT COUNT("No.") FROM table_24381 WHERE "Margin of victory" = '3 strokes' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose marital status is divorced and primary disease is celo-vessicle fistula? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "CELO-VESSICLE FISTULA" | mimicsql_data |
CREATE TABLE table_176529_2 (
status VARCHAR,
official_name VARCHAR
) | How many status are there for Moncton? | SELECT COUNT(status) FROM table_176529_2 WHERE official_name = "Moncton" | sql_create_context |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Eve... | what are the event details of the services that have the type code 'Marriage', and count them by a bar chart, and show from high to low by the bars. | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' GROUP BY Event_Details ORDER BY Event_Details DESC | nvbench |
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... | what number of male patients had bone marrow transplant? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Bone marrow replaced by transplant" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | 哪几家医院为48799651这个患者开了硫酸氢氯吡格雷片这个药物 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '48799651' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.