context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_58772 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) | What is Location, when Opponent is 'Mario Rinaldi'? | SELECT "Location" FROM table_58772 WHERE "Opponent" = 'mario rinaldi' | wikisql |
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... | 看看编号98041595425的检验报告单是哪个机构申请检验的,名称是什么,提供检验的机构又叫什么 | SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '98041595425' | css |
CREATE TABLE table_45927 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | Which Surface has an Opponent in the final of don mcneill, and a Year of 1940? | SELECT "Surface" FROM table_45927 WHERE "Opponent in the final" = 'don mcneill' AND "Year" = '1940' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | count the number of patients whose diagnoses icd9 code is 481 and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "481" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_203_79 (
id number,
"year" number,
"film" text,
"publisher" text,
"director" text,
"distributor" text,
"worldwide gross" text,
"notes" text
) | which live action american superhero movie was released before the 1966 batman movie ? | SELECT "film" FROM table_203_79 WHERE "year" < 1966 | squall |
CREATE TABLE table_74166 (
"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 record on December 12? | SELECT "High rebounds" FROM table_74166 WHERE "Date" = 'December 12' | wikisql |
CREATE TABLE table_27286 (
"Model" text,
"Power" text,
"Torque" text,
"Gearbox" text,
"Weight" text,
"Seating" text,
"Brakes" text,
"Wheels" text,
"Tyres" text
) | What is the power for the Spirit R (Type B)? | SELECT "Power" FROM table_27286 WHERE "Model" = 'Spirit R (Type B)' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose death status is 1 and diagnoses short title is pseudomonas infect nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Pseudomonas infect NOS" | mimicsql_data |
CREATE TABLE table_name_91 (
tonnage VARCHAR,
date VARCHAR
) | What was the tonnage on 12 september 1942? | SELECT tonnage FROM table_name_91 WHERE date = "12 september 1942" | 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 tested for other body fluid were born before the year 2043? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id nu... | How many distinct users have asked questions. | SELECT COUNT(DISTINCT p.AcceptedAnswerId), p2.OwnerUserId FROM Posts AS p, Posts AS p2 GROUP BY p2.OwnerUserId ORDER BY COUNT(DISTINCT p.AcceptedAnswerId) DESC | sede |
CREATE TABLE table_37324 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text
) | Which Democratic has a District smaller than 7, and a Republican of dan mansell? | SELECT "Democratic" FROM table_37324 WHERE "District" < '7' AND "Republican" = 'dan mansell' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | what is the average age for a male in each job?, rank X in desc order. | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE table_name_75 (
time VARCHAR,
method VARCHAR,
record VARCHAR
) | What was the time of the match with a record of 9-0 and used the tko (doctor stoppage) method? | SELECT time FROM table_name_75 WHERE method = "tko (doctor stoppage)" AND record = "9-0" | sql_create_context |
CREATE TABLE table_name_47 (
athlete VARCHAR,
run_1 VARCHAR,
run_3 VARCHAR
) | Who is the athlete with a run 1 less than 54.13 and a 55.21 run 3? | SELECT athlete FROM table_name_47 WHERE run_1 < 54.13 AND run_3 = 55.21 | 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 demographic ... | what is average age of patients whose gender is f and primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" | mimicsql_data |
CREATE TABLE table_22815 (
"Episode title" text,
"Subject" text,
"Music by" text,
"Lyrics by" text,
"Performed by" text,
"First aired" text
) | What is the date for the episode performed by Sue Manchester? | SELECT "First aired" FROM table_22815 WHERE "Performed by" = 'Sue Manchester' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | SebasSBM's custom filter (test phase). | SELECT Id FROM Posts WHERE ViewCount = 9999 | sede |
CREATE TABLE table_name_29 (
game VARCHAR,
result VARCHAR,
attendance VARCHAR
) | How many games have a Result of 4 0, and an Attendance larger than 12,256? | SELECT COUNT(game) FROM table_name_29 WHERE result = "4–0" AND attendance > 12 OFFSET 256 | sql_create_context |
CREATE TABLE table_4819 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date was the match played in Victoria Park? | SELECT "Date" FROM table_4819 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_204_755 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | how many games did this team win this season ? | SELECT COUNT(*) FROM table_204_755 WHERE "result" = 'w' | squall |
CREATE TABLE table_name_64 (
team VARCHAR,
driver VARCHAR
) | what is the team when the driver is viktor jensen? | SELECT team FROM table_name_64 WHERE driver = "viktor jensen" | sql_create_context |
CREATE TABLE table_name_26 (
year VARCHAR,
movie_title VARCHAR
) | What year was Jamboree made? | SELECT year FROM table_name_26 WHERE movie_title = "jamboree" | sql_create_context |
CREATE TABLE table_name_28 (
nation VARCHAR,
silver VARCHAR,
bronze VARCHAR,
gold VARCHAR,
total VARCHAR
) | What Nation has a Gold entry that is greater than 0, a Total that is greater than 2, a Silver entry that is larger than 1, and 0 Bronze? | SELECT nation FROM table_name_28 WHERE gold > 0 AND total > 2 AND bronze = 0 AND silver > 1 | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | report the number of patients with procedure icd9 code 5781 who were admitted in hospital before 2138. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.icd9_code = "5781" | mimicsql_data |
CREATE TABLE table_73727 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Youth Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Most Courageous" text,
"Team Classification" text
) | When Ryan Anderson won the mountains classification, and Michael Rogers won the general classification, who won the sprint classification? | SELECT "Sprint Classification" FROM table_73727 WHERE "Mountains Classification" = 'Ryan Anderson' AND "General Classification" = 'Michael Rogers' | wikisql |
CREATE TABLE table_203_180 (
id number,
"#" number,
"weekend end date" text,
"film" text,
"weekend gross (millions)" text,
"notes" text
) | how many films grossed over five million in their first week ? | SELECT COUNT(DISTINCT "film") FROM table_203_180 WHERE "weekend gross (millions)" > 5 | squall |
CREATE TABLE table_name_56 (
year INTEGER,
artist VARCHAR,
rank VARCHAR
) | What was the first year that the artist of every little thing ranked lower than 10? | SELECT MIN(year) FROM table_name_56 WHERE artist = "every little thing" AND rank < 10 | sql_create_context |
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... | 医疗机构5573688哪些项目的收费金额排在top28 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5573688' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 28 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_k... | css |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | what were the top four most common procedures that were followed within 2 months for patients who were diagnosed with oth inf vena cava thromb since 2104? | 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_27716091_1 (
directed_by VARCHAR,
production_code VARCHAR
) | who put on the show where the numbers were 227412 | SELECT directed_by FROM table_27716091_1 WHERE production_code = 227412 | sql_create_context |
CREATE TABLE table_name_75 (
attendance INTEGER,
date VARCHAR
) | What was the attendance on may 21? | SELECT MAX(attendance) FROM table_name_75 WHERE date = "may 21" | sql_create_context |
CREATE TABLE table_6926 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"Conservative ticket" text,
"Liberal ticket" text,
"Free Libertarian ticket" text,
"Socialist Labor ticket" text
) | The person who is on the Democratic ticket for the position of Office of U.S. Senator was who? | SELECT "Democratic ticket" FROM table_6926 WHERE "Office" = 'u.s. senator' | wikisql |
CREATE TABLE table_19117 (
"Club" text,
"Played" text,
"Won" 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
) | what's the won with points for being 643 | SELECT "Won" FROM table_19117 WHERE "Points for" = '643' | wikisql |
CREATE TABLE table_name_89 (
laps VARCHAR,
grid VARCHAR,
driver VARCHAR
) | How many Laps Did Driver David Coulthard have on a Grid smaller than 11? | SELECT laps FROM table_name_89 WHERE grid < 11 AND driver = "david coulthard" | 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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_name_61 (
races INTEGER,
points VARCHAR,
poles VARCHAR
) | what is the average races when points is 9 and poles is less than 0? | SELECT AVG(races) FROM table_name_61 WHERE points = "9" AND poles < 0 | sql_create_context |
CREATE TABLE table_37520 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
) | What is the report for the team with a home ground of MCG and a home team score of 6.5 (41)? | SELECT "Report" FROM table_37520 WHERE "Ground" = 'mcg' AND "Home team score" = '6.5 (41)' | wikisql |
CREATE TABLE table_name_45 (
company VARCHAR,
country VARCHAR,
author VARCHAR
) | What is the company from Greece with author Aeschylus? | SELECT company FROM table_name_45 WHERE country = "greece" AND author = "aeschylus" | sql_create_context |
CREATE TABLE table_name_65 (
winnings VARCHAR,
points VARCHAR,
make VARCHAR,
car__number VARCHAR
) | What were the winnings for the Chevrolet with a number larger than 29 and scored 102 points? | SELECT winnings FROM table_name_65 WHERE make = "chevrolet" AND car__number > 29 AND points = 102 | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | For all employees who have the letters D or S in their first name, what is the relationship between employee_id and commission_pct ? | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE projects (
code VARCHAR,
name VARCHAR
)
CREATE TABLE scientists (
name VARCHAR,
SSN VARCHAR
)
CREATE TABLE assignedto (
project VARCHAR,
scientist VARCHAR
) | Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'. | SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Pu... | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | please give me direct morning flights from PITTSBURGH to ATLANTA | SELECT DISTINCT flight.flight_id 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'A... | atis |
CREATE TABLE table_name_32 (
round VARCHAR,
method VARCHAR,
event VARCHAR
) | Which Round has a Method of decision (unanimous), and an Event of ufc 145? | SELECT round FROM table_name_32 WHERE method = "decision (unanimous)" AND event = "ufc 145" | sql_create_context |
CREATE TABLE table_80179 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" text
) | What is the start of the race with 676 laps? | SELECT "Start" FROM table_80179 WHERE "Laps" = '676' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | WHICH SITES were Questions MIGRATED TO? (Enter number of years to query). Produces a ranked count of questions migrated away from this site. Enter the number of years back to query in the prompt. | SELECT SUBSTRING(Comment, CHARINDEX('//', Comment) + 2, CHARINDEX('.com', Comment) - CHARINDEX('//', Comment) + 2) AS "sentto", COUNT(Id) AS "count" FROM PostHistory WHERE PostHistoryTypeId = 35 AND CreationDate >= DATEADD(dd, -365 * 2, GETDATE()) GROUP BY SUBSTRING(Comment, CHARINDEX('//', Comment) + 2, CHARINDEX('.co... | sede |
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,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was the name of the procedure that's been performed to patient 25965 two times until 40 months ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 259... | mimic_iii |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | what are the five most common laboratory tests that a patient had within 2 months after being diagnosed with s/p hysterectomy - abdominal since 3 years ago? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p hysterectomy - abdominal' AND DATETIME(diagnosis... | eicu |
CREATE TABLE table_9342 (
"Episode" text,
"7 Deadly Sin" text,
"Challenge Winner" text,
"Challenge Loser" text,
"Voted In To 'El Duelo'" text,
"Eliminated" text
) | Which winner has a Challenge Loser of alexcy? | SELECT "Challenge Winner" FROM table_9342 WHERE "Challenge Loser" = 'alexcy' | wikisql |
CREATE TABLE table_29376 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What is the highest series number with 9.17 million US viewers? | SELECT MAX("No. in Series") FROM table_29376 WHERE "U.S. viewers (millions)" = '9.17' | wikisql |
CREATE TABLE table_14058433_5 (
won VARCHAR,
points_for VARCHAR
) | what's the won with points for being 643 | SELECT won FROM table_14058433_5 WHERE points_for = "643" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在2003年6月30日至2019年7月6日至内患者78376442主要看哪位医生? | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '78376442' AND IN_HOSP_DATE BETWEEN '2003-06-30' AND '2019-07-06' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE qtb (
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... | 编码为18482943的团伙成员最常去的医生排序是什么? | SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_ID = '18482943' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_ID = '18482943' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_... | css |
CREATE TABLE table_40130 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Socialist ticket" text,
"Prohibition ticket" text,
"Progressive ticket" text,
"Independence League ticket" text
) | What name ran for the Prohibition ticket when the Progressive ticket was Eugene M. Travis? | SELECT "Prohibition ticket" FROM table_40130 WHERE "Progressive ticket" = 'eugene m. travis' | wikisql |
CREATE TABLE table_24501 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | On what date was James P. Buchanan (d)'s successor seated? | SELECT "Date successor seated" FROM table_24501 WHERE "Vacator" = 'James P. Buchanan (D)' | wikisql |
CREATE TABLE table_16751596_2 (
republican VARCHAR,
dates_administered VARCHAR
) | Name the republican steve sauerberg where dates administered september 15-september 18, 2008 | SELECT republican AS :_steve_sauerberg FROM table_16751596_2 WHERE dates_administered = "September 15-September 18, 2008" | sql_create_context |
CREATE TABLE table_80151 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | What year did Carolina Marin win the Women's singles? | SELECT "Year" FROM table_80151 WHERE "Women's singles" = 'carolina marin' | wikisql |
CREATE TABLE table_204_659 (
id number,
"seat" text,
"state" text,
"majority" number,
"member" text,
"party" text
) | how many members in total ? | SELECT COUNT("member") FROM table_204_659 | squall |
CREATE TABLE table_name_80 (
opponent VARCHAR,
loss VARCHAR
) | Name the opponent with loss of sanderson (9-8) | SELECT opponent FROM table_name_80 WHERE loss = "sanderson (9-8)" | sql_create_context |
CREATE TABLE table_204_941 (
id number,
"#" number,
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
) | in how many games did one of the teams score below 100 points ? | SELECT COUNT(*) FROM table_204_941 WHERE "score" < 100 OR "score" < 100 | 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 mzjzjlb (
HXPLC number,
HZXM ... | 检测的人在检测结果指标记录79465357479的工号以及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79465357479' | css |
CREATE TABLE table_26292 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Matchup/Results" text,
"Attendance" real,
"Payout (US$)" text
) | How many different items appear in the television column when the results where Iowa State 14, Minnesota 13? | SELECT COUNT("Television") FROM table_26292 WHERE "Matchup/Results" = 'Iowa State 14, Minnesota 13' | wikisql |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename var... | what datasets do papers at ACL use most ? | SELECT DISTINCT dataset.datasetid FROM dataset, paper, paperdataset, venue WHERE paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' | scholar |
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 ... | 列出从04年7月28日开始到2006年12月12日结束78828339患者开出的所有检验报告单的科室编码以及名称分别是什么? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '78828339' AND jybgb.BGRQ BETWEEN '2004-07-28' AND '2006-... | css |
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 real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Draw a bar chart about the distribution of Name and Weight , display Y in ascending order. | SELECT Name, Weight FROM people ORDER BY Weight | nvbench |
CREATE TABLE procedures (
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
)
... | give me the number of hispanic or latino ethnic background patients who were hospitalized for more than 23 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "23" | mimicsql_data |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varc... | flights between MILWAUKEE and ORLANDO one way | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id =... | atis |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,... | Users previous names based on their edit history. | SELECT UserId, UserDisplayName, COUNT(*) OVER (PARTITION BY UserId) AS No FROM (SELECT DISTINCT UserId, UserDisplayName FROM PostHistory WHERE NOT UserId IS NULL AND NOT UserDisplayName IS NULL) AS p ORDER BY No DESC, UserId | 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... | what is maximum age of patients whose insurance is private and discharge location is disc-tran cancer/chldrn h? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE table_27250813_1 (
title VARCHAR,
no_in_season VARCHAR
) | What is the title of the episode no. 16 by season? | SELECT title FROM table_27250813_1 WHERE no_in_season = 16 | sql_create_context |
CREATE TABLE table_59947 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
) | Which building has more than 34 floors? | SELECT "Name" FROM table_59947 WHERE "Floors" > '34' | wikisql |
CREATE TABLE table_49245 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | When was Pablo And jar the opponent? | SELECT "Date" FROM table_49245 WHERE "Opponent" = 'pablo andújar' | wikisql |
CREATE TABLE table_67973 (
"Year" real,
"Record" text,
"Regular Season Finish" text,
"Playoffs" text,
"Avg. Attendance" real
) | Year larger than 1975, and a Record of 13 11 is what playoffs? | SELECT "Playoffs" FROM table_67973 WHERE "Year" > '1975' AND "Record" = '13–11' | wikisql |
CREATE TABLE table_train_253 (
"id" int,
"pregnancy_or_lactation" bool,
"pre_eclampsia" bool,
"acute_ischemia" bool,
"pre_gestational_hypertension" bool,
"diabetic" string,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"NOUSE" float
) | pregnant female with pre _ eclampsia during current pregnancy. | SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND pre_eclampsia = 1 | criteria2sql |
CREATE TABLE table_44280 (
"Year" real,
"Name" text,
"Field" text,
"State" text,
"Country" text
) | What is the sum of the years when the winner was prof. priyambada mohanty hejmadi from orissa? | SELECT SUM("Year") FROM table_44280 WHERE "State" = 'orissa' AND "Name" = 'prof. priyambada mohanty hejmadi' | wikisql |
CREATE TABLE table_71461 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What region is the ALCA-272 Catalog? | SELECT "Region" FROM table_71461 WHERE "Catalog" = 'alca-272' | wikisql |
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... | Scores vs Views (whole site). | SELECT Score, AVG(ViewCount) AS "average_views" FROM Posts GROUP BY Score ORDER BY Score DESC | sede |
CREATE TABLE table_24334261_1 (
founded INTEGER,
team VARCHAR
) | What is the maximum founded year of the Worcester Tornadoes? | SELECT MAX(founded) FROM table_24334261_1 WHERE team = "Worcester Tornadoes" | sql_create_context |
CREATE TABLE table_11621915_1 (
score VARCHAR,
date VARCHAR
) | what's the score with date oct 1 | SELECT score FROM table_11621915_1 WHERE date = "Oct 1" | sql_create_context |
CREATE TABLE table_70045 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What position went lower than 106 from the College of Virginia? | SELECT "Position" FROM table_70045 WHERE "Overall" < '106' AND "College" = 'virginia' | wikisql |
CREATE TABLE table_name_24 (
height__ft_ INTEGER,
floors VARCHAR,
city VARCHAR,
height__m_ VARCHAR
) | What is the smallest height (ft) of a building in Frankfurt with a height (m) of 257 and less than 55 floors? | SELECT MIN(height__ft_) FROM table_name_24 WHERE city = "frankfurt" AND height__m_ = 257 AND floors < 55 | 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... | count the number of patients whose diagnoses short title is mv collision nos-driver? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Mv collision NOS-driver" | mimicsql_data |
CREATE TABLE table_277 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | What is the largest 1st prize( $ ) at the South Carolina location? | SELECT MAX("1st Prize( $ )") FROM table_277 WHERE "Location" = 'South Carolina' | wikisql |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Orders (
order_id INT... | Show me the correlation about how many distinct order ids correspond to each product? | SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items | nvbench |
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 microlab (
microl... | what are the top five most frequent lab tests ordered for patients in the same hospital encounter after the diagnosis of cellulitis - extremity. | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cellulitis - extr... | eicu |
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... | what is procedure long title of subject name jane dillard? | SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jane Dillard" | mimicsql_data |
CREATE TABLE table_15887683_10 (
package_option VARCHAR,
television_service VARCHAR
) | Name the number of package options for music box italia | SELECT COUNT(package_option) FROM table_15887683_10 WHERE television_service = "Music Box Italia" | sql_create_context |
CREATE TABLE table_58541 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time/retired for damon hill? | SELECT "Time/Retired" FROM table_58541 WHERE "Driver" = 'damon hill' | wikisql |
CREATE TABLE table_1341672_14 (
district VARCHAR,
incumbent VARCHAR
) | Name the district for tim lee hall | SELECT district FROM table_1341672_14 WHERE incumbent = "Tim Lee Hall" | sql_create_context |
CREATE TABLE table_65048 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | What was the year of the World Half Marathon Championships with a result of 3rd? | SELECT "Year" FROM table_65048 WHERE "Tournament" = 'world half marathon championships' AND "Result" = '3rd' | wikisql |
CREATE TABLE table_21084 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | What is the diameter of the feature with longitude 8.0e? | SELECT "Diameter (km)" FROM table_21084 WHERE "Longitude" = '8.0E' | wikisql |
CREATE TABLE table_name_7 (
loss VARCHAR,
record VARCHAR
) | What was the loss of the game that had a record of 63-52? | SELECT loss FROM table_name_7 WHERE record = "63-52" | sql_create_context |
CREATE TABLE table_17553 (
"Season" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | How many women doubles teams competed in the same year as when Jamie van Hooijdonk competed in men singles? | SELECT COUNT("Womens doubles") FROM table_17553 WHERE "Mens singles" = 'Jamie van Hooijdonk' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | 在05年11月3日到17年1月12日期间由医院9510699开出的检验报告单中,把不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值列出来 | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '9510699' AND BGRQ BETWEEN '2005-11-03' AND '2017-01-12' GROUP BY JCZBMC, JCZBJGDW | css |
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... | During Spring semester what BA upper level classes are there ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BA' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring' ... | advising |
CREATE TABLE table_37332 (
"Unit" text,
"Russian" text,
"Translation" text,
"Ratio" real,
"Metric value" text,
"Avoirdupois value" text,
"Ordinary value" text
) | Which ordinary value has a Russian value of ? | SELECT "Ordinary value" FROM table_37332 WHERE "Russian" = 'унция' | 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 labevents (
row... | when patient 77053 received for the last time a procedure? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77053) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_16959 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | Name all the tournaments that took place in Rhode Island. | SELECT "Tournament" FROM table_16959 WHERE "Location" = 'Rhode Island' | wikisql |
CREATE TABLE table_72876 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
) | Name the total number of cars for panther racing and grid of 9 | SELECT COUNT("Car No.") FROM table_72876 WHERE "Team" = 'Panther Racing' AND "Grid" = '9' | wikisql |
CREATE TABLE table_22837363_1 (
episodes INTEGER,
viewers__in_millions_ VARCHAR
) | What was the highest amount of episodes for the season with 5.74 million viewers? | SELECT MAX(episodes) FROM table_22837363_1 WHERE viewers__in_millions_ = "5.74" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.