context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Top X users with most answers on hot network questions. | SELECT COUNT(DISTINCT a.Id) AS Count, a.OwnerUserId AS "user_link", a.OwnerDisplayName FROM (Posts AS q JOIN PostHistory AS ph ON q.Id = ph.PostId) JOIN Posts AS a ON q.Id = a.ParentId WHERE (ph.PostHistoryTypeId = 52) GROUP BY a.OwnerUserId, a.OwnerDisplayName ORDER BY COUNT(DISTINCT a.Id) DESC LIMIT 100 | sede |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Find meter_600 and ID , and visualize them by a bar chart, rank by the x axis from high to low. | SELECT meter_600, ID FROM swimmer ORDER BY meter_600 DESC | nvbench |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | Finding basic thank you comments (fewer than 50 characters). | SELECT c.Id AS "comment_link", c.Text AS "comment_body", (SELECT COUNT(c.Id) AS "comment_link" FROM Comments AS c WHERE (c.Text LIKE '%fack%' OR c.Text LIKE '%fck%') AND LENGTH(c.Text) < 50) AS "total_comments" FROM Comments AS c WHERE (c.Text LIKE '%fu%' OR c.Text LIKE '%fuu%') AND LENGTH(c.Text) < 50 ORDER BY c.Creat... | sede |
CREATE TABLE table_56278 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date did the home team score 5.15 (45)? | SELECT "Date" FROM table_56278 WHERE "Home team score" = '5.15 (45)' | wikisql |
CREATE TABLE table_name_73 (
loss VARCHAR,
record VARCHAR
) | What loss has 4-2 as the record? | SELECT loss FROM table_name_73 WHERE record = "4-2" | sql_create_context |
CREATE TABLE table_16089 (
"Character" text,
"Australia & New Zealand (Sydney - first run, Melbourne, Auckland)" text,
"London" text,
"Toronto / Broadway" text,
"Brazil" text,
"UK Tour" text,
"US Tour" text,
"Italy (Milan, Rome, Trieste)" text
) | Which person is in the tronto/broadway and has a uk tour of n/a | SELECT "Toronto / Broadway" FROM table_16089 WHERE "UK Tour" = 'n/a' | wikisql |
CREATE TABLE table_73826 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What town has the population of 777? | SELECT "Cyrillic Name Other Names" FROM table_73826 WHERE "Population (2011)" = '777' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | what was patient 021-155303 diagnosed with the first time until 2102? | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-155303')) AND STRFTIME('%y', diagnosis.diagnosistime) <= '210... | eicu |
CREATE TABLE table_19733 (
"Name" text,
"Years" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Europe" real,
"Other a" real,
"Total" text
) | How many different Leagues are associated with Billy Meredith Category:Articles with hCards? | SELECT COUNT("League") FROM table_19733 WHERE "Name" = 'Billy Meredith Category:Articles with hCards' | wikisql |
CREATE TABLE table_71409 (
"As of September 1, 2012" text,
"vs. Protoss" text,
"vs. Terran" text,
"vs. Zerg" text,
"vs. all" text
) | What occurrs as of September 1, 2012 when the value for vs. all is 65.47%? | SELECT "As of September 1, 2012" FROM table_71409 WHERE "vs. all" = '65.47%' | wikisql |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | has patient 9474 been diagnosed with any since 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9474) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | Show the number of the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks', I want to sort x axis from high to low order please. | SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY Nominee DESC | nvbench |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | 列举出从2000年6月13日到2019年11月17日这段时间,编号为64770032的病患所有检验报告单中的标本采集部位? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD... | css |
CREATE TABLE table_name_72 (
college VARCHAR,
round INTEGER
) | The draft pick that was taken before round 4 went to what college? | SELECT college FROM table_name_72 WHERE round < 4 | sql_create_context |
CREATE TABLE table_203_622 (
id number,
"date" text,
"team" text,
"name" text,
"position" text,
"years in nba" number,
"notes" text
) | what is the difference between the player with the most experience and the least amount of experience ? | SELECT MAX("years in nba") - MIN("years in nba") FROM table_203_622 | squall |
CREATE TABLE table_name_85 (
competition VARCHAR,
assist_pass VARCHAR,
result VARCHAR,
location VARCHAR
) | Which competition has a result of 2-0 in Ferreiras with an assist/pass by Casey Nogueira? | SELECT competition FROM table_name_85 WHERE result = "2-0" AND location = "ferreiras" AND assist_pass = "casey nogueira" | sql_create_context |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | Pie chart about how many eliminations did each team have? | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | how far is it from MCO airport to ORLANDO | SELECT DISTINCT airport_service.miles_distant FROM airport, airport_service, city WHERE airport.airport_code = 'MCO' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ORLANDO' | atis |
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,
... | 韩嘉容这个患者在之前有过哪些门诊诊断记录 | SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '韩嘉容' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM person_info JO... | css |
CREATE TABLE table_4548 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance when Hawthorn played as home team? | SELECT SUM("Crowd") FROM table_4548 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_53510 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | What time was the kickoff on September 15, 1985? | SELECT "Kickoff [a ]" FROM table_53510 WHERE "Date" = 'september 15, 1985' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeou... | how much is patient 030-16826's total hospital bill during their stay until 2104? | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-16826') AND STRFTIME('%y', cost.chargetime) <= '2104' | eicu |
CREATE TABLE table_name_18 (
manufacturer VARCHAR,
laps VARCHAR
) | Which manufacturer has 8 laps? | SELECT manufacturer FROM table_name_18 WHERE laps = "8" | sql_create_context |
CREATE TABLE table_name_27 (
circuit VARCHAR,
race VARCHAR
) | What is the circuit for the ADAC gro er preis der tourenwagen race? | SELECT circuit FROM table_name_27 WHERE race = "adac großer preis der tourenwagen" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | select by tag protected sorted. | SELECT COUNT(Posts.Id) FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId JOIN Posts ON PostTags.PostId = Posts.Id JOIN PostHistory ON PostHistory.PostId = Posts.Id WHERE TagName = 'java' AND PostHistoryTypeId = 19 | sede |
CREATE TABLE table_29202276_2 (
route_via VARCHAR,
train_name VARCHAR
) | What is the route/via when the train name is Parasuram Express? | SELECT route_via FROM table_29202276_2 WHERE train_name = "Parasuram Express" | sql_create_context |
CREATE TABLE table_name_42 (
player VARCHAR,
average VARCHAR,
goals VARCHAR,
caps VARCHAR
) | Who scored more than 8 goals, had more than 75 caps, and averaged 0.432? | SELECT player FROM table_name_42 WHERE goals > 8 AND caps > 75 AND average = 0.432 | sql_create_context |
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... | how much is the maximum hospital bill that involves a acetaminophen lab test until 1 year ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'acetaminophen')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_T... | eicu |
CREATE TABLE table_25174 (
"Version" text,
"Release date" text,
"Distribution mechanism" text,
"Features" text,
"Security issues" text
) | If the distribution mechanism is the Microsoft website and the security issues id 98-004, what are all of the features? | SELECT "Features" FROM table_25174 WHERE "Security issues" = '98-004' AND "Distribution mechanism" = 'Microsoft website' | wikisql |
CREATE TABLE table_1004 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many points where scored by the right end? | SELECT COUNT("Points") FROM table_1004 WHERE "Position" = 'Right end' | wikisql |
CREATE TABLE table_74900 (
"Round" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning team" text
) | Who is the Winning Driver that has a Winning team of Engstler Motorsport Engstler Motorsport and also the Date 22 July? | SELECT "Winning driver" FROM table_74900 WHERE "Winning team" = 'engstler motorsport engstler motorsport' AND "Date" = '22 july' | wikisql |
CREATE TABLE table_7308 (
"Ballarat FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the largest byes with lost games of 4 and Ballarat FL of Melton and the against less than 1819? | SELECT MAX("Byes") FROM table_7308 WHERE "Losses" = '4' AND "Ballarat FL" = 'melton' AND "Against" < '1819' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid ... | Draw a bar chart for what is the average age for each city and what are those cities?, and display in desc by the x axis. | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | which type of drug is patient with patient id 3343 taking? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.subject_id = "3343" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | Compare the total number of different job titles for all those jobs in department 80 using a bar chart, order by the JOB_TITLE in ascending. | SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE ORDER BY JOB_TITLE | nvbench |
CREATE TABLE table_46623 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What are the years when the grizzles had a player who attended UCLA? | SELECT "Years for Grizzlies" FROM table_46623 WHERE "School/Club Team" = 'ucla' | wikisql |
CREATE TABLE table_3433 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Airdate" text
) | How many people directed the episode that aired on February 5, 1968? | SELECT COUNT("Director") FROM table_3433 WHERE "Airdate" = 'February 5, 1968' | wikisql |
CREATE TABLE table_name_44 (
home_team VARCHAR,
crowd INTEGER
) | When the Crowd was larger than 25,000. what was the Home Team score? | SELECT home_team AS score FROM table_name_44 WHERE crowd > 25 OFFSET 000 | sql_create_context |
CREATE TABLE table_76728 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
) | What was the box score during a home game of the Adelaide 36ers? | SELECT "Box Score" FROM table_76728 WHERE "Home team" = 'adelaide 36ers' | wikisql |
CREATE TABLE table_10652 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Who was the home team on 1 April 2008? | SELECT "Home" FROM table_10652 WHERE "Date" = '1 april 2008' | wikisql |
CREATE TABLE table_name_36 (
name VARCHAR,
overall VARCHAR
) | Who had the overall pick of 72? | SELECT name FROM table_name_36 WHERE overall = 72 | sql_create_context |
CREATE TABLE table_name_30 (
january VARCHAR,
opponent VARCHAR
) | What is the number in January for Philadelphia Flyers as opponents? | SELECT COUNT(january) FROM table_name_30 WHERE opponent = "philadelphia flyers" | sql_create_context |
CREATE TABLE table_27112708_2 (
stage VARCHAR,
team_classification VARCHAR
) | Who was the stage winner of the letua cycling team on stage 2? | SELECT stage AS winner FROM table_27112708_2 WHERE team_classification = "LeTua Cycling Team" AND stage = 2 | sql_create_context |
CREATE TABLE table_25990 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | How many games did janae stokes play? | SELECT MAX("Games Played") FROM table_25990 WHERE "Player" = 'Janae Stokes' | wikisql |
CREATE TABLE table_name_93 (
to_par VARCHAR,
player VARCHAR
) | what is the to par for retief goosen? | SELECT to_par FROM table_name_93 WHERE player = "retief goosen" | sql_create_context |
CREATE TABLE table_25547 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Margin of victory" text,
"Tournament location" text,
"Purse ( $ )" real,
"Winners share ($)" real
) | How many different countries did the champion Se Ri Pak (2) represent? | SELECT COUNT("Country") FROM table_25547 WHERE "Champion" = 'Se Ri Pak (2)' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | Which high level courses can I take without having taken 516 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... | advising |
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... | 在名叫韩雅柔的患者治病期间有多些花费的总医疗费比2215.89元少的记录,在入院时经过诊断出的病都叫啥名?是啥编号 | SELECT t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '韩雅柔' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 2215.89) | css |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | what was the name of the drug patient 66015 was prescribed with in the same hospital encounter after having received a closed bronchial biopsy procedure the previous month? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | mimic_iii |
CREATE TABLE table_203_348 (
id number,
"number" number,
"name" text,
"team" text,
"position" text,
"years with franchise" text,
"note" text
) | who is the only person with a retired jersey from the minnesota timberwolves ? | SELECT "name" FROM table_203_348 WHERE "team" = 'minnesota timberwolves' | squall |
CREATE TABLE table_name_60 (
lyrics__l____music__m_ VARCHAR,
draw VARCHAR
) | What are the Lyrics (l) / Music (m) when the draw was 5? | SELECT lyrics__l____music__m_ FROM table_name_60 WHERE draw = 5 | sql_create_context |
CREATE TABLE table_14346353_1 (
title VARCHAR,
series__number VARCHAR
) | What is the title of series #1? | SELECT title FROM table_14346353_1 WHERE series__number = 1 | sql_create_context |
CREATE TABLE table_name_66 (
in_de_creased_by INTEGER,
governorate VARCHAR,
seats_2005 VARCHAR
) | Name the average In/de-creased by which has a Governorate of al anbar governorate, and Seats 2005 smaller than 9? | SELECT AVG(in_de_creased_by) FROM table_name_66 WHERE governorate = "al anbar governorate" AND seats_2005 < 9 | sql_create_context |
CREATE TABLE table_name_76 (
bronze INTEGER,
silver VARCHAR,
total VARCHAR
) | What is the average bronze with silvers of 1 and totals over 2? | SELECT AVG(bronze) FROM table_name_76 WHERE silver = "1" AND total > 2 | sql_create_context |
CREATE TABLE table_name_54 (
affiliation VARCHAR,
enrollment INTEGER
) | Which Affiliation has an Enrollement larger than 502? | SELECT affiliation FROM table_name_54 WHERE enrollment > 502 | sql_create_context |
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,
... | Top 20 users called Tunaki. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(DisplayName) LIKE '%skeet%' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_name_38 (
total_foreign_born__millions_ INTEGER,
born_in_a_non_eu_state__millions_ VARCHAR
) | What was the lowest number of Total Foreign-born (millions) people, when the number of people Born in a non EU state (millions) was 6.415? | SELECT MIN(total_foreign_born__millions_) FROM table_name_38 WHERE born_in_a_non_eu_state__millions_ = 6.415 | sql_create_context |
CREATE TABLE table_2508633_5 (
player VARCHAR,
nfl_team VARCHAR
) | Which player did the green bay packers pick? | SELECT player FROM table_2508633_5 WHERE nfl_team = "Green Bay Packers" | sql_create_context |
CREATE TABLE appointment (
appointmentid number,
patient number,
prepnurse number,
physician number,
start time,
end time,
examinationroom text
)
CREATE TABLE physician (
employeeid number,
name text,
position text,
ssn number
)
CREATE TABLE procedures (
code number,
... | Find the physicians who are trained in a procedure that costs more than 5000. | SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000 | spider |
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREATE TABLE movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_worldwide int
)
CREAT... | Show the total number from each category | SELECT Category, COUNT(*) FROM book_club GROUP BY Category | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | how many patients of black/african american ethnicity were diagnosed with icd9 code 34982? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.icd9_code = "34982" | mimicsql_data |
CREATE TABLE table_77616 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | Name the FCC info for call sign of w279at | SELECT "FCC info" FROM table_77616 WHERE "Call sign" = 'w279at' | 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,
... | 从一一年九月七日到一八年七月十七日,医疗机构6788679给患者51816664做过多少次检查 | SELECT COUNT(*) 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_ID = '51816664' AND t_kc22.STA_DATE BETWEEN '2011-09-07' AND '2018-07-17' AND t_kc21.MED_SER_ORG_NO = '6788679' AND t_kc22.MED_INV... | css |
CREATE TABLE table_32546 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | Which state is University of Tennessee based in? | SELECT "State" FROM table_32546 WHERE "Host" = 'university of tennessee' | wikisql |
CREATE TABLE table_name_33 (
departure VARCHAR,
station_code VARCHAR
) | What is listede for Departure that also has a Station Code of CLT? | SELECT departure FROM table_name_33 WHERE station_code = "clt" | sql_create_context |
CREATE TABLE table_63254 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What's the record on April 12 when the location was The Omni? | SELECT "Record" FROM table_63254 WHERE "Location/Attendance" = 'the omni' AND "Date" = 'april 12' | wikisql |
CREATE TABLE table_name_76 (
constructor VARCHAR,
rider VARCHAR
) | Who was Constructor for rider Marco Melandri? | SELECT constructor FROM table_name_76 WHERE rider = "marco melandri" | sql_create_context |
CREATE TABLE table_20667854_1 (
bse_code VARCHAR,
free_float VARCHAR
) | What is every BSE code for a free float of 0.2726? | SELECT bse_code FROM table_20667854_1 WHERE free_float = "0.2726" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | Percentage of closed posts with close reason off-topic. | SELECT COUNT(*) AS "r1" FROM Posts AS q WHERE q.PostTypeId = 1 | sede |
CREATE TABLE table_65436 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | what is the least silver when gold is 0? | SELECT MIN("Silver") FROM table_65436 WHERE "Gold" < '0' | wikisql |
CREATE TABLE table_62418 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"Team from" text,
"League from" text
) | Which Player has a Position of rw, and a League from of western hockey league? | SELECT "Player" FROM table_62418 WHERE "Position" = 'rw' AND "League from" = 'western hockey league' | wikisql |
CREATE TABLE table_24083 (
"Medal of Honor" text,
"Coast Guard Cross" text,
"Navy Cross" text,
"Distinguished Service Cross" text,
"Air Force Cross" text,
"Homeland Security Distinguished Service Medal" text
) | What is the air force cross when you recieve the Aerial achievement medal? | SELECT "Air Force Cross" FROM table_24083 WHERE "Homeland Security Distinguished Service Medal" = 'Aerial Achievement Medal' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is the number of patients whose procedure icd9 code is 9229? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "9229" | mimicsql_data |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | 患者姜依云为疾病Q41.778,门诊诊断的检测指标024672的结果定量及其单位分别是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J... | css |
CREATE TABLE table_name_54 (
class VARCHAR,
erp_w INTEGER
) | what is the class of the station with erp w more than 30? | SELECT class FROM table_name_54 WHERE erp_w > 30 | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在08年7月28日到10年3月17日期间,陈浩淼这位患者找了多少医生看病 | SELECT COUNT(mzjzjlb.ZZYSGH) 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.YLJ... | css |
CREATE TABLE table_204_627 (
id number,
"date" text,
"opponent" text,
"score" text,
"top scorer (total points)" text,
"venue (location)" text
) | how many total points did askia jones score at the araneta coliseum ? | SELECT SUM("top scorer (total points)") FROM table_204_627 WHERE "top scorer (total points)" = 'askia jones' AND "venue (location)" = 'araneta coliseum' | squall |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 从13年5月29号到19年9月12日,患者17750351的检测指标939792情况如何? | SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_26565936_2 (
no_in_season INTEGER,
directed_by VARCHAR
) | What was the first episode in the season directed by nelson mccormick? | SELECT MIN(no_in_season) FROM table_26565936_2 WHERE directed_by = "Nelson McCormick" | sql_create_context |
CREATE TABLE table_name_65 (
purpose VARCHAR,
frequency VARCHAR
) | What is the purpose for Frequency of 102.3? | SELECT purpose FROM table_name_65 WHERE frequency = "102.3" | sql_create_context |
CREATE TABLE table_name_99 (
musical_guest_song_performed VARCHAR,
pilot VARCHAR
) | What is the Musical Guest/Song with a pilot of 3? | SELECT musical_guest_song_performed FROM table_name_99 WHERE pilot = "3" | 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... | what is the number of patients whose year of death is less than or equal to 2115 and item id is 50824? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2115.0" AND lab.itemid = "50824" | mimicsql_data |
CREATE TABLE table_36360 (
"Virtue" text,
"Latin" text,
"Gloss" text,
"(Vice)" text,
"(Latin)" text
) | Which virtue is Invidia(Latin)? | SELECT "Virtue" FROM table_36360 WHERE "(Latin)" = 'invidia' | wikisql |
CREATE TABLE table_22706 (
"Producer" text,
"Product" text,
"Samples taken" real,
"Samples failed" real,
"Melamine content(mg/kg)" text
) | Who is the producer of ? | SELECT "Producer" FROM table_22706 WHERE "Product" = '金必氏牌嬰幼兒配方乳粉' | wikisql |
CREATE TABLE table_name_97 (
pick INTEGER,
position VARCHAR,
round VARCHAR
) | What is the pick number for the player playing tackle position, and a round less than 15? | SELECT SUM(pick) FROM table_name_97 WHERE position = "tackle" AND round < 15 | sql_create_context |
CREATE TABLE table_20354_7 (
malayalam_name VARCHAR,
zodiac_sign VARCHAR
) | Name the malayalam name for leo | SELECT malayalam_name FROM table_20354_7 WHERE zodiac_sign = "Leo" | 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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '超敏甲状... | css |
CREATE TABLE table_37233 (
"District" text,
"Counties Represented" text,
"Delegate" text,
"Party" text,
"First Elected" real,
"Committee" text
) | What party is the delegate of Turner, Frank S. Frank S. Turner of Howard County? | SELECT "Party" FROM table_37233 WHERE "Counties Represented" = 'howard' AND "Delegate" = 'turner, frank s. frank s. turner' | wikisql |
CREATE TABLE table_20710 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production Code" real
) | Who wrote the episode for s02 e07? | SELECT "Written by" FROM table_20710 WHERE "Broadcast Order" = 'S02 E07' | wikisql |
CREATE TABLE table_20834 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" text
) | What is the fewest number of losses? | SELECT MIN("L") FROM table_20834 | wikisql |
CREATE TABLE gwyjzb (
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,
... | 都有什么编号的医疗记录中显示名叫水高超的患者被开出了价格都不小于8518.36元的药物? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '水高超' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 8518.36) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '水高超' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FRO... | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diag... | what was the last time patient 010-6010 was prescribed medicine? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-6010')) ORDER BY medication.drugstarttime DESC LIMIT 1 | eicu |
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 demographic ... | Get me the number of unmarried patients who had tonsil and adenoid biopsy. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "Tonsil&adenoid biopsy" | mimicsql_data |
CREATE TABLE table_17381 (
"Season" text,
"Cup FinalDate" text,
"WinningTeam" text,
"Score" text,
"LosingTeam" text,
"Location" text,
"Cup Final Attendance" real
) | How many seasons was the losing team Adelaide City? | SELECT COUNT("Season") FROM table_17381 WHERE "LosingTeam" = 'Adelaide City' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | how many patients below 76 years of age are diagnosed with transient neonatal thrombocytopenia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.long_title = "Transient neonatal thrombocytopenia" | mimicsql_data |
CREATE TABLE table_16390576_3 (
no_in_season INTEGER,
directed_by VARCHAR
) | what is the latest episode in season 2 directed by jamie babbit? | SELECT MAX(no_in_season) FROM table_16390576_3 WHERE directed_by = "Jamie Babbit" | 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... | what is the number of patients whose lab test name is bands? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Bands" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what was patient 006-172277's last output on the current intensive care unit visit? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277') AND patient.unitdischargetime IS NULL) AND inta... | eicu |
CREATE TABLE table_name_33 (
field_goals VARCHAR,
extra_points VARCHAR,
points VARCHAR,
touchdowns VARCHAR
) | How many Field goals have Points larger than 5, and Touchdowns larger than 2, and an Extra points smaller than 0? | SELECT COUNT(field_goals) FROM table_name_33 WHERE points > 5 AND touchdowns > 2 AND extra_points < 0 | sql_create_context |
CREATE TABLE gwyjzb (
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,
... | 从04年9月12日至2008年2月3日之内患者55507351被开出的所有药品的编码、名称、数量、单价、金额分别是多些啊? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '55507351' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-09-12' AND '2008-02-03' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.