context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_14728 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What is the result for 23,24,25,26 july 1992? | SELECT "Result" FROM table_14728 WHERE "Date" = '23,24,25,26 july 1992' | 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 diagnoses (
... | give me the number of patients whose diagnoses long title is long-term (current) use of insulin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Long-term (current) use of insulin" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | how many patients were diagnosed with aids - cd4 < 100 in the same month after they were first diagnosed with cardiac arrest, in 2105? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'aids - cd4 < 100' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_name_69 (
away_team VARCHAR,
crowd INTEGER
) | What away team played when the crowd was over 27,463 people? | SELECT away_team FROM table_name_69 WHERE crowd > 27 OFFSET 463 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | Calculate the average age of unmarried patients admitted in or after the year 2154 | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear >= "2154" | mimicsql_data |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | is there a direct flight from DENVER to PITTSBURGH in the morning of 8 31 that is nonstop | 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 = 'PITTSBURGH' AND date_day.day_number = 31 AND date_day.month_number = 8... | atis |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | calculate the number of patients with emergency hospital admission categorized under blood gas lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_name_15 (
draws INTEGER,
wins VARCHAR,
byes VARCHAR
) | Can you tell me the sum of Draws that had the Wins smaller than 3, and the Byes larger than 2? | SELECT SUM(draws) FROM table_name_15 WHERE wins < 3 AND byes > 2 | sql_create_context |
CREATE TABLE table_name_54 (
code VARCHAR,
place VARCHAR
) | What is the total code number for Amadiba? | SELECT COUNT(code) FROM table_name_54 WHERE place = "amadiba" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, find headquarter and the average of code , and group by attribute headquarter, and visualize them by a bar chart, order by the X in asc. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter | nvbench |
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... | find the gender of subject id 2110 and what type of insurance he has? | SELECT demographic.gender, demographic.insurance FROM demographic WHERE demographic.subject_id = "2110" | mimicsql_data |
CREATE TABLE table_name_96 (
second VARCHAR,
third VARCHAR
) | What is the name of the second who has Caroline Reed as third? | SELECT second FROM table_name_96 WHERE third = "caroline reed" | sql_create_context |
CREATE TABLE table_name_7 (
result VARCHAR,
score VARCHAR,
goal VARCHAR
) | Which Result has a Score of 1 0, and a Goal of 16? | SELECT result FROM table_name_7 WHERE score = "1–0" AND goal = 16 | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTyp... | Top users by City. | SELECT Id, Reputation, DisplayName, Location FROM Users WHERE LOWER(Location) LIKE LOWER('%##city##%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_204_793 (
id number,
"call-sign" text,
"location" text,
"rf" number,
"psip" number,
"programming" text
) | which location has more stations , loudonville or newcomerstown ? | SELECT "location" FROM table_204_793 WHERE "location" IN ('loudonville', 'newcomerstown') GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
X... | 这个被门诊诊断为脑梗死后遗症的病人朱文彬,查询他做的罗马指数(绝经前)的检测结果定量及单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE table_name_89 (
date VARCHAR,
loss VARCHAR
) | What was the date of the game that had a loss of lidle (10-8)? | SELECT date FROM table_name_89 WHERE loss = "lidle (10-8)" | sql_create_context |
CREATE TABLE table_22297140_3 (
manner_of_departure VARCHAR,
team VARCHAR
) | What was the manner of leaving the team for the manager of Gostaresh Foolad? | SELECT manner_of_departure FROM table_22297140_3 WHERE team = "Gostaresh Foolad" | sql_create_context |
CREATE TABLE table_name_98 (
result VARCHAR,
method VARCHAR
) | What is the result of the fight that had a tko (low kicks)? | SELECT result FROM table_name_98 WHERE method = "tko (low kicks)" | sql_create_context |
CREATE TABLE gwyjzb (
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,
... | 在05年2月3日到15年9月8日期间医院8966457的科室065收取的医疗费总额是多少? | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8966457' AND gwyjzb.MED_ORG_DEPT_CD = '065' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8966457' AND fgwyjzb.MED_ORG_DEPT_CD = '065') AND t_k... | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
... | people with highest answer count. | SELECT Users.DisplayName, COUNT(Posts.Id) AS "cnt" FROM Users, Posts WHERE OwnerUserId = Users.Id AND PostTypeId = 2 GROUP BY Users.DisplayName ORDER BY cnt DESC LIMIT 25 | sede |
CREATE TABLE table_name_36 (
material_or_non_material VARCHAR,
opponents VARCHAR,
positional_or_automatic VARCHAR,
count_rectified VARCHAR
) | What is the designation of material or non-material for either positional or automatic with no rectified count and either opponent? | SELECT material_or_non_material FROM table_name_36 WHERE positional_or_automatic = "either" AND count_rectified = "no" AND opponents = "either" | sql_create_context |
CREATE TABLE table_name_51 (
q1 VARCHAR,
q2_time VARCHAR,
q1_time VARCHAR
) | What is the Q1+Q2 time for the driver whose Q1 time was 1:14.819, ? | SELECT q1 + q2_time FROM table_name_51 WHERE q1_time = "1:14.819" | sql_create_context |
CREATE TABLE table_48463 (
"Pick" real,
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"NBA years [a ]" text,
"Career with the franchise [b ]" text
) | What is the pick for the player with 2 years in the NBA and who plays for the Utah Jazz? | SELECT "Pick" FROM table_48463 WHERE "NBA years [a ]" = '2' AND "Previous team" = 'utah jazz' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients aged below 70 years had an urgent admission type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.age < "70" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose admission type is elective and lab test name is epithelial cells? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Epithelial Cells" | mimicsql_data |
CREATE TABLE table_name_74 (
jockey VARCHAR,
horse VARCHAR
) | What is Jockey, when Horse is 'Eight Belles'? | SELECT jockey FROM table_name_74 WHERE horse = "eight belles" | sql_create_context |
CREATE TABLE table_13663434_1 (
title_and_source VARCHAR,
pal__295_ VARCHAR,
jp__210_ VARCHAR
) | how many title and source with pal -295- being yes and jp -210- being yes | SELECT COUNT(title_and_source) FROM table_13663434_1 WHERE pal__295_ = "Yes" AND jp__210_ = "Yes" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | when was first time patient 006-158338 was measured with a respiration greater than 0.0 since 4 days ago? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338')) AND vitalperiodic.respiration > 0.0 A... | eicu |
CREATE TABLE table_40612 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text
) | What is Name, when Authors are Kammerer & Sidor? | SELECT "Name" FROM table_40612 WHERE "Authors" = 'kammerer & sidor' | wikisql |
CREATE TABLE table_8454 (
"Player" text,
"Team" text,
"Matches" real,
"Wickets" real,
"Average" real,
"Best Bowling" text
) | what is the sum of matches when the player is jim laker and wikets is less than 9? | SELECT SUM("Matches") FROM table_8454 WHERE "Player" = 'jim laker' AND "Wickets" < '9' | wikisql |
CREATE TABLE table_name_87 (
matches INTEGER,
s_rate VARCHAR,
balls VARCHAR,
average VARCHAR
) | How many Matches have Balls smaller than 224, and an Average larger than 38.25, and an S/Rate larger than 139.09? | SELECT SUM(matches) FROM table_name_87 WHERE balls < 224 AND average > 38.25 AND s_rate > 139.09 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients under diagnosed under icd9 code 5789 had po/ng as drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "5789" AND prescriptions.route = "PO/NG" | mimicsql_data |
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
) | which model has the higher capacity , skater or surf 's up ? | SELECT "model name" FROM table_203_873 WHERE "model name" IN ('skater', "surf's up") ORDER BY "capacity" DESC LIMIT 1 | squall |
CREATE TABLE table_18657 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What candidate is in Louisiana 6? | SELECT "Candidates" FROM table_18657 WHERE "District" = 'Louisiana 6' | wikisql |
CREATE TABLE table_18821196_1 (
tv_network_s_ VARCHAR,
weekly_schedule VARCHAR
) | What is every TV network with a weekly schedule of Monday to Thursday @ 11:00 pm? | SELECT tv_network_s_ FROM table_18821196_1 WHERE weekly_schedule = "Monday to Thursday @ 11:00 pm" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | what is the earliest AA flight that i can get FIRST class from PHILADELPHIA to DALLAS | 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, fare, fare_basis, flight, flight_fare WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND fare_basis.class_type = 'FIRST' AND fare.far... | atis |
CREATE TABLE table_17155 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | How many positions had jersey number 32 | SELECT COUNT("Position") FROM table_17155 WHERE "No.(s)" = '32' | wikisql |
CREATE TABLE table_14255 (
"Model number" text,
"sSpec number" text,
"Cores" real,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | what is the turbo when the frequency is 2.2 ghz? | SELECT "Turbo" FROM table_14255 WHERE "Frequency" = '2.2 ghz' | wikisql |
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 prescriptions... | what number of patients whose ethnicity is black/haitian had the lab test item id as 51108? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.itemid = "51108" | mimicsql_data |
CREATE TABLE table_66688 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real,
"Address" text
) | What is the 123 south broad street address name before 1973? | SELECT "Name" FROM table_66688 WHERE "Year" < '1973' AND "Address" = '123 south broad street' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 把医院4560557全部医疗就诊的记录里民政补助的金额比上全部的医疗费用额度的最大比值参照不同的科室编号和不同的入院诊断疾病的编号列一下,并且把结果从大到小排出来 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '4560557' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_D... | css |
CREATE TABLE table_70768 (
"Week 2" text,
"Week 4" text,
"Week 6" text,
"Week 11" text,
"Week 12" text,
"Week 13" text,
"Week 15" text
) | Who is the week 12 for the week 2 with Magda Tomek? | SELECT "Week 12" FROM table_70768 WHERE "Week 2" = 'magda tomek' | wikisql |
CREATE TABLE table_name_16 (
venue VARCHAR,
opposing_team VARCHAR
) | Which venue had the opposing team Natal? | SELECT venue FROM table_name_16 WHERE opposing_team = "natal" | sql_create_context |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Department_Store_Chain (
dept_st... | What is the price of each product supplied by supplier id 3? Return a bar chart, and list bars in asc order. | SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 ORDER BY product_name | nvbench |
CREATE TABLE table_69791 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Which gender has 7-15 years? | SELECT "Gender" FROM table_69791 WHERE "Years" = '7-15' | wikisql |
CREATE TABLE table_72193 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | what's the championship where winning score is 12 (74-66-65-71=276) | SELECT "Championship" FROM table_72193 WHERE "Winning score" = '−12 (74-66-65-71=276)' | wikisql |
CREATE TABLE table_61207 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm"... | What is the 5pm show where CBS This Morning is on at 7am? | SELECT "5:00 pm" FROM table_61207 WHERE "7:00 am" = 'cbs this morning' | wikisql |
CREATE TABLE table_1341640_11 (
party VARCHAR,
candidates VARCHAR
) | What is the party with the candidates newt gingrich (r) 59.1% dock h. davis (d) 40.9%? | SELECT party FROM table_1341640_11 WHERE candidates = "Newt Gingrich (R) 59.1% Dock H. Davis (D) 40.9%" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who do not work in departments with managers that have ids between 100 and 200, find job_id and employee_id , and visualize them by a bar chart, and rank X-axis in descending order please. | SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC | nvbench |
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... | 在编号为75676535019的检验报告单内写明的机构代码以及名称分别是啥? | SELECT zyjybgb.BGJGDM, zyjybgb.BGJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '75676535019' UNION SELECT mzjybgb.BGJGDM, mzjybgb.BGJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '75676535019' | css |
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
) | A bar chart for showing the number of the dates of performances with attending members whose roles are 'Violin', and list by the Date in descending. | SELECT Date, COUNT(Date) FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" GROUP BY Date ORDER BY Date DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is minimum age of patients whose admission type is newborn and insurance is private? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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_I... | For all employees who have the letters D or S in their first name, show me about the change of department_id over hire_date in a line chart, and I want to show in desc by the HIRE_DATE. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_75210 (
"Year" text,
"Channel" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Courtside reporter" text,
"Studio host" text,
"Studio analysts" text
) | WHich Color commentatorhas a Studio host of gary tanguay & eric frede? | SELECT "Color commentator(s)" FROM table_75210 WHERE "Studio host" = 'gary tanguay & eric frede' | wikisql |
CREATE TABLE table_44383 (
"Number" text,
"Builder" text,
"Type" text,
"Date" text,
"Works number" text
) | What is Works Number, when Number is 55? | SELECT "Works number" FROM table_44383 WHERE "Number" = '55' | wikisql |
CREATE TABLE table_54854 (
"Track" real,
"Recorded" text,
"Catalogue" text,
"Release Date" text,
"Song Title" text,
"Time" text
) | When was the cataglogue EPA 4054 released with a 1/12/57 recorded? | SELECT "Release Date" FROM table_54854 WHERE "Catalogue" = 'epa 4054' AND "Recorded" = '1/12/57' | wikisql |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
) | What is average age of male for different job title? | SELECT AVG(age), job FROM person WHERE gender = 'male' GROUP BY job | spider |
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... | had the heartrate of patient 009-11591 been less on 10/10/2105 than 88.0? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11591')) AND vitalperiodic.heartrate < 88.0 AND NOT vitalperiodi... | eicu |
CREATE TABLE table_49720 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"Location" text,
"Attendance" real
) | For the game ending with a score of 28-43, what is the listed as the final record? | SELECT "Record" FROM table_49720 WHERE "Score" = '28-43' | wikisql |
CREATE TABLE table_name_82 (
fourth_district VARCHAR,
third_district VARCHAR
) | Who's the Fourth District with a Third District of sharon yentsch? | SELECT fourth_district FROM table_name_82 WHERE third_district = "sharon yentsch" | sql_create_context |
CREATE TABLE table_7805 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | Wat was the result for the 20 km after 2008 when the venue was Metz, France? | SELECT "Result" FROM table_7805 WHERE "Year" > '2008' AND "Event" = '20 km' AND "Venue" = 'metz, france' | wikisql |
CREATE TABLE table_495 (
"Rank" real,
"Fastest time (s)" text,
"Wind (m/s)" text,
"Athlete" text,
"Country" text,
"Date" text,
"Location" text
) | What was the stats of Trinidad and Tobago | SELECT "Wind (m/s)" FROM table_495 WHERE "Country" = 'Trinidad and Tobago' | 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... | how many patients whose year of death is less than or equal to 2179? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2179.0" | mimicsql_data |
CREATE TABLE table_name_32 (
feature INTEGER,
wins VARCHAR,
sprint VARCHAR
) | What is the lowest feature with 2 wins and 2 sprints? | SELECT MIN(feature) FROM table_name_32 WHERE wins = 2 AND sprint = 2 | sql_create_context |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 编号为02615390249的住院就诊中,入院途径是啥?代码呢 | SELECT wdmzjzjlb.RYTJDM, wdmzjzjlb.RYTJMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '02615390249' UNION SELECT bdmzjzjlb.RYTJDM, bdmzjzjlb.RYTJMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '02615390249' | css |
CREATE TABLE table_26362472_1 (
left_office VARCHAR,
province VARCHAR
) | What are the dates of leaving office for politician from the province of Seville? | SELECT left_office FROM table_26362472_1 WHERE province = "Seville" | sql_create_context |
CREATE TABLE table_11605 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did Hawthorn play as the away team? | SELECT "Date" FROM table_11605 WHERE "Away team" = 'hawthorn' | wikisql |
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... | 在不同科室编码下,列出所有医疗就诊记录在医院9913454的统筹基金支出与医疗费总额的平均比值是多少? | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9913454' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalpe... | on the first icu visit, list the daily maximum systemicmean of patient 006-195541. | SELECT MAX(vitalperiodic.systemicmean) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195541') AND NOT patient.unitdischargetime IS... | eicu |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 从2001年10月23到2008年1月21,3637568这个医院医疗过多少异地病人 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3637568' AND IN_HOSP_DATE BETWEEN '2001-10-23' AND '2008-01-21' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_name_29 (
course VARCHAR,
date VARCHAR
) | Name the course for 24 july | SELECT course FROM table_name_29 WHERE date = "24 july" | sql_create_context |
CREATE TABLE table_name_98 (
club VARCHAR,
shts VARCHAR
) | What is the club for the 132 SHTS? | SELECT club FROM table_name_98 WHERE shts = 132 | sql_create_context |
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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number... | Top 150 users from Nethelands. Top 150 SO users from China | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%holland%' ORDER BY Reputation DESC LIMIT 150 | sede |
CREATE TABLE table_43737 (
"Year" real,
"Number" real,
"Team" text,
"Co-driver" text,
"Position" text,
"Laps" real
) | What is the lowest Year, when Co-Driver is Warren Luff, when Position is 7th, and when Laps is less than 161? | SELECT MIN("Year") FROM table_43737 WHERE "Co-driver" = 'warren luff' AND "Position" = '7th' AND "Laps" < '161' | wikisql |
CREATE TABLE table_name_52 (
team VARCHAR,
shirt_sponsor VARCHAR
) | What team does Carlsberg sponsor? | SELECT team FROM table_name_52 WHERE shirt_sponsor = "carlsberg" | sql_create_context |
CREATE TABLE table_12232 (
"Version" text,
"KINKA Developer" text,
"KINKA Pre-release" text,
"KINKA 1.0" text,
"KINKA 1.2" text,
"KINKA 1.3" text
) | What is the KINKA 1.2 when the pre-release is no and the developer is yes? | SELECT "KINKA 1.2" FROM table_12232 WHERE "KINKA Pre-release" = 'no' AND "KINKA Developer" = 'yes' | wikisql |
CREATE TABLE table_204_11 (
id number,
"year" number,
"fbs opponent" text,
"result" text,
"opponent's conference" text,
"opponent's head coach" text,
"charleston southern's head coach" text
) | how long was david dowd head coach ? | SELECT COUNT("year") FROM table_204_11 WHERE "charleston southern's head coach" = 'david dowd' | squall |
CREATE TABLE table_name_4 (
run_3 VARCHAR,
rank VARCHAR
) | What was the run 3 for the team in rank 12? | SELECT run_3 FROM table_name_4 WHERE rank = "12" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | when did patient 25696 was prescribed for medication for the first time in 05/this year? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25696) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', prescriptions.startdate) = '05... | 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... | count the number of patients whose primary disease is st-segment elevation myocardial infarction\cardiac cath and age is less than 85? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.age < "85" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
Li... | Top users by tag and location. With parameters | SELECT ROW_NUMBER() OVER (ORDER BY tuser.TagScore DESC) AS "#", Id AS "user_link", Reputation, tuser.TagScore AS "tag_score", WebsiteUrl, Location, UpVotes, DownVotes, EmailHash FROM Users JOIN (SELECT Answers.OwnerUserId AS UserId, SUM(Answers.Score) AS TagScore FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId JOIN... | sede |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
Po... | Questions and their average answers score with more than 5 answers. | SELECT P1.Id AS QuestionId, AVG(1.0 * P2.Score) AS AverageScore FROM Posts AS P1 JOIN Posts AS P2 ON P1.Id = P2.ParentId WHERE P1.PostTypeId = 1 GROUP BY P1.Id HAVING COUNT(P2.Id) > 5 LIMIT 10 | sede |
CREATE TABLE table_11646 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What largest bronze number has a gold number that is bigger than 1? | SELECT MAX("Bronze") FROM table_11646 WHERE "Gold" > '1' | wikisql |
CREATE TABLE table_17516922_1 (
color_commentator VARCHAR,
year VARCHAR
) | What color commentator(s) were in 2010? | SELECT color_commentator FROM table_17516922_1 WHERE year = 2010 | 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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart, and show from high to low by the total number of employee id. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_name_83 (
language VARCHAR,
television_service VARCHAR
) | What is the Language that has sky tg 24 active as the Television service? | SELECT language FROM table_name_83 WHERE television_service = "sky tg 24 active" | sql_create_context |
CREATE TABLE table_72836 (
"Country" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" real
) | What is Norway's least ends lost? | SELECT MIN("Ends Lost") FROM table_72836 WHERE "Country" = 'Norway' | wikisql |
CREATE TABLE table_name_36 (
round INTEGER,
name VARCHAR,
overall VARCHAR
) | With an Overall less than 171, what is the Round pick of Lance Moon? | SELECT MIN(round) FROM table_name_36 WHERE name = "lance moon" AND overall < 171 | sql_create_context |
CREATE TABLE table_52407 (
"City" text,
"Country" text,
"Region" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | I want the region for ICAO of vmmc | SELECT "Region" FROM table_52407 WHERE "ICAO" = 'vmmc' | wikisql |
CREATE TABLE table_45607 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | How many laps did ben spies do on the grid less than 7? | SELECT COUNT("Laps") FROM table_45607 WHERE "Grid" < '7' AND "Rider" = 'ben spies' | 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 allergy (
allergy... | did there was an organism in patient 031-9128's last sputum, tracheal specimen test until 2104? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIM... | eicu |
CREATE TABLE table_name_85 (
position VARCHAR,
player VARCHAR
) | What is Thad Jemison's position? | SELECT position FROM table_name_85 WHERE player = "thad jemison" | 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
... | when was the last time patient 7698 was discharged since 2105 from the hospital? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 7698 AND STRFTIME('%y', admissions.dischtime) >= '2105' ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_53732 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | What is the Tournament with a Opponents in the final with rod laver fred stolle? | SELECT "Tournament" FROM table_53732 WHERE "Opponents in the final" = 'rod laver fred stolle' | wikisql |
CREATE TABLE table_16995 (
"Marginal Ordinary Income Tax Rate" text,
"Single" text,
"Married Filing Jointly or Qualified Widow(er)" text,
"Married Filing Separately" text,
"Head of Household" text
) | What is the range of the head of household whereas single is $171,551 $372,950? | SELECT "Head of Household" FROM table_16995 WHERE "Single" = '$171,551–$372,950' | wikisql |
CREATE TABLE table_name_38 (
local_networked VARCHAR,
ad_freq VARCHAR
) | What is the local/networked value for the show with an ad frequency of N/A? | SELECT local_networked FROM table_name_38 WHERE ad_freq = "n/a" | sql_create_context |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID... | What are the ids and details of events that have more than one participants Visualize by bar chart, order by the bar in ascending. | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose death status is 0 and lab test name is sedimentation rate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Sedimentation Rate" | mimicsql_data |
CREATE TABLE table_18475 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Which party had a person who has been in the seat since 1914? | SELECT "Party" FROM table_18475 WHERE "First elected" = '1914' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.