context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_25293 (
"Station" text,
"Extension" text,
"City/Neighborhood" text,
"Projected opening" real,
"Transit Connections" text,
"Park and ride?" text
) | Name the extension for university of washington | SELECT "Extension" FROM table_25293 WHERE "City/Neighborhood" = 'University of Washington' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Give me the comparison about the sum of Height over the Sex , and group by attribute Sex by a bar chart, and rank x axis in ascending order. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | what is three of the most frequent intake until 2102? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) <= '2102' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE table_49012 (
"Season" text,
"Passenger" text,
"Equipment" text,
"Position" text,
"Points" real,
"Races" real,
"Wins" text,
"Second" text,
"Third" text
) | What were the wins with more than 145 points, less than 17 races, and Sven Verbrugge as a passenger? | SELECT "Wins" FROM table_49012 WHERE "Points" > '145' AND "Passenger" = 'sven verbrugge' AND "Races" < '17' | wikisql |
CREATE TABLE table_60394 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What player is from Wales? | SELECT "Player" FROM table_60394 WHERE "Country" = 'wales' | wikisql |
CREATE TABLE table_40563 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the sum of Cuts made when there were more than 72 events? | SELECT SUM("Cuts made") FROM table_40563 WHERE "Events" > '72' | wikisql |
CREATE TABLE table_204_661 (
id number,
"team" text,
"location" text,
"home ground" text,
"first year in\nqld cup" number,
"last year in\nqld cup" number,
"qld cup\npremierships" text
) | are more teams from brisbane or townsville ? | SELECT "location" FROM table_204_661 WHERE "location" IN ('brisbane', 'townsville') GROUP BY "location" ORDER BY COUNT("team") DESC LIMIT 1 | squall |
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 the sum of Team_ID over the ACC_Road , and group by attribute ACC_Road, show names in desc order. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose discharge location is short term hospital and admission year is less than 2198? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.admityear < "2198" | mimicsql_data |
CREATE TABLE table_10167 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | What team is the home team when the home team scored 12.4 (76)? | SELECT "Home team" FROM table_10167 WHERE "Home team score" = '12.4 (76)' | wikisql |
CREATE TABLE table_204_357 (
id number,
"year" number,
"div." text,
"pos." text,
"cup" text,
"top scorer (league)" text,
"score" number
) | what year did buxoro place first ? | SELECT "year" FROM table_204_357 WHERE "pos." = 1 | squall |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME var... | A pie chart about how many hours do the students spend studying in each department? | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_28636 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | What is the vote percentage for the couple gary and maria? | SELECT "Vote percentage" FROM table_28636 WHERE "Couple" = 'Gary and Maria' | 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,
... | 被门诊诊断为R76.930这个病的蒋宏深,看看他的检测指标089733的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ... | css |
CREATE TABLE manager_half (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
half INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank INTEGER
)
CREATE TABLE manager (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason... | I want to see trend of the total number by yearid | SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid | nvbench |
CREATE TABLE table_50086 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What day in February had an opponent of @ Colorado Rockies? | SELECT SUM("February") FROM table_50086 WHERE "Opponent" = '@ colorado rockies' | wikisql |
CREATE TABLE table_19485 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the position of the player whose college is Western Kentucky? | SELECT "Position" FROM table_19485 WHERE "College" = 'Western Kentucky' | wikisql |
CREATE TABLE table_name_19 (
round VARCHAR,
position VARCHAR
) | Which round has a position that is cornerback? | SELECT round FROM table_name_19 WHERE position = "cornerback" | sql_create_context |
CREATE TABLE table_name_10 (
result VARCHAR,
loser VARCHAR
) | What is the Result when the memphis grizzlies ( 2) were the loser? | SELECT result FROM table_name_10 WHERE loser = "memphis grizzlies ( 2)" | sql_create_context |
CREATE TABLE table_37114 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What tournament has yvonne vermaak as the opponent? | SELECT "Tournament" FROM table_37114 WHERE "Opponent" = 'yvonne vermaak' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistoryTypes (
Id number,
... | Last edit not by me. | SELECT pt.Name AS posttype, p.Id AS "post_link", p.LastEditorUserId AS "user_link", p.LastEditDate AS "last_edit" FROM Posts AS p LEFT JOIN PostTypes AS pt ON (p.PostTypeId = pt.Id) WHERE p.OwnerUserId != LastEditorUserId AND p.OwnerUserId = '##UserId##' ORDER BY pt.Id, p.LastEditDate DESC | sede |
CREATE TABLE table_14314 (
"Reactor Unit" text,
"Type" text,
"Average Output" text,
"Rated Power" text,
"Began construction" text,
"Finish construction" text,
"Commercial operation" text,
"Close of reactor" text
) | When did the reactor that has a rated power of 945 MW and ended construction on May 10, 1978 close? | SELECT "Close of reactor" FROM table_14314 WHERE "Rated Power" = '945 mw' AND "Finish construction" = 'may 10, 1978' | wikisql |
CREATE TABLE Artist (
ArtistId integer,
Name varchar(120)
)
CREATE TABLE PlaylistTrack (
PlaylistId integer,
TrackId integer
)
CREATE TABLE Customer (
CustomerId integer,
FirstName varchar(40),
LastName varchar(20),
Company varchar(80),
Address varchar(70),
City varchar(40),
... | List the phone numbers of all employees, and count them by a bar chart, and list in asc by the names please. | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone | nvbench |
CREATE TABLE table_name_54 (
february INTEGER,
record VARCHAR,
game VARCHAR
) | What is the lowest February, when Record is '21-30-11', and when Game is greater than 62? | SELECT MIN(february) FROM table_name_54 WHERE record = "21-30-11" AND game > 62 | sql_create_context |
CREATE TABLE table_50579 (
"Team" text,
"Make" text,
"Drivers" text,
"Tyre" text,
"Rounds" text
) | In what rounds was the featured team of Avanzza Rosso? | SELECT "Rounds" FROM table_50579 WHERE "Team" = 'avanzza rosso' | wikisql |
CREATE TABLE table_15319 (
"Rank" real,
"Island" text,
"Area (km\u00b2)" real,
"Area (sq mi)" real,
"Country/Countries/Region" text
) | What is the smallest area (sq mi) that has 160 as it rank? | SELECT MIN("Area (sq mi)") FROM table_15319 WHERE "Rank" = '160' | wikisql |
CREATE TABLE table_57259 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the venue when the away team score is 17.13 (115)? | SELECT "Venue" FROM table_57259 WHERE "Away team score" = '17.13 (115)' | 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 demographic (... | what is the number of patients with brain mass; intracranial hemorrhage primary disease who had joint fluid lab test? | 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 = "Joint Fluid" | mimicsql_data |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TA... | show me flights from BALTIMORE to PHILADELPHIA please | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL... | atis |
CREATE TABLE table_name_4 (
week VARCHAR,
result VARCHAR
) | Which Week has a Result of l 21-19? | SELECT COUNT(week) FROM table_name_4 WHERE result = "l 21-19" | sql_create_context |
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,
... | 在02年2月21日到04年4月10日期间作为患者91814247检测指标506686的医务人员的工号及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what is the total number of input patient 16088 has received since 05/13/2104? | 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 = 16088)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2104-05-13' | mimic_iii |
CREATE TABLE table_48277 (
"Date" text,
"U-boat" text,
"Name" text,
"Nationality" text,
"Tonnage (GRT)" real,
"Fate" text
) | Which Name has a Date of 11 june 1940? | SELECT "Name" FROM table_48277 WHERE "Date" = '11 june 1940' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | give me the number of patients whose ethnicity is hispanic or latino and year of birth is less than 1850? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "1850" | mimicsql_data |
CREATE TABLE table_name_20 (
class VARCHAR,
dates VARCHAR
) | What is Class, when Dates is '22 April - 3 May 2009'? | SELECT class FROM table_name_20 WHERE dates = "22 april - 3 may 2009" | sql_create_context |
CREATE TABLE table_name_36 (
year INTEGER,
venue VARCHAR
) | When is the latest year the venue is in gothenburg, sweden? | SELECT MAX(year) FROM table_name_36 WHERE venue = "gothenburg, sweden" | sql_create_context |
CREATE TABLE table_23745 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real,
"Total" real
) | How many percent of the votes in Debaca did McCain get? | SELECT "McCain%" FROM table_23745 WHERE "County" = 'DeBaca' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | User's answers sorted by length. | SELECT p.Id AS "post_link", LENGTH(p.Body) AS "length" FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 ORDER BY Length | sede |
CREATE TABLE table_name_31 (
team VARCHAR,
grid VARCHAR,
points VARCHAR
) | If a team has a grid of over 8 with less than 4 points, what's the team name? | SELECT team FROM table_name_31 WHERE grid > 8 AND points < 4 | sql_create_context |
CREATE TABLE table_24291077_8 (
brisbane INTEGER,
adelaide VARCHAR
) | What was the rating for Brisbane the week that Adelaide had 94000? | SELECT MIN(brisbane) FROM table_24291077_8 WHERE adelaide = 94000 | sql_create_context |
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... | Give the number of patients who died and were aged below 64 years. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.age < "64" | mimicsql_data |
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent ... | Count the number of programs broadcast for each time section of a day. Show bar chart. | SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day | nvbench |
CREATE TABLE table_22267 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
) | What was the arrival for Wansford, Peterborough East? | SELECT "Arrival" FROM table_22267 WHERE "Calling at" = 'Wansford, Peterborough East' | wikisql |
CREATE TABLE table_63562 (
"Year [A ]" real,
"Pick" text,
"Player name" text,
"Position" text,
"College" text
) | who is the player when the pick is 15 and the year [A] is 2000? | SELECT "Player name" FROM table_63562 WHERE "Pick" = '15' AND "Year [A ]" = '2000' | wikisql |
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... | 在医院9492924的记录里按名字不同的科室和入院诊断疾病编码,所有医疗就诊记录中患者的平均年龄列出来是哪些啊? | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9492924' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '94929... | css |
CREATE TABLE table_name_67 (
country VARCHAR,
score VARCHAR
) | What Country scored 70-68-70=208? | SELECT country FROM table_name_67 WHERE score = 70 - 68 - 70 = 208 | sql_create_context |
CREATE TABLE table_76097 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
) | When the Tier is listed as tier iii, who is the Winner? | SELECT "Winner" FROM table_76097 WHERE "Tier" = 'tier iii' | wikisql |
CREATE TABLE table_63008 (
"Rank" real,
"Heat" real,
"Athlete" text,
"Country" text,
"Time" real
) | What is the average time in a rank of 61? | SELECT AVG("Time") FROM table_63008 WHERE "Rank" = '61' | wikisql |
CREATE TABLE table_16913 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | How many tournaments were held in Maryland? | SELECT COUNT("Tournament") FROM table_16913 WHERE "Location" = 'Maryland' | wikisql |
CREATE TABLE table_name_4 (
game VARCHAR,
date VARCHAR
) | On the date April 11, what is the total game number? | SELECT COUNT(game) FROM table_name_4 WHERE date = "april 11" | sql_create_context |
CREATE TABLE table_78144 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
) | What is the code for a Le Haut-Saint-Laurent municipality that has 16 or more regions? | SELECT MIN("Code") FROM table_78144 WHERE "Regional County Municipality" = 'le haut-saint-laurent' AND "Region" > '16' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Show me about the distribution of meter_300 and meter_100 in a bar chart, and list Y from high to low order. | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE table_49811 (
"Date From" text,
"Date To" text,
"Pos." text,
"Name" text,
"Moving To" text
) | What is Name, when Moving To is 'NEC Nijmegen'? | SELECT "Name" FROM table_49811 WHERE "Moving To" = 'nec nijmegen' | wikisql |
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 TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of manager_id over the hire_date bin hire_date by time. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_52962 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Moorabbin oval is home to what team? | SELECT "Home team" FROM table_52962 WHERE "Venue" = 'moorabbin oval' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | give me the birth date of patient stephanie suchan ? | SELECT demographic.dob FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_45172 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner-up" text
) | Which championship after 1985 had a winning score of 8 (68-72-69-71=280)? | SELECT "Championship" FROM table_45172 WHERE "Year" > '1985' AND "Winning score" = '–8 (68-72-69-71=280)' | wikisql |
CREATE TABLE table_10360656_1 (
player_name VARCHAR,
position VARCHAR
) | What was the name of the quarterback drafted? | SELECT player_name FROM table_10360656_1 WHERE position = "Quarterback" | sql_create_context |
CREATE TABLE table_203_309 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years lost" text
) | which teams have more wins that werder bremen ? | SELECT "team" FROM table_203_309 WHERE "winners" > (SELECT "winners" FROM table_203_309 WHERE "team" = 'werder bremen') | squall |
CREATE TABLE table_21076286_2 (
broadcast_day_and_timings__in_jst__ VARCHAR,
broadcast_network VARCHAR
) | Name the broadcast day and timings for tv saitama | SELECT broadcast_day_and_timings__in_jst__ FROM table_21076286_2 WHERE broadcast_network = "TV Saitama" | sql_create_context |
CREATE TABLE table_33322 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team's score when they played at Lake Oval? | SELECT "Home team score" FROM table_33322 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | what was patient 3710's first operation time since 1 year ago? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3710) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_24753 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Languages" text,
"Director" text,
"Result" text
) | How many languages have le roman de renart as the original title? | SELECT COUNT("Languages") FROM table_24753 WHERE "Original title" = 'Le Roman de Renart' | wikisql |
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_province text,
country_id text
)
CREATE TABLE job_history (
employee_id number,
s... | What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000? | SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 | spider |
CREATE TABLE table_20871703_1 (
height VARCHAR,
position VARCHAR
) | What is the height if de is the position? | SELECT COUNT(height) FROM table_20871703_1 WHERE position = "DE" | sql_create_context |
CREATE TABLE table_name_74 (
home_team VARCHAR,
date VARCHAR
) | Which Home team score is on sunday 24 february? | SELECT home_team AS score FROM table_name_74 WHERE date = "sunday 24 february" | sql_create_context |
CREATE TABLE table_6046 (
"Month" text,
"Week" real,
"Offensive" text,
"Defensive" text,
"Goalkeeper" text,
"Rookie" text
) | What was the lowest week in the month of August against Andrew Combs? | SELECT MIN("Week") FROM table_6046 WHERE "Month" = 'august' AND "Offensive" = 'andrew combs' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | show flights between TORONTO and SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... | atis |
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 five most frequent drugs that patients were prescribed with within the same month after receiving palliative care consultation until 2101? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'palliative care consultation' AND STRFTIME('%y', t... | eicu |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain_journal (
... | return me the keyword, which have been contained by the most number of papers by ' H. V. Jagadish ' . | SELECT keyword.keyword FROM author, keyword, publication, publication_keyword, writes WHERE author.name = 'H. V. Jagadish' AND publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY keyword.keyword ORDER BY COUNT(DISTINCT... | academic |
CREATE TABLE table_name_90 (
location VARCHAR,
result VARCHAR,
winner VARCHAR,
year VARCHAR
) | What is the Location, when the Winner is the Baltimore Colts, when the Year is before 1972, and when the Result is 14-6? | SELECT location FROM table_name_90 WHERE winner = "baltimore colts" AND year < 1972 AND result = "14-6" | sql_create_context |
CREATE TABLE table_203_133 (
id number,
"year" number,
"japanese title" text,
"english title" text,
"role" text,
"network" text
) | how many more appearances on fuji tv were there than tbs ? | SELECT (SELECT COUNT(*) FROM table_203_133 WHERE "network" = 'fuji tv') - (SELECT COUNT(*) FROM table_203_133 WHERE "network" = 'tbs') | squall |
CREATE TABLE table_4202 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Director" text,
"Writer" text,
"Originalair date" text
) | What is the original air date when the director is Rowan Woods and the writer is Peter Duncan? | SELECT "Originalair date" FROM table_4202 WHERE "Director" = 'Rowan Woods' AND "Writer" = 'Peter Duncan' | wikisql |
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
... | Visualize a bar chart for what are the ids and locations of all circuits in France or Belgium? | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" | nvbench |
CREATE TABLE gyb (
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... | 患者鲁舒云在2015年7月20日到2019年3月28日期间买了多少次西药? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '鲁舒云' AND t_kc22.STA_DATE BETWEEN '2015-07-20' AND '2019-03-28' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '鲁舒云' A... | css |
CREATE TABLE table_2927 (
"Year" real,
"Population" real,
"Serbs" text,
"Germans" text,
"Romanians" text,
"Hungarians" text,
"Croats" text,
"Roma" text,
"Slovaks" text,
"Rest" text
) | How many values for Germans occurs when value for Slovaks is 0.11%? | SELECT COUNT("Germans") FROM table_2927 WHERE "Slovaks" = '0.11%' | wikisql |
CREATE TABLE table_44194 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"1st Leg" text,
"2nd Leg" text
) | Which season has the Werder Bremen Club and is in Round 2r? | SELECT "Season" FROM table_44194 WHERE "Club" = 'werder bremen' AND "Round" = '2r' | wikisql |
CREATE TABLE table_8807 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What manufacturer made 6 and preserved 1? | SELECT "Manufacturer" FROM table_8807 WHERE "Quantity made" = '6' AND "Quantity preserved" = '1' | wikisql |
CREATE TABLE table_1929755_1 (
top_5 VARCHAR,
avg_start VARCHAR
) | HOw many top 5 starts did the team with an average start of 17.7 have? | SELECT COUNT(top_5) FROM table_1929755_1 WHERE avg_start = "17.7" | sql_create_context |
CREATE TABLE table_name_9 (
fa_cup INTEGER,
league VARCHAR,
malaysia_cup VARCHAR
) | What is the lowest FA cup that has a league greater than 0, with a Malaysia cup greater than 5? | SELECT MIN(fa_cup) FROM table_name_9 WHERE league > 0 AND malaysia_cup > 5 | sql_create_context |
CREATE TABLE table_2668336_24 (
candidates VARCHAR,
incumbent VARCHAR
) | Who are the candidates when the incumbent is john pegram? | SELECT candidates FROM table_2668336_24 WHERE incumbent = "John Pegram" | sql_create_context |
CREATE TABLE table_22274142_1 (
launch_date VARCHAR,
transmission VARCHAR
) | How many launch dates are there for digital transmission? | SELECT COUNT(launch_date) FROM table_22274142_1 WHERE transmission = "Digital" | sql_create_context |
CREATE TABLE table_26416704_2 (
status VARCHAR,
incumbent VARCHAR
) | What was the status of the election featuring incumbent margaret kaiser? | SELECT status FROM table_26416704_2 WHERE incumbent = "Margaret Kaiser" | sql_create_context |
CREATE TABLE table_name_54 (
wins VARCHAR,
total_final_appearances VARCHAR,
club VARCHAR
) | How manywins for dunfermline athletic that has a total final appearances less than 2? | SELECT wins FROM table_name_54 WHERE total_final_appearances < 2 AND club = "dunfermline athletic" | sql_create_context |
CREATE TABLE table_name_87 (
to_par VARCHAR,
country VARCHAR,
player VARCHAR
) | What to par is located in the united states and has the player by the name of hale irwin? | SELECT to_par FROM table_name_87 WHERE country = "united states" AND player = "hale irwin" | sql_create_context |
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... | 之前患者韩依然在哪儿看过病? | SELECT hz_info_mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL... | css |
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE cl... | Give the name of the lowest earning instructor in the Statistics department. | SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1 | spider |
CREATE TABLE table_name_9 (
event VARCHAR,
winner VARCHAR
) | What event did Mark Teltscher win? | SELECT event FROM table_name_9 WHERE winner = "mark teltscher" | sql_create_context |
CREATE TABLE table_76359 (
"Poll Source" text,
"Dates administered" text,
"Democrat: John Kerry" text,
"Republican: Jeff Beatty" text,
"Lead Margin" real
) | Who is the poll source that has Republican: Jeff Beatty behind at 27%? | SELECT "Poll Source" FROM table_76359 WHERE "Republican: Jeff Beatty" = '27%' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | 门诊中医诊断在住院就诊22762045493中的编号是多少? | SELECT wdmzjzjlb.MZZYZDZZBM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '22762045493' UNION SELECT bdmzjzjlb.MZZYZDZZBM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '22762045493' | css |
CREATE TABLE table_34206 (
"Year" text,
"Flagship Station" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Studio host" text
) | Play-by-play of sean grande, and a Flagship Station of wrko, and a Year of 2005-06 had what studio host? | SELECT "Studio host" FROM table_34206 WHERE "Play-by-play" = 'sean grande' AND "Flagship Station" = 'wrko' AND "Year" = '2005-06' | wikisql |
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... | 在医院5565030中的85281827号病患其就诊了哪些名称不包含ICU的科室,其所有门诊就诊记录的流水号是多少? | SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '85281827' AND hz_info.YLJGDM = '5565030' AND NOT txmzjzjlb.JZKSMC LIKE '%ICU%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_info... | css |
CREATE TABLE table_64861 (
"Player" text,
"Country" text,
"Year won" real,
"Total" real,
"To par" real
) | What is the Year won of Davis Love III with a Total of less than 149? | SELECT COUNT("Year won") FROM table_64861 WHERE "Player" = 'davis love iii' AND "Total" < '149' | wikisql |
CREATE TABLE table_4134 (
"Stadium" text,
"Location" text,
"Opened" real,
"Built for" text,
"Capacity at Construction" real
) | What is the location of the Moorabbin Oval stadium? | SELECT "Location" FROM table_4134 WHERE "Stadium" = 'Moorabbin Oval' | wikisql |
CREATE TABLE table_name_11 (
ends_lost INTEGER,
locale VARCHAR
) | What's Ontario's highest Ends Lost? | SELECT MAX(ends_lost) FROM table_name_11 WHERE locale = "ontario" | sql_create_context |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
char... | what is the monthly minimum dose of tpa .5mg/hr that patient 3369 has taken until 35 months ago? | SELECT MIN(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 = 3369)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
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... | Show me a bar chart for what are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type? | SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation | nvbench |
CREATE TABLE table_16301 (
"#" real,
"Air Date" text,
"Challenge" text,
"Winner" text,
"Test-taker" text,
"Passed?" text
) | What episode aired on 18 April 2007? | SELECT MIN("#") FROM table_16301 WHERE "Air Date" = '18 April 2007' | wikisql |
CREATE TABLE table_14785903_1 (
females_rank VARCHAR,
states VARCHAR
) | What is the female rank in Karnataka? | SELECT females_rank FROM table_14785903_1 WHERE states = "Karnataka" | sql_create_context |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | A bar chart for what are the number of the name of rooms booked by customers whose first name has 'ROY' in part?, list by the Y-axis in descending. | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.