instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
applica... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp... | atis |
CREATE TABLE table_name_9 (
att INTEGER,
yards VARCHAR,
comp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the player with yards less than 138, and Comp more than 0, what was the highest Att.?
| SELECT MAX(att) FROM table_name_9 WHERE yards < 138 AND comp > 0 | sql_create_context |
CREATE TABLE table_name_24 (
apps INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the apps when the name is smith?
| SELECT MIN(apps) FROM table_name_24 WHERE name = "smith" | sql_create_context |
CREATE TABLE table_77379 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the St. Louis team?
| SELECT "Record" FROM table_77379 WHERE "Team" = 'st. louis' | wikisql |
CREATE TABLE table_name_92 (
meet VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to meet that has a time 2:15.93
| SELECT meet FROM table_name_92 WHERE time = "2:15.93" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | SELECT Tags.TagName AS tagName, MAX(Tags.Count) AS overallCount, COUNT(a.Id) AS IdCounts, MAX(Tags.Count) - COUNT(a.Id) AS Diff, CAST(COUNT(a.Id) AS FLOAT) / CAST(MAX(Tags.Count) AS FLOAT) AS portion FROM (SELECT Questions.Id AS ID FROM Posts AS Questions INNER JOIN PostTags ON (Questions.Id = PostTags.PostId) INNER JO... | sede |
CREATE TABLE table_name_68 (
engine VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Engine has a Finish of 21?
| SELECT engine FROM table_name_68 WHERE finish = "21" | sql_create_context |
CREATE TABLE table_name_49 (
website VARCHAR,
head_coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Website of Head Coach Yuriy Korotkevich?
| SELECT website FROM table_name_49 WHERE head_coach = "yuriy korotkevich" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_7040 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Margin of victory" text,
"Tournament Location" text,
"Purse ( US$ )" real,
"Winner's share" real
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT SUM("Winner's share") FROM table_7040 WHERE "Champion" = 'ai miyazato' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE T... | 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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NE... | atis |
CREATE TABLE table_44972 (
"Player" text,
"League" real,
"Title Playoff" real,
"Super Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Title Playoff, when Total is less than 3, and when League is greater than '2'?... | SELECT MIN("Title Playoff") FROM table_44972 WHERE "Total" < '3' AND "League" > '2' | wikisql |
CREATE TABLE table_name_15 (
date VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was versmold?
| SELECT date FROM table_name_15 WHERE tournament = "versmold" | sql_create_context |
CREATE TABLE table_name_69 (
away_team VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team when the attendance was 206?
| SELECT away_team FROM table_name_69 WHERE attendance = "206" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb... | css |
CREATE TABLE table_name_57 (
difference VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the difference of the team with 12 points?
| SELECT difference FROM table_name_57 WHERE points = 12 | sql_create_context |
CREATE TABLE table_name_50 (
date VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the total 25 45?
| SELECT date FROM table_name_50 WHERE total = "25–45" | sql_create_context |
CREATE TABLE table_34256 (
"Abbr." text,
"Name" text,
"Picture Coding Types" text,
"Chroma Format" text,
"Aspect Ratios" text,
"Scalable modes" text,
"Intra DC Precision" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Picture Coding Typ... | SELECT "Picture Coding Types" FROM table_34256 WHERE "Chroma Format" = '4:2:2 or 4:2:0' AND "Name" = '4:2:2 profile' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT COUNT(DISTINCT (q.Id)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id INNER JOIN Posts AS aa ON aa.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND aa.PostTypeId = 2 AND q.AnswerCount >= 2 AND DATEDIFF(DAY, q.CreationDate, CreationDate) <= 7 AND DATEDIFF(DAY, q.CreationDate, CreationDa... | sede |
CREATE TABLE table_22893 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the ... | SELECT "Original air date" FROM table_22893 WHERE "Title" = 'Secret Weapons' | wikisql |
CREATE TABLE table_name_69 (
architecture VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Architecture was released on Release date 1988-05-27?
| SELECT architecture FROM table_name_69 WHERE release_date = "1988-05-27" | sql_create_context |
CREATE TABLE table_name_35 (
new_returning_same_network VARCHAR,
returning VARCHAR,
show VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network returns april 3, and a Show of shop 'til you drop?
| SELECT new_returning_same_network FROM table_name_35 WHERE returning = "april 3" AND show = "shop 'til you drop" | sql_create_context |
CREATE TABLE table_1342379_10 (
district VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many areas were in the election in 1912
| SELECT COUNT(district) FROM table_1342379_10 WHERE first_elected = 1912 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT demographic.age, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "9258" | mimicsql_data |
CREATE TABLE table_31272 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which MLS team picked player Jason Herrick?
| SELECT "MLS team" FROM table_31272 WHERE "Player" = 'Jason Herrick' | wikisql |
CREATE TABLE table_204_240 (
id number,
"name" text,
"current use" text,
"completed" text,
"namesake" text,
"info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was strosacker hall or presidents house made in 1965 ?
| SELECT "name" FROM table_204_240 WHERE "name" IN ('strosacker hall', 'presidents house') AND "completed" = 1965 | squall |
CREATE TABLE table_19985 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT COUNT("General classification") FROM table_19985 WHERE "Team classification" = 'Quick Step' | wikisql |
CREATE TABLE table_204_99 (
id number,
"#" number,
"club" text,
"winner" number,
"last win" number,
"runner-up" number,
"last losing final" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who has three wins ? malavan or homa ?
| SELECT "club" FROM table_204_99 WHERE "club" IN ('malavan', 'homa') AND "winner" = 3 | squall |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%hong kong%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_65 (
tone VARCHAR,
standard_thai VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tone has a Standard Thai at ?
| SELECT tone FROM table_name_65 WHERE standard_thai = "ปลา" | sql_create_context |
CREATE TABLE table_26302 (
"Vehicle code" text,
"Bore (mm)" text,
"Stroke (mm)" text,
"Capacity (cm 3 )" real,
"Compression ratio" text,
"Torque (N m)" real,
"Power (HP)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the compression... | SELECT "Compression ratio" FROM table_26302 WHERE "Torque (N m)" = '208' | wikisql |
CREATE TABLE table_26448179_4 (
title VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode watched by 3.2 million viewers?
| SELECT title FROM table_26448179_4 WHERE us_viewers__millions_ = "3.2" | sql_create_context |
CREATE TABLE table_33206 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team's score when the home side... | SELECT "Away team score" FROM table_33206 WHERE "Home team score" = '9.4 (58)' | wikisql |
CREATE TABLE table_72317 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes ... | SELECT COUNT("Written by") FROM table_72317 WHERE "U.S. viewers (millions)" = '12.72' | wikisql |
CREATE TABLE table_name_61 (
date VARCHAR,
city___state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date for the City/State of Sydney, New South Wales?
| SELECT date FROM table_name_61 WHERE city___state = "sydney, new south wales" | sql_create_context |
CREATE TABLE table_name_49 (
points INTEGER,
entrant VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of points for the Modena Team Spa after 1991?
| SELECT MAX(points) FROM table_name_49 WHERE entrant = "modena team spa" AND year > 1991 | sql_create_context |
CREATE TABLE table_8810 (
"Date" text,
"Time ( GMT )" text,
"Serial" text,
"Apogee" text,
"Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time (GMT) for the 4A Serial?
| SELECT "Time ( GMT )" FROM table_8810 WHERE "Serial" = '4a' | wikisql |
CREATE TABLE table_15887683_10 (
ppv VARCHAR,
television_service VARCHAR,
package_option VARCHAR,
dar VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ppv for sky famiglia and dar 16:9 for mtv dance
| SELECT ppv FROM table_15887683_10 WHERE package_option = "Sky Famiglia" AND dar = "16:9" AND television_service = "MTV Dance" | sql_create_context |
CREATE TABLE table_14367 (
"Title" text,
"Year" real,
"Platform" text,
"Developer" text,
"Publisher" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the year when the publisher was argonaut games sierra entertainment
| SELECT "Year" FROM table_14367 WHERE "Publisher" = 'argonaut games sierra entertainment' | wikisql |
CREATE TABLE table_name_1 (
airing_date VARCHAR,
number_of_episodes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the airing date for the show with 62 episodes?
| SELECT airing_date FROM table_name_1 WHERE number_of_episodes = 62 | sql_create_context |
CREATE TABLE table_name_83 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has charlton athletic as the away team?
| SELECT score FROM table_name_83 WHERE away_team = "charlton athletic" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_38323 (
"Event" text,
"Round" text,
"Result" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of andry laffita had what score?
| SELECT "Score" FROM table_38323 WHERE "Opponent" = 'andry laffita' | wikisql |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Participates_in (
stuid IN... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank | nvbench |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '5701953' AND JZKSRQ BETWEEN '2003-04-08' AND '2014-07-28' AND TXBZ > 0 | css |
CREATE TABLE table_name_23 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team's score against Hawthorn?
| SELECT away_team AS score FROM table_name_23 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE table_name_64 (
qual VARCHAR,
finish VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What qual had a finish of 16 in 1968?
| SELECT qual FROM table_name_64 WHERE finish = "16" AND year = "1968" | sql_create_context |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid... | SELECT DISTINCT COUNT(paper.paperid), venue.venueid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid GROUP BY venue.venueid ORDER BY COUNT(paper... | scholar |
CREATE TABLE table_name_20 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What away team played Collingwood?
| SELECT away_team FROM table_name_20 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_name_31 (
podiums INTEGER,
wins VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Podiums with 0 as wins, and a season later than 1985?
| SELECT MAX(podiums) FROM table_name_31 WHERE wins = 0 AND season > 1985 | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '84177470' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ... | css |
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 Reputation, Id AS "user_link", Location, age FROM Users WHERE Location LIKE '%##country##%' ORDER BY Reputation DESC | sede |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_27008 (
"Artist/Band" text,
"Song" text,
"Disney affiliated" text,
"Released" real,
"US exclusive" text,
"EU exclusive" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the us exclusive for miley cyrus
| SELECT "US exclusive" FROM table_27008 WHERE "Artist/Band" = 'Miley Cyrus' | wikisql |
CREATE TABLE table_44091 (
"Usage" text,
"Class" text,
"Performance" text,
"Performance test" text,
"Particulate size approaching 100% retention" text,
"Test Standard" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Performance has a Test S... | SELECT "Performance" FROM table_44091 WHERE "Test Standard" = 'bs en779' AND "Particulate size approaching 100% retention" = '>2µm' AND "Class" = 'f6' | wikisql |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address ... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_name_37 (
extra VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the extra result of the 4th game?
| SELECT extra FROM table_name_37 WHERE result = "4th" | sql_create_context |
CREATE TABLE table_63702 (
"Year" real,
"Baden" text,
"W\u00fcrttemberg" text,
"Nordbayern" text,
"S\u00fcdbayern" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the S dbayern in 1928?
| SELECT "S\u00fcdbayern" FROM table_63702 WHERE "Year" = '1928' | wikisql |
CREATE TABLE table_44638 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country had the runner abubaker kaki khamis in lane 5?
| SELECT "Country" FROM table_44638 WHERE "Lane" = '5' AND "Name" = 'abubaker kaki khamis' | wikisql |
CREATE TABLE table_name_68 (
date VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the dage of catalog asw 28033?
| SELECT date FROM table_name_68 WHERE catalog = "asw 28033" | sql_create_context |
CREATE TABLE table_name_6 (
name VARCHAR,
death VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name with a death in 2001?
| SELECT name FROM table_name_6 WHERE death = "2001" | sql_create_context |
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE mill (
architect_id number,
id number,
location text,
name text,
type text,
built_year number,
notes text
)
CREATE TABLE bridge (
architect_id number,
id number,
name text,... | SELECT COUNT(*) FROM architect WHERE NOT id IN (SELECT architect_id FROM mill WHERE built_year < 1850) | spider |
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND jybgb.YLJGDM = jybgb_jyjgzbb.Y... | css |
CREATE TABLE table_62029 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Party, when Results is 'Re-Elected', and when District is 'Louisiana 5'?
| SELECT "Party" FROM table_62029 WHERE "Results" = 're-elected' AND "District" = 'louisiana 5' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | 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 = "Seroma complicting proc" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_name_11 (
regulatory_citation VARCHAR,
standard VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the regulatory citation when the standard is 15 g/m ?
| SELECT regulatory_citation FROM table_name_11 WHERE standard = "15 μg/m³" | sql_create_context |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69819) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '... | mimic_iii |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | SELECT COUNT(PostId) FROM PostHistory WHERE PostHistoryTypeId = 11 AND DATEDIFF(day, CreationDate, GETDATE()) < 60 | sede |
CREATE TABLE table_name_29 (
rank VARCHAR,
code__iata_icao_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ranks have a Code (IATA/ICAO) of ord/kord?
| SELECT COUNT(rank) FROM table_name_29 WHERE code__iata_icao_ = "ord/kord" | sql_create_context |
CREATE TABLE table_name_86 (
score_in_final VARCHAR,
partnering VARCHAR,
opponents_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of the game against shingo kunieda maikel scheffers when robin ammerlaan was Ronald Vink's... | SELECT score_in_final FROM table_name_86 WHERE partnering = "robin ammerlaan" AND opponents_in_final = "shingo kunieda maikel scheffers" | sql_create_context |
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 lab (
labid numbe... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosist... | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT zyjzjlb.JZLSH 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.RYBH = '69103720' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-11-04') | css |
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 FROM gwyjzb WHERE gwyjzb.PERSON_NM = '严志用' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6005.61) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '严志用' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22... | css |
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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" | mimicsql_data |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TAB... | SELECT stuid FROM sportsinfo INTERSECT SELECT stuid FROM plays_games | spider |
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 hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
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 COUNT(*) FROM jybgb WHERE jybgb.YLJGDM = '7241145' AND jybgb.BGRQ BETWEEN '2008-07-10' AND '2012-10-17' | css |
CREATE TABLE manufacturers (
name VARCHAR,
headquarter VARCHAR,
revenue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.
| SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC | sql_create_context |
CREATE TABLE table_name_88 (
label VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the label on the United States?
| SELECT label FROM table_name_88 WHERE country = "united states" | sql_create_context |
CREATE TABLE table_name_1 (
league_goals INTEGER,
league_apps VARCHAR,
fa_cup_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest league goals when the league apps is 1 and the fa cup goals is more than 0?
| SELECT MIN(league_goals) FROM table_name_1 WHERE league_apps = "1" AND fa_cup_goals > 0 | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE city (
city_code varchar,
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
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 School_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | SELECT (SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2008-09-02' AND '2016-11-08' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 1) - (SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2008-09-02' AND '2016-11-08' AND t_kc22.MED_INV_ITEM_TYPE = '... | css |
CREATE TABLE table_name_19 (
win__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the win percentage for the 2012 of olympic games?
| SELECT win__percentage FROM table_name_19 WHERE 2012 = "olympic games" | sql_create_context |
CREATE TABLE table_name_66 (
lost VARCHAR,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games lost associated with under 14 played?
| SELECT COUNT(lost) FROM table_name_66 WHERE played < 14 | sql_create_context |
CREATE TABLE table_name_8 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the score on april 27 with visitor of buffalo
| SELECT score FROM table_name_8 WHERE visitor = "buffalo" AND date = "april 27" | sql_create_context |
CREATE TABLE table_name_10 (
location VARCHAR,
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location before game 44, and a 20-16 record?
| SELECT location FROM table_name_10 WHERE game < 44 AND record = "20-16" | sql_create_context |
CREATE TABLE table_2687 (
"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.
-- Name th... | SELECT COUNT("High rebounds") FROM table_2687 WHERE "Location Attendance" = 'United Center 19,335' | wikisql |
CREATE TABLE table_41925 (
"Round" text,
"Opposition" text,
"First leg" text,
"Second leg" text,
"Aggregate score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first leg score in the match against Twente?
| SELECT "First leg" FROM table_41925 WHERE "Opposition" = 'twente' | wikisql |
CREATE TABLE table_60507 (
"Date" text,
"Opponent" text,
"Score" text,
"Site/Stadium" text,
"Loss" text,
"Save" text,
"Attendance" real,
"Overall Record" text,
"NCAAT Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the... | SELECT "Save" FROM table_60507 WHERE "Opponent" = 'rice' | wikisql |
CREATE TABLE qtb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '邹正初' AND t_kc22.STA_DATE BETWEEN '2015-03-28' AND '2019-07-23' AND qtb.MED_SER_ORG_NO = '0625386' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN... | css |
CREATE TABLE table_26961951_4 (
us_viewers__million_ VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers in millions did the Alison McDonald episode get?
| SELECT us_viewers__million_ FROM table_26961951_4 WHERE written_by = "Alison McDonald" | sql_create_context |
CREATE TABLE table_78574 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Place of england with a Score larger than 66?
| SELECT "Place" FROM table_78574 WHERE "Country" = 'england' AND "Score" > '66' | wikisql |
CREATE TABLE table_8294 (
"LB&SC Number" real,
"Built" text,
"S.R. Number" real,
"Withdrawal" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the withdrawal when the lb&sc number is less than 16 and the s.r. number is 2011?
| SELECT "Withdrawal" FROM table_8294 WHERE "LB&SC Number" < '16' AND "S.R. Number" = '2011' | wikisql |
CREATE TABLE table_18957 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many clubs had 7 wi... | SELECT COUNT("Club") FROM table_18957 WHERE "Won" = '7' | wikisql |
CREATE TABLE table_name_12 (
grid VARCHAR,
laps VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many grids for heinz-harald frentzen with 61 laps?
| SELECT COUNT(grid) FROM table_name_12 WHERE laps = 61 AND driver = "heinz-harald frentzen" | sql_create_context |
CREATE TABLE table_15781170_3 (
original_air_date VARCHAR,
poll_winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the original air dates when scientology isthe poll winner?
| SELECT original_air_date FROM table_15781170_3 WHERE poll_winner = "Scientology" | sql_create_context |
CREATE TABLE table_79020 (
"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 place of the player with a 66-68-70=204 score?
| SELECT "Place" FROM table_79020 WHERE "Score" = '66-68-70=204' | wikisql |
CREATE TABLE table_203_164 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which opponents scored no goals ?
| SELECT "opponent" FROM table_203_164 WHERE "score" = 0 | squall |
CREATE TABLE table_69438 (
"Rank" real,
"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 total Gold with a Bronze smaller than 7, a Total of 1, a Nation of cape verde, a... | SELECT SUM("Gold") FROM table_69438 WHERE "Bronze" < '7' AND "Total" = '1' AND "Nation" = 'cape verde' AND "Silver" < '0' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.