instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT AVG(price) FROM products | spider |
CREATE TABLE table_name_64 (
performer_1 VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which players have a pick number of 27?
| SELECT "Player" FROM table_16397 WHERE "Pick #" = '27' | wikisql |
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 zyjzjlb.RZBQDM, zyjzjlb.RZBQMC, zyjzjlb.RYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '57073431477' | css |
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... | 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... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On... | 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 ... | (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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tabl... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many r... | SELECT COUNT("Ranking") FROM table_18762 WHERE "Season" = '5th' | wikisql |
CREATE TABLE table_23186738_9 (
score VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a clay surface... | 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
)
-- Using valid SQLite, answer the following questions for the ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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... | 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,... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made an... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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),... | 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... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC | nvbench |
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 ... | SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '60081857997' | css |
CREATE TABLE table_name_69 (
club VARCHAR,
lead VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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 ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the home team... | SELECT "Date" FROM table_20734 WHERE "Home team score" = '14.12 (96)' | wikisql |
CREATE TABLE table_name_18 (
round VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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 ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid... | 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,... | 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... | 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,... | 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... | 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '94703013293' | css |
CREATE TABLE table_21132404_1 (
seats_2006 VARCHAR,
_percentage_1997 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Games Played for... | 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Show, when Episode Number is 1, when Year is less than 2010, and... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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,... | 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
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Headquarter | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.dod_year <= "2148.0" | mimicsql_data |
CREATE TABLE table_name_76 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team when Fitzroy was the away team?
| SELECT home_team FROM table_name_76 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_name_84 (
points INTEGER,
games_played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points on average are there for less than 5 games played?
| SELECT AVG(points) FROM table_name_84 WHERE games_played < 5 | sql_create_context |
CREATE TABLE table_name_76 (
avg VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Domenik Hixon's average rush?
| SELECT avg FROM table_name_76 WHERE player = "domenik hixon" | sql_create_context |
CREATE TABLE table_203_135 (
id number,
"institution" text,
"location" text,
"founded" number,
"type" text,
"enrollment" number,
"joined" number,
"nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many institutions were founde... | SELECT COUNT("institution") FROM table_203_135 WHERE "founded" < 1950 | squall |
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,... | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE MED_CLINIC_ID = '12315818260' | css |
CREATE TABLE table_28715942_2 (
original_artist VARCHAR,
track VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the original artist(s) on harder to breathe?
| SELECT original_artist FROM table_28715942_2 WHERE track = "Harder To Breathe" | sql_create_context |
CREATE TABLE table_name_41 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance on week 1?
| SELECT attendance FROM table_name_41 WHERE week = 1 | sql_create_context |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different cities are they from?
| SELECT COUNT(DISTINCT city) FROM person | spider |
CREATE TABLE table_name_96 (
rank VARCHAR,
country VARCHAR,
accolade VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rank's country is the US when the accolade is 40 best albums of the year?
| SELECT rank FROM table_name_96 WHERE country = "us" AND accolade = "40 best albums of the year" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Oxygen Saturation" | mimicsql_data |
CREATE TABLE Rooms (
roomName VARCHAR,
RoomId VARCHAR
)
CREATE TABLE Reservations (
Rate VARCHAR,
CheckIn VARCHAR,
CheckOut VARCHAR,
Room VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which room has the highest rate? List the room's full na... | SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1 | sql_create_context |
CREATE TABLE diagnoses (
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,
... | 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 = "5771" AND prescriptions.drug_type = "BASE" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.