context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_54695 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | Name the score for bucks with timberwolves | SELECT "Score" FROM table_54695 WHERE "Visitor" = 'bucks' AND "Home" = 'timberwolves' | wikisql |
CREATE TABLE table_name_92 (
losses INTEGER,
wins INTEGER
) | Which Losses is the lowest one that has Wins smaller than 0? | SELECT MIN(losses) FROM table_name_92 WHERE wins < 0 | sql_create_context |
CREATE TABLE table_name_58 (
week VARCHAR,
record VARCHAR
) | Which week has a record of 5-7-1? | SELECT week FROM table_name_58 WHERE record = "5-7-1" | sql_create_context |
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,
... | 范馨逸那个病人在治病期间使用的医疗费总额高于6053.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_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6053.87) | css |
CREATE TABLE table_49696 (
"Product" text,
"Vendor" text,
"Edition" text,
"Release date" text,
"Java EE compatibility" text,
"License" text
) | Which licence has a release date of 2009-08? | SELECT "License" FROM table_49696 WHERE "Release date" = '2009-08' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | how many of the male patients had accidents occurring in residential institution? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Accidents occurring in residential institution" | mimicsql_data |
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_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Which of the classes are being taught by Dr. Kevin Mcgowan next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kevin Mcgowan%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off... | advising |
CREATE TABLE table_27140 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | How many field goals did Stacey Thomas have? | SELECT "Field Goals" FROM table_27140 WHERE "Player" = 'Stacey Thomas' | wikisql |
CREATE TABLE table_name_65 (
country VARCHAR,
player VARCHAR
) | Which country is Scott Hoch from? | SELECT country FROM table_name_65 WHERE player = "scott hoch" | sql_create_context |
CREATE TABLE table_5187 (
"Maryland Counties" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
) | What was the average value for Fall 07 when Fall 09 is less than 296? | SELECT AVG("Fall 07") FROM table_5187 WHERE "Fall 09" < '296' | wikisql |
CREATE TABLE table_46820 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Who is the player with a to par of +1? | SELECT "Player" FROM table_46820 WHERE "To par" = '+1' | wikisql |
CREATE TABLE table_76752 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | How much Drawn has a Lost of 2, and Played smaller than 14? | SELECT SUM("Drawn") FROM table_76752 WHERE "Lost" = '2' AND "Played" < '14' | wikisql |
CREATE TABLE table_203_306 (
id number,
"no." number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
) | which episode aired in the same month as antarctica ? | SELECT "title" FROM table_203_306 WHERE "title" <> '"antarctica"' AND "original air date" = (SELECT "original air date" FROM table_203_306 WHERE "title" = '"antarctica"') | squall |
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... | were there any organisms found until 111 months ago in patient 26922's last microbiological sputum test? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26922) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME... | mimic_iii |
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... | Calculate the maximum age of unmarried patients who have primary disease atrial fibrillation/thoracoscopic maze and procedure bilateral/sda. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" | mimicsql_data |
CREATE TABLE table_11200 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the smallest crowd size for an away team that scored 7.15 (57)? | SELECT MIN("Crowd") FROM table_11200 WHERE "Away team score" = '7.15 (57)' | wikisql |
CREATE TABLE table_27622 (
"Episode" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What is the theme where the original artist is Noemi feat. Fiorella Mannoia? | SELECT "Theme" FROM table_27622 WHERE "Original artist" = 'Noemi feat. Fiorella Mannoia' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 患者32680024以前有过几项疾病? | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '32680024' | css |
CREATE TABLE table_46874 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the date of the game with a result of W 13-10? | SELECT "Date" FROM table_46874 WHERE "Result" = 'w 13-10' | wikisql |
CREATE TABLE table_name_46 (
developer_s_ VARCHAR,
game VARCHAR
) | Who was the developer of Call of Duty: Black Ops? | SELECT developer_s_ FROM table_name_46 WHERE game = "call of duty: black ops" | sql_create_context |
CREATE TABLE table_name_61 (
result VARCHAR,
competition VARCHAR
) | What was the result of the Competition of friendly? | SELECT result FROM table_name_61 WHERE competition = "friendly" | sql_create_context |
CREATE TABLE ship (
Name VARCHAR,
Nationality VARCHAR
) | Show the name of ships whose nationality is either United States or United Kingdom. | SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom" | sql_create_context |
CREATE TABLE table_29219286_1 (
written_by VARCHAR,
directed_by VARCHAR,
no_in_season VARCHAR
) | How many people wrote episode 9 in the season that was directed by Ernest Dickerson? | SELECT COUNT(written_by) FROM table_29219286_1 WHERE directed_by = "Ernest Dickerson" AND no_in_season = 9 | sql_create_context |
CREATE TABLE table_name_68 (
place VARCHAR,
player VARCHAR
) | What is Place, when Player is 'Mike Souchak'? | SELECT place FROM table_name_68 WHERE player = "mike souchak" | sql_create_context |
CREATE TABLE table_203_192 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | where was the first competition held according to this chart ? | SELECT "venue" FROM table_203_192 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_15924 (
"Season" text,
"Network" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" text
) | What was the ranking of the season finale aired on May 8, 2006? | SELECT "Ranking" FROM table_15924 WHERE "Season finale" = 'May 8, 2006' | wikisql |
CREATE TABLE table_name_12 (
event VARCHAR,
city VARCHAR
) | What event is in florianopolis? | SELECT event FROM table_name_12 WHERE city = "florianopolis" | sql_create_context |
CREATE TABLE table_42770 (
"Region" text,
"Date" real,
"Label" text,
"Format" text,
"Catalog" text
) | What is Catalog, when the Region is UK, and when Label is Razor Records? | SELECT "Catalog" FROM table_42770 WHERE "Region" = 'uk' AND "Label" = 'razor records' | wikisql |
CREATE TABLE table_56230 (
"Yard Name" text,
"Location (City, State)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text,
"Total Vessels Built for USMC" text
) | what is the total vessels built for usmc when the 1st ship delivery date is january 1943? | SELECT "Total Vessels Built for USMC" FROM table_56230 WHERE "1st Ship Delivery Date" = 'january 1943' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 在07年4月18日到19年9月17日期间,06584736的患者找了多少医生看病 | SELECT COUNT(txmzjzjlb.ZZYSGH) 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 = '06584736' AND txmzjzjlb.JZKSRQ BETWEEN '2007-04-18' AND '2019-09-17' UNION SELECT COUNT(ftxmzjzjlb.ZZYSGH) FROM hz_info JOIN ftxmzjzjlb ON h... | css |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizo... | Return the average age across all gymnasts. | SELECT AVG(T2.age) FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id | spider |
CREATE TABLE table_47359 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
) | What is the opponent number of the match with a w27-16 result? | SELECT "Opponent#" FROM table_47359 WHERE "Result" = 'w27-16' | 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... | Return a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home. | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_91 (
record VARCHAR,
home VARCHAR
) | What is the team's record when they play nashville at home? | SELECT record FROM table_name_91 WHERE home = "nashville" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)... | what kind of aircraft is used on the FIRST class AA flight from PHILADELPHIA to SAN FRANCISCO with a DALLAS stopover | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, 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, equipment_sequence, fare, fare_basis, flight, flight_fare, flight_stop WHERE (((CITY_2.city_code = AIRPO... | atis |
CREATE TABLE table_457 (
"Season" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | What years did Markose Bristow Madhumita Bisht win the mens singles and/or the mixed doubles? | SELECT "Mens singles" FROM table_457 WHERE "Mixed doubles" = 'Markose Bristow Madhumita Bisht' | wikisql |
CREATE TABLE table_name_92 (
score VARCHAR,
record VARCHAR
) | What was the score of the game when the record was 19 13 3? | SELECT score FROM table_name_92 WHERE record = "19–13–3" | sql_create_context |
CREATE TABLE table_76812 (
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"1980" text
) | what is 1980 when 1979 is 951? | SELECT "1980" FROM table_76812 WHERE "1979" = '951' | wikisql |
CREATE TABLE table_39238 (
"Polling Firm" text,
"Date" text,
"Venstre (V)" text,
"Social Democrats (A)" text,
"Danish People's Party (O)" text,
"Socialist People's Party (F)" text,
"Conservative People's Party (C)" text,
"Social Liberal Party (B)" text,
"Liberal Alliance (I)" text,
... | Which Social Liberal Party has 4.5% of the Conservative People's Party? | SELECT "Social Liberal Party (B)" FROM table_39238 WHERE "Conservative People's Party (C)" = '4.5%' | wikisql |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE professor (
emp_num number,
dep... | What is the name of the department that has the largest number of students enrolled? | SELECT T4.dept_name FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_18536769_1 (
frequency VARCHAR,
owner VARCHAR
) | When vista radio is the owner what is the frequency? | SELECT frequency FROM table_18536769_1 WHERE owner = "Vista Radio" | sql_create_context |
CREATE TABLE table_name_25 (
density__2005_ INTEGER,
area__km²_ VARCHAR,
population__2005_ VARCHAR
) | Which Density (2005) has an Area (km ) of 340086.7, and a Population (2005) smaller than 5926300? | SELECT SUM(density__2005_) FROM table_name_25 WHERE area__km²_ = 340086.7 AND population__2005_ < 5926300 | sql_create_context |
CREATE TABLE table_name_40 (
reg_gp INTEGER,
player VARCHAR,
rd__number VARCHAR
) | How many reg GP for rick vaive in round 1? | SELECT SUM(reg_gp) FROM table_name_40 WHERE player = "rick vaive" AND rd__number > 1 | sql_create_context |
CREATE TABLE table_2840500_8 (
pick INTEGER,
player VARCHAR
) | Name the most pick for evgeny korolev | SELECT MAX(pick) FROM table_2840500_8 WHERE player = "Evgeny Korolev" | sql_create_context |
CREATE TABLE table_64382 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What is the lowest lane in the Czech Republic and a time larger than 21.05? | SELECT MIN("Lane") FROM table_64382 WHERE "Nationality" = 'czech republic' AND "Time" > '21.05' | wikisql |
CREATE TABLE table_2196 (
"Episode" text,
"First broadcast" text,
"Rufus guest" text,
"Marcus guest" text,
"Winner" text
) | What is the resulting score for the episodes where Rufus's guest is Sean Lock? | SELECT "Winner" FROM table_2196 WHERE "Rufus guest" = 'Sean Lock' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of price , and group by attribute founder in a bar chart. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | had any medication been prescribed to patient 80555 in 12/2105? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' | mimic_iii |
CREATE TABLE table_29103 (
"Series #" real,
"Episode #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original airdate" text
) | What numbered episode in the series is directed by tim van patten and titled 'black like monica'? | SELECT MIN("Series #") FROM table_29103 WHERE "Director" = 'Tim Van Patten' AND "Title" = 'Black Like Monica' | wikisql |
CREATE TABLE table_24275 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text
) | When did Oliver Jarvis have pole position? | SELECT "Date" FROM table_24275 WHERE "Pole position" = 'Oliver Jarvis' | wikisql |
CREATE TABLE table_name_2 (
score VARCHAR,
money___$__ VARCHAR,
player VARCHAR
) | What is Score, when Money ( $ ) is 32,200, and when Player is Chip Beck? | SELECT score FROM table_name_2 WHERE money___$__ = "32,200" AND player = "chip beck" | 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,
... | 哪些医务人员在2012年5月30日到2014年9月25日期间为患者朱清佳检测指标204728的,提供一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE table_name_53 (
country VARCHAR,
tv_network_s_ VARCHAR
) | Which country is the Nova TV network from? | SELECT country FROM table_name_53 WHERE tv_network_s_ = "nova tv" | sql_create_context |
CREATE TABLE table_204_517 (
id number,
"name" text,
"date of birth" text,
"club" text,
"division" text,
"appointed" text,
"time as manager" text
) | who served as manager longer - francis bosschaerts or peter maes ? | SELECT "name" FROM table_204_517 WHERE "name" IN ('francis bosschaerts', 'peter maes') ORDER BY "date of birth" LIMIT 1 | squall |
CREATE TABLE table_77721 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Which Tournament has a Margin of victory of 7 strokes | SELECT "Tournament" FROM table_77721 WHERE "Margin of victory" = '7 strokes' | wikisql |
CREATE TABLE table_name_2 (
rank INTEGER,
gold INTEGER
) | What's the total Rank that has a Gold that's smaller than 0? | SELECT SUM(rank) FROM table_name_2 WHERE gold < 0 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | calculate the maximum days for which patients with private health insurance have been hospitalized. | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 10 users without downvotes. Top 10 users with more than 101 rep, at least 1 upvote and no downvotes. | SELECT Id, Reputation, DisplayName, UpVotes FROM Users WHERE Reputation > 101 AND UpVotes > 0 AND DownVotes = 0 ORDER BY UpVotes DESC LIMIT 10 | sede |
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... | Questions with most close/reopen cycles. | SELECT p.Id AS "post_link", MAX(p.ClosedDate) AS CurrentCloseDate, COUNT(*) AS ClosePlusReopenCount FROM Posts AS p INNER JOIN PostHistory AS h ON p.Id = h.PostId WHERE h.PostHistoryTypeId = 10 OR h.PostHistoryTypeId = 11 GROUP BY p.Id ORDER BY ClosePlusReopenCount DESC LIMIT 50 | sede |
CREATE TABLE table_name_68 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
) | What's the average Grid for those who spun off after Lap 64? | SELECT AVG(grid) FROM table_name_68 WHERE time_retired = "spun off" AND laps > 64 | sql_create_context |
CREATE TABLE table_34221 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
) | What player has 14 wins? | SELECT "Player" FROM table_34221 WHERE "Wins" = '14' | wikisql |
CREATE TABLE table_5689 (
"Game #" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
) | What Date has Points smaller than 80, Home of Los Angeles, and a Visitor of Pittsburgh? | SELECT "Date" FROM table_5689 WHERE "Points" < '80' AND "Home" = 'los angeles' AND "Visitor" = 'pittsburgh' | wikisql |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | Show the position of players and the corresponding number of players Visualize by bar chart, and could you show in ascending by the Y please? | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
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 i... | show me the flights from BALTIMORE to DALLAS | 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 = 'DALL... | atis |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | what procedure did patient 025-13899 receive the last time this year. | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-13899')) AND DATETIME(treatment.treatmenttime, 'start of year... | eicu |
CREATE TABLE table_10258 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | What is the highest average number in attendance when the most in attendance is 5,078? | SELECT MAX("Average") FROM table_10258 WHERE "Highest" = '5,078' | wikisql |
CREATE TABLE table_68561 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What date was 53-75 recorded? | SELECT "Date" FROM table_68561 WHERE "Record" = '53-75' | wikisql |
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
)
... | what is the average monthly number of patients who have had mediastinal tumor since 2104? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'mediastinal tumor' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_35582 (
"Year" text,
"Seats in House" real,
"Liberal candidates" real,
"Seats won" real,
"Seat Change" text,
"Popular vote" real,
"% of popular vote" text,
"Result" text,
"Liberal leader" text
) | Which Liberal leader has Seats won smaller than 100, and Seats in House of 215, and a % of popular vote of 43.1%? | SELECT "Liberal leader" FROM table_35582 WHERE "Seats won" < '100' AND "Seats in House" = '215' AND "% of popular vote" = '43.1%' | 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,
... | 查一下李沛文这位参保人从06.8.13起,至18.6.2止,总共在门诊开出了多少金额的手术费 | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '李沛文' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2006-08-13' AND '2018-06-02' AND t_kc22.MED_INV_IT... | css |
CREATE TABLE table_name_53 (
density__hab__km²__ VARCHAR,
population__hab_ VARCHAR
) | What is the Density (hab/ km ) when the population (hab) is 58 414*? | SELECT density__hab__km²__ FROM table_name_53 WHERE population__hab_ = "58 414*" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在哪几次医疗记录中患者34441190被开出过金额不低于8665.65元的药品?医疗就诊编号是什么啊? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '34441190' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8665.65) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '34441190' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMO... | css |
CREATE TABLE table_2383498_4 (
qld_cup_premierships VARCHAR,
home_ground VARCHAR
) | What is every entry in the QLD Cup Premierships when home ground is Dairy Farmers Stadium? | SELECT qld_cup_premierships FROM table_2383498_4 WHERE home_ground = "Dairy Farmers Stadium" | sql_create_context |
CREATE TABLE table_name_52 (
date VARCHAR,
comment VARCHAR,
duration VARCHAR
) | What is Date, when Comment is Tailcone On, Lakebed Landing, and when Duration is 5min 34 s? | SELECT date FROM table_name_52 WHERE comment = "tailcone on, lakebed landing" AND duration = "5min 34 s" | sql_create_context |
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair (
repair_I... | Give me a pie chart that group and count names of technicians with series of machines they are assigned to repair. | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name | nvbench |
CREATE TABLE table_name_13 (
league INTEGER,
club VARCHAR,
play_offs VARCHAR
) | Which of the lowest leagues had Aldershot town as a club when the play-offs number was less than 0? | SELECT MIN(league) FROM table_name_13 WHERE club = "aldershot town" AND play_offs < 0 | sql_create_context |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 05037621患者的颈部的各项指标检验结果的数据是什么样子的? | SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在05年3月16日到2014年5月31日间病患18467147主要看了什么疾病? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '18467147' AND IN_HOSP_DATE BETWEEN '2005-03-16' AND '2014-05-31' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_45 (
date VARCHAR,
home_team VARCHAR
) | On what date was Hawthorn the home team? | SELECT date FROM table_name_45 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_19533 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | What regular seasons occurred in 2011? | SELECT "Regular Season" FROM table_19533 WHERE "Year" = '2011' | wikisql |
CREATE TABLE table_44857 (
"Rank" real,
"Name" text,
"S-League" text,
"Singapore Cup" text,
"Singapore League Cup" text,
"AFC Cup" text,
"Total" text
) | What rank does the Singapore Cup of 0 (1) have? | SELECT MAX("Rank") FROM table_44857 WHERE "Singapore Cup" = '0 (1)' | 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,
... | 在2002年11月4日到2009年6月30日的这段时间里,有多少人在编号为83859的科室看病 | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSBM = '83859' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-11-04' AND '2009-06-30' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSBM = '83859' AND bdmzjzjlb.JZKSRQ BETWEEN '2002-11-04' AND '2009-06-30' | css |
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_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Are there PIBS 14 -credit courses ? | SELECT DISTINCT name, number FROM course WHERE department = 'PIBS' AND credits = 14 | advising |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | count the number of times that patient 73713 had received a vancomycin laboratory test during this hospital visit. | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'vancomycin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_name_31 (
chassis VARCHAR,
year INTEGER
) | What Chassis has a year later than 1989? | SELECT chassis FROM table_name_31 WHERE year > 1989 | sql_create_context |
CREATE TABLE table_name_95 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR,
total VARCHAR
) | What is the lowest number of bronze medals with less than 2 silver medals and more than 1 medal in total for Uzbekistan? | SELECT MIN(bronze) FROM table_name_95 WHERE silver < 2 AND total > 1 AND nation = "uzbekistan" | sql_create_context |
CREATE TABLE table_name_22 (
monounsaturated_fat VARCHAR,
saturated_fat VARCHAR
) | What is the monounsaturated fat with 15g of saturated fat? | SELECT monounsaturated_fat FROM table_name_22 WHERE saturated_fat = "15g" | sql_create_context |
CREATE TABLE table_name_71 (
week_10_nov_5 VARCHAR,
week_15__final__dec_9 VARCHAR
) | What is the week 10 result for the tean when the week 15 result is Illinois (10-1)? | SELECT week_10_nov_5 FROM table_name_71 WHERE week_15__final__dec_9 = "illinois (10-1)" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
... | Listar coment rios em ordem decrescente de votos. | SELECT PostId AS "post_link", Text, Score FROM Comments WHERE UserId = '##UserId##' AND Score >= 0 ORDER BY Score DESC | sede |
CREATE TABLE table_31811 (
"Nomination" text,
"Actor's Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | Tell me the nomination for russia and svetlana hodchenkova | SELECT "Nomination" FROM table_31811 WHERE "Country" = 'russia' AND "Actor's Name" = 'svetlana hodchenkova' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | when was first time the respiration of patient 006-202970 was less than 24.0 since 12/29/2105? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-202970')) AND vitalperiodic.respiration < 24.0 ... | eicu |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
Revision... | Posts by user 'Zeta' sorted by length. | SELECT Id AS "post_link", CreationDate, LENGTH(Body) AS "answer_length" FROM Posts WHERE OwnerUserId = @userId GROUP BY Id, PostTypeId, CreationDate, LENGTH(Body) ORDER BY 'answer_length' DESC | sede |
CREATE TABLE table_59680 (
"Abbr" text,
"Common English" text,
"French" text,
"Italian" text,
"Romansh" text
) | What is the french word for fribourg? | SELECT "French" FROM table_59680 WHERE "Common English" = 'fribourg' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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... | what are the cheapest fares for flights from NEWARK to LOS ANGELES leaving wednesday after 1500 | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, date_day AS DATE... | atis |
CREATE TABLE table_name_74 (
year INTEGER,
gold VARCHAR,
bronze VARCHAR
) | What was the first year that South Korea won gold and Malaysia won bronze? | SELECT MIN(year) FROM table_name_74 WHERE gold = "south korea" AND bronze = "malaysia" | sql_create_context |
CREATE TABLE table_name_96 (
loses VARCHAR,
position VARCHAR,
goals_conceded VARCHAR
) | What is the total number of loses of the club with a 4 position and less than 23 goals conceded? | SELECT COUNT(loses) FROM table_name_96 WHERE position = 4 AND goals_conceded < 23 | sql_create_context |
CREATE TABLE table_18433 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the party for massachusetts 3 | SELECT "Party" FROM table_18433 WHERE "District" = 'Massachusetts 3' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who did not have any job in the past, give me the comparison about the average of employee_id over the job_id , and group by attribute job_id by a bar chart, display in ascending by the X-axis. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | give the number of patients whose diagnosis short title is hx tia/stroke w/o resid and drug type is base. | 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.short_title = "Hx TIA/stroke w/o resid" AND prescriptions.drug_type = "BASE" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.