context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_5 (
date VARCHAR,
result VARCHAR,
competition VARCHAR
) | Result of w, and a Competition of 1968 asian cup happened on what date? | SELECT date FROM table_name_5 WHERE result = "w" AND competition = "1968 asian cup" | sql_create_context |
CREATE TABLE table_46735 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | What is College, when Round is greater than 1, and when Pick is greater than 163? | SELECT "College" FROM table_46735 WHERE "Round" > '1' AND "Pick" > '163' | wikisql |
CREATE TABLE table_2449 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
) | What date did Renger Van Der Zande have the pole position at Donington Park? | SELECT "Date" FROM table_2449 WHERE "Pole Position" = 'Renger van der Zande' AND "Circuit" = 'Donington Park' | wikisql |
CREATE TABLE table_79215 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | Which years did Martin Sacks work on a soap opera? | SELECT "Years" FROM table_79215 WHERE "Actor" = 'martin sacks' | wikisql |
CREATE TABLE gwyjzb (
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,
... | 统计一下医疗记录中年龄15岁及以上的患者的平均治病费总额有多少钱? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE >= 15 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE >= 15) | css |
CREATE TABLE table_53983 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team at South Melbourne with a crowd size larger than 10,000. | SELECT "Home team" FROM table_53983 WHERE "Crowd" > '10,000' AND "Away team" = 'south melbourne' | wikisql |
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers number,
residents_per_officer number,
case_burden number,
crime_rate number,
police_force text,
location text
)
CREATE TABLE city (
city_id number,
county_id number,
name ... | What are the different police forces of counties that are not located in the East? | SELECT DISTINCT police_force FROM county_public_safety WHERE location <> "East" | spider |
CREATE TABLE table_10896 (
"Electorate" text,
"Incumbent" text,
"Winner" text,
"Majority" real,
"Runner up" text
) | Who won with a majority more than 6,181 and J W Andrews as runner up? | SELECT "Winner" FROM table_10896 WHERE "Majority" > '6,181' AND "Runner up" = 'j w andrews' | wikisql |
CREATE TABLE table_39795 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the highest Position when the against is less than 41, and lost is more than 7? | SELECT MAX("Position") FROM table_39795 WHERE "Against" < '41' AND "Lost" > '7' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 门诊诊断为患者的检测指标569976疾病K19.872的数值的最值以及平均值都分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'K19.872' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_56990 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the date for home team Collingwood? | SELECT "Date" FROM table_56990 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE table_203_631 (
id number,
"year" number,
"name of show" text,
"episodes" text,
"other guests" text,
"winner(s)" text
) | how long has it been since chermaine sheh first appeared on a variety show ? | SELECT present_ref - MIN("year") FROM table_203_631 | squall |
CREATE TABLE table_61056 (
"Role" text,
"Original Broadway cast" text,
"Closing Broadway cast" text,
"Original US Tour cast" text,
"Original NonEquity Tour cast" text,
"Original S\u00e3o Paulo cast" text,
"Original Lima cast" text
) | What was the original nonequity tour when the original broadway was Kevin Chamberlin? | SELECT "Original NonEquity Tour cast" FROM table_61056 WHERE "Original Broadway cast" = 'kevin chamberlin' | wikisql |
CREATE TABLE table_20507 (
"Region of USSR" text,
"Number of families" real,
"Number of people" real,
"Average family size" text,
"% of total deportees" text
) | What regions of the USSR have a percentage of deportees of 10.6? | SELECT "Region of USSR" FROM table_20507 WHERE "% of total deportees" = '10.6' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | how many patients during this year had an intake of d5 normal saline? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5 normal saline' A... | mimic_iii |
CREATE TABLE table_203_462 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | what year was the only year the team qualified for the playoffs ? | SELECT "year" FROM table_203_462 WHERE "playoffs" <> 'did not qualify' | squall |
CREATE TABLE table_65017 (
"District" text,
"Number of Households" real,
"Total Population" real,
"Male" real,
"Female" real
) | What is the lowest female number of the hiroo 1-ch me district, which has more than 1,666 households? | SELECT MIN("Female") FROM table_65017 WHERE "District" = 'hiroo 1-chōme' AND "Number of Households" > '1,666' | wikisql |
CREATE TABLE table_9042 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | Which record has an Attendance larger than 17,033, and a Location of air canada centre, and less than 3 points? | SELECT "Record" FROM table_9042 WHERE "Attendance" > '17,033' AND "Location" = 'air canada centre' AND "Points" < '3' | wikisql |
CREATE TABLE table_50006 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the tie number for the round against visiting opponent Chelsea? | SELECT SUM("Tie no") FROM table_50006 WHERE "Away team" = 'chelsea' | wikisql |
CREATE TABLE table_60228 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | Which circuit did alfa romeo win? | SELECT "Circuit" FROM table_60228 WHERE "Winning constructor" = 'alfa romeo' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 通过患者在出院诊断中不同的疾病编码和所在的不同名称的科室,把医院1537137里的全部医疗就诊记录中患者的年龄平均数列出来是多些? | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '1537137' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD | css |
CREATE TABLE table_35277 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | tries against is 55, what is the try bonus? | SELECT "Try bonus" FROM table_35277 WHERE "Tries against" = '55' | wikisql |
CREATE TABLE table_38892 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | What type of game had a result of 1:2? | SELECT "Type of game" FROM table_38892 WHERE "Results\u00b9" = '1:2' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id ... | what are the five most frequently prescribed medicines that patients are prescribed with within 2 months after being diagnosed with intermed coronary synd? | SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE table_name_80 (
score VARCHAR,
record VARCHAR
) | Which score has a record of 58 15 8? | SELECT score FROM table_name_80 WHERE record = "58–15–8" | sql_create_context |
CREATE TABLE table_204_311 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the difference between the total number of bronze medals won by the united states and west germany ? | SELECT (SELECT "bronze" FROM table_204_311 WHERE "nation" = 'united states') - (SELECT "bronze" FROM table_204_311 WHERE "nation" = 'west germany') | squall |
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... | 排出葛晴画患者医疗记录医疗费总额不少于6196.22元的中出院诊断疾病的编码是什么?其名称叫什么? | SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '葛晴画' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6196.22) | css |
CREATE TABLE table_12714 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Score of the Round with Player Aaron Baddeley having a To par of +2? | SELECT "Score" FROM table_12714 WHERE "To par" = '+2' AND "Player" = 'aaron baddeley' | wikisql |
CREATE TABLE table_41308 (
"Album" text,
"Release date" text,
"Label" text,
"Format" text,
"Covered Song" text,
"Original Song" text
) | What label shows an Album of cover version v? | SELECT "Label" FROM table_41308 WHERE "Album" = 'cover version v' | wikisql |
CREATE TABLE table_name_53 (
january VARCHAR,
april VARCHAR
) | Name the january when april is courtney rachel culkin | SELECT january FROM table_name_53 WHERE april = "courtney rachel culkin" | sql_create_context |
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... | Display a bar chart for what is the average salary for each job title?, I want to order Y in ascending order please. | SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_name_21 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
) | With a To par of +4, what is Andy Bean's Score? | SELECT score FROM table_name_21 WHERE to_par = "+4" AND player = "andy bean" | 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... | 列出姜淑华患者医疗记录中医疗费总额不少于2959.88元的出院诊断疾病名称以及编码都是什么? | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '姜淑华' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 2959.88) | css |
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, give me the comparison about the average of code over the founder , and group by attribute founder by a bar chart, and show x axis in desc order. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
CREATE TABLE table_21694 (
"Winner" text,
"Country" text,
"Winter Olympics" text,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | What year did the man from Norway who won the Holmenkollen in 1958 win the FIS Nordic World Ski Championships? | SELECT "FIS Nordic World Ski Championships" FROM table_21694 WHERE "Country" = 'Norway' AND "Holmenkollen" = '1958' | wikisql |
CREATE TABLE table_name_69 (
title VARCHAR,
start_of_reign VARCHAR
) | What Title's Start of Reign is 1993? | SELECT title FROM table_name_69 WHERE start_of_reign = 1993 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | what are the top four most frequent procedures given to patients within 2 months after the diagnosis of obstruction of trachea / bronchus - suspected until 2 years ago? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'obstruction of trachea / bronchus - susp... | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what are the top five common diagnoses until 2104? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_2897457_5 (
pick__number VARCHAR,
player VARCHAR
) | What pick number was marc deschamps? | SELECT pick__number FROM table_2897457_5 WHERE player = "Marc Deschamps" | sql_create_context |
CREATE TABLE table_38848 (
"Institution" text,
"Location" text,
"Team Nickname" text,
"Tenure" text,
"New Conference" text,
"New Classification" text
) | What is the new classification for La Mirada, California? | SELECT "New Classification" FROM table_38848 WHERE "Location" = 'la mirada, california' | wikisql |
CREATE TABLE table_60922 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | In what place did Nick Faldo, who had more than 284 points and a to par score of +5, finish? | SELECT "Finish" FROM table_60922 WHERE "Total" > '284' AND "To par" = '+5' AND "Player" = 'nick faldo' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_i... | count the number of times that in 02/this year patient 20000 had taken tube feeding. | SELECT COUNT(*) 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 = 20000)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tube feeding... | mimic_iii |
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
... | list the card number of all members whose hometown address includes word 'Kentucky'. | SELECT card_number FROM member WHERE hometown LIKE "%Kentucky%" | spider |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me a scatter chart that groups acc road, the x-axis is school id and the y-axis is acc percent. | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE table_name_45 (
rank VARCHAR,
third_quarter VARCHAR
) | When the third quarter is China Mobile 195,680.4, what is the rank? | SELECT rank FROM table_name_45 WHERE third_quarter = "china mobile 195,680.4" | sql_create_context |
CREATE TABLE table_204_893 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | how many runners in the 2002 european athletics indoor championships completed the men 's 3000 metres event in under 8 minutes ? | SELECT COUNT("name") FROM table_204_893 WHERE "time" < 8 | squall |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR... | How many documents for each document type description? Visualize by a bar chart, sort from low to high by the bar. | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Type_Description | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,... | 以前苗静姝患者有过什么异常情况吗? | 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_77 (
games INTEGER,
points VARCHAR,
name VARCHAR
) | What is the total number of games that has Juan Carlos Navarro and more than 266 points? | SELECT SUM(games) FROM table_name_77 WHERE points > 266 AND name = "juan carlos navarro" | sql_create_context |
CREATE TABLE table_2528382_1 (
lyricist VARCHAR,
music_director VARCHAR
) | Who was the lyricist for the song with music directed by madan mohan kohli? | SELECT lyricist FROM table_2528382_1 WHERE music_director = "Madan Mohan Kohli" | sql_create_context |
CREATE TABLE table_25755 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | What is the original air date of the episode written by David Zuckerman? | SELECT "Original air date" FROM table_25755 WHERE "Written by" = 'David Zuckerman' | wikisql |
CREATE TABLE table_12837_1 (
days_with_rain__year_summer_ VARCHAR,
city_town VARCHAR
) | What is the days with rain figure for the city of Santiago de Compostela? | SELECT days_with_rain__year_summer_ FROM table_12837_1 WHERE city_town = "Santiago de Compostela" | sql_create_context |
CREATE TABLE table_name_32 (
crowd INTEGER,
venue VARCHAR
) | How many people were present in a total of every crowd at the MCG venue? | SELECT SUM(crowd) FROM table_name_32 WHERE venue = "mcg" | sql_create_context |
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 ... | Unanswered php sorted by time desc. | SELECT Posts.Id AS "post_link", Score, ViewCount, Tags FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'php' AND Posts.AcceptedAnswerId IS NULL AND Posts.ParentId IS NULL AND AnswerCount = 0 AND ClosedDate IS NULL AND Posts.Id NOT IN (SELECT ... | sede |
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 (
... | give me the number patients with diagnoses icd9 code v452 who had pleural lab test. | 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 = "V452" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_33 (
opponent VARCHAR,
attendance VARCHAR
) | Which opponent has an attendance of 17,015? | SELECT opponent FROM table_name_33 WHERE attendance = "17,015" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what drug has patient 030-21071 been prescribed two times during the last month? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030... | eicu |
CREATE TABLE table_name_18 (
visitor VARCHAR,
leading_scorer VARCHAR
) | What visitor has tim duncan (16) as the leading scorer? | SELECT visitor FROM table_name_18 WHERE leading_scorer = "tim duncan (16)" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 对于患者22354212的医疗记录中医疗费总额不少于4694.23元的入院诊断疾病的编码和名称都是什么呀? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '22354212' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 4694.23) | css |
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... | 8773150这家医院在二零零五年的六月九号到二零零六年二月二十四这期间里全部的医疗记录中个人账户的花费和总医疗费花费之间的平均比值 | SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8773150' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-09' AND '2006-02-24' | css |
CREATE TABLE table_name_85 (
number_of_electorates__2003_ INTEGER,
constituency_number VARCHAR,
district VARCHAR,
reserved_for___sc___st__none_ VARCHAR
) | What is the lowest number of Electorates (2003) in District bhind, Reserved for none, and Constituency Number 11? | SELECT MIN(number_of_electorates__2003_) FROM table_name_85 WHERE district = "bhind" AND reserved_for___sc___st__none_ = "none" AND constituency_number = "11" | sql_create_context |
CREATE TABLE table_name_27 (
vote_to_evict VARCHAR,
vote_to_save VARCHAR
) | Which Vote to Evict has a Vote to Save of 21.22%? | SELECT vote_to_evict FROM table_name_27 WHERE vote_to_save = "21.22%" | sql_create_context |
CREATE TABLE table_52482 (
"Round" real,
"Overall" real,
"Player" text,
"Nationality" text,
"Club team" text
) | When was petter ronnquist picked? | SELECT "Overall" FROM table_52482 WHERE "Player" = 'petter ronnquist' | wikisql |
CREATE TABLE table_name_20 (
cuts_made INTEGER,
top_5 VARCHAR,
wins VARCHAR
) | What is the highest number of cuts made in a tournament with 0 wins and 0 top 5 placings? | SELECT MAX(cuts_made) FROM table_name_20 WHERE top_5 = 0 AND wins < 0 | sql_create_context |
CREATE TABLE table_45602 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
) | What is Result, when Date is 19 August 1992? | SELECT "Result" FROM table_45602 WHERE "Date" = '19 august 1992' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of elective hospital admissions who underwent arthrocentesis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Arthrocentesis" | mimicsql_data |
CREATE TABLE table_8712 (
"Event" text,
"Record" text,
"Nationality" text,
"Date" text,
"Meet" text,
"Place" text
) | what is the meet when the event is flying 200 m time trial? | SELECT "Meet" FROM table_8712 WHERE "Event" = 'flying 200 m time trial' | wikisql |
CREATE TABLE table_28827 (
"Name" text,
"Jewel" text,
"Species" text,
"Gender" text,
"Jewel Power" text,
"Attribute" text,
"Birthday" text,
"Media Debut" text,
"Voice actor" text
) | what is the jewel power when the media debut is ep 17? | SELECT "Jewel Power" FROM table_28827 WHERE "Media Debut" = 'EP 17' | wikisql |
CREATE TABLE table_name_47 (
total INTEGER,
name VARCHAR,
scottish_cup VARCHAR
) | Which Total has a Name of eoin jess category:articles with hcards, and a Scottish Cup larger than 23? | SELECT MIN(total) FROM table_name_47 WHERE name = "eoin jess category:articles with hcards" AND scottish_cup > 23 | sql_create_context |
CREATE TABLE table_204_23 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days held" number,
"location" text,
"event" text,
"notes" text
) | how many days did hardcore tv # 6 take ? | SELECT "days held" FROM table_204_23 WHERE "event" = 'hardcore tv #6' | squall |
CREATE TABLE table_35325 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the Score at the Auckland, New Zealand Tournament? | SELECT "Score" FROM table_35325 WHERE "Tournament" = 'auckland, new zealand' | wikisql |
CREATE TABLE visits (
visit_id number,
tourist_attraction_id number,
tourist_id number,
visit_date time,
visit_details text
)
CREATE TABLE royal_family (
royal_family_id number,
royal_family_details text
)
CREATE TABLE staff (
staff_id number,
tourist_attraction_id number,
name... | Find the details of all the markets that are accessible by walk or bus. | SELECT T1.market_details FROM street_markets AS T1 JOIN tourist_attractions AS T2 ON T1.market_id = T2.tourist_attraction_id WHERE T2.how_to_get_there = "walk" OR T2.how_to_get_there = "bus" | spider |
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 is the total number of Asian patients who had mesenteric ischemia as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | mimicsql_data |
CREATE TABLE table_80262 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | What is the result of the World Race Walking Cup tournament played before the year 2010? | SELECT "Result" FROM table_80262 WHERE "Year" > '2010' AND "Tournament" = 'world race walking cup' | wikisql |
CREATE TABLE table_23369 (
"N\u00ba" real,
"Ep" real,
"Huckleberry Hound" text,
"Pixie and Dixie" text,
"Yogi Bear" text,
"Air date" text,
"Credited animators" text
) | What is the Pixie and Dixie skit in episode 7? | SELECT "Pixie and Dixie" FROM table_23369 WHERE "Ep" = '7' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 之前,患者戚玉树做的检查有哪些? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚玉树' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_203_636 (
id number,
"#" number,
"date" text,
"winner" text,
"score" text,
"location" text,
"notes" text
) | when was the first game played in houston , tx ? | SELECT "date" FROM table_203_636 WHERE "location" = 'houston, tx' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_21948 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
) | What's the name of the church in Stavang? | SELECT "Church Name" FROM table_21948 WHERE "Location of the Church" = 'Stavang' | wikisql |
CREATE TABLE table_dev_54 (
"id" int,
"ogtt" int,
"anemia" bool,
"gender" string,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"hematocrit_hct" float,
"body_mass_index_bmi" float,
"igt" bool,
"fasting_glucose" int,
"age" float,
"NOUSE" float
) | igt: fasting glucose > 100 , < 126 or 2 _ hour ogtt > 140 but < 200 | SELECT * FROM table_dev_54 WHERE igt = 1 OR (fasting_glucose > 100 OR fasting_glucose < 126) OR (ogtt > 140 AND ogtt < 200) | criteria2sql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | for the last time a month before, when was patient 005-46456 prescribed a drug? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND DATETIME(medication.drugstarttime, 'start of ... | eicu |
CREATE TABLE table_203_34 (
id number,
"season" text,
"appearance" number,
"interchange" number,
"tries" number,
"goals" number,
"f/g" number,
"points" number
) | how many total points were score over all the seasons ? | SELECT SUM("points") FROM table_203_34 | squall |
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... | 医疗就诊71656781055与医疗就诊64708958100中开出了哪些名称相同的药品?列出这些药品的金额和名称以及对应的医疗就诊ID是什么? | SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT, t_kc21.MED_CLINIC_ID 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 = '64708958100' OR t_kc21_t_kc22.MED_CLINIC_ID = '71656781055' AND t_kc2... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is average days of hospital stay of patients whose marital status is divorced? | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.marital_status = "DIVORCED" | mimicsql_data |
CREATE TABLE table_name_2 (
shot_pct INTEGER,
blank_ends INTEGER
) | What is the lowest Shot Pct., when Blank Ends is greater than 6? | SELECT MIN(shot_pct) FROM table_name_2 WHERE blank_ends > 6 | sql_create_context |
CREATE TABLE table_69510 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Name the score for record 33-47 | SELECT "Score" FROM table_69510 WHERE "Record" = '33-47' | wikisql |
CREATE TABLE table_30212 (
"Draw" real,
"Artist" text,
"Song (English translation)" text,
"Lyrics (l) / Music (m)" text,
"Juries" real,
"Viewers" real,
"Total" real,
"Place" real
) | How many items appear in the viewers column when the draw is 2? | SELECT COUNT("Viewers") FROM table_30212 WHERE "Draw" = '2' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | Number of daily first posts last week. | SELECT COUNT(*) / '##NumDays:int?7##' AS numberOfDailyFirstPostsLastWeek FROM (SELECT u.Id FROM Users AS u INNER JOIN (SELECT * FROM Posts WHERE CreationDate >= DATEADD(day, DATEDIFF(day, '##NumDays:int?7##' + 1, GETDATE()), 0) AND CreationDate < DATEADD(day, DATEDIFF(day, 1, GETDATE()), 0)) AS p ON p.OwnerUserId = u.I... | sede |
CREATE TABLE table_name_56 (
date INTEGER,
number VARCHAR
) | What is the latest date that has a serial number of Infec 107CDSX? | SELECT MAX(date) FROM table_name_56 WHERE number = "infec 107cdsx" | sql_create_context |
CREATE TABLE table_61103 (
"Year" real,
"Award" text,
"Category" text,
"Nominated Work" text,
"Result" text
) | What is the earliest year with a Drama Desk award when the Mineola Twins was a nominated work? | SELECT MIN("Year") FROM table_61103 WHERE "Award" = 'drama desk award' AND "Nominated Work" = 'the mineola twins' | wikisql |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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,
J... | 名字叫做王子安的患者在医院6839787期间门诊所诊断出名称不包含肾结石的门诊诊察记录一共是哪几条? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i... | css |
CREATE TABLE table_54353 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In what venue is Essendon the home team? | SELECT "Venue" FROM table_54353 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
... | did patient 54281 ever excrete any condom cath since 05/2102? | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'condom cath' A... | mimic_iii |
CREATE TABLE table_name_48 (
party VARCHAR,
name VARCHAR
) | What is Kerry J. Donley's Party? | SELECT party FROM table_name_48 WHERE name = "kerry j. donley" | 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... | User, Badge, Count, Where Badge = INPUT. | SELECT u.DisplayName, b.Name, COUNT(*) AS awarded FROM Users AS u INNER JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = '##BadgeName:String##' GROUP BY u.DisplayName, b.Name ORDER BY Awarded DESC LIMIT 1000 | sede |
CREATE TABLE table_name_83 (
number_of_dances INTEGER,
place VARCHAR,
average VARCHAR
) | What is the lowest number of dances with a less than 2 place and an average smaller than 27.5? | SELECT MIN(number_of_dances) FROM table_name_83 WHERE place < 2 AND average < 27.5 | sql_create_context |
CREATE TABLE table_75885 (
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | When did Demetrios III begin to hold power? | SELECT "From" FROM table_75885 WHERE "Name" = 'demetrios iii' | wikisql |
CREATE TABLE table_2784232_1 (
hebrew_form VARCHAR,
arabic_form VARCHAR
) | How many hebrew forms are there for the arabic form yuktibu ? | SELECT COUNT(hebrew_form) FROM table_2784232_1 WHERE arabic_form = "yuktibu يكتب" | sql_create_context |
CREATE TABLE table_71902 (
"No.1" text,
"No.2" text,
"No.3" text,
"No.5" text,
"No.6" text,
"FINAL" text
) | Who is no. 5 when Lena Claudisabel is no. 1 and Lena Sylvie is no. 2? | SELECT "No.5" FROM table_71902 WHERE "No.1" = 'lena claudisabel' AND "No.2" = 'lena sylvie' | wikisql |
CREATE TABLE table_10812293_3 (
score VARCHAR,
date VARCHAR
) | What was the score of the game on November 12? | SELECT score FROM table_10812293_3 WHERE date = "November 12" | sql_create_context |
CREATE TABLE table_45071 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the Tie Number of the Bradford City away team? | SELECT "Tie no" FROM table_45071 WHERE "Away team" = 'bradford city' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.