context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_79 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | what's the original air date with title 'hell | SELECT "Original air date" FROM table_79 WHERE "Title" = 'Hell' | wikisql |
CREATE TABLE table_37133 (
"Games" real,
"Drawn" real,
"Lost" real,
"Goal difference" text,
"Points" real
) | Name the sum of drawn with lost more than 1 and games less than 5 | SELECT SUM("Drawn") FROM table_37133 WHERE "Lost" > '1' AND "Games" < '5' | wikisql |
CREATE TABLE table_name_45 (
pos VARCHAR,
height VARCHAR,
date_of_birth VARCHAR
) | What is Pos., when Height is 'm (ft 10in)', and when Date of Birth is '1983-05-29'? | SELECT pos FROM table_name_45 WHERE height = "m (ft 10in)" AND date_of_birth = "1983-05-29" | sql_create_context |
CREATE TABLE table_name_69 (
city VARCHAR,
first_season_of_current_spell_in_segunda_división INTEGER
) | Which city has a First season of current spell in Segunda Divisi n smaller than 2013? | SELECT city FROM table_name_69 WHERE first_season_of_current_spell_in_segunda_división < 2013 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | has neostigmine, ns, or morphine sulfate been prescribed for patient 25847 since 02/2101? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25847) AND prescriptions.drug IN ('neostigmine', 'ns', 'morphine sulfate') AND STRFTIME('%y-%m', prescriptions.startdate) >= '2101-02' | mimic_iii |
CREATE TABLE railway (
Builder VARCHAR
) | Show different builders of railways, along with the corresponding number of railways using each builder. | SELECT Builder, COUNT(*) FROM railway GROUP BY Builder | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id n... | what is the one year survival rate of patients who were prescribed with mycophenolate mofetil after the fracture of ilium-closed? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_name_82 (
losses VARCHAR,
wins INTEGER
) | What is the total number of losses for years with fewer than 9 wins? | SELECT COUNT(losses) FROM table_name_82 WHERE wins < 9 | sql_create_context |
CREATE TABLE table_15467476_2 (
points VARCHAR,
club VARCHAR
) | Name the points for pontrhydyfen rfc | SELECT points FROM table_15467476_2 WHERE club = "Pontrhydyfen RFC" | sql_create_context |
CREATE TABLE table_10412 (
"Class" text,
"Type" text,
"Quantity" real,
"Date" text,
"LNER Class" text,
"1946 LNER nos." text
) | Which class has less in quantity than 174 between the years 1921 23? | SELECT "Class" FROM table_10412 WHERE "Quantity" < '174' AND "Date" = '1921–23' | wikisql |
CREATE TABLE table_41606 (
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What is the Title written by Terri Hughes & Ron Milbauer, and an Original air date of march 6, 2001? | SELECT "Title" FROM table_41606 WHERE "Written by" = 'terri hughes & ron milbauer' AND "Original air date" = 'march 6, 2001' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
... | Comments like accepting, with keywords. | SELECT Id AS "comment_link", Score, CreationDate, LENGTH(Text) FROM Comments WHERE Text LIKE '%accepting%' AND LENGTH(Text) >= '##MinLength:int?40##' AND LENGTH(Text) < '##MaxLength:int?55##' AND (Text LIKE 'Thank%' OR Text LIKE 'Please%' OR Text LIKE '%-1%') ORDER BY Score DESC, LENGTH(Text) | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | how many days have passed since patient 022-78423's hospital admission? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '022-78423' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
Review... | Query to get all posts in 2017. | SELECT COUNT(*) FROM Posts WHERE YEAR(Posts.CreationDate) = 2017 | sede |
CREATE TABLE table_31690 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Tell me the player from dallas burn | SELECT "Player" FROM table_31690 WHERE "MLS team" = 'dallas burn' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | What question should I be upvoted on and am not?. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND AnswerCount = 1 AND Id IN (SELECT ParentId FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId##' AND Score = 0) ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_95 (
purse VARCHAR,
trainer VARCHAR
) | What is the purse when Aidan O'brien was the trainer? | SELECT purse FROM table_name_95 WHERE trainer = "aidan o'brien" | sql_create_context |
CREATE TABLE table_3069 (
"Round" real,
"Date" text,
"Country" text,
"Circuit" text,
"Sprint Winner" text,
"Main Winner" text,
"Report" text
) | Name the total number of date for 10 | SELECT COUNT("Date") FROM table_3069 WHERE "Round" = '10' | wikisql |
CREATE TABLE table_45428 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" text,
"Position" text,
"Years" text,
"From" text
) | Who is the player from Tennessee? | SELECT "Player" FROM table_45428 WHERE "From" = 'tennessee' | wikisql |
CREATE TABLE table_name_37 (
country VARCHAR,
to_par VARCHAR
) | What is Country, when To Par is '+11'? | SELECT country FROM table_name_37 WHERE to_par = "+11" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
... | 门诊诊断患者彭清婉为疾病D12.586时其甲状腺素的结果定量及其单位都是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE EMPLOYEE (
BirthDate VARCHAR,
City VARCHAR
) | What are the birth dates of employees living in Edmonton? | SELECT BirthDate FROM EMPLOYEE WHERE City = "Edmonton" | 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,
... | 列出患者69380544就诊科室名称不包含眼外伤的全部医疗在医院2426455中就诊记录都是哪些啊? | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '69380544' AND gwyjzb.MED_SER_ORG_NO = '2426455' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%眼外伤%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '69380544' AND fgwyjzb.MED_SER_ORG_NO = '2426455' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%眼外伤%' | css |
CREATE TABLE table_15792 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is the score of Tommy Bolt | SELECT MIN("Score") FROM table_15792 WHERE "Player" = 'tommy bolt' | wikisql |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
) | What is the average price across all products? | SELECT AVG(price) FROM products | spider |
CREATE TABLE table_name_64 (
performer_1 VARCHAR,
episode VARCHAR
) | Episode of 16 involves which performer 1? | SELECT performer_1 FROM table_name_64 WHERE episode = 16 | sql_create_context |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Customer_Address_History (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Addresses (
address_id INTEGER,
... | Show the proportion of the product name for each product using a pie chart | SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | when patient 22295 first got an operation? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22295) ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_70427 (
"Player" text,
"Country" text,
"Year won" real,
"Total" real,
"To par" real
) | What is the total for Bob Tway for the year won before 2002 with a to par bigger than 7? | SELECT COUNT("Total") FROM table_70427 WHERE "Year won" < '2002' AND "Player" = 'bob tway' AND "To par" > '7' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the three most common microbiological tests that patients had in the same hospital encounter after receiving a anticonvulsant - lorazepam procedure until 1 year ago? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticonvu... | eicu |
CREATE TABLE table_16397 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which players have a pick number of 27? | SELECT "Player" FROM table_16397 WHERE "Pick #" = '27' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | patient 006-47576 had received any laboratory test since 08/2102? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2102-08' | eicu |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | Users with the most self-accepts. | SELECT q.OwnerUserId AS "user_link", COUNT(*) AS "self_accepts" FROM Posts AS q INNER JOIN Posts AS a ON a.Id = q.AcceptedAnswerId WHERE q.OwnerUserId = a.OwnerUserId GROUP BY q.OwnerUserId ORDER BY 'self_accepts' DESC LIMIT 500 | sede |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | Deleted by community, undeleted by community - longest time as deleted. | WITH Raw AS (SELECT RANK() OVER (PARTITION BY PostId ORDER BY Id) AS N, PostId, PostHistoryTypeId, CreationDate, Text FROM PostHistory WHERE PostHistoryTypeId BETWEEN 12 AND 13) SELECT Del.PostId AS "post_link", 'site://posts/' + CAST(Del.PostId AS TEXT) + '/revisions|revisions' AS Revisions, 'site://posts/' + CAST(Del... | sede |
CREATE TABLE table_name_60 (
year INTEGER,
result VARCHAR
) | What is the latest year with a 34-0 result? | SELECT MAX(year) FROM table_name_60 WHERE result = "34-0" | sql_create_context |
CREATE TABLE table_21326 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | On July 8, what was the score? | SELECT "Score" FROM table_21326 WHERE "Date" = 'July 8' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 蒋荌荌患者被开出的所有检验报告单在07年5月7日到09年3月24日内的科室编码以及名称都是什么? | (SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '... | css |
CREATE TABLE table_2840500_2 (
player VARCHAR,
nhl_team VARCHAR
) | Who was drafted by the Washington Capitals? | SELECT player FROM table_2840500_2 WHERE nhl_team = "Washington Capitals" | sql_create_context |
CREATE TABLE table_21696800_1 (
_number VARCHAR,
us_viewers__million_ VARCHAR
) | What's the number of the episode seen by 2.24 million people in the US? | SELECT _number FROM table_21696800_1 WHERE us_viewers__million_ = "2.24" | sql_create_context |
CREATE TABLE table_name_43 (
head_coach VARCHAR,
town VARCHAR
) | What is the Head Coach of Novy Urengoy? | SELECT head_coach FROM table_name_43 WHERE town = "novy urengoy" | sql_create_context |
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,... | 60373690552被医疗就诊的出院日期是那一天? | SELECT OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '60373690552' | css |
CREATE TABLE table_203_637 (
id number,
"player" text,
"for" text,
"against" text,
"result" text,
"date" text
) | who does john hendrie play for ? | SELECT "for" FROM table_203_637 WHERE "player" = 'john hendrie' | squall |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
) | What are the number of the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?, and display by the X-axis in descending please. | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY Date_of_Birth DESC | nvbench |
CREATE TABLE table_18762 (
"Season" text,
"Timeslot" text,
"Season Premiere" text,
"Season Finale" text,
"Episodes" real,
"TV Season" text,
"Ranking" text,
"Viewers (in millions)" text
) | How many rankings did the 5th season have? | SELECT COUNT("Ranking") FROM table_18762 WHERE "Season" = '5th' | wikisql |
CREATE TABLE table_23186738_9 (
score VARCHAR,
team VARCHAR
) | Name the score for chicago | SELECT score FROM table_23186738_9 WHERE team = "Chicago" | sql_create_context |
CREATE TABLE table_name_59 (
leading_scorer VARCHAR,
visitor VARCHAR
) | Tell me the leading scorer for grizzlies | SELECT leading_scorer FROM table_name_59 WHERE visitor = "grizzlies" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 50 users from Turkey. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%turkey' ORDER BY Reputation DESC LIMIT 50 | sede |
CREATE TABLE table_60931 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Which tournament had a clay surface and a score of 6 1, 3 6, 6 2? | SELECT "Tournament" FROM table_60931 WHERE "Surface" = 'clay' AND "Score in the final" = '6–1, 3–6, 6–2' | wikisql |
CREATE TABLE table_20670 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" real,
"To par" text,
"Margin of victory" text,
"Tournament location" text,
"Purse ( US $ )" real,
"Winners share" text
) | Name the champion for london hunt and country club ( london , on ) | SELECT "Champion" FROM table_20670 WHERE "Tournament location" = 'London Hunt and Country Club ( London , ON )' | wikisql |
CREATE TABLE table_name_26 (
exited VARCHAR,
celebrity VARCHAR
) | What day did Alex Best exit? | SELECT exited FROM table_name_26 WHERE celebrity = "alex best" | sql_create_context |
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,
... | what are the five most frequently ordered lab tests for patients who have received cv cath plcmt w guidance previously within the same month this year? | 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 rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | List the name of rooms with king or queen bed. | SELECT roomname FROM rooms WHERE bedtype = "King" OR bedtype = "Queen" | spider |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | Questions closed as primarily opinion-based. | SELECT p.Id AS "post_link" FROM Posts AS p INNER JOIN PostHistory AS ph ON p.Id = ph.PostId WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND PostHistoryTypeId = 10 AND Comment = '105' AND AnswerCount > 0 AND Score >= '##MinScore:int##' ORDER BY p.CreationDate DESC | sede |
CREATE TABLE table_19729 (
"Name" text,
"Years" text,
"League" text,
"FA Cup" text,
"League Cup" text,
"Europe" text,
"Other a" text,
"Total" text
) | which leage had a league cup of 46 (1) | SELECT "League" FROM table_19729 WHERE "League Cup" = '46 (1)' | wikisql |
CREATE TABLE table_name_87 (
division_titles INTEGER,
playoff_appearances VARCHAR,
conference_titles VARCHAR
) | How many division titles does the team with 23 playoff appearances and more than 1 conference titles have? | SELECT SUM(division_titles) FROM table_name_87 WHERE playoff_appearances = 23 AND conference_titles > 1 | sql_create_context |
CREATE TABLE table_name_66 (
bronze INTEGER,
gold INTEGER
) | What largest bronze number has a gold number that is bigger than 1? | SELECT MAX(bronze) FROM table_name_66 WHERE gold > 1 | 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 the number of patients whose procedure icd9 code is 8960 and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8960" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_54386 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Which game site(s) had record of 2-2? | SELECT "Game site" FROM table_54386 WHERE "Record" = '2-2' | wikisql |
CREATE TABLE Claims (
Date_Claim_Made VARCHAR,
Date_Claim_Settled VARCHAR,
Amount_Claimed INTEGER
) | Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled. | SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) | sql_create_context |
CREATE TABLE table_name_72 (
tournament VARCHAR
) | What is the value in 2006 when the value for 2009 is 0 with runner-ups for tournament? | SELECT 2006 FROM table_name_72 WHERE 2009 = "0" AND tournament = "runner-ups" | sql_create_context |
CREATE TABLE table_name_60 (
assumed_office INTEGER,
name VARCHAR
) | Tell me the loewst assume office for madeleine bordallo | SELECT MIN(assumed_office) FROM table_name_60 WHERE name = "madeleine bordallo" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | Draw a bar chart of last name versus department_id, and order from low to high by the X. | SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY LAST_NAME | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about the sum of Team_ID over the ACC_Road , and group by attribute ACC_Road, list in desc by the Y please. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC | nvbench |
CREATE TABLE table_name_69 (
club VARCHAR,
lead VARCHAR
) | Which club has Jamie Korab as Lead? | SELECT club FROM table_name_69 WHERE lead = "jamie korab" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | when did patient 15107 enter for the first time in the hospital since 2104? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 15107 AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
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 ... | what is religion and date of death of subject id 74032? | SELECT demographic.religion, demographic.dod FROM demographic WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_5539 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | Which district has a retired republican hold and an incumbent of rufus p. spalding? | SELECT "District" FROM table_5539 WHERE "Result" = 'retired republican hold' AND "Incumbent" = 'rufus p. spalding' | wikisql |
CREATE TABLE table_20734 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | On what date did the home team score 14.12 (96)? | SELECT "Date" FROM table_20734 WHERE "Home team score" = '14.12 (96)' | wikisql |
CREATE TABLE table_name_18 (
round VARCHAR,
method VARCHAR
) | What round was the method submission (punches)? | SELECT COUNT(round) FROM table_name_18 WHERE method = "submission (punches)" | sql_create_context |
CREATE TABLE table_name_76 (
score VARCHAR,
record VARCHAR
) | What was the score of the game when the record was 35-47? | SELECT score FROM table_name_76 WHERE record = "35-47" | sql_create_context |
CREATE TABLE table_42684 (
"Frequency" text,
"Call sign" text,
"Format" text,
"Owner" text,
"Notes" text
) | What is the Notes of the Frequency with Format of talk radio? | SELECT "Notes" FROM table_42684 WHERE "Format" = 'talk radio' | wikisql |
CREATE TABLE table_2220432_1 (
miles__km_ VARCHAR,
average_speed__mph_ VARCHAR
) | What was the miles (km) for the race that had an average speed of 136.117 MPH? | SELECT miles__km_ FROM table_2220432_1 WHERE average_speed__mph_ = "136.117" | sql_create_context |
CREATE TABLE table_784 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the candidates for first elected 1914 | SELECT "Candidates" FROM table_784 WHERE "First elected" = '1914' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 患有沙眼的患者在门诊诊断的甘油三酯数值的平均值以及最值各是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '沙眼' AND jyjgzbb.JCZBMC = '甘油三酯' | css |
CREATE TABLE table_73244 (
"Round #" real,
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What was Sherrick McManis's earliest round? | SELECT MIN("Round #") FROM table_73244 WHERE "Player" = 'Sherrick McManis' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags ... | All-uppercase Stack Overflow questions asked in the last three days. | SELECT PostId AS "post_link", 'http://stackoverflow.com/posts/' + CAST(p.Id AS TEXT(100)) + '/revisions', Text FROM PostHistory AS ph JOIN Posts AS p ON p.Id = ph.PostId WHERE PostHistoryTypeId = 2 AND Text = UPPER(Text) COLLATE SQL_Latin1_General_CP1_CS_AS AND ph.CreationDate > (SELECT CreationDate FROM Posts WHERE Id... | sede |
CREATE TABLE table_58744 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | Which Score has a Place of t5, and a Country of united states? | SELECT "Score" FROM table_58744 WHERE "Place" = 't5' AND "Country" = 'united states' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id n... | until 1 year ago what were the four most frequent diagnoses that were given to patients within 2 months after the diagnosis of pulmonary collapse? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
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 medication (
medi... | have patient 013-27480 had a diagnosis this year? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETI... | eicu |
CREATE TABLE table_38379 (
"Team" text,
"Manufacturer" text,
"Car model" text,
"Engine" text,
"Driver" text
) | What Car Model has the Engine of Ford 6.0 V8? | SELECT "Car model" FROM table_38379 WHERE "Engine" = 'ford 6.0 v8' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop_n... | flight from DENVER to PHILADELPHIA | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... | atis |
CREATE TABLE student (
stu_fname VARCHAR,
stu_lname VARCHAR,
stu_num VARCHAR
)
CREATE TABLE enroll (
stu_num VARCHAR,
class_code VARCHAR
)
CREATE TABLE course (
crs_description VARCHAR,
crs_code VARCHAR
)
CREATE TABLE CLASS (
class_code VARCHAR,
crs_code VARCHAR
) | Find names of all students who took some course and the course description. | SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code | sql_create_context |
CREATE TABLE match (
Match_ID int,
Date text,
Venue text,
Score text,
Result text,
Competition text
)
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
GDP real
)
CREATE TABLE temperature (
City_ID int,
Jan real,... | Bar chart x axis competition y axis the total number | SELECT Competition, COUNT(*) FROM match GROUP BY Competition | nvbench |
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... | compared to measured at 2102-06-29 10:30:00 was the glucose value of patient 025-53910 less than the value measured at 2102-06-27 10:36:00? | SELECT (SELECT 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 = '025-53910')) AND lab.labname = 'glucose' AND lab.labresulttime = '2102-06-29 10... | eicu |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | Who will teach MICRBIOL 641 next semester ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | show me the flights available from SAN FRANCISCO to PITTSBURGH for tuesday and also the price | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN... | atis |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | list the ids of the patients diagnosed with malfunc card dev/grf nec since 2102. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malfunc card dev/grf nec') AND STRFTIME('%y', diagnoses_icd.charttime) >= ... | mimic_iii |
CREATE TABLE table_name_78 (
site_stadium VARCHAR,
score VARCHAR
) | Which site/stadium was the score 1-2? | SELECT site_stadium FROM table_name_78 WHERE score = "1-2" | sql_create_context |
CREATE TABLE table_57216 (
"Year" text,
"Champion" text,
"Score" text,
"Runner-Up" text,
"Location" text,
"Semi-Finalist #1" text,
"Semi-Finalist #2" text
) | Who was the Semi-Finalist #2 in 2001? | SELECT "Semi-Finalist #2" FROM table_57216 WHERE "Year" = '2001' | 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,
... | 哪些韩志明患者的检验报告单号对应的检验结果指标均异常和检验报告单号都是那个? | SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '韩志明' ... | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | calculate the dose of impact that patient 7519 received until 1785 days ago. | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7519)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
CREATE TABLE table_name_46 (
home_team VARCHAR,
away_team VARCHAR
) | What is the name of the home team that played away team Footscray? | SELECT home_team FROM table_name_46 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 查验告知单号码为94703013293的检验申请机构名字和检验机构的名告诉一下? | SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '94703013293' | css |
CREATE TABLE table_21132404_1 (
seats_2006 VARCHAR,
_percentage_1997 VARCHAR
) | How many seats in 2006 has a % 1997 rating of 38.9? | SELECT COUNT(seats_2006) FROM table_21132404_1 WHERE _percentage_1997 = "38.9" | sql_create_context |
CREATE TABLE table_70245 (
"Player" text,
"Club" text,
"Games Played" real,
"Minutes" real,
"Goals Against" real,
"GA Average" real,
"Wins" real,
"Loses" real
) | What is the average Games Played for Bo Oshoniyi, who had more than 1170 minutes and 10 loses? | SELECT AVG("Games Played") FROM table_70245 WHERE "Loses" = '10' AND "Player" = 'bo oshoniyi' AND "Minutes" > '1170' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients are tested with lab item id 50922? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50922" | mimicsql_data |
CREATE TABLE table_46368 (
"Year" real,
"Show" text,
"Season" real,
"Episode" text,
"Episode number" real,
"Original airdate" text
) | What is Show, when Episode Number is 1, when Year is less than 2010, and when Original Airdate is January 20, 2008? | SELECT "Show" FROM table_46368 WHERE "Episode number" = '1' AND "Year" < '2010' AND "Original airdate" = 'january 20, 2008' | wikisql |
CREATE TABLE table_name_14 (
team VARCHAR,
sponsor VARCHAR
) | What team is sponsored by w.h. bolin? | SELECT team FROM table_name_14 WHERE sponsor = "w.h. bolin" | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | All questions with a *single* tag and a *word* in Title. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND UPPER(Title) LIKE UPPER('%##word##%') ORDER BY CreationDate | sede |
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
) | Give me a bar chart to show the revenue of the company that earns the highest revenue in each headquarter city, I want to show names in asc order. | SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Headquarter | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.