context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | tell me the name of the drug that patient 96006 was prescribed within 2 days after having received a atria septa def rep nec procedure since 181 months ago. | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 96006 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE table_name_11 (
gold INTEGER,
nation VARCHAR,
total VARCHAR
) | How many golds for west germany with over 8 total? | SELECT MIN(gold) FROM table_name_11 WHERE nation = "west germany" AND total > 8 | sql_create_context |
CREATE TABLE table_55563 (
"season" text,
"Contestant" text,
"Height" text,
"Start BMI" real,
"Start Weight" real,
"Recent BMI" text
) | What is the recent BMI on season 8 for the person who's BMI started under 46.3? | SELECT "Recent BMI" FROM table_55563 WHERE "Start BMI" < '46.3' AND "season" = 'season 8' | wikisql |
CREATE TABLE table_46410 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" text,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | what is the average 65 to 69 when the oblast\age is belgorod and 40 to 44 is more than 1,906? | SELECT AVG("65 to 69") FROM table_46410 WHERE "Oblast\\Age" = 'belgorod' AND "40 to 44" > '1,906' | wikisql |
CREATE TABLE cinema (
LOCATION VARCHAR
) | Show each location and the number of cinemas there. | SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION | sql_create_context |
CREATE TABLE table_1427868_1 (
load_bearing_capacity VARCHAR,
scientific_name VARCHAR
) | What is the load bearing capacity when the name is Camelus Dromedarius | SELECT load_bearing_capacity FROM table_1427868_1 WHERE scientific_name = "Camelus dromedarius" | sql_create_context |
CREATE TABLE table_10657 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | A round of 4 is in what position? | SELECT "Position" FROM table_10657 WHERE "Round" = '4' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | how much for a procedure called hepatic lobectomy? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hepatic lobectomy')) | mimic_iii |
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 name of the last intake that patient 31300 has had since 1161 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 = 31300)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_204_301 (
id number,
"nationality" text,
"name" text,
"term as a deputy judge" text,
"reason for termination" text
) | how long are the terms for those deputy judges that are not re elected ? | SELECT "term as a deputy judge" - "term as a deputy judge" FROM table_204_301 WHERE "reason for termination" = 'not re-elected' | squall |
CREATE TABLE table_name_88 (
clubs_involved INTEGER,
clubs_remaining VARCHAR
) | How many clubs are involved when the clubs remaining are 2? | SELECT SUM(clubs_involved) FROM table_name_88 WHERE clubs_remaining = 2 | sql_create_context |
CREATE TABLE table_55470 (
"Player" text,
"No.(s)" real,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What is the position for the Rockets years of 2004-05? | SELECT "Position" FROM table_55470 WHERE "Years for Rockets" = '2004-05' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 按照科室编码和出院诊断的差异算算医院7124001所有就诊记录中病人的年龄平均数 | SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7124001' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7124001' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.... | css |
CREATE TABLE trip (
start_station_id VARCHAR,
start_station_name VARCHAR
) | Find the ids and names of stations from which at least 200 trips started. | SELECT start_station_id, start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200 | sql_create_context |
CREATE TABLE table_204_402 (
id number,
"rank" number,
"player" text,
"from" text,
"to" text,
"transfer fee\n(\u20ac million)" number,
"year" number
) | what is the total number of players that transferred to ajax ? | SELECT COUNT("player") FROM table_204_402 WHERE "to" = 'ajax' | squall |
CREATE TABLE table_name_61 (
rider VARCHAR,
speed VARCHAR
) | Which Rider finished with a speed of 80.18mph? | SELECT rider FROM table_name_61 WHERE speed = "80.18mph" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_i... | what are the three most frequent drugs which were prescribed to the male patients 50s in the same month after they had been diagnosed with hypertension nos during this year? | SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE table_name_37 (
drawn INTEGER,
lost INTEGER
) | What is the average number of games drawn among the teams that lost over 13 games? | SELECT AVG(drawn) FROM table_name_37 WHERE lost > 13 | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, I want to show X from low to high order. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home | nvbench |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE PR... | How many different professors are there for the different schools Show bar chart, list y axis from high to low order. | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE gyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 参保人编码为65953184入院整数金额次数有几次? | SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_NM = '65953184' AND MOD(zyb.MED_CLINIC_ID, 1) = 0 | css |
CREATE TABLE table_name_55 (
term VARCHAR,
hometown VARCHAR
) | What is the term for hometown Ester Creek? | SELECT term FROM table_name_55 WHERE hometown = "ester creek" | sql_create_context |
CREATE TABLE table_67923 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
) | What team was the opponent when the time was 2:57, and a Score of 7 5? | SELECT "Opponent" FROM table_67923 WHERE "Time" = '2:57' AND "Score" = '7–5' | wikisql |
CREATE TABLE table_name_97 (
congress VARCHAR,
_number_of_cosponsors VARCHAR
) | What number of Congress has 44 cosponsors? | SELECT congress FROM table_name_97 WHERE _number_of_cosponsors = 44 | sql_create_context |
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... | provide the disease and discharge time of subject id 26746. | SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "26746" | mimicsql_data |
CREATE TABLE table_14966667_19 (
name VARCHAR,
number VARCHAR
) | who is number 98? | SELECT name FROM table_14966667_19 WHERE number = "98" | sql_create_context |
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
)
... | Find the number of patients with hematology a lab test category who were admitted before 2148. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2148" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Show different types of ships and the average tonnage of ships of each type in a pie chart. | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type | nvbench |
CREATE TABLE table_23790 (
"shareholder name" text,
"A shares" real,
"B shares" real,
"% of capital" text,
"% of votes" text
) | How many different shareholders have 2.39 % of capital? | SELECT COUNT("shareholder name") FROM table_23790 WHERE "% of capital" = '2.39' | wikisql |
CREATE TABLE table_name_5 (
socket VARCHAR,
part_number_s_ VARCHAR
) | What is the Socket when the Part Number(s) is rk80530pz001256? | SELECT socket FROM table_name_5 WHERE part_number_s_ = "rk80530pz001256" | sql_create_context |
CREATE TABLE table_train_58 (
"id" int,
"pregnancy_or_lactation" bool,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"temperature" float,
"surgery" bool,
"antibiotic_treatment" bool,
"heart_rate" int,
"allergy_to_vitamin_c" bool,
"paco2" float,
"immatur... | cardiovascular surgery patients receiving prophylactic peri operative antibiotics | SELECT * FROM table_train_58 WHERE surgery = 1 AND antibiotic_treatment = 1 | criteria2sql |
CREATE TABLE table_name_29 (
winner VARCHAR,
team VARCHAR,
circuit VARCHAR
) | What is Winner, when Team is 'R.J.MacArthur Onslow', and when Circuit is 'Oran Park Raceway'? | SELECT winner FROM table_name_29 WHERE team = "r.j.macarthur onslow" AND circuit = "oran park raceway" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId ... | Questions originally tagged [TAG] but now tagged [single-word-requests] or [phrase-requests]. | SELECT p.Id AS "post_link", p.CreationDate, ph.Text AS "initial_tags", p.Tags FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN PostHistory AS ph ON p.Id = ph.PostId AND ph.PostHistoryTypeId = 3 WHERE t.TagName IN ('single-word-requests', 'phrase-requests')... | sede |
CREATE TABLE table_name_17 (
points INTEGER,
draw VARCHAR,
jury VARCHAR,
artist VARCHAR
) | Jury larger than 6, and a Artist of zhenya rasskazova, and a Draw larger than 9 had what sum of points? | SELECT SUM(points) FROM table_name_17 WHERE jury > 6 AND artist = "zhenya rasskazova" AND draw > 9 | sql_create_context |
CREATE TABLE table_18143210_2 (
first_season_in_top_division VARCHAR,
club VARCHAR
) | When did the club UNAM played the first season in top division? | SELECT first_season_in_top_division FROM table_18143210_2 WHERE club = "UNAM" | sql_create_context |
CREATE TABLE table_16577990_1 (
tree_species VARCHAR,
total_plant_species VARCHAR
) | How many tree species are listed when the total plant species is 258? | SELECT tree_species FROM table_16577990_1 WHERE total_plant_species = 258 | sql_create_context |
CREATE TABLE table_6257 (
"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 is listed under Played that has a Club of Morriston RFC? | SELECT "Played" FROM table_6257 WHERE "Club" = 'morriston rfc' | wikisql |
CREATE TABLE table_name_96 (
game INTEGER,
score VARCHAR,
points VARCHAR
) | Which Game is the highest one that has a Score of 3 4 ot, and Points larger than 75? | SELECT MAX(game) FROM table_name_96 WHERE score = "3–4 ot" AND points > 75 | sql_create_context |
CREATE TABLE table_204_310 (
id number,
"month" text,
"year" number,
"player" text,
"county" text,
"club" text,
"position" number
) | eoin cadogan won in may 2009 , who won the month before ? | SELECT "player" FROM table_204_310 WHERE "year" = 2009 AND "month" = 5 - 1 | squall |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | List classes without lab sessions . | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | advising |
CREATE TABLE table_name_28 (
round INTEGER,
time VARCHAR
) | What is the highest round number with a time of 4:39? | SELECT MAX(round) FROM table_name_28 WHERE time = "4:39" | sql_create_context |
CREATE TABLE table_name_31 (
season INTEGER,
team_2 VARCHAR,
team_1 VARCHAR,
score VARCHAR
) | What year did Bangkok University and Chunnam Dragons have a score of 0-0? | SELECT SUM(season) FROM table_name_31 WHERE team_1 = "bangkok university" AND score = "0-0" AND team_2 = "chunnam dragons" | sql_create_context |
CREATE TABLE table_13591 (
"Rank" text,
"Name" text,
"Country" text,
"Leader's jerseys" real,
"Vuelta Wins" real,
"Points" real,
"Years" text
) | How many times is vuelta wins when points is more than 0, country is spain and the name is jos p rez-franc s? | SELECT COUNT("Vuelta Wins") FROM table_13591 WHERE "Points" > '0' AND "Country" = 'spain' AND "Name" = 'josé pérez-francés' | 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, show me about the correlation between price and code , and group by attribute headquarter in a scatter chart. | SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_8296 (
"Player" text,
"Wkts" real,
"Runs" real,
"Econ" real,
"Ovrs" real
) | What is the average Wkts, when Player is Beau Casson, and when Ovrs is greater than 32? | SELECT AVG("Wkts") FROM table_8296 WHERE "Player" = 'beau casson' AND "Ovrs" > '32' | 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,
... | 俞英卓病患在11年12月30日到2015年4月15日之间买了几次西药? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '俞英卓' AND t_kc22.STA_DATE BETWEEN '2011-12-30' AND '2015-04-15' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_name_44 (
date VARCHAR,
home VARCHAR,
time VARCHAR,
result VARCHAR
) | What day was the time 14:30, the result 0:1, and the home team fc chiasso (chl)? | SELECT date FROM table_name_44 WHERE time = "14:30" AND result = "0:1" AND home = "fc chiasso (chl)" | sql_create_context |
CREATE TABLE table_54061 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What were the laps of aprilia with a grid of 10? | SELECT "Laps" FROM table_54061 WHERE "Manufacturer" = 'aprilia' AND "Grid" = '10' | 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... | 患者73428643开出的药品均不低于9644.26元一共是在哪几次医疗记录中以及医疗就诊编号是多少? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '73428643' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 9644.26) | css |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | What is the average rating star for each reviewer. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name | nvbench |
CREATE TABLE table_203_421 (
id number,
"name" text,
"from" text,
"until" text,
"relationship with predecessor" text
) | who was the first head of medici ? | SELECT "name" FROM table_203_421 ORDER BY "from" LIMIT 1 | squall |
CREATE TABLE table_203_234 (
id number,
"description" text,
"total" number,
"poland" number,
"baltic states(resettled in poland during war)" number,
"resettled in poland during war(from ussr and romania)" number,
"sudetendeutsch" number,
"se europe\n(hungary, romania, yugoslavia & slovak... | how many causes were responsible for more than 50,000 confirmed deaths ? | SELECT COUNT("description") FROM table_203_234 WHERE "total" > 50000 | squall |
CREATE TABLE table_35225 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
) | Which Date has a Catalog of 887 195-2, and a Format of cd maxi? | SELECT "Date" FROM table_35225 WHERE "Catalog" = '887 195-2' AND "Format" = 'cd maxi' | wikisql |
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... | specify the type and route of drug code isos10 | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ISOS10" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | when was the first blood, venipuncture microbiology test conducted in patient 031-3355 on their current hospital encounter? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microla... | eicu |
CREATE TABLE table_809 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What were all the tries for when the try bonus was 8? | SELECT "Tries for" FROM table_809 WHERE "Try bonus" = '8' | wikisql |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
... | Show budget type codes and the number of documents in each budget type Show bar chart, and list Y-axis in ascending order please. | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and could you list y axis in asc order? | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
) | which is the only team that chile was faster than in cycling at the 1996 summer olympics men 's team pursuit ? | SELECT "team" FROM table_204_735 WHERE "time" > (SELECT "time" FROM table_204_735 WHERE "team" = 'chile') | squall |
CREATE TABLE table_name_61 (
silver INTEGER,
rank VARCHAR,
gold VARCHAR
) | What is the average silver with a Rank smaller than 2 and more than 1 gold? | SELECT AVG(silver) FROM table_name_61 WHERE rank < 2 AND gold > 1 | sql_create_context |
CREATE TABLE table_7880 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What years did Lou Graham win in? | SELECT "Year(s) won" FROM table_7880 WHERE "Player" = 'lou graham' | wikisql |
CREATE TABLE table_72818 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | what is the diameter (km) of the feature of latitude 23.0s | SELECT "Diameter (km)" FROM table_72818 WHERE "Latitude" = '23.0S' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | how many patients are admitted in clinic referral/premature and lab tested with lab item id 50976? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50976" | mimicsql_data |
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,
... | how much did it cost for the stay of patient 9038 in the hospital during their first hospital visit? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_name_72 (
club_team VARCHAR,
nationality VARCHAR,
overall VARCHAR
) | Name the club team for overall of 188 for canada | SELECT club_team FROM table_name_72 WHERE nationality = "canada" AND overall = 188 | sql_create_context |
CREATE TABLE table_204_152 (
id number,
"device" text,
"type" text,
"iops" text,
"interface" text,
"notes" text
) | name the device above intel x25 e | SELECT "device" FROM table_204_152 WHERE id = (SELECT id FROM table_204_152 WHERE "device" = 'intel x25-e (slc)') - 1 | squall |
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 procedure long title of subject name paul edwards? | SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_14413 (
"Sunday Surya (the Sun)" text,
"Monday Soma (the Moon)" text,
"Tuesday Mangala (Mars)" text,
"Friday Shukra (Venus)" text,
"Saturday Shani (Saturn)" text
) | What is the result of Friday that's [ oa a] from sans. a g ra on Tuesday? | SELECT "Friday Shukra (Venus)" FROM table_14413 WHERE "Tuesday Mangala (Mars)" = 'တ္ၚဲ အၚါ [ŋoa əŋɛ̀a] from sans. aṅgāra' | wikisql |
CREATE TABLE table_64003 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What's the total draws for Ararat when the byes are less than 2? | SELECT SUM("Draws") FROM table_64003 WHERE "Wimmera FL" = 'ararat' AND "Byes" < '2' | wikisql |
CREATE TABLE table_66848 (
"Vehicle Flight #" text,
"Date" text,
"Pilot" text,
"Mach" real,
"Velocity (km/h)" real,
"Altitude (ft)" real,
"Duration" text
) | Who is the pilot on September 27, 1972? | SELECT "Pilot" FROM table_66848 WHERE "Date" = 'september 27, 1972' | 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... | count the number of patients whose primary disease is rash and year of death is less than or equal to 2131? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.dod_year <= "2131.0" | mimicsql_data |
CREATE TABLE table_27755784_8 (
record VARCHAR,
high_points VARCHAR
) | What is the record when the high points is listed as Stephen Curry (32)? | SELECT record FROM table_27755784_8 WHERE high_points = "Stephen Curry (32)" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | Users by Tag and Location. | SELECT u.Id AS "user_link", u.Reputation AS "reputation", u.Age AS "age", p.Tags AS "tags", COUNT(*) AS UpVotes FROM Tags AS t WITH (nolock) INNER JOIN PostTags AS pt WITH (nolock) ON pt.TagId = t.Id INNER JOIN Posts AS p WITH (nolock) ON p.ParentId = pt.PostId INNER JOIN Votes AS v WITH (nolock) ON v.PostId = p.Id AND... | sede |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | My current GPA is ? | SELECT DISTINCT total_gpa FROM student WHERE student_id = 1 | advising |
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,
... | 患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号 | SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info... | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在医院6149241中,根据入院诊断疾病名称把不同疾病患者的平均年龄列一下 | SELECT t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6149241' GROUP BY t_kc21.IN_DIAG_DIS_NM | css |
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 prescriptio... | what is the yearly minimum amount of carboxyhemoglobin patient 29971 has until 5 months ago? | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29971) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'carboxyhemoglobin') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_T... | mimic_iii |
CREATE TABLE table_15290638_1 (
group_c VARCHAR,
group_d VARCHAR
) | Who is in group c when wisconsin is in group d? | SELECT group_c FROM table_15290638_1 WHERE group_d = "Wisconsin" | sql_create_context |
CREATE TABLE table_62696 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | When less than 30 games have been played what is the average goals scored? | SELECT AVG("Goals scored") FROM table_62696 WHERE "Games played" < '30' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose age is less than 31 and item id is 50820? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab.itemid = "50820" | mimicsql_data |
CREATE TABLE table_45031 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
) | When the mark is 7.35, what's the lowest Lane found? | SELECT MIN("Lane") FROM table_45031 WHERE "Mark" = '7.35' | 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 (
... | Tell me the number of office admissions with the atrial fibrillation/thoracoscopic maze procedure and bilateral/sda primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" | mimicsql_data |
CREATE TABLE table_5213 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Venue" text,
"Attendance" text
) | Attendance of 35,842 had what date? | SELECT "Date" FROM table_5213 WHERE "Attendance" = '35,842' | wikisql |
CREATE TABLE table_name_62 (
venue VARCHAR,
away_team VARCHAR
) | In what venue was the away team South Melbourne? | SELECT venue FROM table_name_62 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_name_33 (
match VARCHAR,
date VARCHAR
) | What match was on 30 january 1938? | SELECT match FROM table_name_33 WHERE date = "30 january 1938" | sql_create_context |
CREATE TABLE table_name_2 (
wins INTEGER,
tournament VARCHAR,
cuts_made VARCHAR
) | Which Wins has a Tournament of totals, and a Cuts made larger than 42? | SELECT AVG(wins) FROM table_name_2 WHERE tournament = "totals" AND cuts_made > 42 | sql_create_context |
CREATE TABLE table_74629 (
"Club" text,
"Total points" text,
"Bonus points" text,
"Match points" text,
"Games" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Diff" text
) | What is the diff for a club that has a value of 662 for points for? | SELECT "Diff" FROM table_74629 WHERE "Points for" = '662' | wikisql |
CREATE TABLE table_name_21 (
points VARCHAR,
record VARCHAR,
january VARCHAR
) | How many Points have a Record of 25 10 11, and a January larger than 28? | SELECT COUNT(points) FROM table_name_21 WHERE record = "25–10–11" AND january > 28 | sql_create_context |
CREATE TABLE table_38245 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
) | Name the outcome for opponents of jonas bj rkman john mcenroe | SELECT "Outcome" FROM table_38245 WHERE "Opponents in the final" = 'jonas björkman john mcenroe' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | 从二零一五年十二月二十二日到二零二零年八月二十五日这段时间里,患者97737667的哪些药品自付比例低于0.04的,把数量统计出来 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '97737667' AND t_kc22.STA_DATE BETWEEN '2015-12-22' AND '2020-08-25' AND t_kc22.SELF_PAY_PRO < 0.04 | css |
CREATE TABLE table_204_431 (
id number,
"yacht" text,
"nation" text,
"owner" text,
"skipper" text,
"launch year" number
) | what is the total number of yachts launched in 2001 ? | SELECT COUNT("yacht") FROM table_204_431 WHERE "launch year" = 2001 | squall |
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... | 列出哪些人在医疗就诊70939777652中申请超过12份检验报告单?申请人工号和姓名各是什么? | SELECT zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '70939777652' GROUP BY zyjybgb.SQRGH HAVING COUNT(*) > 12 UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '70939777652' GROUP BY mzjybgb.SQRGH HAVING COUNT(*) > 12 | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is the diagnosis icd9 code and diagnosis long title of subject id 65982? | SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "65982" | mimicsql_data |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | Top-N users for a tag. | WITH t AS (SELECT SUM(Score) AS total, DisplayName AS name FROM Posts INNER JOIN PostTags ON Posts.ParentId = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Tags.TagName = @Tag AND Score != 0 GROUP BY Users.Id, DisplayName ORDER BY total DESC LIMIT 10)... | sede |
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... | 31337680的患者自02.3.31起,到04.3.1止,看病时一共做了多少次的检查 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '31337680' AND t_kc22.STA_DATE BETWEEN '2002-03-31' AND '2004-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_43 (
enrollment VARCHAR,
affiliation VARCHAR,
founded VARCHAR
) | What is the total enrollment for an affiliation of public, and was founded before 1866? | SELECT COUNT(enrollment) FROM table_name_43 WHERE affiliation = "public" AND founded < 1866 | 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 d_labitems (
row_id number... | what is the daily average value of patient 16066's rdw until 2104? | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16066) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND STRFTIME('%y', labevents.charttime) <= '2104' GROUP BY STRFTIME('... | mimic_iii |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
... | Get ViewCount On Posts User Contributed To. | SELECT DISTINCT (p2.Id) AS "post_link", p2.ViewCount FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.Id ORDER BY p2.ViewCount | sede |
CREATE TABLE table_62956 (
"Draw" real,
"Artist" text,
"Song" text,
"Percentage" text,
"Place" real
) | What Artist has a Place of 3 or less with a Percentage of 38.60%? | SELECT "Artist" FROM table_62956 WHERE "Place" < '3' AND "Percentage" = '38.60%' | wikisql |
CREATE TABLE table_21834 (
"Rank" real,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" real,
"April 1, 2010 density (/km\u00b2)" real,
"April 1, 2010 density (/mi\u00b2)" real,
"July 1, 2010 official estimate" real,
"... | Name the state for lake county | SELECT "State" FROM table_21834 WHERE "County" = 'Lake County' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.