context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_35 (
celebrity VARCHAR,
exited VARCHAR
) | Who was the celebrity who exited on day 13? | SELECT celebrity FROM table_name_35 WHERE exited = "day 13" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | tell me the five most frequently ordered procedure for patients of 40s since 2102? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE table_name_35 (
episode VARCHAR,
rating VARCHAR,
viewers__m_ VARCHAR
) | What Episode has a Rating of 1.8, and Viewers (m) smaller than 2.73? | SELECT episode FROM table_name_35 WHERE rating = "1.8" AND viewers__m_ < 2.73 | sql_create_context |
CREATE TABLE table_57670 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time of the driver on grid 7? | SELECT "Time/Retired" FROM table_57670 WHERE "Grid" = '7' | wikisql |
CREATE TABLE table_59940 (
"Spaceport" text,
"Launch complex" text,
"Launcher" text,
"Spacecraft" text,
"Flights" text,
"Years" text
) | What was the launcher vehicle for Apollo-Soyuz? | SELECT "Launcher" FROM table_59940 WHERE "Spacecraft" = 'apollo-soyuz' | wikisql |
CREATE TABLE table_name_74 (
against INTEGER,
status VARCHAR,
opposing_teams VARCHAR
) | What is the average Against, when Status is '2007 Rugby World Cup', and when Opposing Teams is 'U.S.A.'? | SELECT AVG(against) FROM table_name_74 WHERE status = "2007 rugby world cup" AND opposing_teams = "u.s.a." | 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,
... | how many days has it been since the first time that patient 033-22108 had intake of cl flush: non-tunneled ij r on the current icu visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
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,
... | count the number of patients whose drug code is vanc250l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VANC250L" | mimicsql_data |
CREATE TABLE table_73077 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering this round" text
) | Name the new entries this round for third round | SELECT "New entries this round" FROM table_73077 WHERE "Round" = 'Third round' | wikisql |
CREATE TABLE table_name_95 (
rider VARCHAR,
grid VARCHAR,
laps VARCHAR,
manufacturer VARCHAR
) | Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14 | SELECT rider FROM table_name_95 WHERE laps > 23 AND manufacturer = "aprilia" AND grid = 14 | sql_create_context |
CREATE TABLE table_name_61 (
opponent VARCHAR,
date VARCHAR
) | Who was the Opponent on July 29? | SELECT opponent FROM table_name_61 WHERE date = "july 29" | sql_create_context |
CREATE TABLE table_name_80 (
date VARCHAR,
attendance VARCHAR
) | Attendance of 29,000 occurred on what date? | SELECT date FROM table_name_80 WHERE attendance = "29,000" | sql_create_context |
CREATE TABLE table_name_77 (
seasons VARCHAR,
goals VARCHAR,
lost VARCHAR
) | How many seasons have goals of 261-338 with more than 111 losses? | SELECT COUNT(seasons) FROM table_name_77 WHERE goals = "261-338" AND lost > 111 | sql_create_context |
CREATE TABLE table_name_57 (
name VARCHAR,
medal VARCHAR,
event VARCHAR
) | Which participants won the silver medal for the Men's Doubles? | SELECT name FROM table_name_57 WHERE medal = "silver" AND event = "men's doubles" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZ... | 名叫李宇航的患者以前都有哪些住院诊断还记得吗? | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_... | css |
CREATE TABLE table_11964154_9 (
record VARCHAR,
score VARCHAR
) | what's the record where score is w 105 92 (ot) | SELECT record FROM table_11964154_9 WHERE score = "W 105–92 (OT)" | sql_create_context |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_... | List the customers first and last name of 10 least expensive invoices. | SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10 | spider |
CREATE TABLE table_name_57 (
opponent VARCHAR,
score VARCHAR
) | What Opponent has a Score that is 1-6, 3-6? | SELECT opponent FROM table_name_57 WHERE score = "1-6, 3-6" | sql_create_context |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,... | Plot the number of order date over order date in a line chart | SELECT Order_Date, COUNT(Order_Date) FROM Bookings | nvbench |
CREATE TABLE table_10234 (
"Date" text,
"Venue" text,
"Opponent" text,
"Result" text,
"Competition" text
) | What is the result of game played on 10-05-2012? | SELECT "Result" FROM table_10234 WHERE "Date" = '10-05-2012' | wikisql |
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,... | NEW YORK to LAS VEGAS on sunday afternoon | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 27 AND DATE_DAYalias0.month_number = 8 AND DATE_DAYalias0.year = 1991)) AND to... | atis |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABL... | Who is the advisor of Linda Smith? Give me the first name and last name. | SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" | spider |
CREATE TABLE table_name_64 (
seats_2006 INTEGER,
_percentage_2001 VARCHAR,
seats_2001 VARCHAR
) | what is the seats 2006 total with %2001 of 39 and seats 2001 less than 12? | SELECT MAX(seats_2006) FROM table_name_64 WHERE _percentage_2001 = 39 AND seats_2001 < 12 | sql_create_context |
CREATE TABLE table_17755 (
"Clinical Status" text,
"Compound Name" text,
"Trademark" text,
"Marine Organism \u03b1" text,
"Chemical Class" text,
"Molecular Target" text,
"Clinical Trials \u03b2" text,
"Disease Area" text
) | What is the trademark listed for the molecular target : dna-binding? | SELECT "Trademark" FROM table_17755 WHERE "Molecular Target" = 'DNA-Binding' | wikisql |
CREATE TABLE table_20630462_1 (
years INTEGER,
tournament VARCHAR
) | What is the most years that tournaments held in Rome have lasted? | SELECT MAX(years) FROM table_20630462_1 WHERE tournament = "Rome" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What number of credits do I get for 425 ? | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 425 | advising |
CREATE TABLE table_name_20 (
effic INTEGER,
name VARCHAR
) | What was the total effic for the quarterbacks? | SELECT MIN(effic) FROM table_name_20 WHERE name = "total" | sql_create_context |
CREATE TABLE table_203_109 (
id number,
"treaty" text,
"organization" text,
"introduced" number,
"signed" number,
"ratified" number
) | which was the first treaty in morocco to be ratified ? | SELECT "treaty" FROM table_203_109 ORDER BY "ratified" LIMIT 1 | squall |
CREATE TABLE table_name_16 (
against INTEGER,
opposing_teams VARCHAR,
venue VARCHAR,
status VARCHAR
) | What is the lowest against score for Twickenham, London with the status of Five Nations against Ireland? | SELECT MIN(against) FROM table_name_16 WHERE venue = "twickenham, london" AND status = "five nations" AND opposing_teams = "ireland" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | what is the name of a procedure that patient 4718 has been given for two times until 08/2102? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 471... | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays ... | what are the four most common medications that patients were prescribed with during the same hospital visit after being prescribed with lidocaine 2% since 1 year ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lidocaine 2%' AND DATETIME(prescriptions.star... | mimic_iii |
CREATE TABLE table_64924 (
"Event" text,
"Date" text,
"Location" text,
"Winning skip" text,
"Runner-up skip" text
) | Who was the runner-up during the Mac Ice Classic? | SELECT "Runner-up skip" FROM table_64924 WHERE "Event" = 'mac ice classic' | wikisql |
CREATE TABLE table_6045 (
"Month" text,
"Week" real,
"Offensive" text,
"Defensive" text,
"Goalkeeper" text,
"Rookie" text
) | Who is the rookie goalkeeper Mike Gabel? | SELECT "Rookie" FROM table_6045 WHERE "Goalkeeper" = 'mike gabel' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE S... | Count: Answers by top users in year by month. Answers by top users in year broken down by month | SELECT MONTH(p.CreationDate), COUNT(p.Id) FROM Posts AS p WHERE p.PostTypeId = 2 AND YEAR(p.CreationDate) = @Year AND p.OwnerUserId IN (SELECT TOP(1000) AS Id FROM Users ORDER BY Reputation DESC) GROUP BY MONTH(p.CreationDate) | sede |
CREATE TABLE table_name_22 (
games INTEGER,
drawn INTEGER
) | What games have more than 1 draw? | SELECT AVG(games) FROM table_name_22 WHERE drawn > 1 | 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
)
... | among patients from white ethnic origin, calculate the total number of male patients. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "WHITE" | mimicsql_data |
CREATE TABLE table_name_48 (
team VARCHAR,
stadium VARCHAR
) | What is the team at Stadion Maksimir? | SELECT team FROM table_name_48 WHERE stadium = "stadion maksimir" | sql_create_context |
CREATE TABLE table_name_76 (
date INTEGER,
championship VARCHAR
) | What is the earliest date when the championship was Monterrey WCT, Mexico? | SELECT MIN(date) FROM table_name_76 WHERE championship = "monterrey wct, mexico" | sql_create_context |
CREATE TABLE table_name_7 (
athlete VARCHAR,
fastest_time__s_ VARCHAR
) | Which athlete has the fastest time of 15.82? | SELECT athlete FROM table_name_7 WHERE fastest_time__s_ = 15.82 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what procedure was performed on patient 003-33922 for the last time during their first hospital encounter? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-33922' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
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... | 患者28022050的医疗记录中,有过哪些医疗费总额不小于7272.12元的信息,看看入院诊断疾病名和编码 | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '28022050' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 7272.12) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '28022050' AND gyb.MED_CLINIC_ID IN (SELECT t_kc... | css |
CREATE TABLE table_22040 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1991-92" text,
"1992-93" text,
"1993-94" real
) | Name the points for 1992-93 for 42 | SELECT "Points" FROM table_22040 WHERE "1992-93" = '42' | 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... | 看看病人朱泰和在10.8.21到16.12.05内所有检验报告单中的标本采集部位,把这些采集部位都列出来 | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '朱泰和' AND jybgb.BGRQ BETWEEN '2010-08-21' AND '2016-12-05... | css |
CREATE TABLE table_21220720_1 (
position VARCHAR,
name VARCHAR
) | Name the position for van den brink, bas | SELECT position FROM table_21220720_1 WHERE name = "van den Brink, Bas" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | when did patient 13440 receive the first microbiology test on their last hospital visit? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13440 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_53989 (
"Track #" real,
"Song" text,
"Singers" text,
"Picturization" text,
"Length" text,
"Lyricist" text
) | How long is the song 'Maduraikku Pogathadee'? | SELECT "Length" FROM table_53989 WHERE "Song" = 'maduraikku pogathadee' | wikisql |
CREATE TABLE table_36070 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | with games more than 22 what is the rebound total? | SELECT SUM("Rebounds") FROM table_36070 WHERE "Games" > '22' | wikisql |
CREATE TABLE table_27214 (
"Number" real,
"Name" text,
"Titles" text,
"Date" text,
"Opponent" text,
"Result" text,
"Defenses" real
) | Name the most number | SELECT MAX("Number") FROM table_27214 | wikisql |
CREATE TABLE table_14835 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in final" text,
"Score" text
) | What is the name of the partner who played in the final against Lucas Arnold Ker Mart n Garc a? | SELECT "Partner" FROM table_14835 WHERE "Opponents in final" = 'lucas arnold ker martín garcía' | wikisql |
CREATE TABLE table_25894 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | When did the Portland Trail Blazers play against Cleveland? | SELECT "Date" FROM table_25894 WHERE "Team" = 'Cleveland' | wikisql |
CREATE TABLE table_28744929_2 (
years_at_school VARCHAR,
team VARCHAR
) | How many values were used to express the years at school of the Maryland team? | SELECT COUNT(years_at_school) FROM table_28744929_2 WHERE team = "Maryland" | sql_create_context |
CREATE TABLE table_name_31 (
surface VARCHAR,
opponent VARCHAR
) | What is Surface, when Opponent is 'Ji Van k'? | SELECT surface FROM table_name_31 WHERE opponent = "jiří vaněk" | sql_create_context |
CREATE TABLE table_12828723_3 (
lost VARCHAR,
try_bonus VARCHAR,
points_for VARCHAR
) | what's the loss with try bonus being 5 and points for being 390 | SELECT lost FROM table_12828723_3 WHERE try_bonus = "5" AND points_for = "390" | sql_create_context |
CREATE TABLE table_1072 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Time ( ET )" text,
"TV" text,
"Result" text,
"Record" text
) | How many days were the Kansas City Chiefs the opposing team? | SELECT COUNT("Date") FROM table_1072 WHERE "Opponent" = 'Kansas City Chiefs' | wikisql |
CREATE TABLE table_73072 (
"Date" text,
"B-52 Model" text,
"Serial #" text,
"Unit" text,
"Bomb Capacity" text,
"Mission/Target" text,
"Cause of Loss" text
) | When hit by sam at 38,500 feet just after bomb release was the cause of loss what is the mission/target? | SELECT "Mission/Target" FROM table_73072 WHERE "Cause of Loss" = 'Hit by SAM at 38,500 feet just after bomb release' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the email . | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Ag... | Plot the number of home city by grouped by home city as a bar graph, could you order in asc by the total number? | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY COUNT(Home_city) | nvbench |
CREATE TABLE table_203_694 (
id number,
"#" number,
"name" text,
"took office" text,
"left office" text,
"party" text
) | who was next to serve after nejat konuk ? | SELECT "name" FROM table_203_694 WHERE "took office" > (SELECT "took office" FROM table_203_694 WHERE "name" = 'nejat konuk') ORDER BY "took office" LIMIT 1 | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 列出医院编码3290779根据不相同的科室名字和出院诊断疾病名字全部医疗就诊记录中病人保留平均年龄大于29岁的记录的平均年龄都是多大啊? | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '3290779' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 29 | css |
CREATE TABLE table_1311 (
"Team" text,
"Titles" real,
"Runner-up" real,
"Third place" real,
"Fourth place" real,
"Years participated" real
) | When colgate is the team how many times did they place fourth? | SELECT COUNT("Fourth place") FROM table_1311 WHERE "Team" = 'Colgate' | wikisql |
CREATE TABLE table_name_18 (
weeks VARCHAR,
date VARCHAR
) | On December 12, 2001, how many weeks had the single been in its position? | SELECT weeks FROM table_name_18 WHERE date = "december 12, 2001" | sql_create_context |
CREATE TABLE table_20549 (
"Season" text,
"1st Place" text,
"2nd Place" text,
"3rd Place" text,
"4th Place" text
) | What team finished in 1st when tau cer mica was in 3rd? | SELECT "1st Place" FROM table_20549 WHERE "3rd Place" = 'TAU Cerámica' | wikisql |
CREATE TABLE table_64297 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
) | Which TV station, has romaji title of tantei gakuen q and episodes larger than 10? | SELECT "TV Station" FROM table_64297 WHERE "Episodes" > '10' AND "Romaji Title" = 'tantei gakuen q' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what was the drug prescribed to patient 016-24379 for the last time via intravenous route in 12/this year? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-24379')) AND medication.routeadmin = 'intravenous' AND DATETIME... | eicu |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 通过患者06397639的医疗记录显示其医疗费总数目比6289.51元打的次数有多少,入院诊断疾病编码和名称都是啥啊? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '06397639' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6289.51) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '06397639' AND gyb.MED_CLINIC_ID IN (SELECT t_kc... | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | what is the number of patients who have had a 1:1 ns repletion. intake since 1 year ago? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '1:1 ns repletion.' ... | mimic_iii |
CREATE TABLE table_6876 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | What is the average Number, when Position is Forward? | SELECT AVG("Number") FROM table_6876 WHERE "Position" = 'forward' | wikisql |
CREATE TABLE table_52864 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team had a score of 17.13 (115)? | SELECT "Away team" FROM table_52864 WHERE "Away team score" = '17.13 (115)' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose admission location is clinic referral/premature and procedure short title is cont inv mec ven is less than96 hrs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.short_title = "Cont inv mec ven <96 hrs" | mimicsql_data |
CREATE TABLE table_204_313 (
id number,
"date" text,
"operation" text,
"location" text,
"type" text,
"information" text
) | which operation occurred right after operation maritime guard ? | SELECT "operation" FROM table_204_313 WHERE "date" > (SELECT "date" FROM table_204_313 WHERE "operation" = 'operation maritime guard') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | Is EECS 282 easier , or EECS 767 ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 282 OR course.number = 767) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | Are there usually 2 or 3 lectures held for 541 per week ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... | advising |
CREATE TABLE table_18442691_2 (
no VARCHAR,
released VARCHAR
) | When cannot handle non-empty timestamp argument! 2007 is released what is the no.? | SELECT no FROM table_18442691_2 WHERE released = "Cannot handle non-empty timestamp argument! 2007" | sql_create_context |
CREATE TABLE table_30611 (
"Callsign" text,
"City of license" text,
"Virtual channel" text,
"Digital channel" text,
"Network" text
) | What city licensed the broadcast on virtual channel 8.2? | SELECT "City of license" FROM table_30611 WHERE "Virtual channel" = '8.2' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what number of patients with elective admission type had hemodialysis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Hemodialysis" | mimicsql_data |
CREATE TABLE table_78730 (
"Played" real,
"Drawn" real,
"Lost" real,
"Winning %" real,
"Tries" real,
"Conversions" real,
"Penalties" real,
"s Drop goal" real,
"Points total" real
) | How many ties did he have when he had 1 penalties and more than 20 conversions? | SELECT SUM("Drawn") FROM table_78730 WHERE "Penalties" = '1' AND "Conversions" > '20' | wikisql |
CREATE TABLE table_name_98 (
injured VARCHAR,
date VARCHAR
) | What is Injured, when Date is '09.15 Sep. 15'? | SELECT injured FROM table_name_98 WHERE date = "09.15 sep. 15" | sql_create_context |
CREATE TABLE table_name_83 (
date VARCHAR,
outcome VARCHAR,
score VARCHAR
) | What is the Date of the game with an Outcome of runner-up and Score of 5 7, 3 6, 6 3, 2 6? | SELECT date FROM table_name_83 WHERE outcome = "runner-up" AND score = "5–7, 3–6, 6–3, 2–6" | sql_create_context |
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,
... | what is days of hospital stay and diagnoses long title of subject id 91588? | SELECT demographic.days_stay, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "91588" | mimicsql_data |
CREATE TABLE table_11438 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the record on April 7? | SELECT "Record" FROM table_11438 WHERE "Date" = 'april 7' | 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... | 看一看编号为39298720035的门诊的就诊日期 | SELECT mzjzjlb.JZKSRQ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '39298720035' | css |
CREATE TABLE table_27713030_12 (
high_points VARCHAR,
date VARCHAR
) | What were the high points on April 8? | SELECT high_points FROM table_27713030_12 WHERE date = "April 8" | sql_create_context |
CREATE TABLE table_name_71 (
date VARCHAR,
home_team VARCHAR
) | If collingwood was the Home team, what Date did they play? | SELECT date FROM table_name_71 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_name_97 (
pick__number VARCHAR,
position VARCHAR,
player VARCHAR
) | What was the pick# for Lorenzo Freeman as defensive tackle? | SELECT pick__number FROM table_name_97 WHERE position = "defensive tackle" AND player = "lorenzo freeman" | sql_create_context |
CREATE TABLE table_24399615_5 (
cable_rank VARCHAR,
episode_no VARCHAR
) | How many times did episode number 8 air? | SELECT COUNT(cable_rank) FROM table_24399615_5 WHERE episode_no = 8 | sql_create_context |
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,
... | 在2014年9月24日到2016年6月21日内病患90342065的住院次数有多少次? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '90342065' AND t_kc21.IN_HOSP_DATE BETWEEN '2014-09-24' AND '2016-06-21' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE fgwyjzb (
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,
... | 从二00四年八月八日到二0一九年九月三日这段时间内,患者75340002开出的药品有多少是自费金额高于8808.11元的 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '75340002' AND t_kc22.STA_DATE BETWEEN '2004-08-08' AND '2019-09-03' AND t_kc22.SELF_PAY_AMO > 8808.11 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwy... | css |
CREATE TABLE table_train_109 (
"id" int,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
) | potassium > 5.5 meq / dl at baseline | SELECT * FROM table_train_109 WHERE serum_potassium > 5.5 | criteria2sql |
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 were the three most frequently ordered microbiology tests for patients that had previous laxatives - doss (colace) within 2 months in 2105? | SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'laxatives - doss (colace)' AND STRFTIME('%y'... | eicu |
CREATE TABLE table_9414 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
) | What is the pick for the Maryland-Eastern Shore team with a round lower than 2? | SELECT SUM("Pick") FROM table_9414 WHERE "School/Club Team" = 'maryland-eastern shore' AND "Round" < '2' | wikisql |
CREATE TABLE table_21256068_3 (
score VARCHAR,
opponent VARCHAR
) | what's the score against crusaders | SELECT score FROM table_21256068_3 WHERE opponent = "Crusaders" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is admission location of subject name thomas nazario? | SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Thomas Nazario" | mimicsql_data |
CREATE TABLE table_15272 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | Name the sum of time for lane of 1 and rank less than 8 | SELECT SUM("Time") FROM table_15272 WHERE "Lane" = '1' AND "Rank" < '8' | wikisql |
CREATE TABLE table_65845 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | What is the number of points for the song 'viva rock 'n' roll', with more than 3 Draws? | SELECT AVG("Points") FROM table_65845 WHERE "Song" = 'viva rock ''n'' roll' AND "Draw" > '3' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | calculate the total number of patients treated with sertraline | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Sertraline" | mimicsql_data |
CREATE TABLE table_name_8 (
gold_coast VARCHAR,
melbourne VARCHAR,
auckland VARCHAR
) | Which Gold Coast has Melbourne yes, and Auckland yes? | SELECT gold_coast FROM table_name_8 WHERE melbourne = "yes" AND auckland = "yes" | sql_create_context |
CREATE TABLE table_17787 (
"Day" text,
"Sunday Surya (the Sun)" text,
"Monday Soma (the Moon)" text,
"Tuesday Mangala (Mars)" text,
"Wednesday Budha (Mercury)" text,
"Thursday Guru (Jupiter)" text,
"Friday Shukra (Venus)" text,
"Saturday Shani (Saturn)" text
) | In language where Wednesday is budh'var, what is Saturday? | SELECT "Saturday Shani (Saturn)" FROM table_17787 WHERE "Wednesday Budha (Mercury)" = 'برھ وار Budh''var' | wikisql |
CREATE TABLE table_204_763 (
id number,
"county" text,
"km" number,
"intersecting road" text,
"notes" text,
"coordinates" text
) | which intersecting road comes before range road 273 ? | SELECT "intersecting road" FROM table_204_763 WHERE id = (SELECT id FROM table_204_763 WHERE "intersecting road" = 'range road 273') - 1 | squall |
CREATE TABLE table_train_251 (
"id" int,
"gender" string,
"left_ventricular_ejection_fraction_lvef" int,
"allergy_to_rabbit_proteins" bool,
"recurring_alcohol_related_legal_problem" bool,
"hyperlipidemia" bool,
"fasting_ldl_cholesterol" int,
"baseline_hemoglobin_hgb" float,
"NOUSE" f... | recurring alcohol _ related legal problem | SELECT * FROM table_train_251 WHERE recurring_alcohol_related_legal_problem = 1 | criteria2sql |
CREATE TABLE table_48025 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is To Par, when Score is '69-72=141 | SELECT "To par" FROM table_48025 WHERE "Score" = '69-72=141' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.