instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_19642 (
"Position" real,
"Race number" text,
"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 prov... | SELECT "LOA (Metres)" FROM table_19642 WHERE "Elapsed time d:hh:mm:ss" = '2:17:01:05' | wikisql |
CREATE TABLE table_9048 (
"Year" real,
"Winner" text,
"Score" text,
"Runner(s)-up" text,
"Winner's share ($)" real,
"Course" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is runner-up Betsy Rawls from?
| SELECT "Location" FROM table_9048 WHERE "Runner(s)-up" = 'betsy rawls' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT procedures.icd9_code, procedures.short_title FROM procedures WHERE procedures.subject_id = "8440" | mimicsql_data |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)... | SELECT COUNT(*) FROM employee WHERE salary BETWEEN 100000 AND 200000 | spider |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank | nvbench |
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE ndecoreexcel_math_grade8 (
year number,
state text,
all_students text,
average_scale_score number
... | SELECT state FROM ndecoreexcel_math_grade8 ORDER BY average_scale_score DESC LIMIT 1 | studentmathscore |
CREATE TABLE table_10953197_4 (
writer_s_ VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writer for the episode with production code 2395096?
| SELECT writer_s_ FROM table_10953197_4 WHERE production_code = "2395096" | sql_create_context |
CREATE TABLE table_46931 (
"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.
-- Against the Houston Oilers after week 14, what was the result o... | SELECT "Result" FROM table_46931 WHERE "Week" > '14' AND "Opponent" = 'houston oilers' | wikisql |
CREATE TABLE table_42129 (
"Player" text,
"Club" text,
"League" real,
"FA Cup" real,
"FA Trophy" real,
"League Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest league for the league cup more than 1, and a... | SELECT MAX("League") FROM table_42129 WHERE "League Cup" > '1' AND "FA Cup" = '1' | wikisql |
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 ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE table_name_7 (
nation VARCHAR,
cyclist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation is Danilo di Luca from?
| SELECT nation FROM table_name_7 WHERE cyclist = "danilo di luca" | sql_create_context |
CREATE TABLE table_24491017_1 (
team VARCHAR,
f_laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was he on when he had 10 f/laps?
| SELECT team FROM table_24491017_1 WHERE f_laps = 10 | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline... | 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, fare_basis, flight, flight_fare WHERE (((flight.airline_code = 'US') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.to_airport... | atis |
CREATE TABLE table_21552 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ... | SELECT "Date of appointment" FROM table_21552 WHERE "Replaced by" = 'Petrik Sander' | wikisql |
CREATE TABLE table_name_30 (
surface VARCHAR,
city VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Surface will the Venezuela F5 Futures in Caracas be played?
| SELECT surface FROM table_name_30 WHERE city = "caracas" AND tournament = "venezuela f5 futures" | sql_create_context |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VA... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.customer_id | nvbench |
CREATE TABLE table_63736 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest pick when the college is saginaw valley state?
| SELECT MAX("Pick") FROM table_63736 WHERE "College" = 'saginaw valley state' | 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 PostsWithDeleted (
Id number,
PostTypeId number,
Acc... | SELECT u.DisplayName, 'http://stackoverflow.com/users/' + CAST(u.Id AS TEXT(255)) AS "httplink", u.Reputation, COUNT(v.Id) AS "votes" FROM Users AS u INNER JOIN Votes AS v ON v.UserId = u.Id INNER JOIN Posts AS p ON p.Id = v.PostId INNER JOIN Posts AS ans ON p.Id = ans.ParentId INNER JOIN PostTags AS pt ON p.Id = pt.Po... | sede |
CREATE TABLE table_62468 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was the church located in flor built?
| SELECT "Year Built" FROM table_62468 WHERE "Location of the Church" = 'florø' | wikisql |
CREATE TABLE table_76401 (
"Year" text,
"2009" text,
"2008" text,
"2007" text,
"2006" text,
"2005" text,
"2004" text,
"2003" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2008 for 2009 heartland high tech?
| SELECT "2008" FROM table_76401 WHERE "2009" = 'heartland high tech' | wikisql |
CREATE TABLE table_19789597_5 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent for june 12
| SELECT opponent FROM table_19789597_5 WHERE date = "June 12" | sql_create_context |
CREATE TABLE table_59338 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location where the opponent was Jae Yo... | SELECT "Location" FROM table_59338 WHERE "Opponent" = 'jae young kim' | wikisql |
CREATE TABLE table_55156 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low TD for 49 longs and 1436 less yards?
| SELECT MIN("TD's") FROM table_55156 WHERE "Long" = '49' AND "Yards" < '1436' | wikisql |
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 AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '过敏反应科' AND zyb.IN_HOSP_DAYS BETWEEN '2003-04-29' AND '2008-01-03' AND zyb.IN_DIAG_DIS_NM = 'Q89.696' | css |
CREATE TABLE table_62105 (
"Mission" text,
"Resident Country" text,
"Local Location" text,
"Local Mission" text,
"Non-Resident Head of Mission" text,
"Local Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Local Mission, when Mis... | SELECT "Local Mission" FROM table_62105 WHERE "Mission" = 'mauritius' | 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 Id) FROM Users WHERE UPPER(AboutMe) LIKE '%PYTHON%' AND NOT ProfileImageUrl IS NULL | sede |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) | nvbench |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_... | 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 (((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.to... | atis |
CREATE TABLE table_name_28 (
runners_up VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the runners-up in 1996?
| SELECT runners_up FROM table_name_28 WHERE year = "1996" | sql_create_context |
CREATE TABLE table_49382 (
"Result" text,
"Race" text,
"Distance" text,
"Weight" real,
"Winner or 2nd" text,
"Pos'n" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the race with a 10f distance and mollison as the winner or 2nd?
| SELECT "Race" FROM table_49382 WHERE "Distance" = '10f' AND "Winner or 2nd" = 'mollison' | wikisql |
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 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 = '54118858' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_numb... | SELECT T1.position FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Ryley Goldner" | spider |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | SELECT date, AVG(cloud_cover) FROM weather | nvbench |
CREATE TABLE table_name_46 (
february VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is February, when Record is '21-29-11'?
| SELECT february FROM table_name_46 WHERE record = "21-29-11" | sql_create_context |
CREATE TABLE table_name_32 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score when the record was 5-4-2?
| SELECT score FROM table_name_32 WHERE record = "5-4-2" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | SELECT SourceTagName, src.Count, Posts.Body AS "source_tag_wiki_excerpt", TargetTagName, tgt.TagName, ApprovalDate FROM TagSynonyms INNER JOIN Tags AS src ON SourceTagName = src.TagName LEFT JOIN Tags AS tgt ON TargetTagName = tgt.TagName INNER JOIN Posts ON src.ExcerptPostId = Posts.Id ORDER BY SourceTagName | sede |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_47384 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Brian Schweitzer" text,
"Republican: Roy Brown" text,
"Libertarian: Stan Jones" text,
"Lead Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the ... | SELECT SUM("Lead Margin") FROM table_47384 WHERE "Democrat: Brian Schweitzer" = '55%' AND "Libertarian: Stan Jones" = '2%' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc24.CLINIC_ID FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '03724930880' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "HOME" | mimicsql_data |
CREATE TABLE table_204_371 (
id number,
"team" text,
"competition" text,
"category" text,
"appearances\nstart" number,
"appearances\nsub" number,
"goals" number,
"team record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did japa... | SELECT "competition" FROM table_204_371 WHERE "team" = 'japan' AND "goals" = 4 | squall |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many f/c 's -lrb- forward/center -rrb- ar... | SELECT COUNT(*) FROM table_204_93 WHERE "position" = 'f/c' | squall |
CREATE TABLE table_59117 (
"Club" text,
"City" text,
"Stadium" text,
"Capacity" real,
"2007\u201308 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Rovigo's Club?
| SELECT "Club" FROM table_59117 WHERE "City" = 'rovigo' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | SELECT Title, Body FROM Posts WHERE OwnerUserId = 2515498 | sede |
CREATE TABLE table_77199 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Year Named, when Latitude is 37.9N, and when Diameter (km) is greater th... | SELECT AVG("Year named") FROM table_77199 WHERE "Latitude" = '37.9n' AND "Diameter (km)" > '76' | wikisql |
CREATE TABLE trucks (
truck_id number,
truck_licence_number text,
truck_details text
)
CREATE TABLE actual_orders (
actual_order_id number,
order_status_code text,
regular_order_id number,
actual_order_date time
)
CREATE TABLE regular_order_products (
regular_order_id number,
produ... | SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' | spider |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Other and unspecified open wound of head without mention of complication" | mimicsql_data |
CREATE TABLE table_15467476_3 (
tries_for VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tries for, for club cambrian welfare rfc?
| SELECT tries_for FROM table_15467476_3 WHERE club = "Cambrian Welfare RFC" | sql_create_context |
CREATE TABLE table_name_43 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When were the Brewers 27-31?
| SELECT date FROM table_name_43 WHERE record = "27-31" | 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_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 = 'ST. LOUIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHI... | atis |
CREATE TABLE table_72163 (
"Character" text,
"Fate" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Duration" text,
"Final Episode Count" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the actor with character being j... | SELECT "Actor" FROM table_72163 WHERE "Character" = 'Judge Joseph Ratner' | wikisql |
CREATE TABLE table_name_76 (
date VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did he play with peter nyborg?
| SELECT date FROM table_name_76 WHERE partner = "peter nyborg" | sql_create_context |
CREATE TABLE table_74063 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team replaced their manager with ... | SELECT "Team" FROM table_74063 WHERE "Replaced by" = 'Serhat Güller' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | SELECT * FROM Tags WHERE TagName LIKE 'django%' AND WikiPostId IS NULL ORDER BY Count DESC | sede |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city... | SELECT fname, age FROM student WHERE stuid IN (SELECT stuid FROM sportsinfo WHERE sportname = "Football" INTERSECT SELECT stuid FROM sportsinfo WHERE sportname = "Lacrosse") | spider |
CREATE TABLE table_43289 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game that was before week 4 and was attended by over 54,015 people ?
| SELECT "Date" FROM table_43289 WHERE "Week" < '4' AND "Attendance" > '54,015' | 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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155')) AND intakeoutput.cellpath LIKE '%intake%'... | eicu |
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE ... | SELECT AVG(elevation), country FROM airports GROUP BY country | 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 COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '1966400' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 11 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ... | css |
CREATE TABLE table_62093 (
"Chassis code" text,
"Years" text,
"Model" text,
"Engine" text,
"Power" text,
"Torque" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Engine does the w123.026 chassis have?
| SELECT "Engine" FROM table_62093 WHERE "Chassis code" = 'w123.026' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id... | SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE Tags = '<automation>' ORDER BY Score DESC LIMIT 1000 | sede |
CREATE TABLE table_54182 (
"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 highest crowd listed when the away s... | SELECT MAX("Crowd") FROM table_54182 WHERE "Away team score" = '4.9 (33)' | wikisql |
CREATE TABLE course (
title VARCHAR,
course_id VARCHAR
)
CREATE TABLE SECTION (
course_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010?
| SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010 | sql_create_context |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
J... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy... | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
i... | SELECT (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-95228') AND NOT patient.unitdischarget... | eicu |
CREATE TABLE table_77536 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest guard picked?
| SELECT MAX("Pick") FROM table_77536 WHERE "Position" = 'guard' | wikisql |
CREATE TABLE table_60188 (
"Year" real,
"Champion" text,
"Finalist" text,
"Score" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Champion, when Year is greater than 2007, and when Finalist is 'Asvel'?
| SELECT "Champion" FROM table_60188 WHERE "Year" > '2007' AND "Finalist" = 'asvel' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE table_17355716_5 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team where the date is november 17
| SELECT team FROM table_17355716_5 WHERE date = "November 17" | sql_create_context |
CREATE TABLE table_name_1 (
week VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week was there a w 23 14 result?
| SELECT week FROM table_name_1 WHERE result = "w 23–14" | sql_create_context |
CREATE TABLE table_69007 (
"Country" text,
"2006" real,
"2005" real,
"2004" real,
"2003" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Country has a number smaller than 3 in 2004 and larger than 1 in 2005?
| SELECT COUNT("2006") FROM table_69007 WHERE "2004" < '3' AND "2005" > '1' | wikisql |
CREATE TABLE table_20928649_1 (
date VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of game 6?
| SELECT date FROM table_20928649_1 WHERE game = 6 | sql_create_context |
CREATE TABLE table_50357 (
"Team" text,
"Head Coach" text,
"Team Captain" text,
"Kitmaker" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team uses the kitmaker Saller and has Krombacher as their shirt sponsor?
| SELECT "Team" FROM table_50357 WHERE "Kitmaker" = 'saller' AND "Shirt sponsor" = 'krombacher' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_name_40 (
sack INTEGER,
player VARCHAR,
fumr VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total sack for mike green when fumr is less than 0?
| SELECT SUM(sack) FROM table_name_40 WHERE player = "mike green" AND fumr < 0 | sql_create_context |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'contrast via ng' AN... | mimic_iii |
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE tv_series (
sid int,
title text,
release_year int,
num_of_seasons int,
num_of_episodes int,
title_aka text,
budget text
)
CREATE TABLE keyword (... | SELECT movie.title FROM keyword, movie, tags WHERE keyword.keyword = 'Autism' AND tags.kid = keyword.id AND tags.msid = movie.mid | imdb |
CREATE TABLE table_23915973_1 (
frequency VARCHAR,
callsign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency when callsign is dxru-fm?
| SELECT frequency FROM table_23915973_1 WHERE callsign = "DXRU-FM" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '022-158213' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-6 year') | eicu |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY Directed_by DESC | 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 FROM gwyjzb WHERE gwyjzb.PERSON_ID = '77341331' AND gwyjzb.MED_SER_ORG_NO = '3166423' AND NOT gwyjzb.OUT_DIAG_DIS_NM LIKE '%抑郁症%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '77341331' AND fgwyjzb.MED_SER_ORG_NO = '3166423' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE '... | css |
CREATE TABLE table_2282444_1 (
t_c__ VARCHAR,
magnet VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When nd 2 fe 14 b (bonded) is the magnet how many measurements of tc ( c)?
| SELECT COUNT(t_c__) AS °c_ FROM table_2282444_1 WHERE magnet = "Nd 2 Fe 14 B (bonded)" | sql_create_context |
CREATE TABLE table_15128 (
"Hindi" text,
"Romani" text,
"Domari" text,
"Lomavren" text,
"Persian" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Persian word(s) has the same meaning as the Romani word duj?
| SELECT "Persian" FROM table_15128 WHERE "Romani" = 'duj' | wikisql |
CREATE TABLE table_58873 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many totals have a Gold larger than 0, and a Bronze smaller than 0?
| SELECT COUNT("Total") FROM table_58873 WHERE "Gold" > '0' AND "Bronze" < '0' | wikisql |
CREATE TABLE table_42520 (
"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.
-- What company focuses on Engine Overhaul for their principal act... | SELECT "Company" FROM table_42520 WHERE "Principal activities" = 'engine overhaul' | wikisql |
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transac... | SELECT T2.date_of_transaction, COUNT(T2.date_of_transaction) FROM Ref_Transaction_Types AS T1 JOIN Transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 GROUP BY transaction_type_description ORDER BY date_of_transaction | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "496" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_92 (
championships INTEGER,
established VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many championships did the team or teams established in 1976 win?
| SELECT SUM(championships) FROM table_name_92 WHERE established = 1976 | sql_create_context |
CREATE TABLE table_name_26 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team at corio oval?
| SELECT away_team FROM table_name_26 WHERE venue = "corio oval" | sql_create_context |
CREATE TABLE table_44830 (
"Game" text,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the playoffs Game number on April 26?
| SELECT "Game" FROM table_44830 WHERE "Date" = 'april 26' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'RUSSIAN' AND COURSE_1.numb... | advising |
CREATE TABLE table_62525 (
"Date" text,
"Name" text,
"Local Name" text,
"2012 Date" text,
"2013 Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the local name for January 7, 2013?
| SELECT "Local Name" FROM table_62525 WHERE "2013 Date" = 'january 7' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC te... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy... | css |
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREA... | SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code | nvbench |
CREATE TABLE table_name_31 (
laps INTEGER,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of laps for a grid of 6?
| SELECT AVG(laps) FROM table_name_31 WHERE grid = 6 | sql_create_context |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | SELECT personal_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_name_67 (
score VARCHAR,
country VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of T5 place in the United States?
| SELECT score FROM table_name_67 WHERE country = "united states" AND place = "t5" | sql_create_context |
CREATE TABLE table_name_87 (
name VARCHAR,
rank VARCHAR,
begin_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what name has a Rank of lieutenant colonel, and a Begin Date of 1904-02-22 22 february 1904?
| SELECT name FROM table_name_87 WHERE rank = "lieutenant colonel" AND begin_date = "1904-02-22 22 february 1904" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.