context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_87 (
result_f___a VARCHAR,
league_position VARCHAR,
date VARCHAR
) | Name the Result F A that has a League position of 1st on 4 january 1994? | SELECT result_f___a FROM table_name_87 WHERE league_position = "1st" AND date = "4 january 1994" | sql_create_context |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advis... | How many clubs does 'Linda Smith' have membership for? | SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith" | spider |
CREATE TABLE table_48212 (
"Winner" text,
"Country" text,
"Winter Olympics" real,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | what is the winter olympics when the country is soviet union and holmenkollen is 1970, 1979? | SELECT SUM("Winter Olympics") FROM table_48212 WHERE "Country" = 'soviet union' AND "Holmenkollen" = '1970, 1979' | wikisql |
CREATE TABLE table_33217 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Whom is the away team when the Away team score is 23.14 (152)? | SELECT "Away team" FROM table_33217 WHERE "Away team score" = '23.14 (152)' | wikisql |
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
)
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
) | Show the authors who have submissions to more than one workshop. | SELECT T2.author FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id GROUP BY T2.author HAVING COUNT(DISTINCT T1.workshop_id) > 1 | spider |
CREATE TABLE table_78003 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time/retired for thierry boutsen? | SELECT "Time/Retired" FROM table_78003 WHERE "Driver" = 'thierry boutsen' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | tell me whether the evd output (ml)-icp/external ventricular drain (evd) right ventriculostomy event happend to patient 006-133605 on the current icu visit? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605') AND patient.unitdischargetime IS NULL) AND intakeoutput.c... | eicu |
CREATE TABLE table_47139 (
"Rank" text,
"Team" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | What was the run 3 for the team with a run 1 of 1:17.6? | SELECT "Run 3" FROM table_47139 WHERE "Run 1" = '1:17.6' | wikisql |
CREATE TABLE table_15780049_8 (
high_rebounds VARCHAR,
date VARCHAR
) | Name the high rebounds for march 17 | SELECT high_rebounds FROM table_15780049_8 WHERE date = "March 17" | sql_create_context |
CREATE TABLE table_55848 (
"Presidency" real,
"President" text,
"Date of Birth" text,
"Took office" real,
"Left office" text
) | What is the highest Presidency that Took Office after 1974 and Left Office in 1998? | SELECT MAX("Presidency") FROM table_55848 WHERE "Left office" = '1998' AND "Took office" > '1974' | wikisql |
CREATE TABLE table_5841 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | What was the length for GT class at Portland International Raceway? | SELECT "Length" FROM table_5841 WHERE "Class" = 'gt' AND "Circuit" = 'portland international raceway' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | Next Winter , who will teach the Core classes ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_name_41 (
deputy VARCHAR,
year VARCHAR
) | What is the name of the deputy in 1992 93? | SELECT deputy FROM table_name_41 WHERE year = "1992–93" | sql_create_context |
CREATE TABLE table_54105 (
"End of Fiscal Year" real,
"Gross Debt in $Billions undeflated Treas." real,
"as % of GDP Low-High" text,
"Debt Held By Public ($Billions)" real,
"as % of GDP (Treas/MW, OMB or OMB/MW)" real,
"GDP $Billions OMB/BEA est.=MW.com" text
) | For End of Fiscal Years past 1980 that also have as % of GDP Low-High of 83.4-84.4, and a Debt Held By Public ($Billions) smaller than 7,552 what would be the average Gross Debt in $Billions undeflated Treas. in said years? | SELECT AVG("Gross Debt in $Billions undeflated Treas.") FROM table_54105 WHERE "End of Fiscal Year" > '1980' AND "as % of GDP Low-High" = '83.4-84.4' AND "Debt Held By Public ($Billions)" < '7,552' | wikisql |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | A bar chart showing the number of last name for all female students. Their sex is F. | SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate... | what's the maximum total cost of a hospital that includes a laboratory ntprobnp test? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ntprobnp')) GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_train_131 (
"id" int,
"thyroid_disease" bool,
"pulmonary_disease" bool,
"right_bundle_branch_block" bool,
"allergy_to_piperidine_derivatives" bool,
"obstructive_pulmonary_disease" bool,
"inflammatory_bowel_disease" bool,
"renal_disease" bool,
"hepatic_disease" bool... | patients with active or clinically significant conditions affecting absorption, distribution or metabolism of the study medication ( e.g., inflammatory bowel disease, gastric or duodenal ulcers or severe lactose intolerance ) . | SELECT * FROM table_train_131 WHERE absorption = 1 OR distribution = 1 OR metabolism = 1 OR (inflammatory_bowel_disease = 1 OR gastric = 1 OR duodenal_ulcers = 1 OR lactose_intolerance = 1) | criteria2sql |
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,
... | Show me the number of patients who were ordered to get urine lab test and died in 2111 or before that. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_57537 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | In the Canadian Grand Prix, what tyre was used when Jacky Ickx held pole position? | SELECT "Tyre" FROM table_57537 WHERE "Pole position" = 'jacky ickx' AND "Race" = 'canadian grand prix' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of ACC_Regular_Season and Team_ID , could you rank Y in descending order? | SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID DESC | nvbench |
CREATE TABLE table_name_29 (
season INTEGER,
game VARCHAR,
score VARCHAR
) | Which Season has a Game of fcs midwest region, and a Score of 40-33? | SELECT MAX(season) FROM table_name_29 WHERE game = "fcs midwest region" AND score = "40-33" | sql_create_context |
CREATE TABLE table_name_63 (
win_percentage INTEGER,
games_behind VARCHAR,
wins VARCHAR
) | What is the lowest percentage of wins for 6 games and more than 77 total wins? | SELECT MIN(win_percentage) FROM table_name_63 WHERE games_behind = "6½" AND wins > 77 | sql_create_context |
CREATE TABLE Member_of (
FacID INTEGER,
DNO INTEGER,
Appt_Type VARCHAR(15)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Student (
StuID... | Show me about the correlation between Credits and Instructor in a scatter chart. | SELECT Credits, Instructor FROM Course ORDER BY Credits | nvbench |
CREATE TABLE table_40340 (
"Venue" text,
"Location" text,
"Capacity" text,
"Owner" text,
"Environment" text,
"Year Built" text
) | What type of environment is the venue that was built in 2003? | SELECT "Environment" FROM table_40340 WHERE "Year Built" = '2003' | wikisql |
CREATE TABLE table_name_25 (
cuts_made INTEGER,
tournament VARCHAR,
wins VARCHAR
) | Which Cuts made has a Tournament of totals, and Wins smaller than 11? | SELECT AVG(cuts_made) FROM table_name_25 WHERE tournament = "totals" AND wins < 11 | sql_create_context |
CREATE TABLE table_name_99 (
year INTEGER,
rank VARCHAR,
name VARCHAR
) | Can you tell me the lowest Year that has the Rank smaller the 132, and the Name of biodiversity richness? | SELECT MIN(year) FROM table_name_99 WHERE rank < 132 AND name = "biodiversity richness" | sql_create_context |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
... | number of citations of linda shapiro | SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_204_717 (
id number,
"season" text,
"level" number,
"division" text,
"place" text
) | the two level 6 seasons were 2012/13 and what other season ? | SELECT "season" FROM table_204_717 WHERE "season" <> '2012/13' AND "level" = 6 | squall |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Will there be a 1 -credit upper level class for Fall 2016 ? | 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.credits = 1 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AND seme... | advising |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 列出患者90180222的检验报告单日期在2021年6月7日之后的所对应的住院就诊的流水号 | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj... | css |
CREATE TABLE table_name_28 (
gene VARCHAR,
subject_number VARCHAR
) | Which gene has the subject number 21? | SELECT gene FROM table_name_28 WHERE subject_number = "21" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | exactly what is the total amount of tpn w/lipids intake that patient 26350 has received? | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26350)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | when on their current hospital visit did patient 5828 get the first microbiology test? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828 AND admissions.dischtime IS NULL) ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_40179 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" real,
"Year" text,
"Hometown (Previous school)" text
) | What is the average Weight of the person who is 6'9'? | SELECT AVG("Weight") FROM table_40179 WHERE "Height" = '6''9' | wikisql |
CREATE TABLE table_42204 (
"Name" text,
"Innings" real,
"Runs Scored" real,
"Balls Faced" real,
"Average" real,
"S.R." real
) | How many total innings have an average under 6.33, strike rate under 71.43, balls faced over 36, and smaller than 19 runs scored? | SELECT SUM("Innings") FROM table_42204 WHERE "Average" < '6.33' AND "S.R." < '71.43' AND "Balls Faced" > '36' AND "Runs Scored" < '19' | wikisql |
CREATE TABLE table_204_72 (
id number,
"election year" number,
"# of\nconstituency votes" number,
"# of\nparty list votes" number,
"% of\nparty list votes" number,
"# of\noverall seats won" text,
"+/-" number
) | how many seats were won by the social democratic party in 1994 ? | SELECT "# of\noverall seats won" FROM table_204_72 WHERE "election year" = 1994 | squall |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the email , list by the names in asc. | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE actor (
Duration VARCHAR,
Age VARCHAR
) | What is the duration of the oldest actor? | SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_69725 (
"Race name" text,
"Dist (miles)" text,
"Course" text,
"Prize" text,
"Jockey" text,
"Odds" text,
"Runners" text
) | What is the distance for the unnamed race with 3 runners at Newcastle? | SELECT "Dist (miles)" FROM table_69725 WHERE "Race name" = 'unnamed race' AND "Runners" = '3' AND "Course" = 'newcastle' | wikisql |
CREATE TABLE table_68834 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which country has an IATA of JFK? | SELECT "Country" FROM table_68834 WHERE "IATA" = 'jfk' | wikisql |
CREATE TABLE table_66424 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | How many weeks have an attendance greater than 55,121, and l 27-7 as the result? | SELECT SUM("Week") FROM table_66424 WHERE "Attendance" > '55,121' AND "Result" = 'l 27-7' | wikisql |
CREATE TABLE table_1341586_19 (
candidates VARCHAR,
result VARCHAR
) | how many candidates with result being retired to run for u. s. senate republican hold | SELECT COUNT(candidates) FROM table_1341586_19 WHERE result = "Retired to run for U. S. Senate Republican hold" | sql_create_context |
CREATE TABLE table_204_334 (
id number,
"opposition" text,
"matches" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"win%" text
) | who wins the most ? | SELECT "opposition" FROM table_204_334 WHERE "won" = (SELECT MAX("won") FROM table_204_334) | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientuni... | how many days have passed since patient 017-88691 received a laboratory test of troponin - i for the first time on their current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '017-88691' AND patient.hospi... | eicu |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | count the number of patients who were diagnosed with diabetes mellitus but did not return to the hospital within 2 months in 2104. | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1) - (SELECT COUNT(DIST... | eicu |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 名为曹欣德的这位患者被门诊诊断为疾病Y51.041,查一下编号为909845检测指标的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J... | css |
CREATE TABLE table_name_17 (
location_attendance VARCHAR,
high_assists VARCHAR,
record VARCHAR
) | Which Location Attendance has a High assists of raymond felton (5), and a Record of 35 44? | SELECT location_attendance FROM table_name_17 WHERE high_assists = "raymond felton (5)" AND record = "35–44" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | provide me the top four most common diagnosis since 2101? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2101' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_38047 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Women's singles of akvil stapu aityt , and a Year of 2010 had what mixed doubles? | SELECT "Mixed doubles" FROM table_38047 WHERE "Women's singles" = 'akvilė stapušaitytė' AND "Year" = '2010' | wikisql |
CREATE TABLE table_74149 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Endowment" text,
"Football stadium" text,
"Capacity" real
) | What is the capacity for the institution of university of alberta? | SELECT "Capacity" FROM table_74149 WHERE "Institution" = 'University of Alberta' | wikisql |
CREATE TABLE table_name_18 (
date VARCHAR,
high_assists VARCHAR,
high_rebounds VARCHAR
) | What date were the high assists rondo (5) and the high rebounds rondo (10)? | SELECT date FROM table_name_18 WHERE high_assists = "rondo (5)" AND high_rebounds = "rondo (10)" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | Is ENGR 996 having class on Friday ? | SELECT DISTINCT course_offering.friday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ENGR' AND course.number = 996 AND semester.semester = 'WN' AND semester.year = 2016 | advising |
CREATE TABLE table_44614 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Nuggets points" real,
"Opponents" real,
"Record" text,
"Streak" text
) | How many Opponents have a Result of win, and Nuggets points smaller than 115, and an Opponent of washington? | SELECT SUM("Opponents") FROM table_44614 WHERE "Result" = 'win' AND "Nuggets points" < '115' AND "Opponent" = 'washington' | wikisql |
CREATE TABLE table_name_45 (
record VARCHAR,
time__seconds_ INTEGER
) | Tell me the record for a time in seconds smaller than 5.22. | SELECT record FROM table_name_45 WHERE time__seconds_ < 5.22 | sql_create_context |
CREATE TABLE table_66229 (
"!Event" real,
"Round" text,
"Surface" text,
"Winner" text,
"Opponent" text,
"Result" text
) | Which Surface has an Opponent of rafael nadal, and an Event of 2? | SELECT "Surface" FROM table_66229 WHERE "Opponent" = 'rafael nadal' AND "!Event" = '2' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 医疗费总额高于3743.87元的医疗记录中占严秀逸这个治病花费的多少次,严秀逸出院时诊断的有什么编码和名称的病? | 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_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3743.87) | css |
CREATE TABLE table_name_10 (
years_at_club VARCHAR,
player VARCHAR,
games VARCHAR,
goals VARCHAR
) | Which Years at club have Games smaller than 7, and Goals larger than 2, and a Player of john frazer? | SELECT years_at_club FROM table_name_10 WHERE games < 7 AND goals > 2 AND player = "john frazer" | sql_create_context |
CREATE TABLE table_29483890_1 (
position VARCHAR,
goals VARCHAR
) | What was the position of the player with 57 goals? | SELECT position FROM table_29483890_1 WHERE goals = 57 | sql_create_context |
CREATE TABLE table_name_14 (
highest_position VARCHAR,
issue_date VARCHAR,
album_title VARCHAR
) | What is the highest position the album Where we belong, which had an issue date higher than 9, had? | SELECT COUNT(highest_position) FROM table_name_14 WHERE issue_date < 9 AND album_title = "where we belong" | sql_create_context |
CREATE TABLE table_name_46 (
college VARCHAR,
player VARCHAR
) | What college did Matt Freeman go to? | SELECT college FROM table_name_46 WHERE player = "matt freeman" | sql_create_context |
CREATE TABLE table_46573 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | What was the sum of attendance for games with a time of 3:23? | SELECT SUM("Attendance") FROM table_46573 WHERE "Time" = '3:23' | 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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE tra... | was patient 14671 prescribed medication this month? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | mimic_iii |
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,
... | 医疗就诊58061396005有多少医疗费是统筹基金消费的占医疗费总额的比例是多少? | SELECT (SELECT t_kc24.OVE_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '58061396005') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '58061396005') | css |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | list the flights and departure times for flights leaving DALLAS FORT WORTH for BOSTON after 1800 | SELECT DISTINCT flight.departure_time, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT ... | atis |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,... | What papers has Yoav Artzi written ? | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'Yoav Artzi' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_12340907_1 (
total_costs__2005_ VARCHAR,
municipality VARCHAR
) | What is the value of total costs (2005) in the Coldstream municipality? | SELECT total_costs__2005_ FROM table_12340907_1 WHERE municipality = "Coldstream" | sql_create_context |
CREATE TABLE table_1341604_39 (
candidates VARCHAR,
incumbent VARCHAR
) | How many candidates won the election in the district whose incumbent is Bud Shuster? | SELECT COUNT(candidates) FROM table_1341604_39 WHERE incumbent = "Bud Shuster" | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | What are the average star ratings of each movie title? Could you return me a bar chart? | SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title | nvbench |
CREATE TABLE table_1989 (
"Match no." real,
"Match Type" text,
"Team Europe" text,
"Score" text,
"Team USA" text,
"Progressive Total" text
) | When paul moor is on the europe team who is on the usa team? | SELECT "Team USA" FROM table_1989 WHERE "Team Europe" = 'Paul Moor' | wikisql |
CREATE TABLE table_name_12 (
season VARCHAR,
viewer_rank___number_ VARCHAR
) | When did the season premiere that had a viewer rank of #6? | SELECT season AS premiere FROM table_name_12 WHERE viewer_rank___number_ = "#6" | sql_create_context |
CREATE TABLE table_name_57 (
mintage INTEGER,
theme VARCHAR,
year VARCHAR
) | What is the most mintage with common eider as the theme, and the year less than 2008? | SELECT MAX(mintage) FROM table_name_57 WHERE theme = "common eider" AND year < 2008 | sql_create_context |
CREATE TABLE table_10168 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | What is the home team score when the away team scored 9.11 (65)? | SELECT "Home team score" FROM table_10168 WHERE "Away team score" = '9.11 (65)' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients are divorced and operated with procedure circumcision? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Circumcision" | mimicsql_data |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Plot the average of age by grouped by class as a bar graph, and show by the bar in descending. | SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC | nvbench |
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... | calculate the maximum age of asian ethnic background patients who were hospitalized for 23 days. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "23" | mimicsql_data |
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABLE flight (
id int,
Vehicle_Flight_number text,
Date text,
Pilot text,
Velocity real,
Altitude real,
airport_id int,
company_id int
)
CREATE TABLE operate_company... | Show how many flights each pilot has flied in a pie chart. | SELECT Pilot, COUNT(Pilot) FROM flight GROUP BY Pilot | nvbench |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | How big is the 494 class ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 494 | advising |
CREATE TABLE table_16442 (
"Series #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | Who directed Episode 8? | SELECT "Directed by" FROM table_16442 WHERE "Episode #" = '8' | wikisql |
CREATE TABLE table_53993 (
"Mid Gippsland FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the low draw total for yarragon teams with over 3 wins, and under 966 against? | SELECT MIN("Draws") FROM table_53993 WHERE "Wins" > '3' AND "Mid Gippsland FL" = 'yarragon' AND "Against" < '966' | wikisql |
CREATE TABLE table_203_305 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) | what is the name of the last player on this chart ? | SELECT "player" FROM table_203_305 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_11134 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What week was September 24, 2000 on? | SELECT SUM("Week") FROM table_11134 WHERE "Date" = 'september 24, 2000' | wikisql |
CREATE TABLE table_40384 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | On what surface was the match played with a score of 4 6, 6 3, 6 1? | SELECT "Surface" FROM table_40384 WHERE "Score" = '4–6, 6–3, 6–1' | wikisql |
CREATE TABLE table_204_81 (
id number,
"rank" number,
"bib" number,
"name" text,
"country" text,
"time" text,
"deficit" text
) | what country had the most top 10 finishers in the men 's 15 kilometre classical ? | SELECT "country" FROM table_204_81 WHERE id <= 10 GROUP BY "country" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_73028 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Time Frame" text,
"Starring Actors" text,
"Theme Song(s)" text,
"Episodes" real,
"Average Ratings" text
) | What is the average rating for tv asahi? | SELECT "Average Ratings" FROM table_73028 WHERE "TV Station" = 'TV Asahi' | wikisql |
CREATE TABLE table_24435 (
"Team name" text,
"Races" real,
"Won" real,
"RR1 Pts." real,
"RR2 Pts." real,
"RR3 Pts." real,
"Total Pts." real,
"Ranking" real
) | What is the rank when RR2 has 4 points? | SELECT "Ranking" FROM table_24435 WHERE "RR2 Pts." = '4' | 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... | Give me the comparison about ACC_Percent over the Team_Name by a bar chart, display by the x-axis in asc. | SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE table_36024 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which position does bert coan play? | SELECT "Position" FROM table_36024 WHERE "Player" = 'bert coan' | wikisql |
CREATE TABLE table_name_28 (
agg VARCHAR,
team__number2 VARCHAR
) | When Estudiantes was team #2, what was their agg. value? | SELECT agg FROM table_name_28 WHERE team__number2 = "estudiantes" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | give me a flight from NEWARK to TAMPA on friday | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat... | atis |
CREATE TABLE table_62311 (
"Year" real,
"Award Ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
) | How many times is the award ceremony laurence olivier award, result is won and the nominee is imelda staunton? | SELECT COUNT("Year") FROM table_62311 WHERE "Award Ceremony" = 'laurence olivier award' AND "Result" = 'won' AND "Nominee" = 'imelda staunton' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Searching comments on two keywords inclusive. | SELECT c.CreationDate, c.Text, c.Id AS "comment_link", c.PostId AS "post_link" FROM Comments AS c WHERE Text LIKE '%##keyword1##%' AND Text LIKE '%##keyword2##%' LIMIT 100 | sede |
CREATE TABLE table_1341897_45 (
incumbent VARCHAR,
first_elected VARCHAR
) | Which incumbent was first elected in 1936? | SELECT incumbent FROM table_1341897_45 WHERE first_elected = 1936 | sql_create_context |
CREATE TABLE table_2583036_1 (
exposures VARCHAR,
total_exposure_time VARCHAR
) | how many exposures where there when the total exposure time is 105,000s? | SELECT exposures FROM table_2583036_1 WHERE total_exposure_time = "105,000s" | sql_create_context |
CREATE TABLE table_name_69 (
points INTEGER,
name VARCHAR
) | Which Points have a Name of denis kornilov? | SELECT AVG(points) FROM table_name_69 WHERE name = "denis kornilov" | sql_create_context |
CREATE TABLE table_204_402 (
id number,
"rank" number,
"player" text,
"from" text,
"to" text,
"transfer fee\n(\u20ac million)" number,
"year" number
) | where is dar o cvitanich from before transferring to ajax ? | SELECT "from" FROM table_204_402 WHERE "player" = 'dario cvitanich' AND "to" = 'ajax' | squall |
CREATE TABLE table_14032 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | Which Venue has Notes of 58.48 m? | SELECT "Venue" FROM table_14032 WHERE "Notes" = '58.48 m' | wikisql |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Show me how many type by type in a histogram, and sort by the y axis in desc. | SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY COUNT(Type) DESC | nvbench |
CREATE TABLE table_67283 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the loss of the game when the record was 16 15? | SELECT "Loss" FROM table_67283 WHERE "Record" = '16–15' | wikisql |
CREATE TABLE table_name_10 (
competition VARCHAR,
year VARCHAR,
venue VARCHAR
) | What are the competitions that occurred before 2006 in SVK Nitra? | SELECT competition FROM table_name_10 WHERE year < 2006 AND venue = "svk nitra" | sql_create_context |
CREATE TABLE table_28936 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | When was the incumbent from the Virginia 10 district first elected? | SELECT "First elected" FROM table_28936 WHERE "District" = 'Virginia 10' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.