instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_72602 (
"Year" text,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were all womens doubles for the year 2000/2001?
| SELECT "Womens doubles" FROM table_72602 WHERE "Year" = '2000/2001' | wikisql |
CREATE TABLE table_45806 (
"Pick" real,
"Player" text,
"Nationality" text,
"New WNBA Team" text,
"Former WNBA Team" text,
"College/Country/Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality was the player whose college team wa... | SELECT "Nationality" FROM table_45806 WHERE "College/Country/Team" = 'georgia tech' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'emphysema') | eicu |
CREATE TABLE table_36151 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest week number for the game that was at milwauk... | SELECT MIN("Week") FROM table_36151 WHERE "Game Site" = 'milwaukee county stadium' | wikisql |
CREATE TABLE table_10848177_1 (
lyricist VARCHAR,
length VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the lyricist for the song with a length of 3:05?
| SELECT lyricist FROM table_10848177_1 WHERE length = "3:05" | 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 MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2011-03-15' AND '2018-04-18' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 2 | css |
CREATE TABLE table_2417308_3 (
state__class_ VARCHAR,
successor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state had william bigler (d) as a successor)
| SELECT state__class_ FROM table_2417308_3 WHERE successor = "William Bigler (D)" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Mal neo descend colon" | mimicsql_data |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57' | atis |
CREATE TABLE table_50283 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the high points that ha... | SELECT "High points" FROM table_50283 WHERE "Game" = '42' | wikisql |
CREATE TABLE table_name_9 (
fumb_yds INTEGER,
fumb_f VARCHAR,
int_lg VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Fumb Yds has a Fumb F. of 0, and a Int LG smaller than 0?
| SELECT MAX(fumb_yds) FROM table_name_9 WHERE fumb_f = 0 AND int_lg < 0 | sql_create_context |
CREATE TABLE table_name_50 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of Stewart Cink with a To par of +4?
| SELECT score FROM table_name_50 WHERE to_par = "+4" AND player = "stewart cink" | sql_create_context |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT Year, COUNT(Year) FROM wine | nvbench |
CREATE TABLE table_203_441 (
id number,
"rank" number,
"athlete" text,
"ski time" text,
"penalties\np+s+p+s" text,
"total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many countries were represented ?
| SELECT COUNT(DISTINCT "athlete") FROM table_203_441 | squall |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | SELECT DATEADD(mm, (YEAR(2017) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ('backbone.js'... | sede |
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '25889961' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-01-12' AND '2016-05-16' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID... | css |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 T... | WITH firstrev_cte AS (SELECT MIN(ph.Id) AS MinId, p.Id FROM Posts AS p JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.Text LIKE '%<##tagName##>%' AND ph.PostHistoryTypeId IN (3, 6, 9) GROUP BY p.Id), users_cte AS (SELECT PostId AS pid, UserId AS uid, UserDisplayName AS udn FROM PostHistory INNER JOIN firstrev_cte ... | sede |
CREATE TABLE table_name_41 (
cultural_and_educational_panel VARCHAR,
university_of_dublin VARCHAR,
labour_panel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many in the cultural and educational panel have a university of Dublin of 3 & A labor panel... | SELECT COUNT(cultural_and_educational_panel) FROM table_name_41 WHERE university_of_dublin = 3 AND labour_panel > 11 | sql_create_context |
CREATE TABLE table_13924 (
"SEASON" text,
"TEAM" text,
"LEAGUE" text,
"GAMES" text,
"GOALS" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team name that as games of 7?
| SELECT "TEAM" FROM table_13924 WHERE "GAMES" = '7' | wikisql |
CREATE TABLE table_66824 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score that has a Result of 2 2 on 04 Dec 2005?
| SELECT "Score" FROM table_66824 WHERE "Result" = '2–2' AND "Date" = '04 dec 2005' | wikisql |
CREATE TABLE table_34493 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the back player with a pick less than 183 from the round greater than 12?
| SELECT "Player" FROM table_34493 WHERE "Pick" < '183' AND "Position" = 'back' AND "Round" > '12' | wikisql |
CREATE TABLE table_name_33 (
reverse VARCHAR,
color VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What reverse has a color of green?
| SELECT reverse FROM table_name_33 WHERE color = "green" | sql_create_context |
CREATE TABLE table_name_17 (
best VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Best, when Name is Jimmy Vasser?
| SELECT best FROM table_name_17 WHERE name = "jimmy vasser" | sql_create_context |
CREATE TABLE table_4710 (
"Tournament" text,
"1943" text,
"1944" text,
"1945" text,
"1948" text,
"1949" text,
"1951" text,
"1954" text,
"1956\u20131968" text,
"1969" text,
"Career SR" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "1949" FROM table_4710 WHERE "1945" = 'a' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | SELECT DISTINCT aircraft_code FROM aircraft WHERE propulsion = 'TURBOPROP' | atis |
CREATE TABLE table_name_39 (
gold INTEGER,
nation VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Gold has a Nation of sri lanka, and a Silver smaller than 10?
| SELECT AVG(gold) FROM table_name_39 WHERE nation = "sri lanka" AND silver < 10 | sql_create_context |
CREATE TABLE table_59467 (
"Year" text,
"Champion" text,
"Runner-up" text,
"Score" text,
"Name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the name when Henrik Sundstr m was champion?
| SELECT "Name" FROM table_59467 WHERE "Champion" = 'henrik sundström' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '郎曼吟' | css |
CREATE TABLE table_name_70 (
laps INTEGER,
constructor VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many average laps did brm complete in grids larger than 12?
| SELECT AVG(laps) FROM table_name_70 WHERE constructor = "brm" AND grid = 12 | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TAB... | SELECT OwnerDisplayName, COUNT(*) AS Num_Posts FROM Posts WHERE CreationDate < '08/01/2019 00:00:00' AND CreationDate >= '07/01/2019 00:00:00' AND PostTypeId = 1 AND OwnerDisplayName != '' AND NOT OwnerDisplayName LIKE 'user%' GROUP BY OwnerDisplayName ORDER BY Num_Posts DESC LIMIT 10 | sede |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-43966')) AND medication.drugname = 'vancomycin 1,000 mg iv... | eicu |
CREATE TABLE table_27820 (
"Position" real,
"Sail Number" text,
"Yacht" text,
"State/Country" text,
"Yacht Type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed Time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many... | SELECT COUNT("State/Country") FROM table_27820 WHERE "Skipper" = 'Grant Wharington' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZX... | SELECT wdmzjzjlb.KH, wdmzjzjlb.KLX FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '00282220286' UNION SELECT bdmzjzjlb.KH, bdmzjzjlb.KLX FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '00282220286' | css |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 diagnoses_icd (
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 41393) AND STRFTIME('%y', procedures_icd.charttime) >= '2101' ORDER ... | mimic_iii |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name t... | SELECT u.Reputation / 10, SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS acc, SUM(CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS not_acc FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Reputation < 500 GROUP BY u.Reputation / 10 ORDER BY u.Reputation / 10 | sede |
CREATE TABLE table_30195 (
"Sponsored name" text,
"Non-sponsored name" text,
"Sponsor" text,
"Stadium" text,
"City" text,
"Country" text,
"Sport" text,
"Sponsorship Ended" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the last y... | SELECT MAX("Sponsorship Ended") FROM table_30195 | wikisql |
CREATE TABLE table_152834_2 (
province VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the country is fenghuang how many provinces are there?
| SELECT COUNT(province) FROM table_152834_2 WHERE county = "Fenghuang" | sql_create_context |
CREATE TABLE table_name_21 (
grid VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the grid when the laps is 2?
| SELECT grid FROM table_name_21 WHERE laps = 2 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '86022614' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2011-04-19' AND '2012-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_73 (
cfl_team VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team picked a player(s) from South Carolina?
| SELECT cfl_team FROM table_name_73 WHERE college = "south carolina" | sql_create_context |
CREATE TABLE table_14598_5 (
buddhist VARCHAR,
s_jain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many buddhists are where s jain have 941?
| SELECT buddhist FROM table_14598_5 WHERE s_jain = "941" | sql_create_context |
CREATE TABLE table_63864 (
"Year" real,
"Population" real,
"Five Year % change" text,
"Ten Year % change" text,
"Rank Among Provinces" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest population for the province having a rank under... | SELECT MAX("Population") FROM table_63864 WHERE "Rank Among Provinces" < '5' | wikisql |
CREATE TABLE table_name_28 (
wins VARCHAR,
top_25 VARCHAR,
cuts_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the tournament with more than 6 top-25's and less than 13 cuts made, how many wins were there?
| SELECT COUNT(wins) FROM table_name_28 WHERE top_25 > 6 AND cuts_made < 13 | sql_create_context |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phon... | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code | nvbench |
CREATE TABLE table_57212 (
"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 Champion in Snellville, GA in 20... | SELECT "Champion" FROM table_57212 WHERE "Location" = 'snellville, ga' AND "Year" = '2006' | wikisql |
CREATE TABLE table_58915 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date had a Series of ATCC Round 6?
| SELECT "Date" FROM table_58915 WHERE "Series" = 'atcc round 6' | wikisql |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-202970' AND patient.hos... | eicu |
CREATE TABLE table_name_45 (
points INTEGER,
november VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points have November of 15?
| SELECT SUM(points) FROM table_name_45 WHERE november = 15 | sql_create_context |
CREATE TABLE table_name_2 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game with a record of 7 10 3 1?
| SELECT score FROM table_name_2 WHERE record = "7–10–3–1" | sql_create_context |
CREATE TABLE table_name_90 (
team VARCHAR,
sacks VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the team when sacks is 0 and the season is earlier than 1998?
| SELECT team FROM table_name_90 WHERE sacks = "0" AND season < 1998 | sql_create_context |
CREATE TABLE table_31028 (
"Club" text,
"Location" text,
"Stadium" text,
"Capacity" real,
"Manager" text,
"Captain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many stadiums have haka as the club?
| SELECT COUNT("Stadium") FROM table_31028 WHERE "Club" = 'Haka' | wikisql |
CREATE TABLE table_72727 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by:" text,
"Written by:" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of series?
| SELECT MIN("Series #") FROM table_72727 | wikisql |
CREATE TABLE table_name_62 (
winning_score VARCHAR,
year VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Allison Fouch score in the year larger than 2000?
| SELECT winning_score FROM table_name_62 WHERE year > 2000 AND champion = "allison fouch" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'DAL') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'DAL') | atis |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
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,
... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '28140515' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_27588823_2 (
frequency VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency of the station located in polangui, albay?
| SELECT frequency FROM table_27588823_2 WHERE location = "Polangui, Albay" | sql_create_context |
CREATE TABLE table_name_24 (
drawn INTEGER,
position VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Drawn has a Position of 2, and a Lost larger than 2?
| SELECT MIN(drawn) FROM table_name_24 WHERE position = 2 AND lost > 2 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32341')) AND treatment.treatmentname = 'bicarbonate - sodium bicarbonate... | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'obesity - morbid' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), ... | eicu |
CREATE TABLE table_35247 (
"Distance" text,
"Event" text,
"Record" text,
"Nationality" text,
"Year" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location's year was 2001 when the record was 3:52.983s?
| SELECT "Location" FROM table_35247 WHERE "Year" = '2001' AND "Record" = '3:52.983s' | wikisql |
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 departments (
department_id number,
department_name text,
manager_... | SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' | spider |
CREATE TABLE table_16535 (
"Episode Titles" text,
"First air date" text,
"Reward" text,
"Immunity" text,
"Exiled" text,
"Eliminated" text,
"Vote" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes had their f... | SELECT COUNT("Episode Titles") FROM table_16535 WHERE "First air date" = 'March 6, 2008' | wikisql |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_65113 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue has a score of 4-0 with the 2002 Tiger Cup listed as the competition?
| SELECT "Venue" FROM table_65113 WHERE "Score" = '4-0' AND "Competition" = '2002 tiger cup' | wikisql |
CREATE TABLE table_203_362 (
id number,
"school" text,
"location" text,
"outright titles" number,
"shared titles" number,
"runners-up" number,
"total finals" number,
"last title" number,
"last final" number
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "school" FROM table_203_362 WHERE "total finals" = 12 | squall |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID | nvbench |
CREATE TABLE table_47162 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Pick of 25 (via hamilton)?
| SELECT SUM("Round") FROM table_47162 WHERE "Pick" = '25 (via hamilton)' | wikisql |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT zyjybgb.JYLX FROM zyjybgb WHERE zyjybgb.BGDH = '33518078713' UNION SELECT mzjybgb.JYLX FROM mzjybgb WHERE mzjybgb.BGDH = '33518078713' | css |
CREATE TABLE table_name_16 (
club VARCHAR,
points_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club has 275 points?
| SELECT club FROM table_name_16 WHERE points_for = "275" | sql_create_context |
CREATE TABLE table_28801 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Incoming manager" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How ... | SELECT COUNT("Incoming manager") FROM table_28801 WHERE "Team" = 'Burnley' | wikisql |
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... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_... | mimic_iii |
CREATE TABLE table_train_35 (
"id" int,
"pregnancy_or_lactation" bool,
"glucocorticoid_history" bool,
"impaired_consciousness" bool,
"hematologic_disease" bool,
"glasgow_come_score_gcs" int,
"liver_disease" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for... | SELECT * FROM table_train_35 WHERE hematologic_disease = 1 | criteria2sql |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14355)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'void' AND d_items.... | mimic_iii |
CREATE TABLE table_38959 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have Touchdowns of 1, and a Field goals smaller than 0?
| SELECT AVG("Points") FROM table_38959 WHERE "Touchdowns" = '1' AND "Field goals" < '0' | wikisql |
CREATE TABLE table_8064 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To par of the Player from New Zealand who had a Score of 75-70=145?
| SELECT "To par" FROM table_8064 WHERE "Score" = '75-70=145' AND "Country" = 'new zealand' | wikisql |
CREATE TABLE table_name_53 (
first_baseman VARCHAR,
shortstop VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the First Baseman when the Shortstop was zoilo versalles?
| SELECT first_baseman FROM table_name_53 WHERE shortstop = "zoilo versalles" | sql_create_context |
CREATE TABLE table_204_468 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many drivers did team rah... | SELECT COUNT("driver") FROM table_204_468 WHERE "team" = 'team rahal' | squall |
CREATE TABLE table_204_494 (
id number,
"episode #" text,
"original air date (uk)" text,
"episode title" text,
"guest cast" text,
"dvd # 1" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the title before the episode target ?
| SELECT "episode title" FROM table_204_494 WHERE id = (SELECT id FROM table_204_494 WHERE "episode title" = '"target"') - 1 | squall |
CREATE TABLE table_77161 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the Fifa World Cup 1986 Qualifying Competition?
| SELECT "Score" FROM table_77161 WHERE "Competition" = 'fifa world cup 1986 qualifying' | wikisql |
CREATE TABLE table_16729063_1 (
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions drafted players from Washington?
| SELECT COUNT(position) FROM table_16729063_1 WHERE college = "Washington" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.days_stay = "13" | mimicsql_data |
CREATE TABLE table_74182 (
"Game" real,
"Date" text,
"Team" 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.
-- What i... | SELECT MAX("Game") FROM table_74182 WHERE "Date" = 'April 3' | wikisql |
CREATE TABLE table_204_343 (
id number,
"nation" text,
"model" text,
"length" text,
"barrel length" text,
"weight" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many other models are the same length as the m1898 carbine ?
| SELECT COUNT("model") FROM table_204_343 WHERE "model" <> 'm1898 carbine' AND "length" = (SELECT "length" FROM table_204_343 WHERE "model" = 'm1898 carbine') | squall |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27831) AND DATETIME(icustays.intime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE table_name_95 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has 1-1 as the record?
| SELECT opponent FROM table_name_95 WHERE record = "1-1" | sql_create_context |
CREATE TABLE table_204_546 (
id number,
"year" number,
"film" text,
"song" text,
"language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many films were there in 2010 and 2012 ?
| SELECT COUNT("film") FROM table_204_546 WHERE "year" IN (2010, 2012) | squall |
CREATE TABLE table_17115950_2 (
outgoing_manager VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the outgoing manager replaced by Marian Bucurescu?
| SELECT outgoing_manager FROM table_17115950_2 WHERE replaced_by = "Marian Bucurescu" | sql_create_context |
CREATE TABLE table_22597626_5 (
outcome VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many outcomes are listed when the final opponent was Johan Kriek?
| SELECT COUNT(outcome) FROM table_22597626_5 WHERE opponent_in_the_final = "Johan Kriek" | sql_create_context |
CREATE TABLE table_name_59 (
italian VARCHAR,
mexican VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Italian word for the Mexican word frijol?
| SELECT italian FROM table_name_59 WHERE mexican = "frijol" | sql_create_context |
CREATE TABLE table_47148 (
"Company" text,
"Type" text,
"Principal activities" text,
"Incorporated in" text,
"Group's Equity Shareholding" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Incorporated in has a Group's Equity Shareholding of 100%... | SELECT "Incorporated in" FROM table_47148 WHERE "Group's Equity Shareholding" = '100%' AND "Principal activities" = 'flight academy' | wikisql |
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
-- Using valid SQLite, answer the follo... | SELECT name FROM climber WHERE country <> "Switzerland" | spider |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fligh... | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... | atis |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE table_name_66 (
to_par VARCHAR,
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a score of 68-65=133 and United States as the country what is the To par?
| SELECT to_par FROM table_name_66 WHERE country = "united states" AND score = 68 - 65 = 133 | sql_create_context |
CREATE TABLE table_14943 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What gender is allowed at the school which has a roll of 338?
| SELECT "Gender" FROM table_14943 WHERE "Roll" = '338' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
CR... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int inser lead atri-vent') AND STRFTIME('%y', proced... | mimic_iii |
CREATE TABLE table_name_92 (
sitalsasthi_carnival VARCHAR,
sambalpuri_saree VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sitalsasthi carnival with hirakud as sambalpuri saree?
| SELECT sitalsasthi_carnival FROM table_name_92 WHERE sambalpuri_saree = "hirakud" | sql_create_context |
CREATE TABLE table_27714573_1 (
us_viewers__millions_ VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many millions of north american viewers had the episode whose director was Michael Lembeck?
| SELECT us_viewers__millions_ FROM table_27714573_1 WHERE directed_by = "Michael Lembeck" | sql_create_context |
CREATE TABLE table_19362 (
"Number" real,
"Name of administrative unit" text,
"Telephone (052)" text,
"Area (km 2 )" text,
"Population (people)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the name of administrative unit for 3464 people
| SELECT "Name of administrative unit" FROM table_19362 WHERE "Population (people)" = '3464' | wikisql |
CREATE TABLE table_28372 (
"Name" text,
"GP" real,
"Solo" real,
"Ast" real,
"Total" real,
"TFL-Yds" text,
"No-Yds" text,
"BrUp" real,
"No.-Yds" text,
"Avg" text,
"TD" real,
"Long" real,
"Rcv-Yds" text,
"FF" real,
"Blkd Kick" real
)
-- Using valid SQLite, ans... | SELECT "Name" FROM table_28372 WHERE "TFL-Yds" = '2-2' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.