context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Na... | Comment extraction - ask ubuntu. | SELECT Id, Text FROM Comments WHERE PostId IN (SELECT Id FROM Posts WHERE Tags LIKE '%puppet%') AND Text LIKE '%complex%' | sede |
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 allergy (
allergy... | when has patient 012-66291 last had the heartrate maximum on 12/31/this year? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-66291')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
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... | 编号为5574257这个医疗机构有多少外地住院就诊记录?时间为二零零四年四月十七日到二零一一年十月三十一日 | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '55... | css |
CREATE TABLE table_name_1 (
club_team VARCHAR,
round VARCHAR,
overall VARCHAR
) | Which team scores 119 in round 4? | SELECT club_team FROM table_name_1 WHERE round = 4 AND overall = 119 | sql_create_context |
CREATE TABLE table_7566 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" text,
"To par" text
) | What was the total of the player from Spain? | SELECT "Total" FROM table_7566 WHERE "Country" = 'spain' | wikisql |
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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Regarding upper level classes , what 's the count on the number that have labs ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_25704 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the location attendance of 5-15 | SELECT "Location Attendance" FROM table_25704 WHERE "Record" = '5-15' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients whose death status is 0 and procedure icd9 code is 540? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "540" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | 编号为115226705-s的药品在医疗就诊70669377349中的剂型是什么?规格是什么? | SELECT t_kc22.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '70669377349' AND t_kc22.SOC_SRT_DIRE_CD = '115226705-s' | css |
CREATE TABLE table_28884858_2 (
team VARCHAR,
capacity_percentage VARCHAR
) | How many teams had a 99.3% capacity rating? | SELECT COUNT(team) FROM table_28884858_2 WHERE capacity_percentage = "99.3%" | sql_create_context |
CREATE TABLE table_12680 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | Can you tell me the Money ( ) that has the Country of england, and the Player of malcolm mackenzie? | SELECT "Money ( \u00a3 )" FROM table_12680 WHERE "Country" = 'england' AND "Player" = 'malcolm mackenzie' | wikisql |
CREATE TABLE table_12669 (
"Rank" real,
"Result" text,
"Wind" text,
"Athlete" text,
"Date" text,
"Location" text
) | Show the Result of inger miller? | SELECT "Result" FROM table_12669 WHERE "Athlete" = 'inger miller' | wikisql |
CREATE TABLE table_53129 (
"Record" text,
"Date" text,
"Driver" text,
"Time" text,
"Speed/Avg. Speed" text
) | What date was the nascar nationwide series held? | SELECT "Record" FROM table_53129 WHERE "Date" = 'nascar nationwide series' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | Give a bar chart that bins year into weekday interval, group by year and count them. | SELECT Year, COUNT(Year) FROM exhibition GROUP BY Year | nvbench |
CREATE TABLE table_name_99 (
result VARCHAR,
horse VARCHAR,
event VARCHAR
) | What is the result of Waldemar 27 s freestyle test? | SELECT COUNT(result) FROM table_name_99 WHERE horse = "waldemar 27" AND event = "freestyle test" | sql_create_context |
CREATE TABLE table_name_30 (
player VARCHAR,
round VARCHAR
) | What player was drafted in Round 5? | SELECT player FROM table_name_30 WHERE round = 5 | sql_create_context |
CREATE TABLE table_name_57 (
surface VARCHAR,
round VARCHAR,
player VARCHAR
) | Which Surface has a Round of 4th round, and a Player of maria sharapova? | SELECT surface FROM table_name_57 WHERE round = "4th round" AND player = "maria sharapova" | 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,
... | when was the last time that patient 012-66291 had the heartrate maximum on 12/31/this year? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-66291')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
CREATE TABLE table_23286112_6 (
date VARCHAR,
game VARCHAR
) | When was the game number 3 played? | SELECT date FROM table_23286112_6 WHERE game = 3 | sql_create_context |
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connectio... | Draw a bar chart of operating system versus the total number | SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system | nvbench |
CREATE TABLE table_52353 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
) | Which format had a United States region and a date of August 11, 2009? | SELECT "Format" FROM table_52353 WHERE "Region" = 'united states' AND "Date" = 'august 11, 2009' | wikisql |
CREATE TABLE table_name_54 (
games INTEGER,
assist INTEGER
) | How many games had an assist number greater than 54? | SELECT SUM(games) FROM table_name_54 WHERE assist > 54 | sql_create_context |
CREATE TABLE table_name_83 (
result VARCHAR,
record VARCHAR
) | Record of 3 3 has what result? | SELECT result FROM table_name_83 WHERE record = "3–3" | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 知道住院就诊84637412405的主要诊断编码类型是啥吗?还有编码列表和名称列表 | SELECT ZYBMLX, ZYZDBM, ZYZDMC FROM zyjzjlb WHERE JZLSH = '84637412405' | css |
CREATE TABLE table_15847691_2 (
first_downs VARCHAR,
date VARCHAR
) | What was the total number of first down on October 23? | SELECT COUNT(first_downs) FROM table_15847691_2 WHERE date = "October 23" | sql_create_context |
CREATE TABLE table_18068 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What's the smallest episode number of an episode whose number in the series is 22? | SELECT MIN("No. in season") FROM table_18068 WHERE "No. in series" = '22' | wikisql |
CREATE TABLE table_11650 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the highest interview for Louisiana with an average above 9.324? | SELECT MAX("Interview") FROM table_11650 WHERE "Average" > '9.324' AND "State" = 'louisiana' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
) | Plot a scatter chart, body builder id by people_id. | SELECT Body_Builder_ID, People_ID FROM body_builder | nvbench |
CREATE TABLE table_29225103_2 (
ep_winning_team VARCHAR,
fm_winning_team VARCHAR,
hm_winning_team VARCHAR
) | Who was the EP winning team when the FM winning team was Brabham - Ford and the HM winning team was Osca? | SELECT ep_winning_team FROM table_29225103_2 WHERE fm_winning_team = "Brabham - Ford" AND hm_winning_team = "Osca" | 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 diagnoses (
... | how many patients whose admission location is transfer from hosp/extram and admission year is less than 2167? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2167" | mimicsql_data |
CREATE TABLE table_18357 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | List all results where the voting district is Maryland 7. | SELECT "Result" FROM table_18357 WHERE "District" = 'Maryland 7' | wikisql |
CREATE TABLE table_13212 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Total has Gold of 2? | SELECT MAX("Total") FROM table_13212 WHERE "Gold" = '2' | wikisql |
CREATE TABLE table_21021796_1 (
power VARCHAR,
torque VARCHAR,
applications VARCHAR
) | If torque is n m (lb ft) @1600 2400 rpm and applications is 2000 w90x sprinter, what is the power? | SELECT power FROM table_21021796_1 WHERE torque = "N·m (lb·ft) @1600–2400 rpm" AND applications = "2000 W90x Sprinter" | sql_create_context |
CREATE TABLE table_name_45 (
result VARCHAR,
man_of_the_match VARCHAR,
competition VARCHAR,
opponent VARCHAR
) | What is the result of the league/cup competition with the swindon wildcats as the opponent and neil liddiard as the man of the match? | SELECT result FROM table_name_45 WHERE competition = "league/cup" AND opponent = "swindon wildcats" AND man_of_the_match = "neil liddiard" | sql_create_context |
CREATE TABLE table_16662 (
"Round" real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | who are all the winning constructors where fastest lap is riccardo patrese and location is interlagos | SELECT "Winning Constructor" FROM table_16662 WHERE "Fastest Lap" = 'Riccardo Patrese' AND "Location" = 'Interlagos' | 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 admitted in urgent care have lab test item id 50804? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50804" | mimicsql_data |
CREATE TABLE table_16732 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | what's the report with race argentine grand prix | SELECT "Report" FROM table_16732 WHERE "Race" = 'Argentine Grand Prix' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Posts edited by the user, excluding own posts. | SELECT h.PostId AS "post_link", h.CreationDate AS "edit_date" FROM PostHistory AS h, Posts AS p WHERE h.UserId = '##UserID##' AND h.PostHistoryTypeId IN (4, 5, 6) AND p.Id = h.PostId AND p.OwnerUserId != '##UserID##' ORDER BY 'edit_date' DESC | sede |
CREATE TABLE table_203_554 (
id number,
"year" number,
"place" text,
"gold" text,
"silver" text,
"bronze" text
) | what is the number of total bronze medals that germany has won ? | SELECT COUNT(*) FROM table_203_554 WHERE "bronze" = 'germany' | squall |
CREATE TABLE table_20975 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Falcons points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | Name the date for game 9 | SELECT "Date" FROM table_20975 WHERE "Game" = '9' | wikisql |
CREATE TABLE table_78304 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What sum of Attendance has a Week smaller than 10, and a Result of l 30-21? | SELECT SUM("Attendance") FROM table_78304 WHERE "Week" < '10' AND "Result" = 'l 30-21' | wikisql |
CREATE TABLE table_name_52 (
manager VARCHAR,
manufacturer VARCHAR,
club VARCHAR
) | What Premier League Manager has an Adidas sponsor and a Newcastle United club? | SELECT manager FROM table_name_52 WHERE manufacturer = "adidas" AND club = "newcastle united" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients of hispano/latino - puerto rican ethnicity have been prescribed the drug sulfamethoxazole - trimethoprim? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Sulfamethoxazole-Trimethoprim" | mimicsql_data |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskSt... | Low views, high votes yet unanswered. A list of questions with a high score and low view count | SELECT questao.Id AS "post_link", questao.Score, questao.ViewCount, comentario.Id, comentario.Score AS socre_comentario, comentario.ViewCount AS views_comentario FROM Posts AS questao JOIN Posts AS comentario ON questao.Id = comentario.ParentId WHERE questao.Tags LIKE '%<android%' AND questao.ParentId IS NULL ORDER BY ... | sede |
CREATE TABLE table_56514 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | If essendon is the home team, what venue did they play at? | SELECT "Venue" FROM table_56514 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE table_6915 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
) | Which Status has a Unit of daohugou beds? | SELECT "Status" FROM table_6915 WHERE "Unit" = 'daohugou beds' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Posts containing bit.ly shortened URLs. Posts containing bit.ly shortened URLs, which allow for tracking clicks :-(
See http://meta.stackoverflow.com/questions/29518/can-and-should-stack-overflow-automatically-rewrite-bit-ly-links
See http://stackapps.com/questions/121/what-ideas-do-you-have-for-the-api/546#546 | SELECT Id AS "post_link", Body FROM Posts WHERE Body LIKE '%http://bit.ly%' | sede |
CREATE TABLE table_17166 (
"Series" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text,
"Saturday" text,
"Sunday" text
) | Who is the Wednesday presenter of the show Big Brother 13? | SELECT "Wednesday" FROM table_17166 WHERE "Series" = 'Big Brother 13' | wikisql |
CREATE TABLE table_name_2 (
right_ascension___j2000__ VARCHAR,
ngc_number VARCHAR,
object_type VARCHAR,
apparent_magnitude VARCHAR
) | Tell me the right ascensuon for object type of globular cluster and apparent magnitude of 8.5 and NGC number of 6273 | SELECT right_ascension___j2000__ FROM table_name_2 WHERE object_type = "globular cluster" AND apparent_magnitude = 8.5 AND ngc_number = 6273 | sql_create_context |
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 ... | 从01年3月9号到14年4月7号,患者姜和玉,836622这个指标怎么样 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_name_47 (
competition VARCHAR,
date VARCHAR
) | Which competition was on 17/9/00? | SELECT competition FROM table_name_47 WHERE date = "17/9/00" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | had patient 022-6959 excreted any urine in this month? | 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 = '022-6959')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput... | eicu |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the trend about employee_id over hire_date , show X in descending order. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
... | 列出患者钱艳芳的检验报告单日期在2015年9月20日之前的所对应的住院就诊的流水号 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '钱艳芳' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2015-09-20') | css |
CREATE TABLE table_name_59 (
catalog VARCHAR,
region VARCHAR
) | What is the Catalog Number is for the Japan region? | SELECT catalog FROM table_name_59 WHERE region = "japan" | sql_create_context |
CREATE TABLE table_35704 (
"Source" text,
"Date" text,
"Fidesz" text,
"MSZP" text,
"SZDSZ" text,
"Jobbik" text,
"others" text
) | What is the SZDSZ percentage with an MSZP of 25% on 25/2/2009? | SELECT "SZDSZ" FROM table_35704 WHERE "MSZP" = '25%' AND "Date" = '25/2/2009' | wikisql |
CREATE TABLE table_name_45 (
set_2 VARCHAR,
date VARCHAR,
set_3 VARCHAR
) | Which Set 2 has a Date of 25 may, and a Set 3 of 21 25? | SELECT set_2 FROM table_name_45 WHERE date = "25 may" AND set_3 = "21–25" | sql_create_context |
CREATE TABLE Rooms (
roomName VARCHAR,
RoomId VARCHAR
)
CREATE TABLE Reservations (
Room VARCHAR
) | Return the name and number of reservations made for each of the rooms. | SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | Top 100 android users from Pakistan. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | Next semester , which upper level elective classes only meet Monday , Tuesday , Wednesday and / or Thursday ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... | advising |
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... | 病患在1967584这个医疗机构对医疗项目自付比例的平均值是多少?就在10年9月13到11年4月9的这段时间 | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1967584' AND t_kc22.STA_DATE BETWEEN '2010-09-13' AND '2011-04-09' | 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,
... | give me the number of patients whose insurance is government and diagnoses icd9 code is 78720? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "78720" | mimicsql_data |
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CRE... | How many staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's last name, display in asc by the x-axis. | SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY last_name | nvbench |
CREATE TABLE table_49753 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What is the airport when the iata is tbj? | SELECT "Airport" FROM table_49753 WHERE "IATA" = 'tbj' | wikisql |
CREATE TABLE table_18534 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the party where the incumbent is overton brooks? | SELECT "Party" FROM table_18534 WHERE "Incumbent" = 'Overton Brooks' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airp... | can you tell me the time a flight would leave from ATLANTA to BOSTON in the afternoon | SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_33011 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | What Venue is in Colorado? | SELECT "Venue" FROM table_33011 WHERE "State" = 'colorado' | wikisql |
CREATE TABLE table_20898602_1 (
position VARCHAR,
height VARCHAR
) | what is the position of the player of height ft0in (m) | SELECT position FROM table_20898602_1 WHERE height = "ft0in (m)" | sql_create_context |
CREATE TABLE table_5301 (
"Episode No." text,
"Episode Title" text,
"UK Broadcast Date" text,
"Presenter" text,
"Countries Visited" text
) | What is the broadcast date for the episode titled, 'From Hong Kong to Ulaanbaatar'? | SELECT "UK Broadcast Date" FROM table_5301 WHERE "Episode Title" = 'from hong kong to ulaanbaatar' | wikisql |
CREATE TABLE table_name_99 (
bullet_weight VARCHAR,
source VARCHAR
) | What is Bullet weight, when Source is hornady? | SELECT bullet_weight FROM table_name_99 WHERE source = "hornady" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, and I want to rank by the total number in asc. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_29779 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What were the high points on April 8? | SELECT "High points" FROM table_29779 WHERE "Date" = 'April 8' | wikisql |
CREATE TABLE table_name_86 (
player VARCHAR,
position VARCHAR
) | Who has a position of sg? | SELECT player FROM table_name_86 WHERE position = "sg" | sql_create_context |
CREATE TABLE table_63559 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What is Christian Malcolm s highest react when his time was below 20.58? | SELECT MAX("React") FROM table_63559 WHERE "Time" < '20.58' AND "Athlete" = 'christian malcolm' | wikisql |
CREATE TABLE table_1341690_35 (
candidates VARCHAR,
first_elected VARCHAR
) | Who were the candidates in the districts that was first elected in 1966? | SELECT candidates FROM table_1341690_35 WHERE first_elected = 1966 | sql_create_context |
CREATE TABLE table_26400438_1 (
series VARCHAR,
team VARCHAR
) | In which series did Lecor Sports participate? | SELECT series FROM table_26400438_1 WHERE team = "Lecor Sports" | sql_create_context |
CREATE TABLE table_14086 (
"Year(s)" real,
"Tournament or series" text,
"Played in" text,
"Games played ( Tests )" text,
"Games won ( Tests )" text,
"Games lost ( Tests )" text,
"Games drawn ( Tests )" text,
"Points for ( Tests )" text,
"Points against ( Tests )" text
) | What are the points against for 2000, when games won is 4 (1)? | SELECT "Points against ( Tests )" FROM table_14086 WHERE "Year(s)" = '2000' AND "Games won ( Tests )" = '4 (1)' | wikisql |
CREATE TABLE table_name_2 (
musical_guest__song_performed_ VARCHAR,
air_date VARCHAR
) | What is the Musical Guest (Song performed) for the episode aired on 13 july 2008? | SELECT musical_guest__song_performed_ FROM table_name_2 WHERE air_date = "13 july 2008" | sql_create_context |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machin... | Create a bar chart showing the total number across team | SELECT Team, COUNT(*) FROM technician GROUP BY Team | nvbench |
CREATE TABLE table_25212 (
"District name" text,
"Dist. ID" real,
"ISD" text,
"County" text,
"Authorizing agency" text,
"Date opened" text,
"Services" text
) | If the name of the district is the Charyl Stockwell Academy, what is the county name? | SELECT "County" FROM table_25212 WHERE "District name" = 'Charyl Stockwell Academy' | wikisql |
CREATE TABLE table_22754310_1 (
margin INTEGER,
party VARCHAR,
winner VARCHAR
) | Name the most margin for nco party and p. ramachandran won | SELECT MAX(margin) FROM table_22754310_1 WHERE party = "NCO" AND winner = "P. Ramachandran" | sql_create_context |
CREATE TABLE table_42057 (
"Week" real,
"Date" text,
"TV Time" text,
"Opponent" text,
"Result" text
) | Which Week has a Result of l 13-16 and an Opponent of at buffalo bills? | SELECT AVG("Week") FROM table_42057 WHERE "Result" = 'l 13-16' AND "Opponent" = 'at buffalo bills' | wikisql |
CREATE TABLE table_name_84 (
loses INTEGER,
position VARCHAR,
points VARCHAR,
goals_scored VARCHAR
) | How many loses have points greater than 30, goals scored greater than 59, with a position greater than 5? | SELECT SUM(loses) FROM table_name_84 WHERE points > 30 AND goals_scored > 59 AND position > 5 | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | Is there an CLIMATE 400 -level course that contains 4 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
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... | 参保人98736904在2007.1.26到2015.8.6这段时间,曾开出的药品中,单一药品最大购买次数查一下 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I... | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For all employees who have the letters D or S in their first name, draw a line chart about the change of employee_id over hire_date , and list in desc by the x axis please. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | nvbench |
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 average age of patients whose marital status is single and year of birth is greater than 2175? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2175" | mimicsql_data |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, find name and the average of code , and group by attribute name, and visualize them by a bar chart, rank by the Y-axis in asc. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code | nvbench |
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... | give me the number of patients whose ethnicity is american indian/alaska native and item id is 50803? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.itemid = "50803" | mimicsql_data |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE icustays (
row_id number,
s... | first time patient 26156 got surgery until 2104? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26156) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_71503 (
"Member countries" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (billion US$)" text,
"GDP per capita (US$)" text
) | What is the GDP of the nation with 56,210,000 people? | SELECT "GDP per capita (US$)" FROM table_71503 WHERE "Population" = '56,210,000' | wikisql |
CREATE TABLE table_name_52 (
district VARCHAR,
incumbent VARCHAR
) | What district has benjamin eggleston for incumbent? | SELECT district FROM table_name_52 WHERE incumbent = "benjamin eggleston" | 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 the number of patients less than 85 years old who have coronary artery disease or coronary artery bypass graft with mvr or maze primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.age < "85" | mimicsql_data |
CREATE TABLE table_30110 (
"Player" text,
"Matches" real,
"Overs" text,
"Wickets" real,
"Average" text,
"Economy" text,
"BBI" text,
"4wi" real
) | What is the fewest number of wickets recorded? | SELECT MIN("Wickets") FROM table_30110 | wikisql |
CREATE TABLE table_name_33 (
overall INTEGER,
slalom VARCHAR,
season VARCHAR
) | What is the highest overall prior to 1996 with a slalom of 39? | SELECT MAX(overall) FROM table_name_33 WHERE slalom = "39" AND season < 1996 | sql_create_context |
CREATE TABLE table_name_7 (
position VARCHAR,
pick VARCHAR
) | Tell me the position for pick of 146 | SELECT position FROM table_name_7 WHERE pick = "146" | sql_create_context |
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... | 根据出院诊断疾病名称,不同疾病的平均患者年龄在医院8391729中分别都是多少呢? | SELECT OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8391729' GROUP BY OUT_DIAG_DIS_NM | css |
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE course (
cid text,
cname text,
credits number,
instructor number,
day... | What are the rooms for members of the faculty who are professors and who live in building NEB? | SELECT room FROM faculty WHERE rank = "Professor" AND building = "NEB" | spider |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
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 Allergy_Type (
Allergy VARCHAR(20),
... | A bar chart about the number of first name for all female students whose sex is F, list by the x-axis in descending. | SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname DESC | nvbench |
CREATE TABLE table_204_969 (
id number,
"composer" text,
"title" text,
"genre" text,
"date" number,
"notes" text
) | which composer is listed below pete doherty ? | SELECT "composer" FROM table_204_969 WHERE id = (SELECT id FROM table_204_969 WHERE "composer" = 'pete doherty') + 1 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.