context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 在检测指标结果定量单位与检测指标名称都和检验指标记录24972615703相同的那些记录里,有哪些检测指标结果定量大于其指标记录的情况? | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '24972615703') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '24972615703') AND JCZBJGDL > (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '24972615703') | css |
CREATE TABLE table_train_65 (
"id" int,
"intention_to_arterial_catheter" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"central_venous_pressure_cvp" int,
"receiving_vasopressor" bool,
"pulmonary_artery_occlusive_pressure_paop" int,
"septic_shock" bool,
"a... | 18 years of age or older with a diagnosis of septic shock | SELECT * FROM table_train_65 WHERE age >= 18 AND septic_shock = 1 | criteria2sql |
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... | 在编号为75676535019的检验报告单内写明的机构代码以及名称分别是啥? | SELECT BGJGDM, BGJGMC FROM jybgb WHERE BGDH = '75676535019' | css |
CREATE TABLE table_204_820 (
id number,
"date" text,
"constituency" text,
"c/u" text,
"former incumbent" text,
"winner" text,
"cause" text
) | what is the next date after the first date on the list ? | SELECT "date" FROM table_204_820 WHERE id = 1 + 1 | squall |
CREATE TABLE table_204_226 (
id number,
"municipality/communes" text,
"coalition for the citizen" text,
"coalition for the future" text,
"other/independent" text,
"winning party/coalition" text,
"voter turnout" text
) | what municiplity has the largest voter turnout ? | SELECT "municipality/communes" FROM table_204_226 ORDER BY "voter turnout" DESC LIMIT 1 | squall |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | Next Winter , which ULCS classes are offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
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 of the female patients had sdh as the primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "SDH" | mimicsql_data |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | tell me the total sum of inputs patient 24029 has received on 05/14/last year? | SELECT SUM(inputevents_cv.amount) 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 = 24029)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(),... | mimic_iii |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | A bar chart for what are the number of the titles of all movies that have between 3 and 5 stars?, and sort from low to high by the the number of title. | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY COUNT(title) | nvbench |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 门诊上一般被诊断为慢性支气管炎的患者的检测指标454629数值的平均值以及最值会是怎样的数据 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = '454629' | css |
CREATE TABLE table_7202 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What's the mean week number when attendance was 63,263? | SELECT AVG("Week") FROM table_7202 WHERE "Attendance" = '63,263' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Draw a pie chart about the proportion of ACC_Regular_Season and School_ID. | SELECT ACC_Regular_Season, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_66591 (
"Title" text,
"Label" text,
"Year of Release" real,
"Country of Release" text,
"Peaches:" text
) | What was the last year MCA had a Release? | SELECT MAX("Year of Release") FROM table_66591 WHERE "Label" = 'mca' | wikisql |
CREATE TABLE table_42866 (
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | Who drove for Mathiasen Motorsports with dane cameron as pole position? | SELECT "Winning driver" FROM table_42866 WHERE "Winning team" = 'mathiasen motorsports' AND "Pole Position" = 'dane cameron' | wikisql |
CREATE TABLE table_name_67 (
january VARCHAR,
game VARCHAR,
opponent VARCHAR
) | How much January has a Game smaller than 37, and an Opponent of detroit red wings? | SELECT COUNT(january) FROM table_name_67 WHERE game < 37 AND opponent = "detroit red wings" | sql_create_context |
CREATE TABLE table_name_36 (
verb_meaning VARCHAR,
part_2 VARCHAR
) | What is the verb meaning when part 2 is band? | SELECT verb_meaning FROM table_name_36 WHERE part_2 = "band" | sql_create_context |
CREATE TABLE table_18733 (
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Mascot" text,
"Division" text
) | How many teams have the titans as a mascot? | SELECT COUNT("Affiliation") FROM table_18733 WHERE "Mascot" = 'Titans' | wikisql |
CREATE TABLE table_name_59 (
name VARCHAR,
overall VARCHAR,
round VARCHAR
) | What is Name, when Overall is greater than 132, and when Round is 12? | SELECT name FROM table_name_59 WHERE overall > 132 AND round = 12 | sql_create_context |
CREATE TABLE table_name_58 (
storm VARCHAR,
dance VARCHAR,
clash VARCHAR
) | Which storm has a clash of 3 and a dance of 4? | SELECT storm FROM table_name_58 WHERE dance = "4" AND clash = "3" | sql_create_context |
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
)
... | What is the number of dead patients who had a prescription for pantoprazole sodium medication? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Pantoprazole Sodium" | mimicsql_data |
CREATE TABLE table_name_22 (
position VARCHAR,
pick__number VARCHAR,
player VARCHAR
) | Which Position has a Pick # lower than 278 for Player Charles Benson? | SELECT position FROM table_name_22 WHERE pick__number < 278 AND player = "charles benson" | sql_create_context |
CREATE TABLE table_66370 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | how many times is the fa cup apps more than 0, the position mf and the league goals 4? | SELECT COUNT("Total Goals") FROM table_66370 WHERE "FA Cup Apps" > '0' AND "Position" = 'mf' AND "League Goals" = '4' | wikisql |
CREATE TABLE table_33493 (
"Date" text,
"Name" text,
"Party" text,
"Province" text,
"Details" text
) | Which party is Madeleine Plamondon a member of? | SELECT "Party" FROM table_33493 WHERE "Name" = 'madeleine plamondon' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Show minimal age from each job, and order minimal age from low to high order. | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY MIN(age) | nvbench |
CREATE TABLE table_name_79 (
division_record VARCHAR,
school VARCHAR
) | The Milford School has what Division Record? | SELECT division_record FROM table_name_79 WHERE school = "milford" | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname... | Show me a bar chart for how many faculty members do we have for each faculty rank?, rank x-axis in desc order please. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank DESC | nvbench |
CREATE TABLE table_18946 (
"Trim" text,
"Engine" text,
"Displacement" text,
"Power" text,
"Torque" text,
"Transmission" text,
"Fuel Mileage (latest EPA mpg - US )" text
) | what's the trim with fuel mileage (latest epa mpg - us ) being 22 city, 30 hwy, 25 comb | SELECT "Trim" FROM table_18946 WHERE "Fuel Mileage (latest EPA mpg - US )" = '22 city, 30 hwy, 25 comb' | wikisql |
CREATE TABLE table_69870 (
"Club" text,
"Matches" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Record (%) [draw = 0.5 wins]" real
) | Which club has the most losses with 10 matches played and more than 1 draw? | SELECT MAX("Losses") FROM table_69870 WHERE "Matches" = '10' AND "Draws" > '1' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_61 (
first_elected VARCHAR,
party VARCHAR,
result VARCHAR
) | What is First elected that has republican Party and a Result of retired democratic gain? | SELECT first_elected FROM table_name_61 WHERE party = "republican" AND result = "retired democratic gain" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who did not have any job in the past, find hire_date and the average of salary bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_name_58 (
score VARCHAR,
tie_no VARCHAR
) | What is the score when the tie number is 6? | SELECT score FROM table_name_58 WHERE tie_no = "6" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | for patients who took therapeutic antibacterials - macrolide since 2103, what are the four most frequent procedures that were followed within 2 months? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - macrolide' ... | eicu |
CREATE TABLE table_13564637_4 (
points_for VARCHAR,
points VARCHAR
) | How many points for when the points was 53? | SELECT points_for FROM table_13564637_4 WHERE points = "53" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | how much is the daily maximum weight of patient 013-33898 since 2105? | SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) >= '2105' GROUP BY STRFTIME('%y-%m-%d', patient.unit... | eicu |
CREATE TABLE table_50516 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | What is the finish of South Africa? | SELECT "Finish" FROM table_50516 WHERE "Country" = 'south africa' | wikisql |
CREATE TABLE table_name_62 (
purpose VARCHAR,
area_served VARCHAR
) | What is the Purpose of the Area Braidwood? | SELECT purpose FROM table_name_62 WHERE area_served = "braidwood" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the top three most commonly prescribed drugs for patients of age 40s since 1 year ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-1 year') GR... | eicu |
CREATE TABLE table_50900 (
"Team" text,
"Coach" text,
"Home Ground" text,
"Location" text,
"Founded" text
) | Which team has an unknown coach and location of Athelstone? | SELECT "Team" FROM table_50900 WHERE "Coach" = 'unknown' AND "Location" = 'athelstone' | wikisql |
CREATE TABLE table_204_218 (
id number,
"name" text,
"faith" text,
"type" text,
"gov" text,
"opened" number,
"intake" number,
"dcsf number" number,
"ofsted number" number,
"web" text,
"coordinates" text
) | at least how many types are there ? | SELECT COUNT(DISTINCT "type") FROM table_204_218 AS table_204_218 | squall |
CREATE TABLE table_name_32 (
drawn INTEGER,
name VARCHAR,
points VARCHAR
) | What is the average games that were drawn with ERSC Amberg as name and less than 14 points? | SELECT AVG(drawn) FROM table_name_32 WHERE name = "ersc amberg" AND points < 14 | sql_create_context |
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, return a bar chart about the distribution of name and the sum of code , and group by attribute name, show bar in desc order please. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is language of subject name stephanie suchan? | SELECT demographic.language FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_17317 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the total number of games where A. Johnson (6) gave the most high assists? | SELECT COUNT("Game") FROM table_17317 WHERE "High assists" = 'A. Johnson (6)' | wikisql |
CREATE TABLE table_name_56 (
iata VARCHAR,
city VARCHAR
) | What is the IATA code for Delhi? | SELECT iata FROM table_name_56 WHERE city = "delhi" | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | How many faculty members do we have for each rank? Visualize by pie chart. | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank | nvbench |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistoryTypes (
Id number,
... | Check for Greater Seattle. | SELECT DISTINCT Reputation, Location, WebsiteUrl FROM Users WHERE LOWER(Location) LIKE '%seattle%' AND LOWER(AboutMe) LIKE '%microsoft%' | sede |
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
) | Show the different countries and the number of members from each. Visualize by bar chart. | SELECT Country, COUNT(*) FROM member GROUP BY Country | nvbench |
CREATE TABLE table_name_85 (
tournament VARCHAR,
partner VARCHAR,
score VARCHAR
) | In what Tournament was Barbara Jordan a Partner with a Score of 6-2, 3-6, 3-6? | SELECT tournament FROM table_name_85 WHERE partner = "barbara jordan" AND score = "6-2, 3-6, 3-6" | sql_create_context |
CREATE TABLE table_204_480 (
id number,
"title" text,
"alternate title(s)" text,
"year" number,
"manufacturer" text,
"genre(s)" text,
"max. players" number
) | how many games have a max player limit of at least 3 ? | SELECT COUNT(*) FROM table_204_480 WHERE "max. players" >= 3 | squall |
CREATE TABLE table_14999879_2 (
college VARCHAR,
player VARCHAR
) | What college did steve justice attend? | SELECT college FROM table_14999879_2 WHERE player = "Steve Justice" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,... | how many patients had been diagnosed with tubal ligation status last year? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tubal ligation status') AND DATETIME(diagnoses_icd.chartti... | mimic_iii |
CREATE TABLE table_39029 (
"Saddle cloth" real,
"Horse" text,
"Trainer" text,
"Jockey" text,
"Weight (kg)" real,
"Barrier [b ]" text,
"Placing" text
) | What place was the horse with a barrier of 20 and weighing less than 54 kg | SELECT "Placing" FROM table_39029 WHERE "Weight (kg)" < '54' AND "Barrier [b ]" = '20' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | count the number of patients who had been tested since 2105 for hdl. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'hdl' AND STRFTIME('%y', lab.labresulttime) >= '2105') | eicu |
CREATE TABLE table_69296 (
"Island" text,
"Group" text,
"Area ( ha )" text,
"Population" text,
"Height (m)" real
) | What is the area (ha) of the group on the island of Linga Holm that has a Height (m) larger than 7? | SELECT "Area ( ha )" FROM table_69296 WHERE "Height (m)" > '7' AND "Island" = 'linga holm' | wikisql |
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,
... | since 2102, has patient 015-60616 been admitted to an er? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-60616' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) >= '2102' | eicu |
CREATE TABLE table_37102 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Duchess" text,
"Ceased to be Duchess" text,
"Death" text,
"Spouse" text
) | Which member of house of Habsburg-Lorraine had the spouse Charles II? | SELECT "Name" FROM table_37102 WHERE "Spouse" = 'charles ii' | 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 hz_info (
KH text,
KLX number... | 号码为27876710324的检测通知单的检验科室号码还有名字都是啥呢? | SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '27876710324' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '27876710324' | css |
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
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what was patient 19412 first height in this month? | 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 = 19412)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | mimic_iii |
CREATE TABLE table_53913 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What player belongs to Northwestern College? | SELECT "Player" FROM table_53913 WHERE "College" = 'northwestern' | 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 demographic (... | what is the number of patients whose admission location is trsf within this facility and drug name is glycerin (ped)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Glycerin (Ped)" | 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 urgent hospital admission patients who have tacrolimus drug prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Tacrolimus" | mimicsql_data |
CREATE TABLE table_49987 (
"Draw" real,
"Song" text,
"Artist" text,
"Televotes" real,
"Place" real
) | What is the average Place, when Song is 'Dis Oui'? | SELECT AVG("Place") FROM table_49987 WHERE "Song" = 'dis oui' | wikisql |
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,
... | are patient 017-41154 a man or a woman. | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '017-41154' | eicu |
CREATE TABLE table_32850 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | What was the total attendance in week 8? | SELECT COUNT("Attendance") FROM table_32850 WHERE "Week" = '8' | wikisql |
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... | 病号范雅逸在09年9月22日到2016年7月15日内的所有检验结果指标记录的检测员为74379714的检测指标流水号是多少? | SELECT jyjgzbb.JYZBLSH 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 AND jybgb.YLJGDM = ... | css |
CREATE TABLE table_1203 (
"No" real,
"Date" text,
"Round" text,
"Circuit" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Report" text
) | Which round was the circuit Assen | SELECT "Round" FROM table_1203 WHERE "Circuit" = 'Assen' | wikisql |
CREATE TABLE d_icd_diagnoses (
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_care... | how much does a 24 hr creatinine lab test cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '24 hr creatinine')) | mimic_iii |
CREATE TABLE table_41333 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
) | Can you tell me the Name that has the Goals larger than 98, and the Rank of 7? | SELECT "Name" FROM table_41333 WHERE "Goals" > '98' AND "Rank" = '7' | 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 microlab (
microl... | what are the specimen tests top three most frequently ordered until 2 years ago? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_204_686 (
id number,
"date" text,
"pos." text,
"name" text,
"from" text,
"fee" text
) | who 's fee was higher between steven davis and chris baird ? | SELECT "name" FROM table_204_686 WHERE "name" IN ('steven davis', 'chris baird') ORDER BY "fee" DESC LIMIT 1 | squall |
CREATE TABLE table_65381 (
"Nation" text,
"Birth date" text,
"Height (m)" text,
"Weight (kg)" text,
"World Rank" text
) | what is the nation when the height (m) is 1.91 and the weight (kg) is 99? | SELECT "Nation" FROM table_65381 WHERE "Height (m)" = '1.91' AND "Weight (kg)" = '99' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was patient 85895's first output on last month/05? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895)) AND DATETIME(outputevents.charttim... | mimic_iii |
CREATE TABLE table_56953 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | Which driver drove the Tourtel Larrousse F1? | SELECT "Driver" FROM table_56953 WHERE "Entrant" = 'tourtel larrousse f1' | wikisql |
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,... | 找出医院0919539的门诊记录里患者孙咏歌的就诊记录,要诊断名称不含抽动的 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjz... | css |
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... | Bar chart of school_id from each all games, and list in asc by the X-axis. | SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games | nvbench |
CREATE TABLE table_name_73 (
english_translation VARCHAR,
traditional_chinese VARCHAR
) | What is the english translation of the traditional Chinese word, ? | SELECT english_translation FROM table_name_73 WHERE traditional_chinese = "哀郢" | sql_create_context |
CREATE TABLE table_19203 (
"Designation" text,
"Bus width (bits)" real,
"Channels" text,
"Clock rate (MHz)" real,
"Bandwidth (MB/s)" real
) | Name the least clock rate mhz | SELECT MIN("Clock rate (MHz)") FROM table_19203 | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what was the first height of patient 14671 in 12/2105? | 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 = 14671)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | 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 transfers (
row_id number,
subject_id number,
hadm_... | what intake did patient 24029 last have since 1311 days ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 24029)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_66607 (
"Year" real,
"Championship" text,
"Event" text,
"Nation" text,
"Result" text
) | What championship was in the USA after 1994, and resulted in 5th place? | SELECT "Championship" FROM table_66607 WHERE "Nation" = 'usa' AND "Year" > '1994' AND "Result" = '5th' | wikisql |
CREATE TABLE table_46396 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Assists, when High Points is 'T. J. Ford (29)'? | SELECT "High assists" FROM table_46396 WHERE "High points" = 't. j. ford (29)' | wikisql |
CREATE TABLE table_25741 (
"Season" text,
"Oberbayern A" text,
"Oberbayern B" text,
"Niederbayern" text,
"Schwaben" text,
"Oberpfalz" text
) | When tus rosenberg is the oberpfalz what is the oberbayern b? | SELECT "Oberbayern B" FROM table_25741 WHERE "Oberpfalz" = 'TuS Rosenberg' | wikisql |
CREATE TABLE table_name_15 (
elevation__m_ VARCHAR,
prominence__m_ VARCHAR,
col__m_ VARCHAR,
rank VARCHAR
) | How much Elevation (m) has a Col (m) smaller than 562, and a Rank of 10, and a Prominence (m) larger than 1,598? | SELECT COUNT(elevation__m_) FROM table_name_15 WHERE col__m_ < 562 AND rank = 10 AND prominence__m_ > 1 OFFSET 598 | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Is there a class that 's the easiest one I can take to fulfill the MDE requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE table_5646 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (BOTP)" text,
"Voice acto... | Who is the voice actor (harmony gold ova dub) of the character with a voice actor (adv TV/sentai ova dub) Kim Prause? | SELECT "Voice actor (Harmony Gold OVA Dub)" FROM table_5646 WHERE "Voice actor (ADV TV/Sentai OVA dub)" = 'kim prause' | wikisql |
CREATE TABLE table_1140119_5 (
date VARCHAR,
circuit VARCHAR
) | When was the Albi circuit race driven? | SELECT date FROM table_1140119_5 WHERE circuit = "Albi" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | what is the top five most frequent procedures that were given to patients within 2 months after being diagnosed with rt bbb/lft ant fasc blk until 2104? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE 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,
... | 之前,患者28448699在哪里就诊的? | SELECT hz_info_mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz... | css |
CREATE TABLE table_204_539 (
id number,
"date" text,
"name" text,
"moving from" text,
"moving to" text,
"fee" text
) | the first date is ? | SELECT "date" FROM table_204_539 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_14395920_2 (
winner VARCHAR,
stage VARCHAR,
points_classification VARCHAR,
general_classification VARCHAR
) | Who won the stage when Mark Cavendish led the points classification, Rinaldo Nocentini led the general classification, and the stage was less than 11.0? | SELECT winner FROM table_14395920_2 WHERE points_classification = "Mark Cavendish" AND general_classification = "Rinaldo Nocentini" AND stage < 11.0 | sql_create_context |
CREATE TABLE table_name_13 (
opponent VARCHAR,
res VARCHAR,
time VARCHAR
) | Who is the opponent of the match with a win result and a time of 3:02? | SELECT opponent FROM table_name_13 WHERE res = "win" AND time = "3:02" | sql_create_context |
CREATE TABLE table_name_15 (
strike_rate INTEGER,
matches VARCHAR,
average VARCHAR
) | What is the highest Strike Rate when the average is less than 50.25 with less than 13 matches played? | SELECT MAX(strike_rate) FROM table_name_15 WHERE matches < 13 AND average < 50.25 | sql_create_context |
CREATE TABLE table_13247 (
"National team" text,
"Club" text,
"Year" text,
"Apps" real,
"Goals" real
) | Which Goals have Apps smaller than 1? | SELECT AVG("Goals") FROM table_13247 WHERE "Apps" < '1' | wikisql |
CREATE TABLE table_name_66 (
against INTEGER,
venue VARCHAR
) | How many againsts have asba park, kimberley as the venue? | SELECT SUM(against) FROM table_name_66 WHERE venue = "asba park, kimberley" | sql_create_context |
CREATE TABLE table_46642 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
) | What rank were the Buckeyes when there were 68,586 in attendance? | SELECT "Rank #" FROM table_46642 WHERE "Attendance" = '68,586' | wikisql |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id 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 ... | 列出在医院2726098中患者92492816门诊诊断名称包含扁桃体炎的门诊有哪些就诊记录? | SELECT * FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb... | css |
CREATE TABLE table_21470 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | On what day did Dirk Nowitzki (14) have a high rebound? | SELECT "Date" FROM table_21470 WHERE "High rebounds" = 'Dirk Nowitzki (14)' | wikisql |
CREATE TABLE Documents (
document_status_code VARCHAR
) | How many documents have the status code done? | SELECT COUNT(*) FROM Documents WHERE document_status_code = "done" | sql_create_context |
CREATE TABLE table_41475 (
"Position" text,
"Jersey #" real,
"Name" text,
"Birthdate" text,
"Birthplace" text,
"Club/Team" text
) | What is the Birthplace, when the Name is Bob Mcvey? | SELECT "Birthplace" FROM table_41475 WHERE "Name" = 'bob mcvey' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.