context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_... | Does it have something interesting about the manager id and the salary? Show me a scatter chart first. | SELECT T1.SALARY, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID | nvbench |
CREATE TABLE table_40442 (
"Year" real,
"Series" text,
"Winning team" text,
"Losing team" text,
"Score" text,
"Site" text
) | Where was the series that the Kansas City Royals lost? | SELECT "Site" FROM table_40442 WHERE "Winning team" = 'kansas city royals' | wikisql |
CREATE TABLE table_name_78 (
rank INTEGER,
grid VARCHAR,
time_retired VARCHAR,
laps VARCHAR,
qual VARCHAR
) | What was the rank of the car who had more than 182 laps, gris less than 3, with a qual time of more than 134.14 and a time/retired of +14:21.72? | SELECT MIN(rank) FROM table_name_78 WHERE laps > 182 AND qual > 134.14 AND time_retired = "+14:21.72" AND grid < 3 | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose diagnoses short title is hx of bladder malignancy and drug type is additive? | 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 = "Hx of bladder malignancy" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_11792 (
"Name" text,
"Appointed/Elected" text,
"Term expires" text,
"Appointing Governor" text,
"Governor's Party Affiliation" text
) | Who has a term that expires on December 31, 2020 and Terry Branstad for an appointing governor? | SELECT "Name" FROM table_11792 WHERE "Term expires" = 'december 31, 2020' AND "Appointing Governor" = 'terry branstad' | wikisql |
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_numb... | What are the different dorm amenity names in alphabetical order? | SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name | spider |
CREATE TABLE table_14118521_1 (
edo_flight VARCHAR,
duration VARCHAR
) | what's the edo flight with duration being 17 days, 15 hours, 53 minutes, 18 seconds | SELECT edo_flight FROM table_14118521_1 WHERE duration = "17 days, 15 hours, 53 minutes, 18 seconds" | sql_create_context |
CREATE TABLE table_15058 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
) | What school did Conor Jackson attend? | SELECT "School" FROM table_15058 WHERE "Player" = 'conor jackson' | wikisql |
CREATE TABLE table_40203 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was the time for the bout against Amanda Lavoy, which went under 3 rounds? | SELECT "Time" FROM table_40203 WHERE "Round" < '3' AND "Opponent" = 'amanda lavoy' | wikisql |
CREATE TABLE table_20594 (
"Western Title" text,
"Chinese Title" text,
"Pinyin" text,
"Released Date" text,
"Genre" text,
"Game Modes" text
) | What are the game modes for the game released in 2007? | SELECT "Game Modes" FROM table_20594 WHERE "Released Date" = '2007' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | Median accept-rate excluding 0 and 100.. | WITH ByUser AS (SELECT OwnerUserId, CAST(COUNT(AcceptedAnswerId) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS AcceptRate FROM Posts AS p WHERE p.PostTypeId = 1 AND CommunityOwnedDate IS NULL AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = p.Id) GROUP BY OwnerUserId HAVING COUNT(*) >= 4), FirstStep AS (SELECT AcceptRate, ROW_... | sede |
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... | 查询患者卫晴波在医疗记录中被开出的药品超过7550.96元有哪几次,查一下医疗就诊的编码 | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '卫晴波' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 7550.96) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '卫晴波' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUN... | css |
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
) | How many papers are written by authors from the institution 'University of Pennsylvania'? | SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania" | spider |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
la... | A bar chart about how many songs were released for each format?, and list X in ascending order. | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats | nvbench |
CREATE TABLE table_12441518_1 (
recurring_cast_seasons VARCHAR,
character VARCHAR
) | Kevin lucas appears in which seasons? | SELECT recurring_cast_seasons FROM table_12441518_1 WHERE character = "Kevin Lucas" | sql_create_context |
CREATE TABLE table_8550 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Which Club has a Drawn of 0, and Points of 26? | SELECT "Club" FROM table_8550 WHERE "Drawn" = '0' AND "Points" = '26' | wikisql |
CREATE TABLE table_10383 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | Name the record for bobcats | SELECT "Record" FROM table_10383 WHERE "Home" = 'bobcats' | wikisql |
CREATE TABLE table_38322 (
"Event" text,
"Round" text,
"Result" text,
"Opponent" text,
"Score" text
) | The round that had the final, what was the result? | SELECT "Result" FROM table_38322 WHERE "Round" = 'final' | wikisql |
CREATE TABLE table_71915 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is the winning total from 1976? | SELECT MAX("Total") FROM table_71915 WHERE "Year(s) won" = '1976' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | give me the number of white-russian ethnic background patients who have base type drug prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | Jon Ericson's 'voting currency' equation. https://hermeneutics.meta.stackexchange.com/questions/132/what-does-a-vote-mean-on-the-biblical-hermeneutics-stack-exchange#comment423_181
It seems to me that (very roughly) if you have reputation > 10*votes you are getting more 'voting currency' from the system than you are... | SELECT Id AS "user_link", Reputation, (10 * UpVotes) AS "10 * UpVotesCast", CAST(10 * UpVotes AS FLOAT) / Reputation AS ratio FROM Users WHERE Reputation > 1 ORDER BY ratio DESC LIMIT 200000000 | sede |
CREATE TABLE table_22049 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1988-89" text,
"1989-90" text,
"1990-1991" real
) | What was the average if the game played during 1990-91 is 40 and the points are less than 121.0? | SELECT "Average" FROM table_22049 WHERE "1990-1991" = '40' AND "Points" < '121.0' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
... | how many hours have been elapsed since patient 27172 was admitted to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_28436909_4 (
canadian_chapters VARCHAR,
founding_date VARCHAR
) | When 1872-10-10 is the founding date what are the canadian chapters? | SELECT canadian_chapters FROM table_28436909_4 WHERE founding_date = "1872-10-10" | sql_create_context |
CREATE TABLE table_67466 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points Classification" text,
"Team Classification" text
) | Name the stgae with winner of robbie mcewen | SELECT "Stage" FROM table_67466 WHERE "Winner" = 'robbie mcewen' | wikisql |
CREATE TABLE table_29570 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real,
"Decision" text
) | How many times did they play the pittsburgh penguins? | SELECT COUNT("March") FROM table_29570 WHERE "Opponent" = 'Pittsburgh Penguins' | wikisql |
CREATE TABLE table_36949 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | How many Weeks are on september 8, 1980 and Attendances larger than 55,045? Question 4 | SELECT COUNT("Week") FROM table_36949 WHERE "Date" = 'september 8, 1980' AND "Attendance" > '55,045' | wikisql |
CREATE TABLE table_name_52 (
network VARCHAR,
call_sign VARCHAR,
virtual_channel VARCHAR
) | Call sign of k33ln-ld, and a Virtual channel of 33.5 is what network? | SELECT network FROM table_name_52 WHERE call_sign = "k33ln-ld" AND virtual_channel = "33.5" | sql_create_context |
CREATE TABLE table_name_62 (
round VARCHAR,
player VARCHAR,
pick VARCHAR
) | What is the total number of rounds that had draft pick 97, duncan mccoll? | SELECT COUNT(round) FROM table_name_62 WHERE player = "duncan mccoll" AND pick < 97 | sql_create_context |
CREATE TABLE table_11839306_2 (
track VARCHAR,
rōmaji_title VARCHAR
) | How many tracks are titled M Sukoshi T ku? | SELECT COUNT(track) FROM table_11839306_2 WHERE rōmaji_title = "Mō Sukoshi Tōku" | sql_create_context |
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 prescription... | provide the number of patients whose days of hospital stay is greater than 16 and drug name is sw? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.drug = "SW" | mimicsql_data |
CREATE TABLE table_name_3 (
fleet_size INTEGER,
type VARCHAR,
introduced VARCHAR
) | What is the average fleet size for the Shunter type introduced in 1959? | SELECT AVG(fleet_size) FROM table_name_3 WHERE type = "shunter" AND introduced = "1959" | sql_create_context |
CREATE TABLE table_17402 (
"Vendor and type" text,
"Models" text,
"NetFlow Version" text,
"Implementation" text,
"Comments" text
) | How many netflow version are there when the vendor and type is enterasys switches? | SELECT COUNT("NetFlow Version") FROM table_17402 WHERE "Vendor and type" = 'Enterasys Switches' | wikisql |
CREATE TABLE table_16456 (
"Team" text,
"Location" text,
"Joined" real,
"Conference" text,
"Division" text,
"Previous Conference" text
) | What conference was the churchill chargers team in? | SELECT "Conference" FROM table_16456 WHERE "Team" = 'Churchill Chargers' | wikisql |
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... | 45655595406结束门诊就诊的日子是在哪一年的几月几日 | SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '45655595406' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '45655595406' | css |
CREATE TABLE table_1220125_4 (
pennant VARCHAR,
laid_down VARCHAR
) | What is the pennant for 4 may 1943? | SELECT pennant FROM table_1220125_4 WHERE laid_down = "4 May 1943" | sql_create_context |
CREATE TABLE table_27723228_12 (
score VARCHAR,
team VARCHAR
) | Name the score for indiana | SELECT score FROM table_27723228_12 WHERE team = "Indiana" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | all the questions with jira in the title and tag. | SELECT Id AS "post_link", Title, Body, Tags FROM Posts WHERE Tags LIKE '%jira%' OR Title LIKE '%JIRA%' | sede |
CREATE TABLE table_name_95 (
county VARCHAR,
size VARCHAR,
mascot VARCHAR
) | Which County has a Size larger than 258, and a Mascot of commodores? | SELECT county FROM table_name_95 WHERE size > 258 AND mascot = "commodores" | sql_create_context |
CREATE TABLE table_name_93 (
record VARCHAR,
opponent VARCHAR
) | Which Record has an Opponent of milwaukee bucks? | SELECT record FROM table_name_93 WHERE opponent = "milwaukee bucks" | sql_create_context |
CREATE TABLE table_204_13 (
id number,
"finished" text,
"post" number,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | what is the name of the trainer of the first place horse ? | SELECT "trainer" FROM table_204_13 WHERE "finished" = 1 | squall |
CREATE TABLE table_name_15 (
Id VARCHAR
) | Who attended the school in 2008, that Deandria Hill attended in 2005? | SELECT 2008 FROM table_name_15 WHERE 2005 = "deandria hill" | sql_create_context |
CREATE TABLE table_13762472_4 (
high_rebounds VARCHAR,
score VARCHAR
) | who had high rebounds when score is w 111 92 (ot) | SELECT high_rebounds FROM table_13762472_4 WHERE score = "W 111–92 (OT)" | sql_create_context |
CREATE TABLE table_name_92 (
played INTEGER,
against VARCHAR,
points VARCHAR
) | Which Played is the highest one that has an Against smaller than 18, and Points smaller than 10? | SELECT MAX(played) FROM table_name_92 WHERE against < 18 AND points < 10 | sql_create_context |
CREATE TABLE table_58529 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team when the venue was Lake Oval? | SELECT "Away team" FROM table_58529 WHERE "Venue" = 'lake oval' | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the five most frequent output event during a year before? | 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 WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS... | mimic_iii |
CREATE TABLE table_60771 (
"Date" text,
"Nationality / Opponent" text,
"Ground" text,
"Result" text,
"Competition" text
) | Name the Date has a Competition of welsh rugby union challenge trophy and a Result of 34-34? Question 1 | SELECT "Date" FROM table_60771 WHERE "Competition" = 'welsh rugby union challenge trophy' AND "Result" = '34-34' | wikisql |
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
... | What are the distinct move in dates of the residents, and count them by a bar chart, and list by the Y in desc. | SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) DESC | nvbench |
CREATE TABLE table_name_99 (
netflix VARCHAR,
segment_b VARCHAR
) | Segment B of aerospace fuel lines is what netflix episode? | SELECT netflix FROM table_name_99 WHERE segment_b = "aerospace fuel lines" | 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... | 医疗机构5664551做叶酸片的检查记录有多少 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5664551' AND t_kc22.SOC_SRT_DIRE_NM = '叶酸片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '5664551' AND t_kc22.SOC_SRT_DIR... | css |
CREATE TABLE table_46241 (
"School" text,
"Location" text,
"Founded" real,
"Enrollment" real,
"Nickname" text
) | What is the most recent year founded that has a nickname of bruins? | SELECT MAX("Founded") FROM table_46241 WHERE "Nickname" = 'bruins' | wikisql |
CREATE TABLE table_51760 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | what is the year that the position was 1st in paris? | SELECT "Year" FROM table_51760 WHERE "Position" = '1st' AND "Venue" = 'paris' | wikisql |
CREATE TABLE table_40842 (
"Western Title" text,
"Chinese Title" text,
"Pinyin" text,
"Released Date" text,
"Genre" text,
"Game Modes" text
) | What is the release date for the Chinese title ? | SELECT "Released Date" FROM table_40842 WHERE "Chinese Title" = '摸摸瓦力欧制造' | wikisql |
CREATE TABLE table_name_2 (
score VARCHAR,
date VARCHAR
) | What was the score on March 23? | SELECT score FROM table_name_2 WHERE date = "march 23" | sql_create_context |
CREATE TABLE table_67252 (
"Institution" text,
"Location" text,
"Nickname" text,
"Current Conference" text,
"Classification" text
) | The River Hawks belonged to what current conference? | SELECT "Current Conference" FROM table_67252 WHERE "Nickname" = 'river hawks' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 text,
insuranc... | what was the first id of patient 1457's ward the last year? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1457) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is the number of patients whose days of hospital stay is greater than 16 and procedure long title is continuous intra-arterial blood gas monitoring? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "16" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring" | mimicsql_data |
CREATE TABLE table_9372 (
"Year" text,
"Starts" real,
"Wins" real,
"Top Fives" real,
"Top Tens" real,
"Poles" real,
"Rank" text
) | What is the total number of top fives when casey mears had more than 1 poles and top tens less than 9? | SELECT SUM("Top Fives") FROM table_9372 WHERE "Poles" > '1' AND "Top Tens" < '9' | wikisql |
CREATE TABLE table_8599 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
) | What club had a points difference of -24? | SELECT "Club" FROM table_8599 WHERE "Points difference" = '-24' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 从00.8.7开始,截止到02.12.6,盐酸胺碘酮片总共被医院开出给患者魏俊发多少次 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏俊发' AND t_kc22.STA_DATE BETWEEN '2000-08-07' AND '2002-12-06' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸胺碘酮片' | css |
CREATE TABLE table_18048 (
"Incumbent" text,
"Reason for Vacancy" text,
"Appointed Successor" text,
"Date of Appointment" text,
"Elected Successor" text,
"Date of Election" text
) | What was the election date for H. Brent Coles? | SELECT "Date of Election" FROM table_18048 WHERE "Appointed Successor" = 'H. Brent Coles' | wikisql |
CREATE TABLE table_name_63 (
eliminated_by VARCHAR,
wrestler VARCHAR
) | Who Eliminated Kane? | SELECT eliminated_by FROM table_name_63 WHERE wrestler = "kane" | sql_create_context |
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,... | Show how many courses in 2008 for every instructor with a bar chart, display Y-axis from high to low order. | SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_cours... | In the Fall can I take SOC 370 ? | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... | advising |
CREATE TABLE table_name_35 (
years VARCHAR,
displacement VARCHAR
) | what is the years for the displacement 4.0l (242cid)? | SELECT years FROM table_name_35 WHERE displacement = "4.0l (242cid)" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | had patient 016-27397 had any chest tube output: mediastinal l anterior output during this hospital encounter? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397' AND patient.hospitaldischargetime IS NULL)) AND intakeoutpu... | eicu |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what is the minimum number of yearly diagnosed cases of abdom aortic aneurysm? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abdom aortic aneurysm') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1 | mimic_iii |
CREATE TABLE table_200_1 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | what year was the film polio water released ? | SELECT "year" FROM table_200_1 WHERE "title" = 'polio water' | squall |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TAB... | Selecting closed opinion-based questions on SO. | SELECT p.Id AS "post_link", p.Score FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id INNER JOIN CloseReasonTypes AS crt ON crt.Id = CAST(ph.Comment AS INT) INNER JOIN PostTags ON PostTags.PostId = p.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('elm') AND ph.PostHistoryTypeId = 1... | sede |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
... | Find the number of students who is older than 20 in each dorm. | SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name | spider |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 项目334225104-r检查在这家9593364的医疗机构里,共有多少记录 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9593364' AND t_kc22.SOC_SRT_DIRE_CD = '334225104-r' | css |
CREATE TABLE table_33519 (
"Year" real,
"Player" text,
"Nationality" text,
"Position" text,
"Team" text
) | What nationality has a year larger than 2009 with a position of power forward? | SELECT "Nationality" FROM table_33519 WHERE "Year" > '2009' AND "Position" = 'power forward' | wikisql |
CREATE TABLE table_name_10 (
crowd VARCHAR,
home_team VARCHAR
) | How large was the crowd at Carlton's home game? | SELECT COUNT(crowd) FROM table_name_10 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在医院6644206患者何明煦出院诊断疾病名称包含迟滞的医疗就诊记录编号是什么? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '何明煦' AND MED_SER_ORG_NO = '6644206' AND OUT_DIAG_DIS_NM LIKE '%迟滞%' | css |
CREATE TABLE table_52278 (
"Years" text,
"Winners" text,
"Runners-Up" text,
"Score" text,
"Third" text
) | Who was the winner in the competition in which the runner-up was Rosenborg? | SELECT "Winners" FROM table_52278 WHERE "Runners-Up" = 'rosenborg' | wikisql |
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers real,
Domestic_Passengers real,
Transit_Passengers real,
Aircraft_Movements real,
Freight_Metric_Tonnes real
)
CREATE TABLE aircraft (
Aircraft_ID int(11... | For each aircraft that has won an award, what is its name and how many time has it won Plot them as bar chart, show in desc by the X-axis please. | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft DESC | nvbench |
CREATE TABLE table_1939214_1 (
year VARCHAR,
league VARCHAR,
regular_season VARCHAR
) | In what year did the team compete in the 2nd, Northeast season of the USL PDL League? | SELECT year FROM table_1939214_1 WHERE league = "USL PDL" AND regular_season = "2nd, Northeast" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | how many patients whose gender is f and diagnoses long title is acute diastolic heart failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Acute diastolic heart failure" | mimicsql_data |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZ... | 在医院8127400中列出患者25092297就诊科室名称包含儿的所有门诊就诊记录的流水号都是啥啊? | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.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 pers... | css |
CREATE TABLE table_name_47 (
player VARCHAR,
to_par VARCHAR
) | What is the Player that has a To standard of 7? | SELECT player FROM table_name_47 WHERE to_par = "–7" | sql_create_context |
CREATE TABLE table_18294 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the party with dbeingtrict being massachusetts 3 | SELECT "Party" FROM table_18294 WHERE "District" = 'Massachusetts 3' | wikisql |
CREATE TABLE table_64109 (
"Date Released" text,
"Polling institute" text,
"Socialist" text,
"Social Democratic" text,
"Green-Communist" text,
"People's Party" text,
"Left Bloc" text,
"Lead" text
) | What is the social democrat released on October 10, 1999? | SELECT "Social Democratic" FROM table_64109 WHERE "Date Released" = 'october 10, 1999' | wikisql |
CREATE TABLE table_24307 (
"Competition" text,
"Round" text,
"Opponent" text,
"Result" text,
"Score" text,
"Home/Away" text,
"Venue" text,
"Attendance" text,
"Date" text
) | What is the result of the qf round? | SELECT "Result" FROM table_24307 WHERE "Round" = 'QF' | wikisql |
CREATE TABLE table_name_40 (
year INTEGER,
position VARCHAR,
event VARCHAR
) | Name the sum of year for 2nd position for junior race | SELECT SUM(year) FROM table_name_40 WHERE position = "2nd" AND event = "junior race" | 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... | Are any classes available next semester for PreMajor fulfillment ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = co... | advising |
CREATE TABLE table_45767 (
"Rank" real,
"Name" text,
"Country" text,
"Wins" real,
"Years" text
) | Which Country has Wins larger than 2, and a Rank of 2, and a Name of federico bahamontes? | SELECT "Country" FROM table_45767 WHERE "Wins" > '2' AND "Rank" = '2' AND "Name" = 'federico bahamontes' | wikisql |
CREATE TABLE table_11265 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | with a record of 66-78 what was the loss? | SELECT "Loss" FROM table_11265 WHERE "Record" = '66-78' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, and display by the the average of manager id in asc please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_70153 (
"Surface" text,
"Event" text,
"Time ( h : m : s )" text,
"Date" text,
"Place" text
) | What is the Date that has 1:01:42? | SELECT "Date" FROM table_70153 WHERE "Time ( h : m : s )" = '1:01:42' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | what are the five most frequently performed procedures for a patient who was previously diagnosed with enterostomy status nec in the same month until 2101? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_64291 (
"Year" real,
"Political Rights" real,
"Civil Liberties" real,
"Status" text,
"President" text
) | When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties? | SELECT SUM("Civil Liberties") FROM table_64291 WHERE "Political Rights" = '6' AND "President" = 'yoweri museveni' AND "Year" = '1993' | wikisql |
CREATE TABLE table_46965 (
"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 high rebounds in Philips Arena 12,088? | SELECT "High rebounds" FROM table_46965 WHERE "Location Attendance" = 'philips arena 12,088' | wikisql |
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
category text,
result text
)
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_... | What are the titles, years, and directors of all movies, ordered by budget in millions? | SELECT title, year, director FROM movie ORDER BY budget_million | spider |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,... | on 04/22/2105 the heart rate of patient 6580 was ever less than 86.0? | SELECT COUNT(*) > 0 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 = 6580)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_... | mimic_iii |
CREATE TABLE table_name_6 (
round INTEGER,
location VARCHAR,
method VARCHAR
) | Can you tell me the lowest Round that has the Location of indiana, united states, and the Method of submission (guillotine choke)? | SELECT MIN(round) FROM table_name_6 WHERE location = "indiana, united states" AND method = "submission (guillotine choke)" | sql_create_context |
CREATE TABLE table_11734041_2 (
years_for_rockets VARCHAR,
school_club_team_country VARCHAR
) | What years did the player from LaSalle play for the Rockets? | SELECT years_for_rockets FROM table_11734041_2 WHERE school_club_team_country = "LaSalle" | sql_create_context |
CREATE TABLE table_26132 (
"Election Year" real,
"Assembly" text,
"Winning Party/Coalition" text,
"Chief Minister" text,
"Speaker" text
) | If the assembly is the sixth assembly, what is the maximum election year? | SELECT MAX("Election Year") FROM table_26132 WHERE "Assembly" = 'Sixth Assembly' | wikisql |
CREATE TABLE table_68205 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2? | SELECT MIN("Lane") FROM table_68205 WHERE "Heat" > '2' AND "Time" = '1:10.57' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what is the monthly average emesis output that patient 015-23047 has had since 12/27/2105? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.celllabel = 'emesi... | eicu |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
... | Find the number of courses offered by Psychology department in each building with a bar chart, could you sort from high to low by the names? | 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 DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.