context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_1 (
born___died VARCHAR,
notable_for VARCHAR
) | The person notable for tennis died in what year? | SELECT born___died FROM table_name_1 WHERE notable_for = "tennis" | sql_create_context |
CREATE TABLE zzmzjzjlb (
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... | 看看编号为23677869063的门诊结束就诊的日期 | SELECT zzmzjzjlb.JZJSSJ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '23677869063' UNION SELECT fzzmzjzjlb.JZJSSJ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '23677869063' | css |
CREATE TABLE table_60397 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What country is Craig Parry from? | SELECT "Country" FROM table_60397 WHERE "Player" = 'craig parry' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | Select user posts with a negative score. | SELECT Id AS "post_link", Score, OwnerDisplayName FROM Posts WHERE OwnerUserId = '##UserId:int##' AND Score < 0 GROUP BY Score, Id, OwnerDisplayName ORDER BY Score | sede |
CREATE TABLE table_48836 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What is Record, when Location is 'Boston Garden', and when Date is 'Fri. Nov. 9'? | SELECT "Record" FROM table_48836 WHERE "Location" = 'boston garden' AND "Date" = 'fri. nov. 9' | wikisql |
CREATE TABLE zzmzjzjlb (
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... | 从2016年2月15日到2018年4月16日,患者15906206,685363这个指标怎么样 | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_name_96 (
series VARCHAR,
visitor VARCHAR,
date VARCHAR
) | What was the series score when st. louis was away on april 18? | SELECT series FROM table_name_96 WHERE visitor = "st. louis" AND date = "april 18" | sql_create_context |
CREATE TABLE table_7640 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text
) | Which date was the Winning Score 72-66-67-71=276? | SELECT "Date" FROM table_7640 WHERE "Winning score" = '72-66-67-71=276' | wikisql |
CREATE TABLE table_52579 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Name the surface on june 11, 1995 | SELECT "Surface" FROM table_52579 WHERE "Date" = 'june 11, 1995' | wikisql |
CREATE TABLE table_79439 (
"Class" text,
"Railway number(s)" text,
"Quantity rebuilt" real,
"Rebuildjahr(e)" text,
"Type" text
) | What was the Rebuildjahr(e) for the T2AA class? | SELECT "Rebuildjahr(e)" FROM table_79439 WHERE "Class" = 't2aa' | wikisql |
CREATE TABLE table_name_14 (
traditional_chinese VARCHAR,
standard_order VARCHAR,
simplified_chinese VARCHAR
) | What is the Traditional Chinese of which is over 9? | SELECT traditional_chinese FROM table_name_14 WHERE standard_order > 9 AND simplified_chinese = "国殇" | sql_create_context |
CREATE TABLE table_50532 (
"Year" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Venue" text
) | what is the score when the venue is athens olympic stadium on 30 april 2011? | SELECT "Score" FROM table_50532 WHERE "Venue" = 'athens olympic stadium' AND "Year" = '30 april 2011' | wikisql |
CREATE TABLE table_name_54 (
round VARCHAR,
date VARCHAR
) | what is the round on 21 february 2009? | SELECT round FROM table_name_54 WHERE date = "21 february 2009" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | calculate the three year survival probability of the patients who were prescribed metoprolol tartrate 25 mg tablet after having been diagnosed with pancreatitis - with pseudocyst formation. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE customers (
customer_id number,
customer_address_id n... | What are the first and last names for all customers? | SELECT first_name, last_name FROM customers | spider |
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,... | 列出编号16771614711的医疗就诊中,所有开出的药品里自付金额高于5485.87元的那些药品 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '16771614711' AND OVE_SELF_AMO > 5485.87 | css |
CREATE TABLE table_29302711_12 (
matches_won INTEGER,
matches_played VARCHAR
) | how many matches did the player that played 23 matches win | SELECT MIN(matches_won) FROM table_29302711_12 WHERE matches_played = 23 | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | how many days have passed since patient 012-66291 had an admission to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '012-66291' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_22 (
venue VARCHAR,
home_team VARCHAR
) | Where did Fitzroy play as the home team? | SELECT venue FROM table_name_22 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_20399 (
"Player" text,
"Matches" real,
"Overs" text,
"Maidens" real,
"Runs" real,
"Wickets" real,
"Average" text,
"Economy" text,
"5w" real,
"10w" real,
"Best Bowling" text
) | Who was the player with a bowling best of 2/43? | SELECT "Player" FROM table_20399 WHERE "Best Bowling" = '2/43' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | Which classes are the least demanding to satisfy the ULCS requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE table_54570 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL Team" text,
"College/Junior/Club Team (League)" text
) | What's the Nationality of Round 8 Vancouver Canucks NHL Team of Swift Current Broncos (WHL)? | SELECT "Nationality" FROM table_54570 WHERE "NHL Team" = 'vancouver canucks' AND "College/Junior/Club Team (League)" = 'swift current broncos (whl)' AND "Round" = '8' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | Return a bar chart about the distribution of meter_600 and ID , and display by the Y in asc. | SELECT meter_600, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_name_54 (
competition VARCHAR,
result VARCHAR,
date VARCHAR
) | Which competition did he win on August 15, 2012? | SELECT competition FROM table_name_54 WHERE result = "win" AND date = "august 15, 2012" | sql_create_context |
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 number of patients whose admission type is emergency and diagnoses long title is glucocorticoid deficiency? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Glucocorticoid deficiency" | mimicsql_data |
CREATE TABLE table_name_48 (
first_elected INTEGER,
party VARCHAR,
district VARCHAR
) | What is the highest First Elected, when Party is 'Republican', and when District is 'Louisiana 7'? | SELECT MAX(first_elected) FROM table_name_48 WHERE party = "republican" AND district = "louisiana 7" | sql_create_context |
CREATE TABLE table_66796 (
"January" text,
"February" text,
"March" text,
"April" text,
"June" text,
"July" text,
"August" text,
"September" text,
"October" text,
"November" text,
"December" text
) | Who is in February where has September is kristine hanson? | SELECT "February" FROM table_66796 WHERE "September" = 'kristine hanson' | wikisql |
CREATE TABLE table_name_43 (
points_for VARCHAR,
tries_for VARCHAR
) | How many points for did the club that had 77 tries for have ? | SELECT points_for FROM table_name_43 WHERE tries_for = "77" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | what is patient 013-11660's maximum wbc x 1000 value? | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-11660')) AND lab.labname = 'wbc x 1000' | eicu |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Average time of getting accepted answers. | WITH diffs AS (SELECT CAST(a.CreationDate - q.CreationDate AS FLOAT) AS d FROM Posts AS q JOIN Posts AS a ON a.Id = q.AcceptedAnswerId) SELECT AVG(d), STDEV(d) FROM diffs | sede |
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
)
... | when was patient 033-3009 admitted to the hospital for the first time until 2104 via the direct admit? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '033-3009' AND patient.hospitaladmitsource = 'direct admit' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_15953 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What college/junior/club teams do the players from the St. Louis Blues come from? | SELECT "College/junior/club team" FROM table_15953 WHERE "NHL team" = 'St. Louis Blues' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_... | heart rate of patient 138 has been normal? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 138)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_i... | mimic_iii |
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 ... | Is it possible for me to take the 400 -level classes , in the Fall or Winter term ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... | advising |
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
team text,
machine_series text,
value_points number,
quality_rank number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
notes text
)
CREATE TABLE repair_assignment (
techni... | Please show the team that has the most number of technicians. | SELECT team FROM technician GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_3607 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Candiates Charles Fisher (DR) 65.1% W. Jones (F) 34.9% had what result? | SELECT "Result" FROM table_3607 WHERE "Candidates" = 'Charles Fisher (DR) 65.1% W. Jones (F) 34.9%' | wikisql |
CREATE TABLE table_203_133 (
id number,
"year" number,
"japanese title" text,
"english title" text,
"role" text,
"network" text
) | what was the first english title role ? | SELECT "english title" FROM table_203_133 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_name_16 (
goals VARCHAR,
venue VARCHAR
) | What were the goals at Sydney? | SELECT goals FROM table_name_16 WHERE venue = "sydney" | sql_create_context |
CREATE TABLE table_name_42 (
wins INTEGER,
years VARCHAR,
games VARCHAR
) | What was the average of games that were one in 1978 that were smaller than 141? | SELECT AVG(wins) FROM table_name_42 WHERE years = "1978" AND games < 141 | sql_create_context |
CREATE TABLE table_26485957_1 (
judging_panel_points INTEGER
) | What is the minimum score given in judging panel points? | SELECT MIN(judging_panel_points) FROM table_26485957_1 | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_co... | airline that stands for DL | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL' | atis |
CREATE TABLE table_name_53 (
english VARCHAR,
german VARCHAR
) | What's the English word for apfel? | SELECT english FROM table_name_53 WHERE german = "apfel" | sql_create_context |
CREATE TABLE table_41936 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the highest Points with a Lost total of 8? | SELECT MAX("Points") FROM table_41936 WHERE "Lost" = '8' | wikisql |
CREATE TABLE table_15187735_12 (
segment_b VARCHAR,
series_ep VARCHAR
) | What is Segment B for series episode 12-02? | SELECT segment_b FROM table_15187735_12 WHERE series_ep = "12-02" | sql_create_context |
CREATE TABLE table_name_48 (
to_par VARCHAR,
country VARCHAR
) | What is Australia's to par? | SELECT to_par FROM table_name_48 WHERE country = "australia" | sql_create_context |
CREATE TABLE table_24673710_1 (
winning_boat VARCHAR,
entries VARCHAR
) | When 64 is the entries what is the winning boat? | SELECT winning_boat FROM table_24673710_1 WHERE entries = 64 | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
... | what are the top three most frequent lab tests that followed within the same month for the patient who received aortocor bypas-3 cor art since 2105? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE table_name_86 (
location VARCHAR,
mascot VARCHAR
) | What school has the Lancers as their mascot? | SELECT location FROM table_name_86 WHERE mascot = "lancers" | sql_create_context |
CREATE TABLE table_69137 (
"Representative" text,
"Years" text,
"State" text,
"Party" text,
"Lifespan" text
) | Which Representative was from Kentucky during the years of 1855 1859? | SELECT "Representative" FROM table_69137 WHERE "State" = 'kentucky' AND "Years" = '1855–1859' | wikisql |
CREATE TABLE Products (
product_id INTEGER,
product_category VARCHAR(15),
product_name VARCHAR(80)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
premise_id INTEGER,
date_address_from DATETIME,
address_type_code VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Premises (
... | Draw a pie chart with all distinct product categories along with the number of mailshots in each category. | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category | nvbench |
CREATE TABLE table_63982 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | what is the competition when the result is won and the score is 8-0? | SELECT "Competition" FROM table_63982 WHERE "Result" = 'won' AND "Score" = '8-0' | wikisql |
CREATE TABLE table_15700367_6 (
wickets INTEGER,
name VARCHAR
) | What is the lowest number of wickets for farveez maharoof? | SELECT MIN(wickets) FROM table_15700367_6 WHERE name = "Farveez Maharoof" | sql_create_context |
CREATE TABLE table_78433 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps did Ricardo Zonta have? | SELECT SUM("Laps") FROM table_78433 WHERE "Driver" = 'ricardo zonta' | wikisql |
CREATE TABLE table_202_80 (
id number,
"name" text,
"metres" number,
"feet" number
) | how much higher , in feet , is marmolada than vernel ? | SELECT (SELECT "feet" FROM table_202_80 WHERE "name" = 'marmolada') - (SELECT "feet" FROM table_202_80 WHERE "name" = 'vernel') | squall |
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | Show different parties of people along with the number of people in each party with a bar chart, and could you display by the y-axis in ascending? | SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_73816 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What type of settlement is rabe? | SELECT "Type" FROM table_73816 WHERE "Settlement" = 'Rabe' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | All questions closed as 'not constructive'. | SELECT p.Id AS "post_link", p.CreationDate, ph.CreationDate AS ClosureDate, p.Score, p.ViewCount FROM Posts AS p LEFT JOIN PostHistory AS ph ON ph.PostId = p.Id LEFT JOIN PostHistoryTypes AS pht ON ph.PostHistoryTypeId = pht.Id WHERE ph.PostHistoryTypeId = 10 AND ph.Comment = (SELECT Id FROM CloseReasonTypes WHERE Name... | sede |
CREATE TABLE table_25889 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What is the score in game 3? | SELECT "Score" FROM table_25889 WHERE "Game" = '3' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | mention the diagnosis icd9 code and the age of patient with patient id 42067. | SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067" | mimicsql_data |
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... | Number of valuable PTIJ posts per year. | SELECT TIME_TO_STR(p.CreationDate, '%y') AS year, p.Id, p.Score, p_a.AnswerCount FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id AND t.TagName = 'purim-torah-in-jest' INNER JOIN (SELECT ParentId, COUNT(p.Id) AS answercount FROM Posts AS p INNER JOIN PostTags AS pt O... | sede |
CREATE TABLE table_27484208_1 (
world_rank_by_arwu_ VARCHAR,
_2013 VARCHAR,
members VARCHAR
) | What was the world rank by ARWU in 2013 of the University of T bingen? | SELECT world_rank_by_arwu_, _2013 FROM table_27484208_1 WHERE members = "University of Tübingen" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is age and days of hospital stay of subject name gus marques? | SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.name = "Gus Marques" | mimicsql_data |
CREATE TABLE table_name_52 (
year VARCHAR,
laps INTEGER
) | What year had the largest number of laps over 196? | SELECT year FROM table_name_52 WHERE laps > 196 | sql_create_context |
CREATE TABLE table_36399 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | What is the class of the Budweiser Grand Prix of Miami race with a length of 3 hours? | SELECT "Class" FROM table_36399 WHERE "Race" = 'budweiser grand prix of miami' AND "Length" = '3 hours' | wikisql |
CREATE TABLE table_name_90 (
poles VARCHAR,
season VARCHAR,
points VARCHAR
) | Which pole has a Season of 2009 and points of test driver? | SELECT poles FROM table_name_90 WHERE season = 2009 AND points = "test driver" | sql_create_context |
CREATE TABLE table_name_64 (
d_49 VARCHAR,
d_46 VARCHAR
) | Tell me the D 49 and D 46 of r 13 | SELECT d_49 FROM table_name_64 WHERE d_46 = "r 13" | sql_create_context |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCH... | What are the first names of all students in Smith Hall, and count them by a bar chart, and rank how many fname in asc order please. | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) | nvbench |
CREATE TABLE table_name_50 (
athlete VARCHAR,
notes VARCHAR,
country VARCHAR
) | Who was the athlete from egypt with q in the notes? | SELECT athlete FROM table_name_50 WHERE notes = "q" AND country = "egypt" | sql_create_context |
CREATE TABLE table_name_37 (
year INTEGER,
time VARCHAR
) | What is the most recent year with a time of 10.56? | SELECT MAX(year) FROM table_name_37 WHERE time = 10.56 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | what is the total amount of furosemide that has been prescribed to patient 72909 this month? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72909) AND prescriptions.drug = 'furosemide' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | mimic_iii |
CREATE TABLE table_name_7 (
march INTEGER,
record VARCHAR
) | What's the smallest March when the record is 22-12-6? | SELECT MIN(march) FROM table_name_7 WHERE record = "22-12-6" | sql_create_context |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose admission year is less than 2131 and lab test name is albumin/creatinine, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2131" AND lab.label = "Albumin/Creatinine, Urine" | mimicsql_data |
CREATE TABLE table_name_20 (
couple VARCHAR,
number_of_dances VARCHAR,
total VARCHAR,
rank_by_average VARCHAR,
average VARCHAR
) | Which Couple has a Rank by average larger than 3, and an Average larger than 16.5, and a Total smaller than 195, and a Number of dances larger than 3? | SELECT couple FROM table_name_20 WHERE rank_by_average > 3 AND average > 16.5 AND total < 195 AND number_of_dances > 3 | sql_create_context |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is primary disease and admission time of subject id 4589? | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "4589" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose diagnoses long title is obstructive chronic bronchitis with acute bronchitis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Obstructive chronic bronchitis with acute bronchitis" | mimicsql_data |
CREATE TABLE table_33215 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team's score when footscray is the away team? | SELECT "Away team score" FROM table_33215 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE table_34666 (
"Date" text,
"Track" text,
"Race" text,
"Purse Hi" text,
"Finish" text,
"Time" text,
"Last 1/4" real,
"Odds" text,
"Driver" text
) | What is the lowest last quarter with a time of 1:53.2 and odds of *1.30? | SELECT MIN("Last 1/4") FROM table_34666 WHERE "Time" = '1:53.2' AND "Odds" = '*1.30' | wikisql |
CREATE TABLE table_12434380_1 (
mascot VARCHAR,
institution VARCHAR
) | What is the mascot for the instition of Kansas city Kansas community college? | SELECT mascot FROM table_12434380_1 WHERE institution = "Kansas City Kansas Community College" | sql_create_context |
CREATE TABLE table_name_52 (
track_number INTEGER,
time VARCHAR,
title VARCHAR
) | What is the average track number 3:25 long and a title of Great Getting up Mornin'? | SELECT AVG(track_number) FROM table_name_52 WHERE time = "3:25" AND title = "great getting up mornin'" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | how many patients whose marital status is widowed and drug route is both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_24069 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Sun Devils points" real,
"Opponents" real,
"Record" text
) | What was the numer of the game when the record was 4-0? | SELECT MAX("Game") FROM table_24069 WHERE "Record" = '4-0' | wikisql |
CREATE TABLE table_name_92 (
country VARCHAR,
to_par VARCHAR,
player VARCHAR
) | Which country is Jay Haas from when he had a to par of E? | SELECT country FROM table_name_92 WHERE to_par = "e" AND player = "jay haas" | sql_create_context |
CREATE TABLE Student (
Fname VARCHAR,
Lname VARCHAR,
Age VARCHAR,
Major VARCHAR
) | Which student's age is older than 18 and is majoring in 600? List each student's first and last name. | SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600 | sql_create_context |
CREATE TABLE table_name_13 (
away_team VARCHAR,
home_team VARCHAR
) | Who is the away team that goes against Team Zambia? | SELECT away_team FROM table_name_13 WHERE home_team = "zambia" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose admission location is emergency room admit and item id is 50902? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.itemid = "50902" | mimicsql_data |
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... | 患者钱婉秀主要是看什么病,从04年10月24日到2013年8月30日这几年? | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '钱婉秀' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-10-24' AND '2013-08-30' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_18077713_1 (
year_to_april VARCHAR,
earnings_per_share__¢_ VARCHAR
) | When the earning per share is listed as 22.0 what is the year to april? | SELECT COUNT(year_to_april) FROM table_18077713_1 WHERE earnings_per_share__¢_ = "22.0" | sql_create_context |
CREATE TABLE table_name_55 (
order INTEGER,
weeks VARCHAR,
majors VARCHAR
) | What was the highest order amount in weeks prier to 15 and a major less than 1? | SELECT MAX(order) FROM table_name_55 WHERE weeks < 15 AND majors < 1 | sql_create_context |
CREATE TABLE table_204_785 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what was the average number of gold medals received by a nation ? | SELECT AVG("gold") FROM table_204_785 | 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... | Find Team_Name and Team_ID , and visualize them by a bar chart, and display X-axis in asc order. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text... | Return a histogram on what is the average high temperature for each day of week?, display in asc by the total number. | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) | nvbench |
CREATE TABLE table_30391 (
"Position" real,
"Club" text,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"Pts For" real,
"Pts Agst" real,
"Points" real,
"Percent" text
) | How many points does the club that had 45 points against it have? | SELECT "Points" FROM table_30391 WHERE "Pts Agst" = '45' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | indicate the daily minimum amount of respiration for patient 025-56111 on the last icu visit. | SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-56111') AND NOT patient.unitdischargetime IS N... | eicu |
CREATE TABLE table_390 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Musical guest and song" text,
"Original air date" text,
"Production code" real
) | Who were the writers for series number 20? | SELECT "Written by" FROM table_390 WHERE "Series #" = '20' | wikisql |
CREATE TABLE table_name_88 (
weight VARCHAR,
denomination VARCHAR
) | What weight has one rupee as the denomination? | SELECT weight FROM table_name_88 WHERE denomination = "one rupee" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code te... | how many patients had metoclopramide prescriptions within 2 months after being diagnosed with acute rheumatic endocard, this year? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acute rheumatic en... | mimic_iii |
CREATE TABLE table_66652 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What was the total for united states player phil mickelson? | SELECT MIN("Total") FROM table_66652 WHERE "Country" = 'united states' AND "Player" = 'phil mickelson' | wikisql |
CREATE TABLE table_name_81 (
time VARCHAR,
score VARCHAR
) | What is the Time with a Score that is 65-19? | SELECT time FROM table_name_81 WHERE score = "65-19" | sql_create_context |
CREATE TABLE table_name_88 (
player VARCHAR,
country VARCHAR
) | Which player is from Australia? | SELECT player FROM table_name_88 WHERE country = "australia" | sql_create_context |
CREATE TABLE table_50714 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | What is the total number of Round, when College is Northern Illinois? | SELECT COUNT("Round") FROM table_50714 WHERE "College" = 'northern illinois' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.