context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_51 (
catalogue VARCHAR,
track VARCHAR
) | What cataglogue has 27 tracks? | SELECT catalogue FROM table_name_51 WHERE track = 27 | sql_create_context |
CREATE TABLE table_31066 (
"Week of" text,
"Tournament" text,
"Champion" text,
"Runner-up" text,
"Semifinalists" text,
"Quarterfinalists" text
) | Who were the semifinalists when sammy giammalva was runner-up? | SELECT "Semifinalists" FROM table_31066 WHERE "Runner-up" = 'Sammy Giammalva' | wikisql |
CREATE TABLE table_50636 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" text,
"Location" text
) | What was Gassaway's record at the fight in mississippi, united states against anthony macias? | SELECT "Record" FROM table_50636 WHERE "Location" = 'mississippi, united states' AND "Opponent" = 'anthony macias' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | provide the number of patients whose lab test chart time is 2144-12-08 03:27:00? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2144-12-08 03:27:00" | mimicsql_data |
CREATE TABLE table_name_57 (
date VARCHAR,
partner VARCHAR,
score VARCHAR
) | What is the Date of the match with a Score of 0 6, 2 6 with Partner Marcella Mesker? | SELECT date FROM table_name_57 WHERE partner = "marcella mesker" AND score = "0–6, 2–6" | sql_create_context |
CREATE TABLE table_55121 (
"Episode #" real,
"# in Season" real,
"Episode Name" text,
"Airdate" text,
"Location" text
) | What is the average episode # located in Tanzania and whose # in season is larger than 5? | SELECT AVG("Episode #") FROM table_55121 WHERE "Location" = 'tanzania' AND "# in Season" > '5' | 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... | Show me about the distribution of Sex and the sum of Height , and group by attribute Sex in a bar chart, show sum height in descending order. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC | nvbench |
CREATE TABLE table_73103 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Canadian airdate" text,
"US airdate" text,
"Production code" real
) | How many U.S. air dates were from an episode in Season 4? | SELECT COUNT("US airdate") FROM table_73103 WHERE "No. in season" = '4' | wikisql |
CREATE TABLE table_name_19 (
competition VARCHAR,
assists INTEGER
) | What competition had more than 40 assists? | SELECT competition FROM table_name_19 WHERE assists > 40 | sql_create_context |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID... | A bar chart about what are the ids and details of events that have more than one participants? | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details | nvbench |
CREATE TABLE table_name_21 (
ae_2011 INTEGER,
forbes_2011 VARCHAR,
ft_2011 VARCHAR
) | What is the average AE 2011 ranking with a Forbes 2011 ranking of 24 and a FT 2011 ranking less than 44? | SELECT AVG(ae_2011) FROM table_name_21 WHERE forbes_2011 = 24 AND ft_2011 < 44 | sql_create_context |
CREATE TABLE table_203_33 (
id number,
"conference" text,
"date" text,
"place" text,
"attendance" number,
"archive of presentations" text
) | how many days was the wikimania 2011 ? | SELECT "date" - "date" FROM table_203_33 WHERE "conference" = 'wikimania 2011' | squall |
CREATE TABLE table_204_968 (
id number,
"squad #" number,
"position" text,
"player" text,
"transferred to" text,
"fee" text,
"date" text
) | how many consecutive players were released on july 9 ? | SELECT COUNT("player") FROM table_204_968 WHERE "date" = '9 july 2012' | squall |
CREATE TABLE table_name_61 (
result VARCHAR,
nominated_work VARCHAR
) | Did the nominated work of white valentine win an award? | SELECT result FROM table_name_61 WHERE nominated_work = "white valentine" | sql_create_context |
CREATE TABLE table_name_34 (
fall_09 INTEGER,
fall_05 INTEGER
) | What is the mean Fall 09 number where fall 05 is less than 3? | SELECT AVG(fall_09) FROM table_name_34 WHERE fall_05 < 3 | sql_create_context |
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... | Visualize a bar chart about the distribution of Name and Weight , could you sort from high to low by the Name? | SELECT Name, Weight FROM people ORDER BY Name DESC | nvbench |
CREATE TABLE table_51306 (
"Year" real,
"Design" text,
"Issue" text,
"Artist" text,
"Mintage" real,
"Issue Price" text
) | What artist has a mintage of greater than 34,135? | SELECT "Artist" FROM table_51306 WHERE "Mintage" > '34,135' | wikisql |
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... | Find All_Home and the average of School_ID , and group by attribute All_Home, and visualize them by a bar chart, rank mean school id in ascending order. | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) | nvbench |
CREATE TABLE table_61638 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is Date, when Away Team is 'Minehead'? | SELECT "Date" FROM table_61638 WHERE "Away team" = 'minehead' | wikisql |
CREATE TABLE table_50379 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was Bill Glasson's score to par after 2 rounds? | SELECT "To par" FROM table_50379 WHERE "Player" = 'bill glasson' | wikisql |
CREATE TABLE table_29102 (
"Series #" real,
"Episode #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original airdate" text
) | What was the first numbered episode in the series titled 'the wind beneath our wings'? | SELECT MIN("Series #") FROM table_29102 WHERE "Title" = 'The Wind Beneath Our Wings' | wikisql |
CREATE TABLE table_name_29 (
track VARCHAR,
distance VARCHAR,
race VARCHAR
) | What is the race with the track distance of 6 furlongs and spectacular bid stakes? | SELECT track FROM table_name_29 WHERE distance = "6 furlongs" AND race = "spectacular bid stakes" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 检验结果指标记录39909874653的检测项目名称、检测指标代码以及名称、检测方法分别是什么? | SELECT jyjgzbb.JCXMMC, jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCFF FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '39909874653' | css |
CREATE TABLE table_name_43 (
rank VARCHAR,
time VARCHAR
) | What's the rank when the time was 59.65? | SELECT rank FROM table_name_43 WHERE time = "59.65" | sql_create_context |
CREATE TABLE table_203_671 (
id number,
"name" text,
"rank" text,
"age" number,
"years until mandatory retirement" text,
"appointed by" text,
"year appointed" number
) | who has the most number of years until their mandatory retirement ? | SELECT "name" FROM table_203_671 ORDER BY "years until mandatory retirement" DESC LIMIT 1 | squall |
CREATE TABLE table_name_6 (
position VARCHAR,
player VARCHAR
) | What position does Zack Torquato play? | SELECT position FROM table_name_6 WHERE player = "zack torquato" | sql_create_context |
CREATE TABLE table_name_33 (
score VARCHAR,
place VARCHAR
) | What is the Score of the T3 Place Player? | SELECT score FROM table_name_33 WHERE place = "t3" | sql_create_context |
CREATE TABLE table_13328239_4 (
opponent VARCHAR,
round VARCHAR
) | Who was the opponent in round 2? | SELECT opponent FROM table_13328239_4 WHERE round = "2" | sql_create_context |
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... | 94947569717住院就诊中,出院科室的代码和名称分别是什么 | SELECT CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '94947569717' | css |
CREATE TABLE table_39156 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Score has an October smaller than 15, and a Record of 2 0 0? | SELECT "Score" FROM table_39156 WHERE "October" < '15' AND "Record" = '2–0–0' | wikisql |
CREATE TABLE table_73441 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | What was the conference when Arizona State won the regular season? | SELECT "Conference" FROM table_73441 WHERE "Regular Season Winner" = 'Arizona State' | 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... | count the number of patients whose insurance is government and procedure long title is creation of conduit between left ventricle and aorta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Creation of conduit between left ventricle and aorta" | mimicsql_data |
CREATE TABLE table_name_38 (
opponent VARCHAR,
record VARCHAR
) | Who was the opponent that led to a 10-13 record? | SELECT opponent FROM table_name_38 WHERE record = "10-13" | sql_create_context |
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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a line chart shows the trend of salary over hire_date , and display X-axis in asc order. | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_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,
... | 医院1692026全部医疗就诊的记录里,依据科室编码和出院诊断的不同算一算患者平均多大年纪 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1692026' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_45019 (
"Player" text,
"Position" text,
"Premier League" real,
"FA Cup" real,
"League Cup" real,
"UEFA Cup" real,
"Total" real
) | What player had less than 6 appearances at the FA cup, 33 at the premier league, and more than 5 at the UEFA cup? | SELECT "Player" FROM table_45019 WHERE "FA Cup" < '6' AND "Premier League" = '33' AND "UEFA Cup" > '5' | wikisql |
CREATE TABLE table_7069 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | What was the highest attendance when the result was L 6-28? | SELECT MAX("Attendance") FROM table_7069 WHERE "Result" = 'l 6-28' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | what was the diagnosis of patient 20066 for the last time until 2104? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20066) AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' ORDER BY diag... | mimic_iii |
CREATE TABLE table_4109 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers *" text
) | How many different title names had 358,000 viewers? | SELECT COUNT("Title") FROM table_4109 WHERE "Viewers *" = '358,000' | wikisql |
CREATE TABLE table_name_34 (
listed VARCHAR,
name VARCHAR
) | When was the oakachoy covered bridge listed? | SELECT listed FROM table_name_34 WHERE name = "oakachoy covered bridge" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | # of votes by question (for a specific user). | SELECT p.Id AS "post_link", p.CreationDate, COUNT(v.VoteTypeId) AS "#_votes" FROM Posts AS p LEFT OUTER JOIN Votes AS v ON v.PostId = p.Id WHERE p.OwnerUserId = '##UserID##' AND VoteTypeId IN (1, 2, 3, 5, NULL) GROUP BY p.Id, p.CreationDate ORDER BY p.CreationDate | sede |
CREATE TABLE zyjybgb (
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,
... | 以前患者07290816有过什么异常情况吗? | SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_203_499 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | which other player scored the same as the player from japan ? | SELECT "player" FROM table_203_499 WHERE "country" <> 'japan' AND "score" = (SELECT "score" FROM table_203_499 WHERE "country" = 'japan') | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_i... | what's the name of the diagnosis that patient 77177 was given for the first time until 2101? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77177) AND STRFTIME('%y', diagnoses_icd.charttime) <= '2101' ORDER BY diag... | mimic_iii |
CREATE TABLE table_name_26 (
race_title VARCHAR,
year VARCHAR
) | Which race happened in 1948? | SELECT race_title FROM table_name_26 WHERE year = 1948 | sql_create_context |
CREATE TABLE table_20843 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | what is the number for 65-69 where 50-54 is 1571? | SELECT "65 to 69" FROM table_20843 WHERE "50 to 54" = '1571' | wikisql |
CREATE TABLE table_2524 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
) | What is every school with basic elements of 52? | SELECT "School" FROM table_2524 WHERE "Basic Elements" = '52' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what was the last time in a month before patient 006-1634 received a bedside glucose lab test? | 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 = '006-1634')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime, 'st... | eicu |
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,
... | 内有几个科室在2007年3月29日到2008年4月25日之间在医院1746368门诊就诊中开出超过28张检验报告单啊? | SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '1746368' AND zyjybgb.BGRQ BETWEEN '2007-03-29' AND '2008-04-25' GROUP BY zyjybgb.KSBM HAVING COUNT(*) > 28 UNION SELECT mzjybgb.KSBM FROM mzjzj... | 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 demographic ... | provide the number of patients whose diagnoses long title is abnormal coagulation profile? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile" | mimicsql_data |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE ... | papers at pldi | SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'pldi' | scholar |
CREATE TABLE table_70527 (
"Name" text,
"Country" text,
"Status" text,
"Transfer window" text,
"Transfer fee" text
) | What shows as the status for Diogo? | SELECT "Status" FROM table_70527 WHERE "Name" = 'diogo' | wikisql |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | Show the comparison of the total number of the home city of all drivers with a bar chart, and rank Y in asc order. | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY COUNT(Home_city) | nvbench |
CREATE TABLE table_5338 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What date has aus by 382 runs as the result? | SELECT "Date" FROM table_5338 WHERE "Result" = 'aus by 382 runs' | wikisql |
CREATE TABLE film_market_estimation (
TYPE VARCHAR,
YEAR VARCHAR
) | What are the types of film market estimations in year 1995? | SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 | sql_create_context |
CREATE TABLE table_37675 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | What is the grid of pkv racing with the driver oriol servi ? | SELECT SUM("Grid") FROM table_37675 WHERE "Team" = 'pkv racing' AND "Driver" = 'oriol servià' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | A bar chart for finding the number of the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties?, sort names in desc order. | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY Comptroller DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_45086 (
"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 fewest goals for when goal difference is +10 and goals against is more than 61? | SELECT MIN("Goals For") FROM table_45086 WHERE "Goal Difference" = '+10' AND "Goals Against" > '61' | wikisql |
CREATE TABLE table_24051050_1 (
challengers__female_ VARCHAR,
episode VARCHAR
) | Which female challengers featured in episode 28? | SELECT challengers__female_ FROM table_24051050_1 WHERE episode = 28 | sql_create_context |
CREATE TABLE mzb (
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... | 总计医疗记录中医院6353786的出院诊断为胆囊炎的最高和最低医疗费总额分别有多少钱? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '6353786' AND qtb.OUT_DIAG_DIS_NM = '胆囊炎' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '6353786' AND gyb.OUT_DIAG_DIS_NM = '胆囊炎' UNION SELECT ... | css |
CREATE TABLE table_61362 (
"Club" text,
"First season in top division" text,
"Number of seasons in top division" real,
"First season of current spell in top division" text,
"Number of seasons in Liga MX" real,
"Top division titles" real
) | What is the highest Number of seasons in Liga MX for Club cruz azul? | SELECT MAX("Number of seasons in Liga MX") FROM table_61362 WHERE "Club" = 'cruz azul' | wikisql |
CREATE TABLE table_36837 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
) | How many bats does Todd have? | SELECT "Bats" FROM table_36837 WHERE "First" = 'todd' | wikisql |
CREATE TABLE table_56954 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | Who constructed Gerhard Berger car that went all rounds? | SELECT "Constructor" FROM table_56954 WHERE "Rounds" = 'all' AND "Driver" = 'gerhard berger' | wikisql |
CREATE TABLE table_38360 (
"Season" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text
) | What Nationality has the Player of Marcus Walker? | SELECT "Nationality" FROM table_38360 WHERE "Player" = 'marcus walker' | wikisql |
CREATE TABLE table_64856 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | Which School has a #/ County of 85 wabash, and an IHSAA Football Class of A, and a Mascot of norsemen? | SELECT "School" FROM table_64856 WHERE "# / County" = '85 wabash' AND "IHSAA Football Class" = 'a' AND "Mascot" = 'norsemen' | wikisql |
CREATE TABLE table_29499399_2 (
money_list_rank VARCHAR,
player VARCHAR
) | What is Jonathan Kaye's money list ranking? | SELECT COUNT(money_list_rank) FROM table_29499399_2 WHERE player = "Jonathan Kaye" | sql_create_context |
CREATE TABLE table_15635 (
"Year" real,
"Number of Users" text,
"Penetration" text,
"Number of Broadband Subscribers" text,
"Broadband Penetration" text,
"Population" text,
"Data provided by" text
) | How many broadband subscribers are there where there are ~47,372 users? | SELECT "Number of Broadband Subscribers" FROM table_15635 WHERE "Number of Users" = '~47,372' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | how many hours have it been since the last stay of patient 006-133605 during this hospital visit in the ward 384? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-133605' AND patient.wardid = 384 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
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... | 按照科室和出院诊断所患疾病的不同编码,把医院4313090所有医疗就诊记录中病人的平均年龄列出来 | SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4313090' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD | css |
CREATE TABLE Accounts (
account_id VARCHAR,
date_account_opened VARCHAR,
account_name VARCHAR,
other_account_details VARCHAR
) | Show the id, the date of account opened, the account name, and other account detail for all accounts. | SELECT account_id, date_account_opened, account_name, other_account_details FROM Accounts | sql_create_context |
CREATE TABLE table_54358 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text
) | Which method has a record of 11-10? | SELECT "Method" FROM table_54358 WHERE "Record" = '11-10' | 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 long title is chronic total occlusion of coronary artery and drug name is ondansetron? | 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.long_title = "Chronic total occlusion of coronary artery" AND prescriptions.drug = "Ondansetron" | mimicsql_data |
CREATE TABLE table_name_71 (
athlete VARCHAR,
country VARCHAR
) | Who was the athlete from Hong Kong? | SELECT athlete FROM table_name_71 WHERE country = "hong kong" | sql_create_context |
CREATE TABLE table_name_44 (
drafting_team VARCHAR,
graduated VARCHAR,
college_prior VARCHAR
) | Who drafted the player from Michigan after 2010? | SELECT drafting_team FROM table_name_44 WHERE graduated > 2010 AND college_prior = "michigan" | sql_create_context |
CREATE TABLE table_18701 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | who is the the incumbent with candidates being percy e. quin (d) unopposed | SELECT "Incumbent" FROM table_18701 WHERE "Candidates" = 'Percy E. Quin (D) Unopposed' | wikisql |
CREATE TABLE table_33843 (
"Kanji" text,
"Name (Translation)" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | Which builder is associated with ikazuchi 'thunder'? | SELECT "Builder" FROM table_33843 WHERE "Name (Translation)" = 'ikazuchi "thunder' | wikisql |
CREATE TABLE table_5859 (
"District" real,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text
) | What party has a district of 28 and was elected after 1983? | SELECT "Party" FROM table_5859 WHERE "Elected" > '1983' AND "District" = '28' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | What is offered for CS majors that are upper level electives ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_64182 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | Poland has what notes? | SELECT "Notes" FROM table_64182 WHERE "Country" = 'poland' | wikisql |
CREATE TABLE table_9544 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What was the average total for the player from the United States, who won in 1978? | SELECT AVG("Total") FROM table_9544 WHERE "Country" = 'united states' AND "Year(s) won" = '1978' | wikisql |
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
)
... | how many patients staying in the hospital for more than 5 days were diagnosed under icd9 code 30400? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.icd9_code = "30400" | mimicsql_data |
CREATE TABLE table_name_24 (
label VARCHAR,
region VARCHAR
) | What label does Germany have? | SELECT label FROM table_name_24 WHERE region = "germany" | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
dire... | what is the earliest flight that i can get from BWI to BOS logan | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (AIRPORT_0.airport_code = 'BWI' AND AIRPORT_1.airport_code = 'BOS' AND flight.from_airport = AIRPORT_0.airport_code AND flight.to_airport = AIRPORT_1.airport_code) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departur... | atis |
CREATE TABLE table_train_212 (
"id" int,
"pregnancy_or_lactation" bool,
"postmeal_c_peptide" float,
"chemotherapy" bool,
"liver_disease" bool,
"alcohol_abuse" bool,
"NOUSE" float
) | postmeal c peptide > 0.3 mg / dl | SELECT * FROM table_train_212 WHERE postmeal_c_peptide > 0.3 | criteria2sql |
CREATE TABLE table_68263 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | tell me the authority that has a decile less than 6 and roll less than 65. | SELECT "Authority" FROM table_68263 WHERE "Decile" < '6' AND "Roll" < '65' | wikisql |
CREATE TABLE table_77950 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
) | What is the sum of the points of all teams that had against scores less than 14? | SELECT SUM("Points") FROM table_77950 WHERE "Against" < '14' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time, and I want to show from low to high by the Y-axis. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_name_95 (
nationality VARCHAR,
player VARCHAR
) | What nationality has steve kerr as the player? | SELECT nationality FROM table_name_95 WHERE player = "steve kerr" | sql_create_context |
CREATE TABLE table_41233 (
"Location" text,
"Aircraft" text,
"Tail number" text,
"Aircraft damage" text,
"Fatalities" text
) | What was the tail number with 3/3 fatalities? | SELECT "Tail number" FROM table_41233 WHERE "Fatalities" = '3/3' | wikisql |
CREATE TABLE table_name_82 (
pick__number INTEGER,
pl_gp VARCHAR,
rd__number VARCHAR,
player VARCHAR
) | What numbered pick was mattias ohlund, with over 52 PL GP, and also a round under 11? | SELECT SUM(pick__number) FROM table_name_82 WHERE rd__number < 11 AND player = "mattias ohlund" AND pl_gp > 52 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH ... | 诊断门诊诊断31016439849的中医编号以及名称各是什么? | SELECT MZZYZDZZBM, MZZYZDZZMC FROM mzjzjlb WHERE JZLSH = '31016439849' | css |
CREATE TABLE table_79962 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the score of the game that had a loss of Drese (2-2)? | SELECT "Score" FROM table_79962 WHERE "Loss" = 'drese (2-2)' | wikisql |
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_ye... | How many players were awarded more than ten times? | SELECT COUNT(*) FROM (SELECT player_id FROM player_award GROUP BY player_id HAVING COUNT(*) > 10) | thehistoryofbaseball |
CREATE TABLE table_name_70 (
label VARCHAR,
date VARCHAR,
catalogue VARCHAR
) | What is the Label for Date of 14 November 2003, and Catalogue tojp 60121-22? | SELECT label FROM table_name_70 WHERE date = "14 november 2003" AND catalogue = "tojp 60121-22" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | is there a microbiology test that was performed on patient 031-3355's blood, venipuncture on their current hospital visit? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite = '... | eicu |
CREATE TABLE table_20468206_1 (
county VARCHAR,
mccain_percentage VARCHAR
) | Name the county for mccain being 38.78% | SELECT county FROM table_20468206_1 WHERE mccain_percentage = "38.78%" | sql_create_context |
CREATE TABLE table_name_38 (
year_of_first_appearance VARCHAR,
corps_name VARCHAR,
number_of_finals_appearances VARCHAR
) | What is the year of the first appearance of the Black Knights, who had less than 1 finals appearances? | SELECT COUNT(year_of_first_appearance) FROM table_name_38 WHERE corps_name = "black knights" AND number_of_finals_appearances < 1 | sql_create_context |
CREATE TABLE table_12186 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | Which week 1 had a week 2 of Claudia Nathalia? | SELECT "Week 1" FROM table_12186 WHERE "Week 2" = 'claudia nathalia' | wikisql |
CREATE TABLE table_name_73 (
silver INTEGER,
gold VARCHAR,
rank VARCHAR
) | What is the average number of silver medals for countries with 0 gold and rank under 3? | SELECT AVG(silver) FROM table_name_73 WHERE gold = 0 AND rank < 3 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.