context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_6685 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the average pick # of the player from round 11? | SELECT AVG("Pick #") FROM table_6685 WHERE "Round" = '11' | wikisql |
CREATE TABLE table_2970978_1 (
ave_attendance INTEGER,
___ave_on_prev_season VARCHAR
) | What is the least value for average attendance when average on previous season is +644? | SELECT MIN(ave_attendance) FROM table_2970978_1 WHERE ___ave_on_prev_season = "+644" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | give me the number of patients with diagnoses icd9 code 28522 who were discharged dead/expired. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND diagnoses.icd9_code = "28522" | mimicsql_data |
CREATE TABLE table_26460435_8 (
monarch VARCHAR,
heir VARCHAR
) | Who is the monarch with the heir thado minsaw? | SELECT monarch FROM table_26460435_8 WHERE heir = "Thado Minsaw" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id num... | what were the four most frequent output events until 2101? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) <= '2101' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE table_26375386_23 (
result VARCHAR,
total VARCHAR
) | What was the result for the total of 12? | SELECT result FROM table_26375386_23 WHERE total = 12 | sql_create_context |
CREATE TABLE diagnoses (
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,
... | how many patients whose ethnicity is hispanic/latino - puerto rican and diagnoses long title is orthostatic hypotension? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Orthostatic hypotension" | mimicsql_data |
CREATE TABLE table_name_49 (
class VARCHAR,
frequency_mhz INTEGER
) | What class is assigned to frequencies lower than 90.5? | SELECT class FROM table_name_49 WHERE frequency_mhz < 90.5 | sql_create_context |
CREATE TABLE table_7237 (
"Name" text,
"Japanese" text,
"Population ( 2012 )" real,
"Date of designation" text,
"Region" text,
"Prefecture" text
) | What Japanese prefecture has Ibaraki, Tsukuba? | SELECT "Japanese" FROM table_7237 WHERE "Prefecture" = 'ibaraki' AND "Name" = 'tsukuba' | wikisql |
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
date_of_notes DATETIME,
text_of_notes VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TAB... | Show me about the distribution of date_address_to and the sum of monthly_rental bin date_address_to by weekday in a bar chart. | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is primary disease of subject name hector blair? | SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Hector Blair" | mimicsql_data |
CREATE TABLE table_name_95 (
round INTEGER,
record VARCHAR
) | What is the smallest round to have a record of 4-0? | SELECT MIN(round) FROM table_name_95 WHERE record = "4-0" | sql_create_context |
CREATE TABLE table_name_1 (
coach VARCHAR,
captain VARCHAR
) | Which coach works with Robert Harvey? | SELECT coach FROM table_name_1 WHERE captain = "robert harvey" | sql_create_context |
CREATE TABLE table_203_35 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
) | how many riders were faster than massimo ottobre ? | SELECT COUNT("rider") FROM table_203_35 WHERE "points" > (SELECT "points" FROM table_203_35 WHERE "rider" = 'massimo ottobre') | squall |
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,
... | 在检验报告单70540908797的上面都有哪些检验项目,它们的名称还有代码都是什么? | SELECT zyjybgb.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '70540908797' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '70540908797' | css |
CREATE TABLE table_name_16 (
opponent VARCHAR,
surface VARCHAR,
date VARCHAR
) | Who played on clay on 3 march 2012? | SELECT opponent FROM table_name_16 WHERE surface = "clay" AND date = "3 march 2012" | sql_create_context |
CREATE TABLE table_19753 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Jockey" text,
"Winner/2nd" text
) | How many different jockeys ran on 17 Feb 2007? | SELECT COUNT("Jockey") FROM table_19753 WHERE "Date" = '17 Feb 2007' | wikisql |
CREATE TABLE assignedto (
scientist number,
project text
)
CREATE TABLE scientists (
ssn number,
name text
)
CREATE TABLE projects (
code text,
name text,
hours number
) | What is the name of the project with the most hours? | SELECT name FROM projects ORDER BY hours DESC LIMIT 1 | spider |
CREATE TABLE table_4898 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people watch an away team score 6.9 (45)? | SELECT AVG("Crowd") FROM table_4898 WHERE "Away team score" = '6.9 (45)' | wikisql |
CREATE TABLE table_2649597_1 (
finish VARCHAR,
start VARCHAR
) | Where did he finish when he started at 21.6? | SELECT COUNT(finish) FROM table_2649597_1 WHERE start = "21.6" | sql_create_context |
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(... | List the number of engineers and group by other details in a pie chart. | SELECT other_details, COUNT(other_details) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY other_details | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | 从08年5月22日起到08年11月21日患者54662739的所有检验结果指标记录中的检测方法可以提供一下吗? | (SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE LOCATIONS (
Address VARCHAR,
Location_Name VARCHAR
) | What is the address of the location 'UK Gallery'? | SELECT Address FROM LOCATIONS WHERE Location_Name = "UK Gallery" | sql_create_context |
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 job_history (
EMPLOYEE_ID decimal(6,0... | For those employees who was hired before 2002-06-21, give me the comparison about the average of salary over the hire_date bin hire_date by time. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_49779 (
"Year" real,
"Series" text,
"Make" text,
"Driver" text,
"Team" text,
"Schedule" text,
"Role" text
) | what is the team when the make is dodge and the year is after 2008? | SELECT "Team" FROM table_49779 WHERE "Make" = 'dodge' AND "Year" > '2008' | wikisql |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | Group by the result and count them by a bar chart, rank from low to high by the Y. | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) | nvbench |
CREATE TABLE table_name_41 (
weight VARCHAR,
denomination VARCHAR
) | What is the weight with a denomination that is three paise? | SELECT weight FROM table_name_41 WHERE denomination = "three paise" | sql_create_context |
CREATE TABLE table_26693 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | How many times was the date of vacancy 14 february 2011? | SELECT COUNT("Position in table") FROM table_26693 WHERE "Date of vacancy" = '14 February 2011' | 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... | 序列号31931776的参保人住院整数金额次数有多少次? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '31931776' AND gwyjzb.CLINIC_TYPE = '住院' AND MOD(gwyjzb.MED_AMOUT, 1) = 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31931776' AND fgwyjzb.CLINIC_TYPE = '住院' AND MOD(fgwyjzb.MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_6021 (
"Rank" real,
"Rider" text,
"Manufacturer" text,
"Points" real,
"Wins" real
) | Points larger than 108, and a Wins of 0, and a Rank smaller than 8, and a Manufacturer of honda is what rider? | SELECT "Rider" FROM table_6021 WHERE "Points" > '108' AND "Wins" = '0' AND "Rank" < '8' AND "Manufacturer" = 'honda' | wikisql |
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 prescription... | How many female patients are with lab test name creatinine kinase (ck)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Creatine Kinase (CK)" | mimicsql_data |
CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
) | what is the total number of polls published by the company gis xxi ? | SELECT COUNT(*) FROM table_204_639 WHERE "poll company" = 'gis xxi' | squall |
CREATE TABLE Staff (
staff_id INTEGER,
staff_first_name VARCHAR(80),
staff_last_name VARCHAR(80),
other_staff_details VARCHAR(255)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_rep... | Find all dates of the logs for the problem whose id is 10, show me a bar chart that bins the dates into the weekday interval, and counts the dates, and I want to show from high to low by the y axis. | SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) DESC | nvbench |
CREATE TABLE table_49279 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What is the score of the game on December 22? | SELECT "Score" FROM table_49279 WHERE "Date" = 'december 22' | wikisql |
CREATE TABLE table_dev_14 (
"id" int,
"anemia" bool,
"pulmonary_disease" bool,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"cardiovascular_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_c_peptide" float,
"organ_failure" b... | significant organ system dysfunction ( e.g., clinically significant pulmonary or cardiovascular disease, anemia [hemoglobin < 10 g / dl], known hemoglobinopathies, and renal dysfunction [egfr < 60 ml / min] ) ; | SELECT * FROM table_dev_14 WHERE organ_failure = 1 OR pulmonary_disease = 1 OR cardiovascular_disease = 1 OR anemia = 1 OR hemoglobin_a1c_hba1c < 10 OR renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 60 | criteria2sql |
CREATE TABLE table_name_57 (
time VARCHAR,
nation VARCHAR,
race VARCHAR
) | What is the time of the peachtree road race in kenya? | SELECT time FROM table_name_57 WHERE nation = "kenya" AND race = "peachtree road race" | sql_create_context |
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 year of birth is less than 2175 and procedure icd9 code is 9915? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2175" AND procedures.icd9_code = "9915" | mimicsql_data |
CREATE TABLE table_50602 (
"Oklahoma vs." text,
"Overall Record" text,
"at Norman" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"Since Beginning of Big 12" text
) | What is Oklahoma vs. when Current Streak is l 1, and Neutral Site is osu, 7-6? | SELECT "Oklahoma vs." FROM table_50602 WHERE "Current Streak" = 'l 1' AND "at Neutral Site" = 'osu, 7-6' | wikisql |
CREATE TABLE table_name_42 (
pick INTEGER,
player VARCHAR
) | Which pick was MIchael Holper? | SELECT MIN(pick) FROM table_name_42 WHERE player = "michael holper" | sql_create_context |
CREATE TABLE table_name_46 (
player VARCHAR,
total VARCHAR
) | What player has a total of 290 points? | SELECT player FROM table_name_46 WHERE total = 290 | sql_create_context |
CREATE TABLE table_46121 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Lowest pick for mike flater? | SELECT MIN("Pick") FROM table_46121 WHERE "Name" = 'mike flater' | wikisql |
CREATE TABLE table_name_20 (
film_title_used_in_nomination VARCHAR,
original_title VARCHAR
) | What title was used in the nomination of Una Giornata Particolare? | SELECT film_title_used_in_nomination FROM table_name_20 WHERE original_title = "una giornata particolare" | sql_create_context |
CREATE TABLE table_2117 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real,
"Left" real,
"Current Conference" text
) | Which conference has the nickname Chargers? | SELECT "Current Conference" FROM table_2117 WHERE "Nickname" = 'Chargers' | wikisql |
CREATE TABLE table_name_65 (
margin_of_victory VARCHAR,
tournament VARCHAR
) | What was the margin of victory at the LPGA Championship? | SELECT margin_of_victory FROM table_name_65 WHERE tournament = "lpga championship" | sql_create_context |
CREATE TABLE table_43276 (
"element" text,
"group" real,
"period" real,
"reaction" text,
"potential" text
) | Which highest period's element is platinum? | SELECT MAX("period") FROM table_43276 WHERE "element" = 'platinum' | wikisql |
CREATE TABLE table_28941 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Name the district for john randolph (dr) | SELECT "District" FROM table_28941 WHERE "Candidates" = 'John Randolph (DR)' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | 列出患者42321223入院科室名称包含与的有哪些住院就诊记录在医院7925513中? | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '42321223' AND hz_info.YLJGDM = '7925513' AND zyjzjlb.JZKSMC LIKE '%与%' | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 number,
itemid... | tell me the variation in weight of patient 22449 second measured on the last hospital visit compared to the value first measured on the last hospital visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22449 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... | mimic_iii |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR... | Show me a bar chart for how many faculty members does each building have? List the result with the name of the building, show from high to low by the x-axis. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC | nvbench |
CREATE TABLE table_10566855_1 (
runner_up VARCHAR,
premier VARCHAR
) | who are all the runner-up for premier in richmond | SELECT runner_up FROM table_10566855_1 WHERE premier = "Richmond" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | what was the medication that patient 035-2057 was prescribed for the first time through the iv push route in 09/this year? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2057')) AND medication.routeadmin = 'iv push' AND DATETIME(medi... | eicu |
CREATE TABLE table_18912 (
"Cost" text,
"2400 kWh/kWp\u2022y" text,
"2200 kWh/kWp\u2022y" text,
"2000 kWh/kWp\u2022y" text,
"1800 kWh/kWp\u2022y" text,
"1600 kWh/kWp\u2022y" text,
"1400 kWh/kWp\u2022y" text,
"1200 kWh/kWp\u2022y" text,
"1000 kWh/kWp\u2022y" text,
"800 kWh/kWp\u20... | At the rate where 1000 kwh/kwp y is 26.0, what is the value of 1600 kwh/kwp y? | SELECT "1600 kWh/kWp\u2022y" FROM table_18912 WHERE "1000 kWh/kWp\u2022y" = '26.0' | wikisql |
CREATE TABLE table_46612 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | What is the Part 3 when the Verb meaning is to gather? | SELECT "Part 3" FROM table_46612 WHERE "Verb meaning" = 'to gather' | wikisql |
CREATE TABLE table_name_62 (
american VARCHAR,
british VARCHAR
) | Which American has British of m? | SELECT american FROM table_name_62 WHERE british = "ɛm" | sql_create_context |
CREATE TABLE table_1137718_2 (
winning_driver VARCHAR,
date VARCHAR
) | Who was the winning driver on 13 August? | SELECT winning_driver FROM table_1137718_2 WHERE date = "13 August" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 有哪些人审核超过13份检验报告单在医疗就诊71249027132中?列出这些审核人工号和姓名分别是? | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '71249027132' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 13 | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | what are the five most frequently given lab tests for patients who had previously received systemic antibiotics - metronidazole within the same hospital visit? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'systemic antibiot... | 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 (
... | provide the number of patients whose marital status is married and procedure long title is percutaneous (endoscopic) jejunostomy [pej]? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]" | mimicsql_data |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar... | what nonstop flights are available from OAKLAND to PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTS... | atis |
CREATE TABLE table_17260 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage (Proof)" text,
"Issue Price (Proof)" text,
"Mintage (BU)[ clarification needed ]" text,
"Issue Price (BU)[ clarification needed ]" text
) | What is the year that the issue price (bu) is $26.95? | SELECT "Year" FROM table_17260 WHERE "Issue Price (BU)[ clarification needed ]" = '$26.95' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | tell me the last test that patient 29806 had received on their first hospital visit? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DE... | mimic_iii |
CREATE TABLE table_73554 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | How many directed by have 2.80 as u.s. viewers (in millions)? | SELECT COUNT("Directed by") FROM table_73554 WHERE "U.S. viewers (in millions)" = '2.80' | 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 mzjzjlb_jybgb (
YLJGDM_MZJZJLB te... | 看看19年12月9号到20年6月11号9038216这个医疗机构特需门诊的就诊记录 | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '9038216' AND mzjzjlb.JZKSRQ BETWEEN '2019-12-09' AND '2020-06-11' AND mzjzjlb.TXBZ > 0 | css |
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 age and gender of subject id 31066? | SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.subject_id = "31066" | mimicsql_data |
CREATE TABLE table_15537 (
"Call Sign" text,
"City of License" text,
"Frequency" text,
"age Watt" text,
"Coverage Area" text,
"Founded" text
) | Name the city of license for when founded is october 2010 | SELECT "City of License" FROM table_15537 WHERE "Founded" = 'october 2010' | wikisql |
CREATE TABLE table_name_8 (
iata VARCHAR,
airport VARCHAR
) | What is the IATA of Madrid-Barajas Airport? | SELECT iata FROM table_name_8 WHERE airport = "madrid-barajas airport" | sql_create_context |
CREATE TABLE table_name_51 (
place VARCHAR,
score VARCHAR,
player VARCHAR
) | What place has a score greater than 68, and camilo villegas as the player? | SELECT place FROM table_name_51 WHERE score > 68 AND player = "camilo villegas" | sql_create_context |
CREATE TABLE table_name_8 (
attendance INTEGER,
season VARCHAR,
premiership VARCHAR,
runner_up VARCHAR
) | If the season is before 2000, the runner up was north melbourne, and it's the pre-season cup, what's the sum of attendees? | SELECT SUM(attendance) FROM table_name_8 WHERE premiership = "pre-season cup" AND runner_up = "north melbourne" AND season < 2000 | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what are the four most commonly given lab tests for patients of age 20s until 2103? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND STRFTIME('%y', labevents.c... | mimic_iii |
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,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm... | when was patient 7375's first discharge until 2100 from the hospital? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 7375 AND STRFTIME('%y', admissions.dischtime) <= '2100' ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE table_20944 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
) | Who was the winning driver at Okayama International Circuit? | SELECT "Winning Driver" FROM table_20944 WHERE "Circuit" = 'Okayama International Circuit' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
... | since 1 year ago what are the four most frequently given procedures for patients 20s? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE table_name_33 (
away_team VARCHAR,
score VARCHAR,
home_team VARCHAR
) | What is the Away team at the Wolverhampton Wanderers Home game with a Score of 2 0? | SELECT away_team FROM table_name_33 WHERE score = "2–0" AND home_team = "wolverhampton wanderers" | sql_create_context |
CREATE TABLE table_22050544_1 (
winner VARCHAR,
event__number VARCHAR
) | What is the winner in event number 15h? | SELECT winner FROM table_22050544_1 WHERE event__number = "15H" | sql_create_context |
CREATE TABLE staff (
staff_id number,
staff_first_name text,
staff_last_name text,
other_staff_details text
)
CREATE TABLE problem_status_codes (
problem_status_code text,
problem_status_description text
)
CREATE TABLE problems (
problem_id number,
product_id number,
closure_author... | Which problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems. | SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_las... | spider |
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,
... | what number of patients with elective admission type had procedure title (aorto)coronary bypass of three coronary arteries? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" | mimicsql_data |
CREATE TABLE table_33081 (
"sliding tackle" text,
"spear tackle" text,
"dump tackle" text,
"body tackle" text,
"ankle tap" text,
"diving tackle" text,
"bumping/blocking" text,
"shoulder charge" text,
"steal/intercept ball" text,
"Chicken wing" text
) | Which steal/intercept ball has no for both the sliding tackle and dump tackle? | SELECT "steal/intercept ball" FROM table_33081 WHERE "sliding tackle" = 'no' AND "dump tackle" = 'no' | wikisql |
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
)
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
) | List the time of elimination of the wrestlers with largest days held. | SELECT T1.time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.wrestler_id = T2.wrestler_id ORDER BY T2.days_held DESC LIMIT 1 | spider |
CREATE TABLE table_27539272_5 (
points INTEGER
) | what is the maximum number of points? | SELECT MAX(points) FROM table_27539272_5 | sql_create_context |
CREATE TABLE table_30265 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position was the player who was drafted by Edmonton? | SELECT "Position" FROM table_30265 WHERE "CFL Team" = 'Edmonton' | wikisql |
CREATE TABLE table_57805 (
"Annual ridership (2012)" real,
"Rider. per mile" real,
"Opened" real,
"Stations" real,
"Lines" real
) | Which station has 3,871 riders per mile, and an annual ridership in 2012 of larger than 15,399,400? | SELECT MAX("Stations") FROM table_57805 WHERE "Rider. per mile" = '3,871' AND "Annual ridership (2012)" > '15,399,400' | wikisql |
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... | Calculate the minimum age of patients admitted to emergency who died before 2154? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2154.0" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | what is the organism that was detected in patient 031-23724's first blood, venipuncture microbiology test in 08/2104? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND STRFTIM... | eicu |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is procedure icd9 code and drug type of subject id 18480? | SELECT procedures.icd9_code, prescriptions.drug_type FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "18480" | mimicsql_data |
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,
... | how many patients was diagnosed with change in mental status during the same hospital visit after being diagnosed with hematological effect of infection - leukocytosis in this year? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND DATETIME(diagnosis.diagnosistime, 'start of ... | eicu |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges Show bar chart, and sort by the Y-axis in desc please. | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr DESC | nvbench |
CREATE TABLE table_name_74 (
away_team VARCHAR,
home_team VARCHAR
) | I want to see the away team the has a home team of richmond | SELECT away_team FROM table_name_74 WHERE home_team = "richmond" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the email , and display y-axis in ascending order. | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY | nvbench |
CREATE TABLE table_name_72 (
water_park VARCHAR,
rank VARCHAR
) | what is the water park with the rank 20? | SELECT water_park FROM table_name_72 WHERE rank = 20 | sql_create_context |
CREATE TABLE table_63462 (
"Team" text,
"Location" text,
"County" text,
"Division" text,
"Home ground" text,
"Coach" text,
"Captain" text
) | Which team is located in Leicester? | SELECT "Team" FROM table_63462 WHERE "Location" = 'leicester' | wikisql |
CREATE TABLE table_8634 (
"Place" real,
"Star" text,
"Average" real,
"Best score" real,
"Worst score" real
) | WHAT IS THE HIGHEST PLACE AND BEST SCORE BIGGER THAN 10? | SELECT MAX("Place") FROM table_8634 WHERE "Best score" > '10' | wikisql |
CREATE TABLE table_14219514_2 (
home__2nd_leg_ VARCHAR,
home__1st_leg_ VARCHAR
) | When belgrano is the home (1st leg) what is the home (2nd leg)? | SELECT home__2nd_leg_ FROM table_14219514_2 WHERE home__1st_leg_ = "Belgrano" | sql_create_context |
CREATE TABLE table_23018775_3 (
lap_two VARCHAR,
name VARCHAR
) | How many lap two's did marco andretti do? | SELECT COUNT(lap_two) FROM table_23018775_3 WHERE name = "Marco Andretti" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | when was the last hospital admission that patient 035-4428 was admitted to via the floor since 2 years ago? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '035-4428' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_54992 (
"Year" real,
"English title" text,
"Korean title" text,
"Romanization" text,
"Role" text,
"Director" text
) | What is the Romanization for my old sweetheart? | SELECT "Romanization" FROM table_54992 WHERE "English title" = 'my old sweetheart' | wikisql |
CREATE TABLE table_name_61 (
opponents_in_the_final VARCHAR,
surface VARCHAR,
tournament VARCHAR
) | What is Opponents In The Final, when Surface is 'Carpet', and when Tournament is 'Milan , Italy'? | SELECT opponents_in_the_final FROM table_name_61 WHERE surface = "carpet" AND tournament = "milan , italy" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在01年11月20日到2018年6月28日内,病患戚文栋自费金额高于7007.75元的药品量一共有多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '戚文栋' AND t_kc22.STA_DATE BETWEEN '2001-11-20' AND '2018-06-28' AND t_kc22.SELF_PAY_AMO > 7007.75 | css |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | Show me a scatter plot of mid and mean stars for . | SELECT mID, AVG(stars) FROM Rating GROUP BY mID | nvbench |
CREATE TABLE procedures (
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
)
... | how many patients have admitted before the year 2112 with 51026 as their item id? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2112" AND lab.itemid = "51026" | mimicsql_data |
CREATE TABLE table_19101 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many points were made when the tries for was 83? | SELECT "Points" FROM table_19101 WHERE "Tries for" = '83' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.