context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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,
... | find the number of female patients who had 24 hour creatinine lab test. | 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 = "24 hr Creatinine" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE... | has patient 25869 had pco2 tests in 2105? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25869) AND STRFTIME('%y', labevents.charttime) = '2105' | mimic_iii |
CREATE TABLE table_21705 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | What's the part 3 of the verb with part 4 gelopen? | SELECT "Part 3" FROM table_21705 WHERE "Part 4" = 'gelopen' | wikisql |
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),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | 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, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_19998428_3 (
san_antonio_de_lomerío_municipality___percentage_ VARCHAR,
san_javier_municipality___percentage_ VARCHAR
) | What is the municipality percentage for San Antonio de Lomerio is San Javier municipality percentage is 31? | SELECT san_antonio_de_lomerío_municipality___percentage_ FROM table_19998428_3 WHERE san_javier_municipality___percentage_ = 31 | sql_create_context |
CREATE TABLE table_12962773_5 (
height VARCHAR,
current_club VARCHAR
) | what's the height with current club being dkv joventut | SELECT height FROM table_12962773_5 WHERE current_club = "DKV Joventut" | sql_create_context |
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_contact_channels (
customer_id numbe... | How many orders have detail 'Second time'? | SELECT COUNT(*) FROM customer_orders WHERE order_details = "Second time" | spider |
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... | 名叫韩夏旋的患者在医疗就诊37817686165过程中,有哪些医师为其开具了医疗项目他们的编号和姓名叫什么? | SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_CLINIC_ID = '37817686165' | css |
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,... | 列出编码为6196587的医院所有非异地结算的医疗就诊记录在2006年8月31日到2016年4月5日内的有哪些? | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '6196587' AND IN_HOSP_DATE BETWEEN '2006-08-31' AND '2016-04-05') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '6196587' AND IN_HOSP_DATE BETWEEN '2006-08-31' AND '2016-04-05' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')) | css |
CREATE TABLE table_76909 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of Total, when Rank is 8, and when Bronze is less than 1? | SELECT SUM("Total") FROM table_76909 WHERE "Rank" = '8' AND "Bronze" < '1' | wikisql |
CREATE TABLE table_16770037_4 (
tries_for INTEGER,
w VARCHAR
) | Name the least tries for when w is 4 | SELECT MIN(tries_for) FROM table_16770037_4 WHERE w = 4 | sql_create_context |
CREATE TABLE table_61794 (
"Club" text,
"Played" 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
) | What was the try bonus when the points for was 608? | SELECT "Try bonus" FROM table_61794 WHERE "Points for" = '608' | wikisql |
CREATE TABLE table_11950720_4 (
first_class_team VARCHAR,
date_of_birth VARCHAR
) | What is the number of first class team with birthday of 5 december 1970? | SELECT COUNT(first_class_team) FROM table_11950720_4 WHERE date_of_birth = "5 December 1970" | sql_create_context |
CREATE TABLE table_29774 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many high rebounds took place on December 8? | SELECT COUNT("High rebounds") FROM table_29774 WHERE "Date" = 'December 8' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Net votes per question by tag. | SELECT Tags.TagName, SUM(Posts.Score) AS TotScore, COUNT(*) AS TotCount, CAST(CAST(SUM(Posts.Score) AS FLOAT) / COUNT(*) AS FLOAT(20, 3)) AS NetScorePQ, SUM(CASE WHEN Posts.Score > 0 THEN 1 ELSE 0 END) AS PosScoreQs, SUM(CASE WHEN Posts.Score = 0 THEN 1 ELSE 0 END) AS ZeroScoreQs, SUM(CASE WHEN Posts.Score < 0 THEN 1 E... | sede |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
... | what was patient 20441's changes in the weight last measured on the last hospital visit compared to the value second to last 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 = 20441 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... | mimic_iii |
CREATE TABLE table_204_159 (
id number,
"name" text,
"nation" text,
"position" text,
"league apps" number,
"league goals" number,
"fa cup apps" number,
"fa cup goals" number,
"total apps" number,
"total goals" number
) | name the nation with the most appearances . | SELECT "nation" FROM table_204_159 ORDER BY "total apps" DESC LIMIT 1 | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | find out how many patients were discharged from the hospital until 2101. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2101' | eicu |
CREATE TABLE table_name_82 (
line VARCHAR,
name VARCHAR
) | Which line is the Geumjeong tunnel? | SELECT line FROM table_name_82 WHERE name = "geumjeong tunnel" | sql_create_context |
CREATE TABLE elimination (
Elimination_Move VARCHAR,
Wrestler_ID VARCHAR
)
CREATE TABLE wrestler (
Name VARCHAR,
Wrestler_ID VARCHAR
) | What are the names of wrestlers and the elimination moves? | SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID | sql_create_context |
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,
... | 在08年5月15日到2018年1月29日内患者49084699的检测指标968550是什么样的? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '49084699' AND jyjgzbb.JYRQ BETWEEN '2008-05-15' AND '2018-0... | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 num... | what is the monthly average value of patient 5828's mch? | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') GROUP BY STRFTIME('%y-%m', labevents.charttime) | mimic_iii |
CREATE TABLE table_name_43 (
ifop_4_24_09 VARCHAR,
opinionway_4_17_09 VARCHAR,
party VARCHAR
) | Name the lfop 4/24/09 for opinionway of 4/17/09 of 5% for party of left front | SELECT ifop_4_24_09 FROM table_name_43 WHERE opinionway_4_17_09 = "5%" AND party = "left front" | sql_create_context |
CREATE TABLE table_256286_43 (
description VARCHAR,
no_votes VARCHAR
) | What is every description if NO votes is 233759? | SELECT description FROM table_256286_43 WHERE no_votes = 233759 | sql_create_context |
CREATE TABLE table_name_16 (
wins VARCHAR,
team VARCHAR,
f_laps VARCHAR,
series VARCHAR
) | How many wins did team Kolles & Heinz union, with f/laps of 0, have in the Formula Three Euroseries? | SELECT wins FROM table_name_16 WHERE f_laps = "0" AND series = "formula three euroseries" AND team = "kolles & heinz union" | sql_create_context |
CREATE TABLE table_70529 (
"Name" text,
"Country" text,
"Status" text,
"Transfer window" text,
"Transfer fee" text
) | What is the transfer window for the country of ESP and the name of de la red? | SELECT "Transfer window" FROM table_70529 WHERE "Country" = 'esp' AND "Name" = 'de la red' | wikisql |
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 d_icd_procedures (
row_id number,
icd9_code text,
s... | was the value of the creatinine of patient 2334 last measured on the first hospital visit greater than that second to last measured on the first hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2334 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label =... | mimic_iii |
CREATE TABLE table_26066 (
"Place came" text,
"Artist" text,
"Category" text,
"Act" text,
"Semi-final" text,
"Result" text
) | What was the final place came for the performance of Erlend Bratland? | SELECT "Place came" FROM table_26066 WHERE "Artist" = 'Erlend Bratland' | wikisql |
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int
)
CREATE TABLE membership_register_branch (
Member_ID int,
... | Count the hometown by hometown using a bar chart, and order in descending by the x-axis please. | SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY Hometown DESC | nvbench |
CREATE TABLE table_203_437 (
id number,
"year" number,
"laureate" text,
"relation" text,
"category" text,
"rationale" text
) | how many of the laureates received the nobel peace prize ? | SELECT COUNT("laureate") FROM table_203_437 WHERE "category" = 'nobel peace prize' | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many male patients had unspecified erythematous condition? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Unspecified erythematous condition" | mimicsql_data |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | what is the first flight arriving in MONTREAL from TORONTO friday | 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 (((((flight.departure_time > flight.arrival_time) AND date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.da... | atis |
CREATE TABLE table_name_49 (
to_par VARCHAR,
winning_score VARCHAR
) | What is the to par value for the game with a winning score of 71-69-71-70=281? | SELECT to_par FROM table_name_49 WHERE winning_score = 71 - 69 - 71 - 70 = 281 | sql_create_context |
CREATE TABLE table_9620 (
"Edition" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Opponent" text,
"Result" text
) | Who was the opponent for the 2003 davis cup europe/africa group ii? | SELECT "Opponent" FROM table_9620 WHERE "Edition" = '2003 davis cup europe/africa group ii' | wikisql |
CREATE TABLE table_28654454_5 (
reunion_weight VARCHAR,
lbs_lost_finale VARCHAR
) | What is the reunion weight of the contestant who lost 74.4 lbs at the finale? | SELECT reunion_weight FROM table_28654454_5 WHERE lbs_lost_finale = "74.4" | sql_create_context |
CREATE TABLE table_21457754_2 (
races INTEGER
) | Name the most races | SELECT MAX(races) FROM table_21457754_2 | sql_create_context |
CREATE TABLE cinema (
LOCATION VARCHAR
) | What are all the locations with a cinema? | SELECT DISTINCT LOCATION FROM cinema | sql_create_context |
CREATE TABLE table_204_471 (
id number,
"year" number,
"title" text,
"peak chart positions\nger" number,
"label" text,
"artist" text
) | what 's the total number of albums released by willy deville ? | SELECT COUNT("title") FROM table_204_471 WHERE "artist" = 'willy deville' | squall |
CREATE TABLE table_name_93 (
game INTEGER,
record VARCHAR
) | Name the least game for record of 5-1-3 | SELECT MIN(game) FROM table_name_93 WHERE record = "5-1-3" | 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 Comments (
Id number,
PostId number,
Score number,
Text text,
... | All questions by a specific user. | SELECT Id AS "post_link", Title, Score, ViewCount, AnswerCount, Tags FROM Posts WHERE (PostTypeId = 1) AND (OwnerUserId = '##userid##') ORDER BY Id | sede |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | Name the MDE course which is easiest . | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_numb... | How many diffrent dorm amenities are there? | SELECT COUNT(*) FROM dorm_amenity | spider |
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
)
... | provide the number of patients whose diagnoses short title is long-term use of aspirin and drug route is iv bolus? | 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.short_title = "Long-term use of aspirin" AND prescriptions.route = "IV BOLUS" | mimicsql_data |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 在哪几次医疗记录中病患许飞烟被开出的药物全部都比1281.74元大?当时就诊的编玛是多少号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '许飞烟' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1281.74) | css |
CREATE TABLE table_58411 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | What was the term of Hon Peter Morris? | SELECT "Term in office" FROM table_58411 WHERE "Member" = 'hon peter morris' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of founder and the sum of manufacturer , and group by attribute founder. | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | mention the diagnosis short title of diagnosis icd9 code 3671. | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "3671" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me about the distribution of ACC_Regular_Season and School_ID in a bar chart, rank from low to high by the y-axis. | SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID | nvbench |
CREATE TABLE table_22190 (
"State" text,
"City" text,
"Population" real,
"Violent Crime" text,
"Murder and Non-Negligent Manslaughter" text,
"Forcible Rape" text,
"Robbery" text,
"Aggravated Assault" text,
"Property Crime" text,
"Burglary" text,
"Larceny-Theft" text,
"Mot... | What was the violent crime rate in the city where the robbery rate was 201.4? | SELECT "Violent Crime" FROM table_22190 WHERE "Robbery" = '201.4' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 罗列出名称包含胸部的科室在医疗就诊57398975869中开出的所有检验报告单的编号分别是什么? | SELECT BGDH FROM jybgb WHERE JZLSH = '57398975869' AND KSMC LIKE '%胸部%' | css |
CREATE TABLE table_22394 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
) | what is the original airdate for garfield episode 2 the wise man | SELECT "Original Airdate" FROM table_22394 WHERE "Garfield Episode 2" = 'The Wise Man' | 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... | Among patients admitted to emergency room, how many of them were born before 2184? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "2184" | mimicsql_data |
CREATE TABLE students (
student_id number,
student_details text
)
CREATE TABLE people_addresses (
person_address_id number,
person_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE people (
person_id number,
first_name text,
middle_name text,
last_na... | What are all details of the students who registered but did not attend any course? | SELECT * FROM student_course_registrations WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance) | spider |
CREATE TABLE table_17503169_1 (
republican VARCHAR,
incumbent VARCHAR
) | Who was the republican candidate in the race with incumbent thelma drake? | SELECT republican FROM table_17503169_1 WHERE incumbent = "Thelma Drake" | sql_create_context |
CREATE TABLE table_name_42 (
heat VARCHAR,
mark VARCHAR
) | What is Heat, when Mark is 6.69? | SELECT heat FROM table_name_42 WHERE mark = "6.69" | sql_create_context |
CREATE TABLE table_name_7 (
place VARCHAR,
artist VARCHAR,
draw VARCHAR,
points VARCHAR
) | In what place is the artist Midnight Band with a draw larger than 2 and less than 139 points. | SELECT place FROM table_name_7 WHERE draw > 2 AND points < 139 AND artist = "midnight band" | sql_create_context |
CREATE TABLE table_19998428_3 (
san_antonio_de_lomerío_municipality___percentage_ VARCHAR,
cuatro_cañadas_municipality___percentage_ VARCHAR
) | If the Cuatro Ca adas municipality percentage is 252, what are all the San Antonio de Lomer o municipality percentage? | SELECT san_antonio_de_lomerío_municipality___percentage_ FROM table_19998428_3 WHERE cuatro_cañadas_municipality___percentage_ = "252" | sql_create_context |
CREATE TABLE table_56476 (
"Name" text,
"Date of birth" text,
"Date of death" text,
"Reign" text,
"Relationship with predecessor" text
) | When did Charles III die? | SELECT "Date of death" FROM table_56476 WHERE "Name" = 'charles iii' | wikisql |
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,
... | give me the number of patients whose days of hospital stay is greater than 3 and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
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... | provide the number of patients whose procedure icd9 code is 3607? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3607" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
... | when was patient 99747 first prescribed any medication on the dialys route during the previous month? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99747) AND prescriptions.route = 'dialys' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY pr... | mimic_iii |
CREATE TABLE table_12886178_5 (
club VARCHAR,
won VARCHAR
) | How many clubs have won 6 games? | SELECT COUNT(club) FROM table_12886178_5 WHERE won = "6" | sql_create_context |
CREATE TABLE table_53794 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the location attendance for game more than 54 on february 25 | SELECT "Location Attendance" FROM table_53794 WHERE "Game" > '54' AND "Date" = 'february 25' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | provide me with the top four most common intake in 2102? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_12468 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest gold with 1 silver, and more than 1 altogether? | SELECT MAX("Gold") FROM table_12468 WHERE "Silver" = '1' AND "Total" > '1' | wikisql |
CREATE TABLE table_19522 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Position" text,
"Years" text,
"League" real,
"Cup" real,
"Europe" real,
"Others" real,
"Total" real
) | How many years was the total 402? | SELECT COUNT("Years") FROM table_19522 WHERE "Total" = '402' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id n... | how many days have elapsed since patient 15447 last received an intake of d5w on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447) AND icustays.outtime IS NULL) ... | mimic_iii |
CREATE TABLE table_name_92 (
ihsaa_class VARCHAR,
ihsaa_football_class VARCHAR,
school VARCHAR
) | What is the IHSAA class of Centerville, which plays IHSAA class AA football? | SELECT ihsaa_class FROM table_name_92 WHERE ihsaa_football_class = "aa" AND school = "centerville" | sql_create_context |
CREATE TABLE table_16723 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | What is the fastest lap with pole position of gilles villeneuve? | SELECT "Fastest Lap" FROM table_16723 WHERE "Pole Position" = 'Gilles Villeneuve' | 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... | what is the number of patients whose ethnicity is white - russian and diagnoses long title is unspecified septicemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Unspecified septicemia" | mimicsql_data |
CREATE TABLE table_203_475 (
id number,
"stage" number,
"date" text,
"route" text,
"terrain" text,
"length" text,
"winner" text
) | how much longer is the 20th tour de france stage than the 19th ? | SELECT (SELECT "length" FROM table_203_475 WHERE "stage" = 20) - (SELECT "length" FROM table_203_475 WHERE "stage" = 19) | squall |
CREATE TABLE table_name_1 (
region VARCHAR,
host VARCHAR
) | What region is the host university of southern california located? | SELECT region FROM table_name_1 WHERE host = "university of southern california" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
... | what was the first sputum microbiology test performed in 05/last year for patient 54281? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start o... | mimic_iii |
CREATE TABLE table_name_23 (
player VARCHAR,
position VARCHAR,
round VARCHAR,
overall VARCHAR
) | Who is the athlete who was picked before round 9, had an overall draft pick after number 143 and plays the position of db? | SELECT player FROM table_name_23 WHERE round < 9 AND overall > 143 AND position = "db" | 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 stayed in hospital more than 0 days and diagnosed with pulmonary collapse? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "0" AND diagnoses.long_title = "Pulmonary collapse" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE i... | the previous year, what was the three most frequent drugs prescribed to patients within the same hospital visit after being diagnosed with dka? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'dka' AND DATETI... | eicu |
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... | 手术量排名前2的科室,在04年1月19日到2011年8月13日期间,编码和名称都叫什么? | SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2004-01-19' AND '2011-08-13' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 2 | css |
CREATE TABLE table_11376 (
"Grid" real,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/Retired" text
) | Which qual has rank of more than 28 and a grid number that is bigger than 23? | SELECT "Qual" FROM table_11376 WHERE "Rank" > '28' AND "Grid" > '23' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Questions closed as off topic on not constructive. | SELECT * FROM Posts AS Questions WHERE Questions.PostTypeId = 1 AND Questions.Tags LIKE '%<' + '##tagname:string##' + '>%' OR (Questions.Title LIKE '%' + '##topic:string##' + '%' OR Questions.Tags LIKE '%<' + '##topic:string##' + '>%' OR Questions.Body LIKE '%' + '##topic:string##' + '%') AND YEAR(Questions.CreationDat... | sede |
CREATE TABLE table_59508 (
"School" text,
"Suburb/Town" text,
"Years" text,
"Founded" real,
"Website" text
) | What suburb/town has school years of k-6, was founded before 1875, and has Ashfield Public School as its school? | SELECT "Suburb/Town" FROM table_59508 WHERE "Years" = 'k-6' AND "Founded" < '1875' AND "School" = 'ashfield public school' | wikisql |
CREATE TABLE table_name_58 (
event VARCHAR
) | What is the 2008-09 result has Masters as the event? | SELECT 2008 AS _09 FROM table_name_58 WHERE event = "masters" | sql_create_context |
CREATE TABLE table_202_178 (
id number,
"year" text,
"title" text,
"role" text,
"notes" text
) | when was bobbie phillips first role in tv ? | SELECT MIN("year") FROM table_202_178 | squall |
CREATE TABLE table_name_8 (
notes VARCHAR,
country VARCHAR
) | What are the notes for South Africa? | SELECT notes FROM table_name_8 WHERE country = "south africa" | sql_create_context |
CREATE TABLE table_name_14 (
date VARCHAR,
high_points VARCHAR
) | What date did mehmet okur (24) have the most points? | SELECT date FROM table_name_14 WHERE high_points = "mehmet okur (24)" | sql_create_context |
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... | Give the number of patients who are diagnosed with hypospadias and have their lab test as abnormal. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hypospadias" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Find all posts where a certain user has edited and included a certain keyword. | SELECT DISTINCT PostHistory.PostId AS "post_link" FROM PostHistory LEFT JOIN Posts ON Posts.Id = PostHistory.PostId WHERE PostHistoryTypeId = 5 AND Text LIKE '%' + '##keyword:string##' + '%' AND OwnerUserId = '##UserId##' AND Posts.CreationDate > '##date##' | sede |
CREATE TABLE table_name_80 (
events VARCHAR,
top_10 VARCHAR,
top_5 VARCHAR
) | How many Events have a Top-10 larger than 6, and a Top-5 smaller than 8? | SELECT COUNT(events) FROM table_name_80 WHERE top_10 > 6 AND top_5 < 8 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
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,
MZBMLX num... | 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_45824 (
"Season" real,
"Series" text,
"Points" text,
"Position" text,
"Driver" text
) | What is Points, when Series is Queensland Formula Ford Championship, and when Position is 1st? | SELECT "Points" FROM table_45824 WHERE "Series" = 'queensland formula ford championship' AND "Position" = '1st' | wikisql |
CREATE TABLE table_38189 (
"Name" text,
"Size" text,
"Price" text,
"Quantity" real,
"Released" text,
"Nicotine" real
) | Which Raison Blue has the highest nicotine? | SELECT MAX("Nicotine") FROM table_38189 WHERE "Name" = 'raison blue' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
... | when does patient 10425 have received a urine microbiology test for the first time in 09/last year? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10425) AND microbiologyevents.spec_type_desc = 'urine' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of... | mimic_iii |
CREATE TABLE table_26554 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What was the name of the epiode written by Gary M. Goodrich? | SELECT "Title" FROM table_26554 WHERE "Written by" = 'Gary M. Goodrich' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 有哪些人报告超过13份检验报告单在医疗就诊24605485299中?列出这些报告人有什么工号和姓名? | SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '24605485299' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 13 | css |
CREATE TABLE table_name_41 (
pole_position VARCHAR,
grand_prix VARCHAR
) | What is the pole position of the Hungarian Grand Prix? | SELECT pole_position FROM table_name_41 WHERE grand_prix = "hungarian grand prix" | sql_create_context |
CREATE TABLE table_61172 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest number of bronze of the nation with more than 13 total medals, more than 10 gold medals, and less than 22 silvers? | SELECT MIN("Bronze") FROM table_61172 WHERE "Total" > '13' AND "Gold" > '10' AND "Silver" < '22' | wikisql |
CREATE TABLE table_1654 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" real,
"Final Placing" text
) | When the wins is 3, what is the maximum races? | SELECT MAX("Races") FROM table_1654 WHERE "Wins" = '3' | 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,
... | 患者37544109在2015年2月26日到2020年8月30日内所做的检测丙戊酸的检查是哪个医务人员工号及姓名都是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_train_11 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"active_infection" bool,
"heart_disease" bool,
"body_weight" float,
"septic_shock" bool,
"serum_aminotransferase_level_alt_ast" int,
"NOUSE" float
) | are or become pregnant | SELECT * FROM table_train_11 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_19868 (
"Stage" real,
"Stage winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Malaysian rider classification" text,
"Team classification" text
) | When hossein askari is the stage winner who is the malaysian rider classification ? | SELECT "Malaysian rider classification" FROM table_19868 WHERE "Stage winner" = 'Hossein Askari' | wikisql |
CREATE TABLE table_name_70 (
all_around INTEGER,
total VARCHAR,
hoop VARCHAR
) | What is the smallest all around when the total is 19.85 and the hoop is less than 9.85? | SELECT MIN(all_around) FROM table_name_70 WHERE total = 19.85 AND hoop < 9.85 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.