context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE section (
... | Find the number of courses offered by Psychology department in each building with a bar chart, and rank in asc by the X. | SELECT building, COUNT(building) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY building ORDER BY building | nvbench |
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... | 从01.3.7开始,截止到03.11.9,药品109251736总共被医院开出给患者78775126多少次 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '78775126' AND t_kc22.STA_DATE BETWEEN '2001-03-07' AND '2003-11-09' AND t_kc22.SOC_SRT_DIRE_CD = '109251736' | css |
CREATE TABLE table_71592 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Name the highest rank when silver is 4 and bronze is less than 3 | SELECT MAX("Rank") FROM table_71592 WHERE "Silver" = '4' AND "Bronze" < '3' | wikisql |
CREATE TABLE table_25042332_16 (
median_income___intl INTEGER,
region VARCHAR
) | What is the median income of Maule? | SELECT MIN(median_income___intl) AS $__ FROM table_25042332_16 WHERE region = "Maule" | sql_create_context |
CREATE TABLE table_10475 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many grids have a Manufacturer of honda, a Rider of yuki takahashi, and more than 22 laps? | SELECT COUNT("Grid") FROM table_10475 WHERE "Manufacturer" = 'honda' AND "Rider" = 'yuki takahashi' AND "Laps" > '22' | 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... | provide the number of patients with the diagnoses of tricuspid valve disorders, specified as nonrheumtatic who have sc route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Nonrheum tricusp val dis" AND prescriptions.route = "SC" | mimicsql_data |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | has patient 52604 been prescribed with pantoprazole sodium, chlorhexidine gluconate 0.12% oral rinse or furosemide since 2101? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52604) AND prescriptions.drug IN ('pantoprazole sodium', 'chlorhexidine gluconate 0.12% oral rinse', 'furosemide') AND STRFTIME('%y', prescriptions.startdate) >= '2101' | mimic_iii |
CREATE TABLE table_72827 (
"Season" real,
"MLS Reg. Season" text,
"MLS Cup Playoffs" text,
"U.S. Open Cup" text,
"CONCACAF Champions Cup / Champions League" text
) | What were the placements of the team in regular season when they reached quarterfinals in the U.S. Open Cup but did not qualify for the Concaf Champions Cup? | SELECT "MLS Reg. Season" FROM table_72827 WHERE "U.S. Open Cup" = 'Quarterfinals' AND "CONCACAF Champions Cup / Champions League" = 'Did not qualify' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Find meter_400 and ID , and visualize them by a bar chart, order by the y axis in asc. | SELECT meter_400, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_23867 (
"#" real,
"Date" text,
"at/vs." text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
) | Who was the opponent when the attendance was exactly 16642? | SELECT "Opponent" FROM table_23867 WHERE "Attendance" = '16642' | wikisql |
CREATE TABLE table_name_64 (
population INTEGER,
area__km_2__ VARCHAR,
type VARCHAR,
name VARCHAR
) | Saint-Blaise-Sur-Richelieu is smaller than 68.42 km^2, what is the population of this type M municipality? | SELECT MIN(population) FROM table_name_64 WHERE type = "m" AND name = "saint-blaise-sur-richelieu" AND area__km_2__ < 68.42 | sql_create_context |
CREATE TABLE table_name_39 (
score VARCHAR,
date VARCHAR
) | what was the score on november 3? | SELECT score FROM table_name_39 WHERE date = "november 3" | sql_create_context |
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... | 给患有癫痫性精神病的病患都开出了哪些药品它们的编号和名称各是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_IN_DIAG_DIS_NM = '癫痫性精神病' | css |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM... | 编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AN... | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients whose admission year is less than 2203 and procedure long title is regional lymph node excision? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2203" AND procedures.long_title = "Regional lymph node excision" | mimicsql_data |
CREATE TABLE table_2688 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the team for kirk hinrich , derrick rose , john salmons (6) | SELECT "Team" FROM table_2688 WHERE "High assists" = 'Kirk Hinrich , Derrick Rose , John Salmons (6)' | wikisql |
CREATE TABLE table_name_35 (
to_par VARCHAR,
place VARCHAR,
player VARCHAR
) | What is the to par for t10 and Colin Montgomerie? | SELECT to_par FROM table_name_35 WHERE place = "t10" AND player = "colin montgomerie" | sql_create_context |
CREATE TABLE table_name_25 (
laps VARCHAR,
grid VARCHAR,
constructor VARCHAR,
driver VARCHAR
) | How many laps were completed by Piers Courage when BRM was the constructor and the grid is larger than 8? | SELECT COUNT(laps) FROM table_name_25 WHERE constructor = "brm" AND driver = "piers courage" AND grid > 8 | sql_create_context |
CREATE TABLE table_27942 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
) | What is the highest measure number? | SELECT MAX("meas. num.") FROM table_27942 | wikisql |
CREATE TABLE table_14191 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver medals for germany with a bronze count more than 0? | SELECT MAX("Silver") FROM table_14191 WHERE "Nation" = 'germany' AND "Bronze" > '0' | wikisql |
CREATE TABLE Enrolled_in (
StuID INTEGER,
CID VARCHAR(7),
Grade VARCHAR(2)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Course (
CID VARCHAR... | Visualize a bar chart about the distribution of Days and the average of Credits , and group by attribute Days. | SELECT Days, AVG(Credits) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
CREATE TABLE table_9910 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Can you tell me Location Attendance that has the High points of andrew bogut (17)? | SELECT "Location Attendance" FROM table_9910 WHERE "High points" = 'andrew bogut (17)' | wikisql |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cine... | A bar chart showing the number of films each cinema has, and order y axis in desc order. | SELECT Name, COUNT(Name) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom t... | what were the four most commonly prescribed drugs for patients that were also prescribed potassium chl 20 meq / 1000 ml d5w at the same time in the previous year? | 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 = 'potassium chl 20 meq / 1000 ml d5w' AND DATETIME(prescriptions.st... | mimic_iii |
CREATE TABLE table_203_396 (
id number,
"year" number,
"domestic passengers" number,
"international passengers" number,
"total passengers" number,
"change" text
) | how many years of statistics are listed in chart ? | SELECT COUNT("year") FROM table_203_396 | squall |
CREATE TABLE table_64365 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What's the least against number for Cobden with draws more than 0? | SELECT MIN("Against") FROM table_64365 WHERE "Club" = 'cobden' AND "Draws" > '0' | wikisql |
CREATE TABLE table_1353096_1 (
owned_since VARCHAR,
channel_tv___dt__ VARCHAR
) | When was 10 (10) bought? | SELECT owned_since FROM table_1353096_1 WHERE channel_tv___dt__ = "10 (10)" | sql_create_context |
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... | 患者73428643开出的药品均不低于9644.26元一共是在哪几次医疗记录中以及医疗就诊编号是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '73428643' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 9644.26) | css |
CREATE TABLE table_20253 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | IN THE ISSUE WITH KARA MONACO ON THE COVER, WHO WAS THE INTERVIEW SUBJECT? | SELECT "Interview subject" FROM table_20253 WHERE "Cover model" = 'Kara Monaco' | wikisql |
CREATE TABLE table_3995 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Which title has 147 as no. in series? | SELECT "Title" FROM table_3995 WHERE "No. in series" = '147' | wikisql |
CREATE TABLE table_22265716_1 (
director VARCHAR,
original_title VARCHAR
) | Who is the director of the film with the title ? | SELECT director FROM table_22265716_1 WHERE original_title = "Лепа села лепо горе" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
... | For UC 327 what prerequistes do I have already ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'UC' AND COURSE_1.number = 32... | 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,
... | 在医院5241360中,病患鲁俊健在名中包括肾内的就诊科室的所有门诊就诊记录的流水号是什么 | SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '鲁俊健' AND hz_info.YLJGDM = '5241360' AND wdmzjzjlb.JZKSMC LIKE '%肾内%' UNION SELECT bdmzjzjlb.J... | css |
CREATE TABLE table_27633 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | How many results are listed for shot PCT Where PA is 79? | SELECT COUNT("Shot Pct.") FROM table_27633 WHERE "PA" = '79' | wikisql |
CREATE TABLE table_19984 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
) | When the winner was Alessandro Ballan, how many total team classifications were there? | SELECT COUNT("Team classification") FROM table_19984 WHERE "Winner" = 'Alessandro Ballan' | wikisql |
CREATE TABLE table_name_82 (
authority VARCHAR,
area VARCHAR,
name VARCHAR
) | What is the Authority for Kuranui Primary School that is located in the Area of Tirau? | SELECT authority FROM table_name_82 WHERE area = "tirau" AND name = "kuranui primary school" | sql_create_context |
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... | provide me the number of patients less than 67 years who have diphenhydramine hcl drug prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.drug = "DiphenhydrAMINE HCl" | mimicsql_data |
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 txmzjzjlb.JZKSRQ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '39298720035' UNION SELECT ftxmzjzjlb.JZKSRQ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '39298720035' | css |
CREATE TABLE table_23397386_2 (
rank__timeslot_ VARCHAR,
airdate VARCHAR
) | How many rankings (timeslot) were there for the episode that aired on May 2, 2010? | SELECT COUNT(rank__timeslot_) FROM table_23397386_2 WHERE airdate = "May 2, 2010" | 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,
... | provide the number of patients whose ethnicity is white and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_61950 (
"English name" text,
"Thai name" text,
"Transcription" text,
"Color" text,
"Sanskrit word" text,
"Planet" text
) | Which English name has a Color of green? | SELECT "English name" FROM table_61950 WHERE "Color" = 'green' | wikisql |
CREATE TABLE table_56649 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game played when the away team scored 12.5 (77)? | SELECT "Venue" FROM table_56649 WHERE "Away team score" = '12.5 (77)' | wikisql |
CREATE TABLE table_name_46 (
year INTEGER,
entrant VARCHAR
) | What was the earliest year for the Ligier Gitanes? | SELECT MIN(year) FROM table_name_46 WHERE entrant = "ligier gitanes" | sql_create_context |
CREATE TABLE table_79525 (
"Date" text,
"Internet Explorer" text,
"Firefox" text,
"Safari" text,
"Opera" text
) | What is the firefox value with a 1.8% opera on 30 July 2007? | SELECT "Firefox" FROM table_79525 WHERE "Opera" = '1.8%' AND "Date" = '30 july 2007' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what number of patients with death status 1 had drug code ns100cg? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "NS100CG" | mimicsql_data |
CREATE TABLE table_name_77 (
award_name VARCHAR,
team_number VARCHAR
) | What's the name of the award given to Team number 23? | SELECT award_name FROM table_name_77 WHERE team_number = 23 | sql_create_context |
CREATE TABLE table_name_39 (
notes VARCHAR,
fleet_size VARCHAR
) | What is the Notes when the fleet size is 3? | SELECT notes FROM table_name_39 WHERE fleet_size = 3 | sql_create_context |
CREATE TABLE table_name_33 (
decile VARCHAR,
name VARCHAR
) | What is the Decile number for St Mary's Catholic School? | SELECT decile FROM table_name_33 WHERE name = "st mary's catholic school" | sql_create_context |
CREATE TABLE table_13499 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the nation when gold is 0, bronze is more than 0 and rank is 16? | SELECT "Nation" FROM table_13499 WHERE "Gold" = '0' AND "Bronze" > '0' AND "Rank" = '16' | wikisql |
CREATE TABLE table_name_13 (
bike_no INTEGER,
driver___passenger VARCHAR,
position VARCHAR
) | What is the lowest Bike No, when Driver / Passenger is Joris Hendrickx / Kaspars Liepins, and when Position is less than 4? | SELECT MIN(bike_no) FROM table_name_13 WHERE driver___passenger = "joris hendrickx / kaspars liepins" AND position < 4 | sql_create_context |
CREATE TABLE table_name_11 (
winning_driver VARCHAR,
circuit VARCHAR
) | What kind of the Winning driver has a Circuit of saint-rapha l? | SELECT winning_driver FROM table_name_11 WHERE circuit = "saint-raphaël" | sql_create_context |
CREATE TABLE table_name_92 (
away_team VARCHAR,
home_team VARCHAR
) | What away team played Footscray? | SELECT away_team FROM table_name_92 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_63240 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What is the lowest year for the game called The Elder Scrolls v: Skyrim? | SELECT MIN("Year") FROM table_63240 WHERE "Game" = 'the elder scrolls v: skyrim' | wikisql |
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... | 在2007年2月6日到2018年12月21日内,查出编号为1388267的医院非科室72353负责的所有医疗就诊记录 | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '1388267' AND qtb.IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '1388267' AND gyb.IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '1388267' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_26686908_2 (
city___state VARCHAR,
circuit VARCHAR
) | Which city and state hosted the adelaide street circuit? | SELECT city___state FROM table_26686908_2 WHERE circuit = "Adelaide Street circuit" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Which 11 -credit classes are upper-level ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 11 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_56871 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | Which School did Player Tyrone Johnson attend? | SELECT "School" FROM table_56871 WHERE "Player" = 'tyrone johnson' | wikisql |
CREATE TABLE table_name_23 (
grid INTEGER,
rider VARCHAR,
laps VARCHAR
) | Which Grid that has a Rider of mike di meglio, and Laps larger than 23? | SELECT AVG(grid) FROM table_name_23 WHERE rider = "mike di meglio" AND laps > 23 | sql_create_context |
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE product_characteristics (
... | What are the product ids and color descriptions for products with two or more characteristics? | SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_60023 (
"District" real,
"Seat" text,
"Candidate" text,
"Party" text,
"Vote" real,
"Percentage" text
) | How many votes have a Seat of house A, and a Percentage of 75.44%, and a District smaller than 11? | SELECT COUNT("Vote") FROM table_60023 WHERE "Seat" = 'house a' AND "Percentage" = '75.44%' AND "District" < '11' | wikisql |
CREATE TABLE table_name_32 (
place VARCHAR,
score VARCHAR
) | What is the Place of the Player with a Score of 73-73-65-73=284? | SELECT place FROM table_name_32 WHERE score = 73 - 73 - 65 - 73 = 284 | sql_create_context |
CREATE TABLE table_name_67 (
term_ending INTEGER,
position VARCHAR,
nationality VARCHAR
) | Position of member, and a Nationality of india is what sum of term ending? | SELECT SUM(term_ending) FROM table_name_67 WHERE position = "member" AND nationality = "india" | sql_create_context |
CREATE TABLE table_44752 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
) | What is the highest Lane, when Mark is 46.65, and when React is greater than 0.251? | SELECT MAX("Lane") FROM table_44752 WHERE "Mark" = '46.65' AND "React" > '0.251' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | What is total number of patients who were diagnosed with icd9 code 53550 and died? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "53550" | mimicsql_data |
CREATE TABLE table_51164 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the highest rebounds of the game with a game number higher than 65 on March 28? | SELECT "High rebounds" FROM table_51164 WHERE "Game" > '65' AND "Date" = 'march 28' | wikisql |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CR... | Group by the local authorities and count the number of local authorities, and then group by services, display in ascending by the bar. | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY services | nvbench |
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... | 个人自费金额在医疗就诊62205810460中有多少? | SELECT t_kc24.PER_EXP FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '62205810460' | css |
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,
... | find out the death date for the patient with patient id 66411. | SELECT demographic.dod FROM demographic WHERE demographic.subject_id = "66411" | mimicsql_data |
CREATE TABLE table_60249 (
"Season" text,
"Premier Division" text,
"Division One" text,
"Division Two" text,
"Division Three" text
) | What Division One team were champions at the same time the Division Two Hereford Lads Club Colts were champs? | SELECT "Division One" FROM table_60249 WHERE "Division Two" = 'hereford lads club colts' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how much do antithyroid therapy's cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'antithyroid therapy') | eicu |
CREATE TABLE table_name_27 (
type_of_game VARCHAR,
date VARCHAR
) | what game was played on june 14 | SELECT type_of_game FROM table_name_27 WHERE date = "june 14" | sql_create_context |
CREATE TABLE table_46275 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | HOW MANY SILVER METALS DOES SOUTH KOREA HAVE WITH 2 GOLD METALS? | SELECT MAX("Silver") FROM table_46275 WHERE "Nation" = 'south korea' AND "Gold" > '2' | wikisql |
CREATE TABLE table_5629 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Team classification" text
) | Which stage corresponds to Banesto and Tony Rominger? | SELECT "Stage" FROM table_5629 WHERE "Team classification" = 'banesto' AND "Points classification" = 'tony rominger' | 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,
... | 华明哲这个病人被门诊诊断为脑梗死后遗症,他做的检测指标097260的结果定量和单位是啥 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ... | css |
CREATE TABLE table_47528 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
) | When did Fejzi Bej Alizoti's term start? | SELECT "Term start" FROM table_47528 WHERE "Name" = 'fejzi bej alizoti' | 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 (
... | which patients have prescription for spironolactone medication? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Spironolactone" | mimicsql_data |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | What are the countries for applications with at most 3 wines? Return the result in a bar chart, I want to list from high to low by the x-axis. | SELECT County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County ORDER BY County DESC | nvbench |
CREATE TABLE table_name_29 (
episode__number INTEGER,
demo VARCHAR
) | Which episode with a demo of 0.7/3 was the lowest? | SELECT MIN(episode__number) FROM table_name_29 WHERE demo = "0.7/3" | sql_create_context |
CREATE TABLE table_18117 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | what is the party with the incumbent jim demint? | SELECT "Party" FROM table_18117 WHERE "Incumbent" = 'Jim DeMint' | wikisql |
CREATE TABLE table_53182 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What was the Vanwall time/retired with 49 laps? | SELECT "Time/Retired" FROM table_53182 WHERE "Laps" = '49' AND "Constructor" = 'vanwall' | 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 ... | 病患36963389检测丙戊酸在2012年2月7日起到2019年5月3日结束的医务人员工号及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | when was the last time a diagnostic ultrasound of heart - transthoracic echocardiography procedure was given to patient 027-144847 since 3 years ago? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-144847')) AND treatment.treatmentname = 'diagnostic ultrasoun... | eicu |
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 procedures (
... | How many of the patients admitted before 2121 had int insert dual-cham dev? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2121" AND procedures.short_title = "Int insert dual-cham dev" | mimicsql_data |
CREATE TABLE table_59778 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What is the score for the game in which Arsenal was the away team? | SELECT "Score" FROM table_59778 WHERE "Away team" = 'arsenal' | wikisql |
CREATE TABLE table_39809 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the CFL Team with #48 as the pick number? | SELECT "CFL Team" FROM table_39809 WHERE "Pick #" = '48' | wikisql |
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... | 在17年11月1日到2021年8月20日内患者97853987有多少医保金额是在这段时间使用的? | SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '97853987' AND CLINIC_SLT_DATE BETWEEN '2017-11-01' AND '2021-08-20' | css |
CREATE TABLE nomination (
Artwork_ID int,
Festival_ID int,
Result text
)
CREATE TABLE artwork (
Artwork_ID int,
Type text,
Name text
)
CREATE TABLE festival_detail (
Festival_ID int,
Festival_Name text,
Chair_Name text,
Location text,
Year int,
Num_of_Audience int
) | Show the ids and names of festivals that have at least two nominations for artworks by a bar chart. | SELECT T3.Festival_Name, T1.Festival_ID FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID | nvbench |
CREATE TABLE table_name_87 (
goals INTEGER,
player VARCHAR
) | How many goals does mitsuo kato have? | SELECT MAX(goals) FROM table_name_87 WHERE player = "mitsuo kato" | sql_create_context |
CREATE TABLE table_783 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the party or first elected is 1920 | SELECT "Party" FROM table_783 WHERE "First elected" = '1920' | wikisql |
CREATE TABLE table_15431251_1 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | What is the original air date for episode 17 in the season? | SELECT original_air_date FROM table_15431251_1 WHERE no_in_season = 17 | sql_create_context |
CREATE TABLE table_name_35 (
score VARCHAR,
date VARCHAR
) | Name the score for october 9 | SELECT score FROM table_name_35 WHERE date = "october 9" | sql_create_context |
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... | 患者72267378以前就诊的地方在哪? | SELECT hz_info_mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz... | css |
CREATE TABLE 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 demographic ... | Get the list of white-russian patients diagnosed with icd9 code 49122. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.icd9_code = "49122" | mimicsql_data |
CREATE TABLE table_name_22 (
opponent VARCHAR,
date VARCHAR
) | Who did the Red Sox play against on July 8? | SELECT opponent FROM table_name_22 WHERE date = "july 8" | sql_create_context |
CREATE TABLE table_2528382_5 (
movie_album VARCHAR,
co_stars VARCHAR
) | What movie did Bela Bose co-star in? | SELECT movie_album FROM table_2528382_5 WHERE co_stars = "Bela Bose" | sql_create_context |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
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),
... | Visualize a bar chart for how many sections does each course has? | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE | nvbench |
CREATE TABLE table_13643 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Who is team 2 with a 2nd leg of 0-2? | SELECT "Team 2" FROM table_13643 WHERE "2nd leg" = '0-2' | wikisql |
CREATE TABLE table_47991 (
"Year" real,
"Network" text,
"Title" text,
"Notes" text,
"Language" text
) | What are the notes for the Mandarin Chinese program on CTV earlier than 2013? | SELECT "Notes" FROM table_47991 WHERE "Year" < '2013' AND "Language" = 'mandarin chinese' AND "Network" = 'ctv' | wikisql |
CREATE TABLE table_name_43 (
malay_ethnic_group VARCHAR
) | What ethnic group is 65,104 in 1931? | SELECT malay_ethnic_group FROM table_name_43 WHERE 1931 = "65,104" | sql_create_context |
CREATE TABLE university (
school VARCHAR,
LOCATION VARCHAR,
affiliation VARCHAR
) | List all public schools and their locations. | SELECT school, LOCATION FROM university WHERE affiliation = 'Public' | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.