context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
) | What are the different names of the colleges involved in the tryout in alphabetical order? | SELECT DISTINCT cname FROM tryout ORDER BY cname | spider |
CREATE TABLE table_name_3 (
place VARCHAR,
score VARCHAR
) | what is the place when the score is 68-70-68=206? | SELECT place FROM table_name_3 WHERE score = 68 - 70 - 68 = 206 | 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, a bar chart shows the distribution of job_id and commission_pct , order in ascending by the total number. | SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT | nvbench |
CREATE TABLE table_204_32 (
id number,
"season" number,
"division" text,
"w-l" text,
"finish" text,
"home" text,
"road" text,
"gf" number,
"ga" number,
"coach" text,
"playoffs" text,
"avg attendance" number
) | what year did the rush allow the most goals ? | SELECT "season" FROM table_204_32 ORDER BY "ga" DESC LIMIT 1 | squall |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and I want to order from low to high by the y axis. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 门诊诊断患者99012820为特发性肌张力障碍,他的检测指标203759的结果定量以及单位数据分别是什么? | 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 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... | How many of the female patients belonged to a black/cape verdean ethnic origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/CAPE VERDEAN" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the five most frequently prescribed drugs in 2101 for patients prescribed with dexmedetomidine hcl at the same time? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'dexmedetomidine hcl' AND STRFTIME('%y', prescriptions.startdate) ... | mimic_iii |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | Return a bar chart on how many movie reviews does each director get?, and order in asc by the bars. | SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY director | nvbench |
CREATE TABLE table_name_55 (
week INTEGER,
attendance VARCHAR
) | Total weeks of 49,980 attendance? | SELECT SUM(week) FROM table_name_55 WHERE attendance = 49 OFFSET 980 | sql_create_context |
CREATE TABLE table_name_41 (
Id VARCHAR
) | Name the 2008 for 2012 of sf | SELECT 2008 FROM table_name_41 WHERE 2012 = "sf" | sql_create_context |
CREATE TABLE table_203_694 (
id number,
"#" number,
"name" text,
"took office" text,
"left office" text,
"party" text
) | nejat konuk and dervi ş ero ğ lu are from which party ? | SELECT "party" FROM table_203_694 WHERE "name" IN ('nejat konuk', 'dervis eroglu') | squall |
CREATE TABLE table_18600760_20 (
ansi_code VARCHAR,
latitude VARCHAR
) | How many ansi codes are there for longitude 46.415037? | SELECT COUNT(ansi_code) FROM table_18600760_20 WHERE latitude = "46.415037" | sql_create_context |
CREATE TABLE table_name_28 (
railway_number_s_ VARCHAR,
class VARCHAR
) | What's the railway number of a D(rebuild) class? | SELECT railway_number_s_ FROM table_name_28 WHERE class = "d(rebuild)" | sql_create_context |
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,
... | 出院时医疗就诊13686436304诊断的疾病编号与名称分别是什么? | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '13686436304' | css |
CREATE TABLE table_train_169 (
"id" int,
"leukocytes" int,
"hemoglobin_a1c_hba1c" float,
"urine_albumin_excretion" int,
"estimated_glomerular_filtration_rate_egfr" int,
"glucola_beverage_gct" int,
"age" float,
"NOUSE" float
) | screening egfr < 60 ml / min / 1.73 m2 | SELECT * FROM table_train_169 WHERE estimated_glomerular_filtration_rate_egfr < 60 | criteria2sql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | what is the name of the drug that patient 002-41152 has been prescribed two or more times last month? | 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 = '002... | eicu |
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... | 以往,患者71329181的门诊诊断结果怎么样? | SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '71329181' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AN... | css |
CREATE TABLE table_10468 (
"Independent" text,
"Lost" real,
"Tied" real,
"Pct." real,
"Years" real,
"Total Games" real
) | What is the average number lost when the PCT is more than 0.7334 and the total number of games is larger than 48? | SELECT AVG("Lost") FROM table_10468 WHERE "Pct." > '0.7334' AND "Total Games" > '48' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | how many times did patient 010-6098 since 128 months ago receive crystalloids? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-6098')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel... | eicu |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | how much does the minimum hospital cost including a procedure called hypotonic fluid administration - d5w until 1 year ago? | SELECT MIN(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'hypotonic fluid administration - d5w')) AND ... | eicu |
CREATE TABLE table_54361 (
"Candidate" text,
"Contributions" real,
"Loans Received" real,
"All Receipts" real,
"Operating Expenditures" real,
"All Disbursements" real
) | How much is the lowest Operating Expenditures when Contributions are more than 8,245,241? | SELECT MIN("Operating Expenditures") FROM table_54361 WHERE "Contributions" > '8,245,241' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE... | what is the daily maximum amount of the foley of patient 14458 during their first hospital visit? | SELECT MAX(outputevents.value) 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 = 14458 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND outputeven... | mimic_iii |
CREATE TABLE table_70723 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many gold medals does the country ranked higher than 2 with more than 8 bronze have? | SELECT SUM("Gold") FROM table_70723 WHERE "Rank" < '2' AND "Bronze" > '8' | wikisql |
CREATE TABLE table_203_873 (
id number,
"model name" text,
"length" text,
"width" text,
"height" text,
"riders" number,
"capacity" number,
"description" text,
"portable" text,
"notes" number
) | total number of models created . | SELECT COUNT(DISTINCT "model name") FROM table_203_873 | squall |
CREATE TABLE table_name_7 (
engine VARCHAR,
year INTEGER
) | Which engine has a Year larger than 1969? | SELECT engine FROM table_name_7 WHERE year > 1969 | sql_create_context |
CREATE TABLE table_53738 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team when the away team was Footscray? | SELECT "Home team" FROM table_53738 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE table_name_59 (
position VARCHAR,
years_for_jazz VARCHAR
) | Which position was active in Jazz in 2002-03? | SELECT position FROM table_name_59 WHERE years_for_jazz = "2002-03" | sql_create_context |
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... | on this month/27 what was the respiration minimum value of patient 005-87465? | SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND NOT vitalperiodic.respiration IS ... | eicu |
CREATE TABLE table_name_43 (
actor VARCHAR,
year VARCHAR
) | Which actor won in 1966? | SELECT actor FROM table_name_43 WHERE year = 1966 | 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 ... | 在2017-05-28之前,患者24453147有哪些门诊就诊的检验报告单?看一下门诊就诊的流水号 | 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.RYBH = '24453147' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2017-05-28' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | i would like the earliest morning flight from ATLANTA to PHILADELPHIA on wednesday morning | 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 = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = ... | atis |
CREATE TABLE table_3703 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | For outgoing manager is alberto malesani mention all the applicable replaced by person | SELECT "Replaced by" FROM table_3703 WHERE "Outgoing manager" = 'Alberto Malesani' | wikisql |
CREATE TABLE table_18703133_6 (
losses VARCHAR,
team VARCHAR
) | How many losses are there for team tembetary? | SELECT losses FROM table_18703133_6 WHERE team = "Tembetary" | sql_create_context |
CREATE TABLE table_1053802_1 (
main_presenters VARCHAR,
region_country VARCHAR
) | What is the main presenter of bulgaria? | SELECT main_presenters FROM table_1053802_1 WHERE region_country = "Bulgaria" | sql_create_context |
CREATE TABLE table_28715942_5 (
original_artist VARCHAR,
vocal_percussionist VARCHAR
) | What is the original artist when the vocal percussionist is Alexei Kalveks? | SELECT original_artist FROM table_28715942_5 WHERE vocal_percussionist = "Alexei Kalveks" | sql_create_context |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHA... | How many documents in different ending date? Return a line chart grouping by ending date. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To | nvbench |
CREATE TABLE table_name_27 (
total INTEGER,
gold VARCHAR,
bronze VARCHAR,
nation VARCHAR
) | What is the sum of all total medals with more than 2 bronze medals and more than 1 gold medal for the United States? | SELECT SUM(total) FROM table_name_27 WHERE bronze > 2 AND nation = "united states" AND gold > 1 | sql_create_context |
CREATE TABLE table_70472 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What was the winning score of the Buy.com Siouxland Open? | SELECT "Winning score" FROM table_70472 WHERE "Tournament" = 'buy.com siouxland open' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | Provide me the number of patients born before 1846 who have an abnormal lab test status. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1846" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_59768 (
"Year" real,
"Pick" text,
"Player" text,
"Position" text,
"Country" text,
"Previous team (League)" text
) | What is Country, when Previous Team (League) is 'Kingston Frontenacs ( OHL )', and when Player is 'Anthony Stewart Category:Articles with hCards'? | SELECT "Country" FROM table_59768 WHERE "Previous team (League)" = 'kingston frontenacs ( ohl )' AND "Player" = 'anthony stewart category:articles with hcards' | wikisql |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | Find the title and star rating of the movie that got the least rating star for each reviewer. | SELECT T2.title, T1.rid, T1.stars, MIN(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.rid | spider |
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
CREATE TABLE circulation_history (
document_id number,
draft_number number,
copy_number number,
employee_id number
)
CREATE TABLE documents (
document_id number,
document_status_code text,
... | List roles that have more than one employee. List the role description and number of employees. | SELECT roles.role_description, COUNT(employees.employee_id) FROM roles JOIN employees ON employees.role_code = roles.role_code GROUP BY employees.role_code HAVING COUNT(employees.employee_id) > 1 | spider |
CREATE TABLE table_66466 (
"Sport" text,
"Body" text,
"Year" text,
"Event type" text,
"Location" text,
"Nations" text
) | What nations participated in 2007? | SELECT "Nations" FROM table_66466 WHERE "Year" = '2007' | wikisql |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 患者13034482在2003年4月25日到2009年2月2日内曾在医院一共就诊多少次? | SELECT (SELECT COUNT(*) 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 = '13034482' AND wdmzjzjlb.JZKSRQ BETWEEN '2003-04-25' AND '2009-02-02' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjl... | css |
CREATE TABLE table_34550 (
"Rank" real,
"Country" text,
"International tourist arrivals (2012)" text,
"International tourist arrivals (2011)" text,
"Change (2011 to 2012)" text,
"Change (2010 to 2011)" text
) | How many tourists visited the country that had 2.5 million tourists in 2011? | SELECT "International tourist arrivals (2012)" FROM table_34550 WHERE "International tourist arrivals (2011)" = '2.5 million' | wikisql |
CREATE TABLE table_11219 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
) | What stage did team Carrera Jeans-Tassoni have when Mario Cipollini won and Claudio Chiappucci had the points? | SELECT "Stage" FROM table_11219 WHERE "Trofeo Fast Team" = 'carrera jeans-tassoni' AND "Winner" = 'mario cipollini' AND "Points classification" = 'claudio chiappucci' | wikisql |
CREATE TABLE table_27597 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Replaced by" text,
"Date of appointment" text
) | Name the replaced by for august 9 | SELECT "Replaced by" FROM table_27597 WHERE "Date of vacancy" = 'August 9' AND "Date of appointment" = 'August 9' | wikisql |
CREATE TABLE table_name_81 (
venue VARCHAR,
date VARCHAR
) | What venue was on 27 May 2000? | SELECT venue FROM table_name_81 WHERE date = "27 may 2000" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | has patient 029-584 ever had a medication prescribed the last year? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-584')) AND DATETIME(medication.drugstarttime, 'start of year') = DATET... | eicu |
CREATE TABLE table_9828 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"GPU frequency" text,
"L2 cache" text,
"I/O bus" text,
"Memory" text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" text
) | What is Socket, when Part Number(s) is au80610003495aa? | SELECT "Socket" FROM table_9828 WHERE "Part number(s)" = 'au80610003495aa' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | how many hours have passed since the patient 95057 was admitted to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 95057 AND admissions.dischtime IS NULL | mimic_iii |
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... | how many of the patients aged below 76 had migraine unspecified w/o ntrc mgrn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.short_title = "Migrne unsp wo ntrc mgrn" | mimicsql_data |
CREATE TABLE table_name_24 (
to_par VARCHAR,
year VARCHAR
) | Which To par has a Year of 1994? | SELECT to_par FROM table_name_24 WHERE year = 1994 | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | Draw a bar chart about the distribution of meter_700 and ID , and rank meter_700 in desc order. | SELECT meter_700, ID FROM swimmer ORDER BY meter_700 DESC | nvbench |
CREATE TABLE table_name_36 (
year VARCHAR,
championship VARCHAR
) | Which year was the peter jackson classic? | SELECT year FROM table_name_36 WHERE championship = "peter jackson classic" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | TOTAL number of SUCCESSFUL questions. | SELECT COUNT(DISTINCT p.Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL | sede |
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... | when did patient 19040 first get a procedure on their first hospital visit? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19040 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
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 are the procedures that are the top four most commonly received? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
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 diagnoses (
... | what is the number of patients whose gender is f and primary disease is st elevated myocardial infarction\cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
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... | give me the number of patients whose diagnoses short title is enterococcus group d? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Enterococcus group d" | mimicsql_data |
CREATE TABLE table_name_27 (
district VARCHAR,
constituency_number VARCHAR
) | What district has a constituency of 60? | SELECT district FROM table_name_27 WHERE constituency_number = "60" | sql_create_context |
CREATE TABLE table_14553 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | When were there less than 1 point with a cosworth v8 engine in jolly club switzerland? | SELECT "Year" FROM table_14553 WHERE "Points" < '1' AND "Engine" = 'cosworth v8' AND "Entrant" = 'jolly club switzerland' | wikisql |
CREATE TABLE table_20718 (
"Institution" text,
"Location" text,
"Team Nickname" text,
"Joined TSCHL" real,
"Home Arena" text,
"Capacity" real,
"Team Website" text
) | For the flyers, what's the minimum capacity? | SELECT MIN("Capacity") FROM table_20718 WHERE "Team Nickname" = 'Flyers' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | give the number of patients who are born before 2180 with a ivpca drug route. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2180" AND prescriptions.route = "IVPCA" | mimicsql_data |
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),
... | You can return a bar chart with employees' first names and their salaries, display by the y axis from high to low. | SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY DESC | nvbench |
CREATE TABLE table_23292220_17 (
scores VARCHAR,
seans_team VARCHAR
) | Name the scores for chris ramsey and carol vorderman | SELECT scores FROM table_23292220_17 WHERE seans_team = "Chris Ramsey and Carol Vorderman" | sql_create_context |
CREATE TABLE table_name_86 (
games VARCHAR,
tied VARCHAR
) | What is the number of games for the season with 10 ties? | SELECT games FROM table_name_86 WHERE tied = 10 | sql_create_context |
CREATE TABLE table_name_9 (
year VARCHAR,
event VARCHAR,
position VARCHAR
) | What year did she place 8th in the junior race? | SELECT year FROM table_name_9 WHERE event = "junior race" AND position = "8th" | sql_create_context |
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
color_code VARCHAR(15),
product_category_code VARCHAR(15),
product_name VARCHAR(80),
typical_buying_price VARCHAR(20),
... | A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and rank y-axis in ascending order. | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description) | nvbench |
CREATE TABLE table_56530 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings ($)" real,
"Money list rank" text
) | What is the smallest Earnings that has a Money list rank of 6 and Starts smaller than 22? | SELECT MIN("Earnings ($)") FROM table_56530 WHERE "Money list rank" = '6' AND "Starts" < '22' | wikisql |
CREATE TABLE table_8509 (
"White" text,
"Black" text,
"Year" real,
"Result" text,
"Moves" real,
"Tournament" text,
"Opening" text
) | What year had 32 moves? | SELECT SUM("Year") FROM table_8509 WHERE "Moves" = '32' | wikisql |
CREATE TABLE table_204_343 (
id number,
"nation" text,
"model" text,
"length" text,
"barrel length" text,
"weight" text
) | how long was the m1894 rifle 's barrel ? | SELECT "barrel length" FROM table_204_343 WHERE "model" = 'm1894 rifle' | squall |
CREATE TABLE table_name_65 (
att INTEGER,
yards VARCHAR,
long VARCHAR
) | How many Atts that have Yards of 43 and a Long larger than 43? | SELECT SUM(att) FROM table_name_65 WHERE yards = 43 AND long > 43 | sql_create_context |
CREATE TABLE table_25220821_4 (
mon_31_may VARCHAR,
rank VARCHAR
) | How many times are listed for 31 May for the rider ranked 5? | SELECT COUNT(mon_31_may) FROM table_25220821_4 WHERE rank = 5 | sql_create_context |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CR... | Plot how many name by grouped by name as a bar graph, and sort by the total number in descending. | SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE table_56316 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which constructor has a Time/Retired of +37.311? | SELECT "Constructor" FROM table_56316 WHERE "Time/Retired" = '+37.311' | wikisql |
CREATE TABLE table_name_91 (
tournament VARCHAR
) | What is the 2007 result when the 2010 result was 2r, at the US Open? | SELECT 2007 FROM table_name_91 WHERE 2010 = "2r" AND tournament = "us open" | sql_create_context |
CREATE TABLE table_22277 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
) | when does the train arriving at bourne at 11.45 departure | SELECT "Departure" FROM table_22277 WHERE "Going to" = 'Bourne' AND "Arrival" = '11.45' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | Users with close-vote privileges ordered by last access date.. | SELECT ROW_NUMBER() OVER (ORDER BY LastAccessDate DESC) AS " ", Id AS "user_link", LastAccessDate FROM Users WHERE Reputation > 3000 ORDER BY LastAccessDate DESC | sede |
CREATE TABLE table_name_58 (
time_retired VARCHAR,
grid VARCHAR,
driver VARCHAR
) | Which Time/Retired has a Grid smaller than 3, and a Driver of mika h kkinen? | SELECT time_retired FROM table_name_58 WHERE grid < 3 AND driver = "mika häkkinen" | sql_create_context |
CREATE TABLE table_name_4 (
attendance INTEGER,
date VARCHAR
) | What was the higest attendance on November 9, 1958? | SELECT MAX(attendance) FROM table_name_4 WHERE date = "november 9, 1958" | sql_create_context |
CREATE TABLE table_78521 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | How many losses did the team with 22 goals for andmore than 8 games played have? | SELECT COUNT("Losses") FROM table_78521 WHERE "Goals For" = '22' AND "Games Played" > '8' | wikisql |
CREATE TABLE table_2930244_3 (
number_of_major_hurricanes INTEGER
) | What is the largest overall number of major hurricanes? | SELECT MAX(number_of_major_hurricanes) FROM table_2930244_3 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose primary disease is morbid obesity/sda and drug name is soln.? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND prescriptions.drug = "Soln." | mimicsql_data |
CREATE TABLE table_41531 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" text,
"Province / Club" text
) | What is Position, when Caps is Example, and When Player is Shane Kelly? | SELECT "Position" FROM table_41531 WHERE "Caps" = 'example' AND "Player" = 'shane kelly' | 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,
... | 看看患者水葛菲从2016.4.26到2019.12.28这期间,曾就诊过多少位医生 | 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.person_info_XM = '水葛菲' AND mzjzjlb.JZKSRQ BETWEEN '2016-04-26' AND '2019-12-28' | css |
CREATE TABLE table_name_97 (
proto_austronesian VARCHAR,
proto_oceanic VARCHAR
) | Which Proto-Austronesian has a Proto-Oceanic of *lima? | SELECT proto_austronesian FROM table_name_97 WHERE proto_oceanic = "*lima" | sql_create_context |
CREATE TABLE table_60349 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Away team at the Wolverhampton Wanderers Home game with a Score of 2 0? | SELECT "Away team" FROM table_60349 WHERE "Score" = '2–0' AND "Home team" = 'wolverhampton wanderers' | wikisql |
CREATE TABLE table_name_19 (
res VARCHAR,
opponent VARCHAR
) | The match against Oleg Taktarov had what result? | SELECT res FROM table_name_19 WHERE opponent = "oleg taktarov" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | what is the four most frequently ordered procedure for a patient with an age 40s? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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,
... | 找出医院5086789开出的检验报告单上的日期为13年2月9号到15年6月7号的,把不一样的检测指标名称和不一样的检测指标结果定量单位选出来,把检测指标结果定量平均后的最大的12项都多少? | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '5086789' AND jyjgzbb.BGRQ BETWEEN '2013-02-09' AND '2015-06... | css |
CREATE TABLE table_55779 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Driver" text,
"Rounds" text
) | What was the featured in Engine through rounds 10-13? | SELECT "Engine" FROM table_55779 WHERE "Rounds" = '10-13' | wikisql |
CREATE TABLE table_67113 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
) | What was Laurel's division record? | SELECT "Division Record" FROM table_67113 WHERE "School" = 'laurel' | wikisql |
CREATE TABLE table_name_91 (
games INTEGER,
name VARCHAR,
points VARCHAR
) | What is the lowest Games, when Name is Jeremiah Massey, and when Points is less than 340? | SELECT MIN(games) FROM table_name_91 WHERE name = "jeremiah massey" AND points < 340 | sql_create_context |
CREATE TABLE table_30030227_1 (
written_by VARCHAR,
directed_by VARCHAR
) | How many people wrote the episode directed by Arvin Brown? | SELECT COUNT(written_by) FROM table_30030227_1 WHERE directed_by = "Arvin Brown" | sql_create_context |
CREATE TABLE table_70406 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | How many years was ensign n180b a Chassis with 4 points? | SELECT SUM("Year") FROM table_70406 WHERE "Points" = '4' AND "Chassis" = 'ensign n180b' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | among patients who were diagnosed with routine circumcision during a year before, what are the top three most frequent procedures that followed afterwards within 2 months? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_75827 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Home" text,
"Away" text,
"Series" text
) | Which Opponent has an Away of 1 1, and a Home of 3 3? | SELECT "Opponent" FROM table_75827 WHERE "Away" = '1–1' AND "Home" = '3–3' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is marital status and primary disease of subject id 74032? | SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "74032" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.