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,
... | give me the list of patients with lab test item id 50824 who died in or before 2115. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2115.0" AND lab.itemid = "50824" | mimicsql_data |
CREATE TABLE table_2509202_2 (
tipuani_municipality VARCHAR,
tacacoma_municipality VARCHAR
) | tipuani municipality when tacacoma municipality is 6? | SELECT tipuani_municipality FROM table_2509202_2 WHERE tacacoma_municipality = "6" | sql_create_context |
CREATE TABLE table_15188 (
"Year" real,
"Population (Total)" real,
"(Barcaldine)" real,
"(Aramac)" real,
"(Jericho)" real
) | What is the average (Jericho) with a Population (Total) less than 4,059 in 1986 and a (Barcaldine) higher than 1,779? | SELECT AVG("(Jericho)") FROM table_15188 WHERE "Population (Total)" < '4,059' AND "Year" = '1986' AND "(Barcaldine)" > '1,779' | 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... | 患者42705253主要去哪家医院,在2016-09-13到2017-01-15这一年里? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '42705253' AND t_kc21.IN_HOSP_DATE BETWEEN '2016-09-13' AND '2017-01-15' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_86 (
score VARCHAR,
place VARCHAR,
country VARCHAR
) | What Score has a Place of t8, and a Country of scotland? | SELECT score FROM table_name_86 WHERE place = "t8" AND country = "scotland" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在2005年3月24日到14年8月29日期间在医疗机构住院1952480的患者平均住院是多长时间? | SELECT AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1952480' AND qtb.IN_HOSP_DATE BETWEEN '2005-03-24' AND '2014-08-29' UNION SELECT AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1952480' AND gyb.IN_HOSP_DATE BETWEEN '2005-03-24' AND '2014-08-29' UNION SELECT AVG(zyb.IN_HOSP_DAYS) FROM zyb WH... | css |
CREATE TABLE table_72699 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | List the pictorals from issues when lindsey roeper was the cover model. | SELECT "Pictorials" FROM table_72699 WHERE "Cover model" = 'Lindsey Roeper' | wikisql |
CREATE TABLE table_79640 (
"Round" real,
"Date" text,
"Home Team" text,
"Away Team" text,
"Attendance" real,
"Stadium" text
) | What is the least round for the game played at Members Equity Stadium in from of 12,581 people? | SELECT MIN("Round") FROM table_79640 WHERE "Stadium" = 'members equity stadium' AND "Attendance" < '12,581' | wikisql |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labev... | what were the four most frequently prescribed drugs at the same time, since 4 years ago, among the patients who were prescribed with heparin flush port (10units/ml)? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin flush port (10units/ml)' AND DATETIME(prescriptions.start... | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | How many of the patients with icd9 code 598 died in or before the 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "598" | mimicsql_data |
CREATE TABLE table_204_672 (
id number,
"year" number,
"title" text,
"label" text,
"uk singles chart" number,
"u.s. billboard hot 100 chart" number
) | what was the last single from this music group ? | SELECT "title" FROM table_204_672 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_65330 (
"Position" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthplace" text,
"2009\u201310 team" text
) | What is the sum of the heights for the Cornell Big Red? | SELECT SUM("Height (cm)") FROM table_65330 WHERE "2009\u201310 team" = 'cornell big red' | wikisql |
CREATE TABLE table_29368 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Ratings" text
) | What were the ratings for 'episode 6'? | SELECT "Ratings" FROM table_29368 WHERE "Title" = 'Episode 6' | wikisql |
CREATE TABLE table_train_137 (
"id" int,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"hcv" bool,
"schizophrenia" bool,
"neutrophil_count" int,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"platelet_count"... | subject has a history of primary psychotic disorder ( e.g. schizophrenia, schizoaffective disorder, delusional disorder ) or bipolar disorder. | SELECT * FROM table_train_137 WHERE primary_psychotic_disorder = 1 OR schizophrenia = 1 OR schizoaffective_disorder = 1 OR delusional_disorder = 1 OR bipolar_disorder = 1 | criteria2sql |
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 team_id by acc regular season in a histogram, list by the Y-axis in desc. | SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID DESC | nvbench |
CREATE TABLE table_17069 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | WHAT SCHOOL DID THE PLAYER FROM SOUTH CAROLINA ATTEND? | SELECT "School" FROM table_17069 WHERE "College" = 'South Carolina' | 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,
... | 患者韩曼冬在2002年2月11日到2014年2月3日内都做了什么检验把检验结果指标记录中的仪器编号以及名称列出来 | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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 jybg... | css |
CREATE TABLE table_name_64 (
zone INTEGER,
stations VARCHAR
) | Name the average zone for waddon marsh tram stop | SELECT AVG(zone) FROM table_name_64 WHERE stations = "waddon marsh tram stop" | sql_create_context |
CREATE TABLE table_143579_1 (
area___ha__ INTEGER,
island VARCHAR
) | What is the area of Colonsay Island? | SELECT MIN(area___ha__) FROM table_143579_1 WHERE island = "Colonsay" | sql_create_context |
CREATE TABLE table_22328 (
"Serial No." real,
"District" text,
"Headquartered City" text,
"City Population (2009)" real,
"City Area(km 2 )" real
) | In what district is the city listed in Serial number 9? | SELECT COUNT("District") FROM table_22328 WHERE "Serial No." = '9' | wikisql |
CREATE TABLE table_name_98 (
date VARCHAR,
away_team VARCHAR
) | On what Date is Carlton the Away Team? | SELECT date FROM table_name_98 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE Customer_Contact_Channels (
customer_id INTEGER,
channel_code VARCHAR(15),
active_from_date DATETIME,
active_to_date DATETIME,
contact_number VARCHAR(50)
)
CREATE TABLE Order_Items (
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(15)
)
CREATE TABLE Customer_A... | Find the number of orders in each day and bin the number of orders by customers in a line chart. | SELECT order_date, COUNT(order_date) FROM Customers AS t1 JOIN Customer_Orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" GROUP BY customer_name | nvbench |
CREATE TABLE table_651 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What's the series number of the episode that's written by Elizabeth Devine? | SELECT MIN("No. in series") FROM table_651 WHERE "Written by" = 'Elizabeth Devine' | wikisql |
CREATE TABLE table_31751 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Start Time" text,
"Attendance" text
) | Tell me the number of weeks for december 5, 2005 | SELECT COUNT("Week") FROM table_31751 WHERE "Date" = 'december 5, 2005' | 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... | Find the total student enrollment for different affiliation type schools Plot them as bar chart, could you rank by the names from high to low? | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation DESC | nvbench |
CREATE TABLE table_15187735_6 (
segment_a VARCHAR,
segment_c VARCHAR
) | What is the Segment A for when Segment C is s Sailboard? | SELECT segment_a FROM table_15187735_6 WHERE segment_c = "s Sailboard" | sql_create_context |
CREATE TABLE table_name_69 (
venue VARCHAR,
competition VARCHAR
) | Competition of fa cup rd 1 had what venue? | SELECT venue FROM table_name_69 WHERE competition = "fa cup rd 1" | sql_create_context |
CREATE TABLE table_31813 (
"Nomination" text,
"Actor's Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | Tell me the actor's name for escho raz o voyne | SELECT "Actor's Name" FROM table_31813 WHERE "Film Name" = 'escho raz o voyne' | wikisql |
CREATE TABLE table_name_50 (
year INTEGER,
play VARCHAR,
recipient VARCHAR
) | Name the average year for much ado about nothing and recipient of ray virta | SELECT AVG(year) FROM table_name_50 WHERE play = "much ado about nothing" AND recipient = "ray virta" | sql_create_context |
CREATE TABLE table_64399 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | What Podiums listing has a World Rally Championship series entry? | SELECT "Podiums" FROM table_64399 WHERE "Series" = 'world rally championship' | wikisql |
CREATE TABLE table_7541 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | Where did they play against Clemson? | SELECT "Location" FROM table_7541 WHERE "Opponent" = 'clemson' | wikisql |
CREATE TABLE table_name_89 (
release_date VARCHAR,
country VARCHAR,
release_format VARCHAR
) | How many release dates have a Country of west germany, and a Release format of vinyl? | SELECT COUNT(release_date) FROM table_name_89 WHERE country = "west germany" AND release_format = "vinyl" | sql_create_context |
CREATE TABLE table_203_798 (
id number,
"party" text,
"votes" text,
"%" number,
"swing" number,
"seats" number,
"change" number
) | how many votes did the independent party have ? | SELECT "votes" FROM table_203_798 WHERE "party" = 'independent' | squall |
CREATE TABLE table_name_16 (
res VARCHAR,
round VARCHAR,
opponent VARCHAR
) | What was the result when there were less than 3 rounds against Gil Rael? | SELECT res FROM table_name_16 WHERE round < 3 AND opponent = "gil rael" | sql_create_context |
CREATE TABLE table_name_17 (
award VARCHAR,
year VARCHAR,
result VARCHAR
) | What is the name of the award in a year more than 2005, and the Result of nominated? | SELECT award FROM table_name_17 WHERE year > 2005 AND result = "nominated" | sql_create_context |
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 time,
ExpiryDate time,
Body text,
OwnerUserId... | Get Title, ViewCount for all posts. | SELECT Title, ViewCount FROM Posts | sede |
CREATE TABLE table_train_243 (
"id" int,
"c_peptide_level" float,
"finger_stick_measurements" bool,
"diabetic" string,
"fasting_blood_glucose_fbg" float,
"hypoglycemia" bool,
"insulin_requirement" float,
"triglyceride_tg" float,
"a1c" float,
"age" float,
"NOUSE" float
) | a1c 7.1 _ 11 | SELECT * FROM table_train_243 WHERE a1c >= 7.1 AND a1c <= 11 | criteria2sql |
CREATE TABLE table_name_19 (
team VARCHAR,
high_assists VARCHAR,
date VARCHAR
) | Which team was played against on the game where Earl Watson (6) had the highest assists on January 19? | SELECT team FROM table_name_19 WHERE high_assists = "earl watson (6)" AND date = "january 19" | sql_create_context |
CREATE TABLE table_10930 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps have a Time/Retired of +12.5 secs? | SELECT COUNT("Laps") FROM table_10930 WHERE "Time/Retired" = '+12.5 secs' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 医院9235653中列出56017266病患入院科室名称包含角膜的住院就诊记录一共是哪些条? | SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | css |
CREATE TABLE table_12014 (
"Rider" text,
"Horse" text,
"Faults" text,
"Round 1 + 2A Points" text,
"Total" real
) | Tell me the highest total when the horse is spender s | SELECT MAX("Total") FROM table_12014 WHERE "Horse" = 'spender s' | wikisql |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR... | Visualize a bar chart about the distribution of other_details and the average of monthly_rental , and group by attribute other_details. | SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Eve... | Draw a bar chart for what are the ids and details of events that have more than one participants?, and show in asc by the Y. | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID | nvbench |
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_diagnoses (
row_id number,
icd9_code text,
sh... | give me the top four of the most common output events? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE table_name_36 (
balls VARCHAR,
strike_rate VARCHAR
) | When the strike rate is 70.10, what is the balls? | SELECT balls FROM table_name_36 WHERE strike_rate = "70.10" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many single patients are diagnosed with migrne unsp wo ntrc mgrn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.short_title = "Migrne unsp wo ntrc mgrn" | mimicsql_data |
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 (
... | what is lab test abnormal status of subject id 6983? | SELECT lab.flag FROM lab WHERE lab.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_16815824_1 (
round5 VARCHAR,
total_points VARCHAR
) | What was the round 5 score if the team's total points where 212? | SELECT round5 FROM table_16815824_1 WHERE total_points = 212 | 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... | what is date of death and discharge time of subject id 94762? | SELECT demographic.dod, demographic.dischtime FROM demographic WHERE demographic.subject_id = "94762" | mimicsql_data |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (... | show me the flights arriving at DAL from all other airports | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DAL' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code | atis |
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... | 列出病人周锐志医疗记录中的入院诊断疾病名称和编码,主要针对医疗费总额不低于6373.39元的 | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '周锐志' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 6373.39) | css |
CREATE TABLE table_name_52 (
score VARCHAR,
game VARCHAR
) | What was the score of game 30? | SELECT score FROM table_name_52 WHERE game = 30 | sql_create_context |
CREATE TABLE table_203_593 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number,
"ncaa tournament" number
) | who was the first coach to reach the ncaa tournament ? | SELECT "coach" FROM table_203_593 WHERE NOT "ncaa tournament" IS NULL ORDER BY "tenure" LIMIT 1 | squall |
CREATE TABLE table_19704392_1 (
rpm VARCHAR,
standard_speed__6th_gear_ VARCHAR
) | when standard speed (6th gear) is 88, what is the rpm? | SELECT rpm FROM table_19704392_1 WHERE standard_speed__6th_gear_ = "88" | sql_create_context |
CREATE TABLE table_47742 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | What home is dated march 19? | SELECT "Home" FROM table_47742 WHERE "Date" = 'march 19' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | metion the age and primary disease of gonzalo wasson. | SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.name = "Gonzalo Wasson" | mimicsql_data |
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... | 医院5848199所有就诊的记录里面,按照患者所在的不同科室和入院诊断的差异算出他们平均岁数有多大 | SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5848199' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5848199' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.IN_... | css |
CREATE TABLE table_4420 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | I want the NHL team for wade belak | SELECT "NHL team" FROM table_4420 WHERE "Player" = 'wade belak' | wikisql |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | what is the difference in arterial bp [diastolic] in patient 3125's last measured on the current icu visit compared to the value first measured on the current icu 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 = 3125) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it... | mimic_iii |
CREATE TABLE table_204_868 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"opponent" text,
"score" text
) | what is the number of victories this player has had on hard surfaces ? | SELECT COUNT(*) FROM table_204_868 WHERE "surface" = 'hard' | squall |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what is the last flight leaving SAN FRANCISCO going to WASHINGTON on 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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 25 AND date_day.month_number = 6 A... | atis |
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... | provide the number of patients whose gender is f and procedure long title is atrial cardioversion? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Atrial cardioversion" | mimicsql_data |
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
) | Compare the lowest rating among all movies by each director using a bar chart. | SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director | nvbench |
CREATE TABLE table_61162 (
"Lince" text,
"Leopard 2A4" text,
"Leclerc" text,
"M1A1 Abrams" text,
"M60A3 Patton" text
) | What's the lince when Leclerc was Hp (kw)? | SELECT "Lince" FROM table_61162 WHERE "Leclerc" = 'hp (kw)' | wikisql |
CREATE TABLE table_name_22 (
events INTEGER,
earnings VARCHAR,
average VARCHAR
) | Which Events has Earnings of $113,259, and an Average larger than 229.5? | SELECT MAX(events) FROM table_name_22 WHERE earnings = "$113,259" AND average > 229.5 | sql_create_context |
CREATE TABLE table_12250 (
"Round" real,
"Date" text,
"Event" text,
"Circuit" text,
"Winning Driver" text,
"Winning Team" text
) | Which Circuit has an Event of international procar meeting? | SELECT "Circuit" FROM table_12250 WHERE "Event" = 'international procar meeting' | wikisql |
CREATE TABLE table_16799784_7 (
diameter__km_ VARCHAR,
longitude VARCHAR
) | what is the diameter (km) of longitude 170.1e | SELECT diameter__km_ FROM table_16799784_7 WHERE longitude = "170.1E" | sql_create_context |
CREATE TABLE table_57955 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the low lap total for a grid of 14? | SELECT MIN("Laps") FROM table_57955 WHERE "Grid" = '14' | wikisql |
CREATE TABLE table_16372911_1 (
acc_home VARCHAR,
acc__percentage VARCHAR
) | what was the ACC home game record for the team who's ACC winning percentage was .813? | SELECT acc_home FROM table_16372911_1 WHERE acc__percentage = ".813" | sql_create_context |
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 prescriptions (
row_id number,
subject_id number,
h... | how many patients have undergone vaccination nec within 2 months after first receiving inj/inf platelet inhibit? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inj/inf pla... | mimic_iii |
CREATE TABLE table_25695 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | Name the most free throws for 4 steals | SELECT MAX("Free Throws") FROM table_25695 WHERE "Steals" = '4' | 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,
... | 门诊诊断患者为结膜炎的尿素的参考值范围有什么下限和上限? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '尿素' | css |
CREATE TABLE table_55565 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What's the crowd population of the home team located in Richmond? | SELECT SUM("Crowd") FROM table_55565 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE people (
Hometown VARCHAR,
People_ID VARCHAR
)
CREATE TABLE gymnast (
Gymnast_ID VARCHAR,
Total_Points INTEGER
) | What are the distinct hometowns of gymnasts with total points more than 57.5? | SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5 | sql_create_context |
CREATE TABLE table_train_70 (
"id" int,
"pregnancy_or_lactation" bool,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"mean_arterial_pressure_map" int,
"temperature" float,
"oliguria" bool,
"surgery" bool,
"heart_rate" int,
"systemic_inflammatory_response" b... | pregnant or breast feeding female | SELECT * FROM table_train_70 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_17723 (
"Year" real,
"Population (Region total)" real,
"Population (Stanthorpe)" real,
"Population (Warwick)" real,
"Population (Allora)" real,
"Population (Glengallan)" real,
"Population (Rosenthal)" real
) | What is the maximum population size in the town of Glengallen? | SELECT MAX("Population (Glengallan)") FROM table_17723 | wikisql |
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 ... | 韩霞飞患者以前都有过哪些异常情况吗? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
CREATE TABLE table_9511 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What is the highest number of goals for for teams with 25 losses? | SELECT MAX("Goals For") FROM table_9511 WHERE "Lost" = '25' | wikisql |
CREATE TABLE table_36338 (
"Volume" text,
"Discs" real,
"Episodes" real,
"Region 1 release" text,
"Region 2 release" text,
"Region 4 release" text
) | What is the region 4 release that has july 20, 2009 as the region 2? | SELECT "Region 4 release" FROM table_36338 WHERE "Region 2 release" = 'july 20, 2009' | wikisql |
CREATE TABLE table_38396 (
"Name" text,
"Years of Operation" text,
"Location" text,
"Historical Photos" text,
"Year Clubhouse Constructed" text,
"Sign-in/Bicker" text,
"Year co-ed" text
) | When was the Clubhouse built with a Sign-in/Bicker of bicker, and Named cannon club? | SELECT "Year Clubhouse Constructed" FROM table_38396 WHERE "Sign-in/Bicker" = 'bicker' AND "Name" = 'cannon club' | wikisql |
CREATE TABLE table_26418 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Name the score for san diego | SELECT "Score" FROM table_26418 WHERE "Championship" = 'San Diego' | wikisql |
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... | What MDE classes are offered next Winter ? | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | calculate the minimum days for which patients who were admitted on or after 2179 were hospitalized. | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2179" | mimicsql_data |
CREATE TABLE table_204_667 (
id number,
"year" number,
"film title" text,
"genre" text,
"cast" text,
"notes" text
) | what is the title listed after parva ? | SELECT "film title" FROM table_204_667 WHERE id = (SELECT id FROM table_204_667 WHERE "film title" = 'parva') + 1 | squall |
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 the number of patients whose diagnosis icd9 code is v5416 and lab test fluid is pleural. | 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.icd9_code = "V5416" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | count the number of patients who have already undergone a sputum, expectorated microbiology test until 1 year ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND DATETIME(microlab.culturetakentime) <= DATETIME(CURRENT_TIME(), '-1 year')) | eicu |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | 在2001-07-24到2018-05-18期间,1438612这个医疗机构有多少次外地住院的就诊记录 | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '1438612' AND zyjzjlb.RYDJSJ BETWEEN '2001-07-24' AND '2018-05-18' AND zyjzjlb.WDBZ > 0 | css |
CREATE TABLE table_62264 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is Visitor, when Date is 'May 9'? | SELECT "Visitor" FROM table_62264 WHERE "Date" = 'may 9' | wikisql |
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 maximum age of patients whose insurance is self pay and primary disease is hypoxia? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "HYPOXIA" | 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what are the five most frequent lab tests patients have taken within the same month after being diagnosed with senile dementia uncomp? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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.i... | mimic_iii |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of manager_id bin hire_date by time in a bar chart, and rank from high to low by the y axis. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_13606 (
"General election" real,
"Name" text,
"Share of votes" text,
"Seats" real,
"Share of seats" text
) | Which Share of seats has Seats smaller than 52, and a Name of sdp liberal alliance, and a General election of 1983? | SELECT "Share of seats" FROM table_13606 WHERE "Seats" < '52' AND "Name" = 'sdp–liberal alliance' AND "General election" = '1983' | wikisql |
CREATE TABLE table_43858 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | What attendance is dated february 27? | SELECT AVG("Attendance") FROM table_43858 WHERE "Date" = 'february 27' | wikisql |
CREATE TABLE table_name_25 (
born_died VARCHAR,
term_start VARCHAR
) | What is Born-Died, when Term Start is 4 December 1941? | SELECT born_died FROM table_name_25 WHERE term_start = "4 december 1941" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 在病患61732704的检验报告单中哪些号码是检验结果指标全部不正常的? | SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '61732704' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ... | css |
CREATE TABLE table_name_61 (
translation VARCHAR,
composer VARCHAR
) | WhatTranslation has a Composer of jacques brel, rod mckuen? | SELECT translation FROM table_name_61 WHERE composer = "jacques brel, rod mckuen" | sql_create_context |
CREATE TABLE table_10305 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the name of the venue where the away team scored 17.12 (114)? | SELECT "Venue" FROM table_10305 WHERE "Away team score" = '17.12 (114)' | wikisql |
CREATE TABLE table_54569 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"College" text
) | What is the average round for players from california? | SELECT AVG("Round") FROM table_54569 WHERE "College" = 'california' | wikisql |
CREATE TABLE table_65044 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Who was the opponent in week 6? | SELECT "Opponent" FROM table_65044 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_203_519 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | charles zwolsman acquired the same number of points as who ? | SELECT "driver" FROM table_203_519 WHERE "driver" <> 'charles zwolsman' AND "points" = (SELECT "points" FROM table_203_519 WHERE "driver" = 'charles zwolsman') | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.