context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_38329 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What championship had Francesca Schiavone in the finals? | SELECT "Championship" FROM table_38329 WHERE "Opponent in the final" = 'francesca schiavone' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal bool... | What's the Comment field in ReviewTaskResults?. | SELECT Comment FROM ReviewTaskResults WHERE NOT Comment IS NULL AND ReviewTaskResultTypeId != 3 | sede |
CREATE TABLE table_17886 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | Name the current club for player sacha giffa | SELECT "Current Club" FROM table_17886 WHERE "Player" = 'Sacha Giffa' | 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 diagnoses short title of subject id 21796? | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796" | mimicsql_data |
CREATE TABLE table_203_197 (
id number,
"#" number,
"title" text,
"artist" text,
"highest pos. reached" number,
"weeks at no. 1" text
) | which song stayed at no. 1 for the most amount of weeks . | SELECT "title" FROM table_203_197 ORDER BY "weeks at no. 1" DESC LIMIT 1 | squall |
CREATE TABLE table_203_158 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | how many games had an attendance of 50,000 or greater fans ? | SELECT COUNT(*) FROM table_203_158 WHERE "attendance" >= 50000 | squall |
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 text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 在02年7月13日到2009年11月4日内名叫戚雅娴的病人所有检验结果指标记录中的仪器编号以及名称分别都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHE... | css |
CREATE TABLE table_name_78 (
percentage_of_marine_area__foreez_ VARCHAR,
ecozone VARCHAR,
area__km²__exclusive_economic_zone VARCHAR
) | How many values for percentage of marine area are for the Atlantic marine ecozone with an exclusive economic zone area less than 996,439? | SELECT COUNT(percentage_of_marine_area__foreez_) FROM table_name_78 WHERE ecozone = "atlantic marine" AND area__km²__exclusive_economic_zone < 996 OFFSET 439 | sql_create_context |
CREATE TABLE table_6674 (
"Mission" text,
"Resident Country" text,
"Local Location" text,
"Local Mission" text,
"Local Position" text
) | What is the mission that has ambassador of local position, and a resident country of democratic republic of congo? | SELECT "Mission" FROM table_6674 WHERE "Local Position" = 'ambassador' AND "Resident Country" = 'democratic republic of congo' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 38590585这个患者之前做了什么检查 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '38590585' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE PostHistoryTypes (
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,
OwnerDi... | Gold badge ranking in India. | SELECT u.DisplayName, u.Id, REPLACE(CAST(TIME_TO_STR(b.Date, '%d %b %Y') AS TEXT(30)), ' ', '/') FROM Users AS u JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = 'css' AND b.Class = 1 ORDER BY b.Date DESC | sede |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
Li... | Oldest question without any answer. | SELECT * FROM Posts WHERE AnswerCount = 0 ORDER BY CreationDate | sede |
CREATE TABLE table_name_1 (
oilers_points INTEGER,
record VARCHAR,
oilers_first_downs VARCHAR
) | Which Oilers points have a Record of 10 6, and Oilers first downs larger than 14? | SELECT AVG(oilers_points) FROM table_name_1 WHERE record = "10–6" AND oilers_first_downs > 14 | sql_create_context |
CREATE TABLE departments (
department_id number,
department_name text,
manager_id number,
location_id number
)
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_... | What are full names and salaries of employees working in the city of London? | SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London' | spider |
CREATE TABLE Student (
advisor VARCHAR
)
CREATE TABLE Faculty (
fname VARCHAR,
lname VARCHAR,
FacID VARCHAR
) | What are the first and last name of the faculty who has the most students? | SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_23916462_3 (
date VARCHAR,
week VARCHAR
) | How many dates for the week of 4? | SELECT COUNT(date) FROM table_23916462_3 WHERE week = 4 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | the first time patient 025-44842 was prescribed alprazolam 0.25 mg po tabs and dextrose 50% at the same time during this month? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dextrose 50%' AND patient.uniquepid = '025-44842' AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CUR... | eicu |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 患者韩曼冬在2002年2月11日到2014年2月3日内都做了什么检验把检验结果指标记录中的仪器编号以及名称列出来 | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AN... | css |
CREATE TABLE table_name_38 (
club VARCHAR,
tries_against VARCHAR,
try_bonus VARCHAR
) | Which club has a try bonus of 9 and 43 tries against? | SELECT club FROM table_name_38 WHERE tries_against = "43" AND try_bonus = "9" | sql_create_context |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid i... | How many papers were written on question answering in the past year ? | SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 | scholar |
CREATE TABLE table_name_30 (
location VARCHAR,
competition VARCHAR
) | What is the location of the gold medal match? | SELECT location FROM table_name_30 WHERE competition = "gold medal match" | sql_create_context |
CREATE TABLE table_name_98 (
winner VARCHAR,
course VARCHAR,
date VARCHAR
) | Name the winner for rest day for 13 july | SELECT winner FROM table_name_98 WHERE course = "rest day" AND date = "13 july" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Get users that have in username ' '. | SELECT * FROM Users WHERE DisplayName LIKE 'irc' | sede |
CREATE TABLE table_21836 (
"Rank" real,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" real,
"April 1, 2010 density (/km\u00b2)" real,
"April 1, 2010 density (/mi\u00b2)" real,
"July 1, 2010 official estimate" real,
"... | Name the total number of states for july 1 2010 density is 1209 | SELECT COUNT("State") FROM table_21836 WHERE "July 1, 2010 density (/mi\u00b2)" = '1209' | wikisql |
CREATE TABLE table_name_79 (
rider VARCHAR,
speed VARCHAR
) | Who was the rider with 120.953 mph speed? | SELECT rider FROM table_name_79 WHERE speed = "120.953 mph" | 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... | 列出患者30218340入院科室名称中不包含医学科在医院0208580中的住院就诊记录分别是哪几条? | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '30218340' AND hz_info.YLJGDM = '0208580' AND NOT zyjzjlb.JZKSMC LIKE '%医学科%' | css |
CREATE TABLE table_46440 (
"Year" text,
"Player" text,
"Team" text,
"League" text,
"Position" text
) | What is the team for 1976? | SELECT "Team" FROM table_46440 WHERE "Year" = '1976' | wikisql |
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide number
)
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
category text,
result text... | Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross. | SELECT title, director FROM movie WHERE year <= 2000 ORDER BY gross_worldwide DESC LIMIT 1 | spider |
CREATE TABLE table_name_87 (
runner_s__up VARCHAR,
margin_of_victory VARCHAR
) | What is Runner(s)-Up when Margin of Victory is 6 Strokes? | SELECT runner_s__up FROM table_name_87 WHERE margin_of_victory = "6 strokes" | sql_create_context |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)... | Show all flight numbers with aircraft Airbus A340-300. | SELECT T1.flno FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" | spider |
CREATE TABLE table_16337329_5 (
injunctive VARCHAR,
past_habitual VARCHAR
) | Name the injunctive for garyo 'he did | SELECT injunctive FROM table_16337329_5 WHERE past_habitual = "गर्यो garyo 'he did'" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | how to draw a line with a bar in the same time in a pareto chart. | SELECT Title FROM Posts WHERE Title LIKE '%Pareto%' | sede |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATE... | How many documents are created in each day? Bin the document date by year interval and group by document type with a group line chart, and I want to sort Document_Date in asc order. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date | nvbench |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 医疗就诊30242405141入院时诊断的疾病编号及名称给提供一下 | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '30242405141' | css |
CREATE TABLE table_20649850_1 (
player VARCHAR,
position VARCHAR
) | Name the player for ol | SELECT player FROM table_20649850_1 WHERE position = "OL" | sql_create_context |
CREATE TABLE table_name_52 (
year INTEGER,
tournament VARCHAR,
points VARCHAR
) | What is the lowest year that has hypo-meeting as the tournament, with 8002 as the points? | SELECT MIN(year) FROM table_name_52 WHERE tournament = "hypo-meeting" AND points = "8002" | sql_create_context |
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... | 患者谢天心的身高多少?体重多少? | SELECT txmzjzjlb.SG, txmzjzjlb.TZ FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '谢天心' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ... | css |
CREATE TABLE table_31492 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
) | What is the area of the civil parish kilworth and townland monadrishane? | SELECT "Area( acres )" FROM table_31492 WHERE "Civil parish" = 'Kilworth' AND "Townland" = 'Monadrishane' | wikisql |
CREATE TABLE table_name_76 (
tries_for VARCHAR,
losing_bonus VARCHAR
) | If the losing bonus was 6, what is the tries for? | SELECT tries_for FROM table_name_76 WHERE losing_bonus = "6" | sql_create_context |
CREATE TABLE table_1134 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | Name the opponent for october 2, 1983 | SELECT "Opponent" FROM table_1134 WHERE "Date" = 'October 2, 1983' | wikisql |
CREATE TABLE table_61477 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Total" text
) | What is Set 2, when Total is '52:44'? | SELECT "Set 2" FROM table_61477 WHERE "Total" = '52:44' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | Site users overlap with SO. Original inspiration: http://data.stackexchange.com/stackoverflow/query/168043/accountid-comparison | SELECT 'Aviation SE User Count', COUNT(*) FROM "stackexchange.aviation".Users AS fu UNION ALL SELECT 'Users of both SO and AviationSE', COUNT(*) FROM "stackexchange.aviation".Users AS fu JOIN Users AS u ON fu.AccountId = u.AccountId | sede |
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... | How many of the patients on elective admission were born before 2043? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2043" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | when patient 021-190775 received the last laboratory test until 11/2105? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-190775')) AND STRFTIME('%y-%m', lab.labresulttime) <= '2105-11' ORDER BY lab.la... | eicu |
CREATE TABLE table_45371 (
"Stage" text,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Points Classification" text,
"Sprints classification" text,
"Team Classification" text
) | In the final Stage with a Mountains Classification of Christophe Moreau, what is the Team Classification? | SELECT "Team Classification" FROM table_45371 WHERE "Mountains Classification" = 'christophe moreau' AND "Stage" = 'final' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_36679 (
"Name" text,
"Capacity" text,
"Power" text,
"Type" text,
"Torque" text
) | What is the torque of 1.2 petrol? | SELECT "Torque" FROM table_36679 WHERE "Name" = '1.2 petrol' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 患有精神发育迟滞的人在门诊诊断确诊后其转铁蛋白数值的平均值以及最值数据是什么样子的? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '精神发育迟滞' AND jyjgzbb.JCZBMC = '转... | css |
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,
... | 在2003年9月3日到2003年10月12日间患者53577732全部检验报告单的审核日期都是几月几号? | SELECT jybgb.SHSJ FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '53577732' AND jybgb.BGRQ BETWEEN '2003-09-03' AND '2003-... | css |
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 (
... | Get the number of catholic religious background patients who had a total protein lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.label = "Protein, Total" | mimicsql_data |
CREATE TABLE table_63152 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text
) | What is the Date of the game with a Record of 5-3? | SELECT "Date" FROM table_63152 WHERE "Record" = '5-3' | wikisql |
CREATE TABLE table_name_33 (
score VARCHAR,
player VARCHAR
) | What is Tom Gillis' score? | SELECT score FROM table_name_33 WHERE player = "tom gillis" | sql_create_context |
CREATE TABLE table_name_9 (
current_club VARCHAR,
player VARCHAR
) | What is the club for Sam Magri? | SELECT current_club FROM table_name_9 WHERE player = "sam magri" | sql_create_context |
CREATE TABLE table_name_33 (
score VARCHAR,
set_1 VARCHAR
) | What was the overall score when set 1 was 23 25? | SELECT score FROM table_name_33 WHERE set_1 = "23–25" | sql_create_context |
CREATE TABLE table_name_65 (
gold VARCHAR,
year VARCHAR,
place VARCHAR
) | What gold has a year after 1970, with milan as the place? | SELECT gold FROM table_name_65 WHERE year > 1970 AND place = "milan" | sql_create_context |
CREATE TABLE table_52812 (
"Name" text,
"TKM career" text,
"Ties" real,
"Dou W/L" text,
"Sin W/L" text
) | Who has ties of 5? | SELECT "Name" FROM table_52812 WHERE "Ties" = '5' | wikisql |
CREATE TABLE table_name_8 (
series VARCHAR,
team VARCHAR
) | What series was Dick Johnson Racing the team? | SELECT series FROM table_name_8 WHERE team = "dick johnson racing" | 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... | 从二00九年十一月三十日到二0一六年六月十三日这段时间内,患者78396126开出的药品有多少是自付比例低于0.31的 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '78396126' AND t_kc22.STA_DATE BETWEEN '2009-11-30' AND '2016-06-13' AND t_kc22.SELF_PAY_PRO < 0.31 | css |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 看看在零七年八月二十八到一二年三月二十一日医疗机构8485615住院时长超过28天的就诊记录有多少 | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '8485615' AND RYDJSJ BETWEEN '2007-08-28' AND '2012-03-21' AND DATEDIFF(CYSJ, RYSJ) > 28 | 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 ... | provide the number of patients whose lab test name is wbc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "WBC" | mimicsql_data |
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 diagnosis (
diagn... | count the number of current patients whose age is in their 60 or above. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age >= 60 | eicu |
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,... | 有哪些名称包含传染科的科室给医疗就诊59532862326中开出了医疗费用明细项目? | SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '59532862326' AND MED_ORG_DEPT_NM LIKE '%传染科%' | css |
CREATE TABLE table_24406 (
"Name" text,
"Career" text,
"Matches" real,
"Innings" real,
"Not Out" real,
"Runs scored" real,
"High Score" text,
"50s" real,
"100s" real,
"Average" text
) | Name the innings for 5088 runs scored | SELECT COUNT("Innings") FROM table_24406 WHERE "Runs scored" = '5088' | wikisql |
CREATE TABLE table_74881 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
) | Which Incumbent has a District of California 8? | SELECT "Incumbent" FROM table_74881 WHERE "District" = 'california 8' | wikisql |
CREATE TABLE publication (
publication_id number,
book_id number,
publisher text,
publication_date text,
price number
)
CREATE TABLE book (
book_id number,
title text,
issues number,
writer text
) | List the writers of the books in ascending alphabetical order. | SELECT writer FROM book ORDER BY writer | spider |
CREATE TABLE table_33274 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Total points" real,
"Number of dances" real,
"Average" real
) | What is the lowest number of dances with a rank larger than 4 and a place of 8? | SELECT MIN("Number of dances") FROM table_33274 WHERE "Rank by average" > '4' AND "Place" = '8' | wikisql |
CREATE TABLE table_26981 (
"Season" text,
"Premier Division" text,
"Division One" text,
"Division Two" text,
"Division Three" text,
"Division Four" text,
"Division Five" text
) | When westcott 1935 is in division two how many leagues are in division three? | SELECT COUNT("Division Three") FROM table_26981 WHERE "Division Two" = 'Westcott 1935' | wikisql |
CREATE TABLE table_name_31 (
drawn INTEGER,
against VARCHAR
) | What is the lowest nuber of games drawn in the total column? | SELECT MIN(drawn) FROM table_name_31 WHERE against = "total" | sql_create_context |
CREATE TABLE table_name_40 (
date VARCHAR,
constructor VARCHAR
) | What dates did Ferrari win races? | SELECT date FROM table_name_40 WHERE constructor = "ferrari" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid nu... | when did patient 59941 come to the hospital for the last time until 2104 via an phys referral/normal deli? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 59941 AND admissions.admission_location = 'phys referral/normal deli' AND STRFTIME('%y', admissions.admittime) <= '2104' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
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... | 病人69954049的身高与体重分别达到多少? | SELECT mzjzjlb.SG, mzjzjlb.TZ 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 table_22073745_1 (
result VARCHAR,
year__ceremony_ VARCHAR
) | What is the result of the 2005 (78th) year ceremony? | SELECT result FROM table_22073745_1 WHERE year__ceremony_ = "2005 (78th)" | 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... | give me the number of patients whose admission location is emergency room admit and procedure short title is closed biopsy of tongue? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Closed biopsy of tongue" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepi... | in the last hospital encounter, has patient 013-29856 been given any diagnosis? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29856' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | calculate the difference between patient 28048's total input and the total output until 01/30/2104. | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28048)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2104-01-30') - (SEL... | mimic_iii |
CREATE TABLE table_25390 (
"Magnet" text,
"B r (T)" text,
"H ci (kA/m)" text,
"(BH) max (kJ/m 3 )" text,
"T c (\u00b0C)" text
) | When 720 is the t c ( c) what is the h ci (ka/m)? | SELECT "H ci (kA/m)" FROM table_25390 WHERE "T c (\u00b0C)" = '720' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, I want to sort X in ascending order. | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_204_108 (
id number,
"typ" text,
"construction time" text,
"cylinders" text,
"capacity" text,
"power" text,
"top speed" text
) | what is the number of cylinders that a 5/9 ps has ? | SELECT "cylinders" FROM table_204_108 WHERE "typ" = '5/9 ps' | squall |
CREATE TABLE table_53222 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average gold medals Uzbekistan, which has less than 24 total medals, has? | SELECT AVG("Gold") FROM table_53222 WHERE "Nation" = 'uzbekistan' AND "Total" < '24' | wikisql |
CREATE TABLE d_icd_diagnoses (
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 chartevents (
ro... | what does patient 49578 have to pay for the hospital stay in their first hospital visit? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49578 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_name_54 (
ship VARCHAR,
year INTEGER
) | Which Ship has a Year larger than 2013? | SELECT ship FROM table_name_54 WHERE year > 2013 | sql_create_context |
CREATE TABLE table_name_8 (
high_points VARCHAR,
high_rebounds VARCHAR
) | What is High Points, when High Rebounds is 'Dwight Howard (16)'? | SELECT high_points FROM table_name_8 WHERE high_rebounds = "dwight howard (16)" | sql_create_context |
CREATE TABLE table_name_4 (
week INTEGER,
result VARCHAR
) | On what Week was the Result W 17-14? | SELECT AVG(week) FROM table_name_4 WHERE result = "w 17-14" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
tre... | what are the three most commonly ordered lab tests for patients that had previously received intracranial/cerebral perfusion pressure monitoring - ventriculostomy within 2 months during the last year? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'intracranial/cerebral perfusion pressure monitoring ... | eicu |
CREATE TABLE table_36023 (
"Date" text,
"Time" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Who was the opponent for the game played with 54,136 people in attendance? | SELECT "Opponent" FROM table_36023 WHERE "Attendance" = '54,136' | wikisql |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,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 takes (
ID varchar(5)... | How many total credits are offered by each department. Show bar chart. | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name | nvbench |
CREATE TABLE table_204_809 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"national final" text,
"place" number,
"points" number
) | what country is in draw 17 ? | SELECT "country" FROM table_204_809 WHERE "draw" = 17 | squall |
CREATE TABLE table_71585 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | What the name of Peter White's party? | SELECT "Party" FROM table_71585 WHERE "Member" = 'peter white' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | what are patient 13703's arterial bp [diastolic] differences second measured on the first intensive care unit visit compared to the value first measured on the first intensive care unit visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13703) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_26591434_1 (
ratings__kanto_ VARCHAR,
episode VARCHAR
) | What was the ratings for episode 11? | SELECT ratings__kanto_ FROM table_26591434_1 WHERE episode = 11 | sql_create_context |
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 demographic (... | provide the number of patients whose diagnoses short title is polycythemia vera and drug type is main? | 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 = "Polycythemia vera" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_25 (
venue VARCHAR,
home_team VARCHAR
) | Where did North Melbourne play as the home team? | SELECT venue FROM table_name_25 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE table_26131768_4 (
term_limited VARCHAR,
representative VARCHAR
) | If the representative is Dave Hall, when was the term limited? | SELECT term_limited FROM table_26131768_4 WHERE representative = "Dave Hall" | sql_create_context |
CREATE TABLE table_79099 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | What is the total number drawn with goals against less than 55, and a total of 14 losses? | SELECT COUNT("Drawn") FROM table_79099 WHERE "Goals Against" < '55' AND "Lost" = '14' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
Revision... | Average score for accepted post. | SELECT AVG(Score) AS avg_score, Id FROM Posts WHERE PostTypeId = 2 GROUP BY Id ORDER BY avg_score DESC | sede |
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... | count the number of patients whose admission type is emergency and diagnoses short title is malig neo tongue nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Malig neo tongue NEC" | mimicsql_data |
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,
... | 在2004年1月21日到2017年9月23日之间患者孔幼怡就诊过的医生统共有多少个? | SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '孔幼怡' AND zzmzjzjlb.JZKSRQ BETWEEN '2004-01-21' AND '2017-09-23' UNION SELECT COUNT(fz... | css |
CREATE TABLE table_14332822_1 (
genbank_id VARCHAR
) | What is the 3utr sequence when the genbank id is hq021437? | SELECT 3 AS ’utr_sequence FROM table_14332822_1 WHERE genbank_id = "HQ021437" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | what is the new prescriptions of patient 17462 today compared to the prescriptions yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_204_401 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"react" number,
"time" number,
"notes" text
) | the first person to finish in heat 1 ? | SELECT "name" FROM table_204_401 WHERE "rank" = 1 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.