instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
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... | SELECT Body, Tags FROM Posts WHERE Id = 563355 | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '013-29301' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '013-29301' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_name_20 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team 1 in the match with a team 2 of Karabakh?
| SELECT team_1 FROM table_name_20 WHERE team_2 = "karabakh" | sql_create_context |
CREATE TABLE user_profiles (
email VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the emails of the user named 'Mary'.
| SELECT email FROM user_profiles WHERE name = 'Mary' | sql_create_context |
CREATE TABLE table_68331 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Sydney's Melbourne was no, when Auckland was yes?
| SELECT "Sydney" FROM table_68331 WHERE "Melbourne" = 'no' AND "Auckland" = 'yes' | wikisql |
CREATE TABLE table_23419 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many teams does Jeff Wyler own?
| SELECT COUNT("Team") FROM table_23419 WHERE "Listed Owner(s)" = 'Jeff Wyler' | wikisql |
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,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE table_78756 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which director had not nominated as a result, and had Bayan Ko: ... | SELECT "Director" FROM table_78756 WHERE "Result" = 'not nominated' AND "Original title" = 'bayan ko: kapit sa patalim' | wikisql |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) | nvbench |
CREATE TABLE table_50824 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the runner-up of Atlantic city classic?
| SELECT "Runner(s)-up" FROM table_50824 WHERE "Tournament" = 'atlantic city classic' | wikisql |
CREATE TABLE table_261927_2 (
football_conference VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the football conference for Henniker, New Hampshire>?
| SELECT football_conference FROM table_261927_2 WHERE location = "Henniker, New Hampshire" | sql_create_context |
CREATE TABLE table_26500 (
"Municipality" text,
"No. of Barangays" real,
"Area Coordinator" text,
"Population (2010)" real,
"Pop. density (per km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the area coordinator for the municipality... | SELECT "Area Coordinator" FROM table_26500 WHERE "Population (2010)" = '1715' | 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 jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '81824209749' AND jyjgzbb.JCRXM LIKE '曹%' | css |
CREATE TABLE table_name_71 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the tournament of beijing
| SELECT 2011 FROM table_name_71 WHERE tournament = "beijing" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT * FROM PostLinks WHERE RelatedPostId IN (SELECT Id FROM Posts WHERE OwnerUserId = @UserId AND PostTypeId = 2) AND LinkTypeId = 1 | sede |
CREATE TABLE table_7713 (
"Year" text,
"Regular Season" text,
"Playoffs" text,
"Canadian Championship" text,
"CONCACAF Champions League" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Canadian Championship had CONCACAF Champions League of semif... | SELECT "Canadian Championship" FROM table_7713 WHERE "CONCACAF Champions League" = 'semifinals' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate ... | SELECT COUNT(DISTINCT UserId) FROM Comments WHERE CreationDate > DATEADD(year, -1, GETDATE()) | sede |
CREATE TABLE table_name_57 (
name VARCHAR,
roll VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With what Name does the Roll of 637 belong?
| SELECT name FROM table_name_57 WHERE roll = "637" | sql_create_context |
CREATE TABLE table_21100348_15 (
rank VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of Tim Paine?
| SELECT rank FROM table_21100348_15 WHERE player = "Tim Paine" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_name_26 (
games VARCHAR,
points_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of games for a club that has a value of 595 for points for?
| SELECT games FROM table_name_26 WHERE points_for = "595" | sql_create_context |
CREATE TABLE table_40820 (
"1935" text,
"1936" text,
"1937" text,
"1938" text,
"1939" text,
"1940" text,
"1941" text,
"1943" text,
"1945" text,
"1946" text,
"1947" text,
"1948" text,
"1949" text,
"1950" text,
"1951" text,
"1952" text,
"1953" text
)
-... | SELECT "1951" FROM table_40820 WHERE "1948" = 'dne' | wikisql |
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway (
Railway_ID int,
Railway ... | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country | nvbench |
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... | SELECT gwyjzb.MED_CLINIC_ID, gwyjzb.PERSON_ID, gwyjzb.PERSON_NM, gwyjzb.IDENTITY_CARD, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '33088921636') UNION SELECT fgwyjz... | css |
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 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.JZZDBM = 'F51.X21' AND jyjgzbb.JCZBMC = '血清铁' | css |
CREATE TABLE table_name_70 (
group VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the group of ESPN International Sports?
| SELECT group FROM table_name_70 WHERE name = "espn international sports" | sql_create_context |
CREATE TABLE table_name_64 (
outgoing_manager VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the outgoing manager who was replaced by j rgen klopp?
| SELECT outgoing_manager FROM table_name_64 WHERE replaced_by = "jürgen klopp" | sql_create_context |
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
date_payment_made time,
amount_payment number
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_se... | SELECT date_claim_made FROM claims WHERE amount_settled <= (SELECT AVG(amount_settled) FROM claims) | spider |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewT... | SELECT q.Id AS "post_link", q.Tags, q.CreationDate, q.LastActivityDate FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##tagName:string?geometry##' ORDER BY q.LastActivityDate DESC | sede |
CREATE TABLE table_204_882 (
id number,
"number" number,
"builder" text,
"entered service" text,
"withdrawn" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which locomotive was withdrawn from service in the same year as 445 ?
| SELECT "number" FROM table_204_882 WHERE "number" <> 445 AND "withdrawn" = (SELECT "withdrawn" FROM table_204_882 WHERE "number" = 445) | squall |
CREATE TABLE table_name_8 (
outcome VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome for the game that was played on 07-Jun-2010?
| SELECT outcome FROM table_name_8 WHERE date = "07-jun-2010" | sql_create_context |
CREATE TABLE table_76844 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the week 6 game played on?
| SELECT "Date" FROM table_76844 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_48854 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Surface, when Opponents is 'Daniel Nestor Sandon Stol... | SELECT "Surface" FROM table_48854 WHERE "Opponents" = 'daniel nestor sandon stolle' | wikisql |
CREATE TABLE table_30529 (
"Rnd" real,
"Date" text,
"Circuit" text,
"Supporting" text,
"Distance" text,
"GT Winning Car" text,
"TC Winning Car" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest round where the gt winning ca... | SELECT MIN("Rnd") FROM table_30529 WHERE "GT Winning Car" = 'Max Angelelli' | wikisql |
CREATE TABLE table_27631756_2 (
captain VARCHAR,
shirt_sponsor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the captain when teh shirt sponsor is n/a?
| SELECT captain FROM table_27631756_2 WHERE shirt_sponsor = "N/A" | sql_create_context |
CREATE TABLE table_32211 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player was a forward/center from 1960?
| SELECT "Player" FROM table_32211 WHERE "From" = '1960' AND "Position" = 'forward/center' | wikisql |
CREATE TABLE table_name_33 (
format VARCHAR,
label VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Format of the Epic/Sony Label after 1980?
| SELECT format FROM table_name_33 WHERE label = "epic/sony" AND date > 1980 | sql_create_context |
CREATE TABLE table_name_81 (
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time with 10 grids?
| SELECT time_retired FROM table_name_81 WHERE grid = 10 | sql_create_context |
CREATE TABLE player_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first text
)
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_st... | SELECT player_id FROM salary WHERE year = "2015" ORDER BY salary DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name tex... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) | nvbench |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE va... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) | nvbench |
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 WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2078" | mimicsql_data |
CREATE TABLE table_22946 (
"Year" real,
"Qatari Male" real,
"Qatari Female" real,
"Total Qatari" real,
"Non Qatari Male" real,
"Non Qatari Female" real,
"Total Non Qatar" real,
"Total Male" real,
"Total Female" real,
"Grand Total" real
)
-- Using valid SQLite, answer the follow... | SELECT COUNT("Year") FROM table_22946 WHERE "Qatari Male" = '97' | wikisql |
CREATE TABLE table_name_54 (
team_country VARCHAR,
year VARCHAR,
race_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ream played later than 1958 in the kellogg's tour?
| SELECT team_country FROM table_name_54 WHERE year > 1958 AND race_name = "kellogg's tour" | sql_create_context |
CREATE TABLE table_name_21 (
score VARCHAR,
country VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did United States score in the place t6?
| SELECT score FROM table_name_21 WHERE country = "united states" AND place = "t6" | sql_create_context |
CREATE TABLE table_name_48 (
manchu___möllendorff__ VARCHAR,
wu_xing_correlations VARCHAR,
wuu_wuupin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Manchu (M llendorff) with the Wi Xing Correltation of South, along with Wuu Wuupin of ting44?
| SELECT manchu___möllendorff__ FROM table_name_48 WHERE wu_xing_correlations = "南 south" AND wuu_wuupin = "ting44" | sql_create_context |
CREATE TABLE table_23442 (
"Episode" text,
"First broadcast" text,
"Rufus guest" text,
"Marcus guest" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Marcus's guest in the episode when Rufus's guest was Rory McGrath?
| SELECT "Marcus guest" FROM table_23442 WHERE "Rufus guest" = 'Rory McGrath' | wikisql |
CREATE TABLE table_43057 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Year did Chernova come in 1st in G tzis, Austria?
| SELECT SUM("Year") FROM table_43057 WHERE "Venue" = 'götzis, austria' AND "Position" = '1st' | wikisql |
CREATE TABLE table_44563 (
"Coach" text,
"Years" text,
"Win-Loss" text,
"Win %" text,
"Conference Titles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Conference Titles, when Win % is .667?
| SELECT "Conference Titles" FROM table_44563 WHERE "Win %" = '.667' | wikisql |
CREATE TABLE user_profiles (
followers INTEGER,
UID VARCHAR
)
CREATE TABLE tweets (
followers INTEGER,
UID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the average number of followers for the users who had some tweets.
| SELECT AVG(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets) | sql_create_context |
CREATE TABLE countries (
country_id text,
country_name text,
region_id number
)
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_id number
)
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_sal... | SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%') | spider |
CREATE TABLE table_3365 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Safeties" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The player who had 5 touchdowns had how many extra points?
| SELECT "Extra points" FROM table_3365 WHERE "Touchdowns" = '5' | wikisql |
CREATE TABLE table_name_21 (
venue VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did fitzroy play as the home team?
| SELECT venue FROM table_name_21 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_203_89 (
id number,
"#" number,
"name\n(birth-death)" text,
"took office" text,
"left office" text,
"monarch" text,
"prime minister" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how old was gideon brand van zyl when he t... | SELECT "took office" - "name\n(birth-death)" FROM table_203_89 WHERE "name\n(birth-death)" = 'gideon brand van zyl' | squall |
CREATE TABLE table_62776 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the home game against the New York Jets?
| SELECT SUM("Attendance") FROM table_62776 WHERE "Opponent" = 'new york jets' | wikisql |
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 PostHistory (
Id number,
PostHistoryT... | SELECT COUNT(q.Id) FROM Posts AS q WHERE q.PostTypeId = 1 AND NOT q.ClosedDate IS NULL AND YEAR(q.CreationDate) = 2019 | sede |
CREATE TABLE perpetrator (
LOCATION VARCHAR,
Killed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the perpetrator with the largest kills.
| SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_204_761 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many nations did not receive any gold medals ?
| SELECT COUNT("nation") FROM table_204_761 WHERE "gold" = 0 | squall |
CREATE TABLE table_78006 (
"Name (Irish)" text,
"Name (English)" text,
"Sport" text,
"Teams" text,
"Location" text,
"Pitch" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location of the Old Bedians Pitch?
| SELECT "Location" FROM table_78006 WHERE "Pitch" = 'old bedians' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number... | SELECT q.Score AS "qscore", q.Id AS "post_link", q.Title, q.Tags, q.Body AS "question_body", q.OwnerUserId AS "questioner", a.Score AS "ascore", a.Body AS "answer_body", a.CreationDate AS "answerdate" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserId##' | sede |
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equity_Shareholding real
)
CREATE TABLE flight (
id int,
... | SELECT Country, COUNT(Country) FROM airport GROUP BY Country ORDER BY name | nvbench |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 7112 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_17467147_1 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When there are 12.70 million u.s. viewers who is the director?
| SELECT directed_by FROM table_17467147_1 WHERE us_viewers__million_ = "12.70" | sql_create_context |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT * FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '91778499' AND hz_info.YLJGDM = '4450505' AND zzmzjzjlb.JZZDSM LIKE '%牙%' UNION SELECT * FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_... | css |
CREATE TABLE table_58917 (
"Week 9 Oct 29" text,
"Week 10 Nov 5" text,
"Week 11 Nov 12" text,
"Week 12 Nov 19" text,
"Week 13 Nov 26" text,
"Week 14 Dec 3" text,
"Week 15 (Final) Dec 9" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT "Week 15 (Final) Dec 9" FROM table_58917 WHERE "Week 9 Oct 29" = 'washington (6-1)' | 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 treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-23768')) AND STRFTIME('%y', treatment.treatmenttime) = '2102'... | eicu |
CREATE TABLE table_27571406_1 (
season VARCHAR,
team_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what season did Pons Racing compete?
| SELECT season FROM table_27571406_1 WHERE team_name = "Pons Racing" | sql_create_context |
CREATE TABLE table_name_85 (
week_6 VARCHAR,
week_3 VARCHAR,
week_7 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the week 6 when week 3 is 25 and week 7 is eliminated
| SELECT week_6 FROM table_name_85 WHERE week_3 = "25" AND week_7 = "eliminated" | sql_create_context |
CREATE TABLE ref_locations (
location_code text,
location_name text,
location_description text
)
CREATE TABLE ref_calendar (
calendar_date time,
day_number number
)
CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE document_locations (
docum... | SELECT document_type_name, document_type_description FROM ref_document_types WHERE document_type_code = "RV" | spider |
CREATE TABLE table_name_93 (
withdrawn VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the withdrawn for charles dickens
| SELECT withdrawn FROM table_name_93 WHERE name = "charles dickens" | sql_create_context |
CREATE TABLE table_33658 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date when the opponent in the final is gast n etlis mart... | SELECT "Date" FROM table_33658 WHERE "Opponents in the final" = 'gastón etlis martín rodríguez' | wikisql |
CREATE TABLE table_49791 (
"Tournament" text,
"2008" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 2011 at the French open?
| SELECT "2011" FROM table_49791 WHERE "Tournament" = 'french open' | wikisql |
CREATE TABLE table_name_44 (
outcome VARCHAR,
year VARCHAR,
opponent_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome from the 2009 match in the final against Chong Wei Feng?
| SELECT outcome FROM table_name_44 WHERE year = 2009 AND opponent_in_final = "chong wei feng" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | SELECT a.Id AS "post_link", a.Score AS "score", a.CreationDate AS "date" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id AND a.OwnerUserId = q.OwnerUserId WHERE a.PostTypeId = 2 AND a.Score < 0 AND a.Id != q.AcceptedAnswerId ORDER BY a.Score, a.CreationDate | sede |
CREATE TABLE nuclear_power_plants (
id text,
name text,
latitude text,
longitude text,
country text,
status text,
reactortype text,
reactormodel text,
constructionstartat text,
operationalfrom text,
operationalto text,
capacity text,
lastupdatedat text,
source tex... | SELECT country FROM nuclear_power_plants GROUP BY country ORDER BY SUM(capacity) LIMIT 1 | geonucleardata |
CREATE TABLE table_name_75 (
time VARCHAR,
release_date VARCHAR,
track VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the time for tracks before 19 on 8/26/69?
| SELECT time FROM table_name_75 WHERE release_date = "8/26/69" AND track < 19 | sql_create_context |
CREATE TABLE table_1102 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What NHL team drafted Rob Palmer?
| SELECT "NHL team" FROM table_1102 WHERE "Player" = 'Rob Palmer' | wikisql |
CREATE TABLE table_54318 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of roll for Te Hapua school?
| SELECT COUNT("Roll") FROM table_54318 WHERE "Name" = 'te hapua school' | wikisql |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
-- Using valid SQLite, answer the following questions ... | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hyperpotassemia" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) >= '2105' | eicu |
CREATE TABLE genres (
name VARCHAR,
id VARCHAR
)
CREATE TABLE tracks (
genre_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find number of tracks in each genre?
| SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name | sql_create_context |
CREATE TABLE table_name_81 (
goals_for INTEGER,
wins VARCHAR,
draws VARCHAR,
goals_against VARCHAR,
goal_differential VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for a Goals Against smaller than 9, and a Goal Differential of 0, and a Draws sma... | SELECT SUM(goals_for) FROM table_name_81 WHERE goals_against < 9 AND goal_differential = "0" AND draws < 2 AND wins = 1 | sql_create_context |
CREATE TABLE table_22654073_6 (
date VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for lebron james , mo williams (21)
| SELECT date FROM table_22654073_6 WHERE high_points = "LeBron James , Mo Williams (21)" | sql_create_context |
CREATE TABLE table_65820 (
"Part Number" text,
"Pins" text,
"Body Width/mm" real,
"Body Length/mm" real,
"Lead Pitch/mm" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Body Width/mm has a Body Length/mm of 18.4, and Pins of 40?
| SELECT COUNT("Body Width/mm") FROM table_65820 WHERE "Body Length/mm" = '18.4' AND "Pins" = '40' | wikisql |
CREATE TABLE table_name_14 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1995 GDP when 1990 GDP is 441 and 1985 GDP is less than 359?
| SELECT MIN(1995) FROM table_name_14 WHERE 1990 = 441 AND 1985 < 359 | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
d... | 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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WORTH' AND date_day.day_number = 10 AND date_day.month_number = 7 A... | atis |
CREATE TABLE Movie (
YEAR INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many movies were made before 2000?
| SELECT COUNT(*) FROM Movie WHERE YEAR < 2000 | sql_create_context |
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,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '郑波涛' AND hz_info.YLJGDM = '8549699' AND zyjzjlb.CYKSMC LIKE '%关节病%' | css |
CREATE TABLE table_name_68 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average attendance on october 3, 1976?
| SELECT AVG(attendance) FROM table_name_68 WHERE date = "october 3, 1976" | sql_create_context |
CREATE TABLE table_20984 (
"Season" real,
"Class" text,
"Team" text,
"Motorcycle" text,
"Type" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real,
"Pts" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the... | SELECT "Position" FROM table_20984 WHERE "Motorcycle" = 'KTM' | wikisql |
CREATE TABLE table_name_38 (
week INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest week with a w 33-14 result?
| SELECT MAX(week) FROM table_name_38 WHERE result = "w 33-14" | sql_create_context |
CREATE TABLE table_36913 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins for Tom Watson who earns less than $4,974,845?
| SELECT MAX("Wins") FROM table_36913 WHERE "Player" = 'tom watson' AND "Earnings ( $ )" < '4,974,845' | wikisql |
CREATE TABLE table_33377 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total of medals that has a gold of 3 and a silver less than 3?
| SELECT MIN("Total") FROM table_33377 WHERE "Gold" = '3' AND "Silver" < '3' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... | advising |
CREATE TABLE table_name_24 (
european_cup VARCHAR,
national_league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What European Cup is in Israeli Premier League?
| SELECT european_cup FROM table_name_24 WHERE national_league = "israeli premier league" | sql_create_context |
CREATE TABLE table_8334 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT YEAR WAS AT GIANTS STADIUM, WITH WINNER OF NEW YORK GIANTS?
| SELECT MIN("Year") FROM table_8334 WHERE "Location" = 'giants stadium' AND "Winner" = 'new york giants' | wikisql |
CREATE TABLE table_22033 (
"Romanised name" text,
"Chinese name" text,
"age at appointment" real,
"Foreign nationality" text,
"Portfolio attachment" text,
"Prior occupation" text,
"Govt salary" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Chinese name" FROM table_22033 WHERE "Romanised name" = 'Chan Chi-yuen, Paul' | wikisql |
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 CloseReasonTypes (
Id number,
Name text,
Description... | SELECT Id AS "post_link", Body FROM Posts WHERE UPPER(Body) LIKE UPPER('%##PostText##%') ORDER BY Score DESC | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.