instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 procedures (
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND demographic.days_stay = "7" | mimicsql_data |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
-- Using valid SQLite, answer the following questions for the ... | SELECT T1.Date, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID ORDER BY T1.Sales DESC | nvbench |
CREATE TABLE table_75262 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real,
"Participants" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Participants that has Silver that's smaller than 0?
| SELECT SUM("Participants") FROM table_75262 WHERE "Silver" < '0' | wikisql |
CREATE TABLE course (
cid text,
cname text,
credits number,
instructor number,
days text,
hours text,
dno number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE department (
dno number,
division text,
dname text,
room text,
bui... | SELECT T3.fname, T3.lname, T2.gradepoint FROM enrolled_in AS T1 JOIN gradeconversion AS T2 JOIN student AS T3 ON T1.grade = T2.lettergrade AND T1.stuid = T3.stuid | spider |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_10577579_3 (
institution VARCHAR,
men’s_nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college has the men's nickname of the blazers?
| SELECT institution FROM table_10577579_3 WHERE men’s_nickname = "Blazers" | sql_create_context |
CREATE TABLE table_name_93 (
power VARCHAR,
city_of_license VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Power, when City of License is Sioux Lookout?
| SELECT power FROM table_name_93 WHERE city_of_license = "sioux lookout" | sql_create_context |
CREATE TABLE table_name_82 (
character_name VARCHAR,
voice_actor__japanese_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what character did naoko watanabe play
| SELECT character_name FROM table_name_82 WHERE voice_actor__japanese_ = "naoko watanabe" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT COUNT(*), flight.airline_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.to_airport = airport_service.airport_code GROUP BY flight.airline_code | atis |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '6840536' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-11-25' AND '2010-11-03' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '6840536' AND fzzmzjzjlb.JZKSRQ BETWEEN '2002-11-25' AND '2010-11-03' AND fzzmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_name_88 (
rank VARCHAR,
total VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank with more than 0 silver and less than 2 medals total?
| SELECT COUNT(rank) FROM table_name_88 WHERE total < 2 AND silver > 0 | sql_create_context |
CREATE TABLE table_79315 (
"Rank" real,
"Heat" real,
"Lane" real,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Rank that has the Lane of 6, and the Heat of 2?
| SELECT "Rank" FROM table_79315 WHERE "Lane" = '6' AND "Heat" = '2' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id... | SELECT MIN(outputevents.value) 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 = 97121)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'r p... | mimic_iii |
CREATE TABLE table_5937 (
"Medium" text,
"Title" text,
"Date" text,
"Theatre, Studio, or Network" text,
"Role" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the film created by the Screen Guild in 1948?
| SELECT "Title" FROM table_5937 WHERE "Medium" = 'film' AND "Date" = '1948' AND "Theatre, Studio, or Network" = 'screen guild' | wikisql |
CREATE TABLE table_name_41 (
country VARCHAR,
builder VARCHAR,
ship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country was the Pegasus, build by Royal Dockyard, from?
| SELECT country FROM table_name_41 WHERE builder = "royal dockyard" AND ship = "pegasus" | sql_create_context |
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.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '柳... | css |
CREATE TABLE table_name_29 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the Home team in the game that had the Away team of south melbourne?
| SELECT home_team AS score FROM table_name_29 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_26512 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Caught" real,
"Stumped" real,
"Matches" real,
"Innings" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ist he matches where the player is ms dhoni?
| SELECT "Matches" FROM table_26512 WHERE "Player" = 'MS Dhoni' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | SELECT Reputation, DisplayName, WebsiteUrl, AboutMe, Location FROM Users WHERE Location LIKE '%Dhaka%' OR Location = 'Bangladesh' ORDER BY Reputation DESC | sede |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ASTRO' AND course.number = 105 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe... | advising |
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_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '48885255' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 7137.7) | css |
CREATE TABLE CLASS (
class_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different classes are there?
| SELECT COUNT(DISTINCT class_code) FROM CLASS | sql_create_context |
CREATE TABLE table_29118 (
"Country" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT MAX("Ends Lost") FROM table_29118 | wikisql |
CREATE TABLE table_33708 (
"City" text,
"Province" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has an ICAO of ZSXZ?
| SELECT "City" FROM table_33708 WHERE "ICAO" = 'zsxz' | wikisql |
CREATE TABLE table_203_757 (
id number,
"year" number,
"award ceremony" text,
"category" text,
"film/show" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what show/film were both the 2011 filmfare awards and the 2011 screen awards... | SELECT "film/show" FROM table_203_757 WHERE "year" = 2011 AND "award ceremony" = 'filmfare awards' INTERSECT SELECT "film/show" FROM table_203_757 WHERE "year" = 2011 AND "award ceremony" = 'screen awards' | squall |
CREATE TABLE table_14405 (
"City" text,
"Province/Region" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Brisbane airport is located in which country?
| SELECT "Country" FROM table_14405 WHERE "Airport" = 'brisbane airport' | wikisql |
CREATE TABLE table_27457 (
"Rank" real,
"Rider" text,
"Sat 29 May" text,
"Mon 31 May" text,
"Tues 1 June" text,
"Wed 2 June" text,
"Thurs 3 June" text,
"Fri 4 June" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Friday 4 June if ... | SELECT "Fri 4 June" FROM table_27457 WHERE "Wed 2 June" = '20'' 11.98 112.071mph' | wikisql |
CREATE TABLE table_43394 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the margin of victory in a semgroup championship?
| SELECT "Margin of victory" FROM table_43394 WHERE "Tournament" = 'semgroup championship' | wikisql |
CREATE TABLE table_2131 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the judge's total for Roxanne and Daniel?
| SELECT "Judges" FROM table_2131 WHERE "Couple" = 'Roxanne and Daniel' | wikisql |
CREATE TABLE table_43933 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the pick number for the WR position?
| SELECT "Pick #" FROM table_43933 WHERE "Position" = 'wr' | wikisql |
CREATE TABLE table_name_11 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Score of 6 1 7 6 (8 6)?
| SELECT date FROM table_name_11 WHERE score = "6–1 7–6 (8–6)" | sql_create_context |
CREATE TABLE table_name_27 (
venue VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue when the result was position of 17th?
| SELECT venue FROM table_name_27 WHERE position = "17th" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c... | advising |
CREATE TABLE table_name_74 (
name VARCHAR,
moving_to VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name moving to atl tico minero?
| SELECT name FROM table_name_74 WHERE moving_to = "atlético minero" | 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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Seroma complicating a procedure" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_262501_1 (
primary_conference_when_joining_the_csfl VARCHAR,
joined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the primary conference when joining the csfl for the institution that joined in 2004-05?
| SELECT primary_conference_when_joining_the_csfl FROM table_262501_1 WHERE joined = "2004-05" | sql_create_context |
CREATE TABLE table_993 (
"Name" text,
"Population (2002 census)" real,
"Population (2007 estimation)" real,
"Population (2011 census)" real,
"Area (km\u00b2)" text,
"Density (pop/km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many... | SELECT COUNT("Area (km\u00b2)") FROM table_993 WHERE "Population (2007 estimation)" = '7996' | wikisql |
CREATE TABLE table_name_24 (
lost VARCHAR,
against VARCHAR,
position VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What lost has a position greater than 2, a drawn greater than 0, with an against greater than 15?
| SELECT lost FROM table_name_24 WHERE position > 2 AND drawn > 0 AND against > 15 | sql_create_context |
CREATE TABLE table_name_85 (
method VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which method had a time of 0:46?
| SELECT method FROM table_name_85 WHERE time = "0:46" | sql_create_context |
CREATE TABLE table_16577 (
"#" real,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/Share (18-49)" text,
"Viewers (millions)" text,
"Rank (timeslot)" real,
"Rank (night)" real,
"Rank (week)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT COUNT("Viewers (millions)") FROM table_16577 WHERE "Rank (week)" = '20' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE c... | SELECT (SELECT chartevents.valuenum 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 = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.name, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2110" | mimicsql_data |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskSt... | WITH anon_votes AS (SELECT COUNT(CASE VoteTypeId WHEN 2 THEN 1 END) AS upvotes, COUNT(CASE VoteTypeId WHEN 3 THEN 1 END) AS downvotes, COALESCE(ParentId, PostId) AS PostId FROM PostFeedback AS pf JOIN Posts AS p ON PostId = p.Id GROUP BY COALESCE(ParentId, PostId)) SELECT LN(upvotes + downvotes) AS anon_feedback, LN(AV... | sede |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 j... | css |
CREATE TABLE table_203_862 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which artist had almost no points ?
| SELECT "artist" FROM table_203_862 ORDER BY "points" LIMIT 1 | squall |
CREATE TABLE table_12261714_2 (
winner VARCHAR,
young_rider_classification VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the winner in stage 1a, where the leader in the young rider classification is Francesco Casagrande?
| SELECT winner FROM table_12261714_2 WHERE young_rider_classification = "Francesco Casagrande" AND stage = "1a" | sql_create_context |
CREATE TABLE volume (
Song VARCHAR,
Weeks_on_Top INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the songs in volumes with more than 1 week on top?
| SELECT Song FROM volume WHERE Weeks_on_Top > 1 | sql_create_context |
CREATE TABLE table_1942366_9 (
low VARCHAR,
high VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the C_{low} value when C_{high} is 12.0?
| SELECT STRUCT(low) FROM table_1942366_9 WHERE STRUCT(high) = "12.0" | sql_create_context |
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 Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Lots (
... | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY COUNT(lot_details) | nvbench |
CREATE TABLE table_40068 (
"Stake" text,
"Organized" text,
"Wards/ Branches in Arkansas" real,
"Stake President" text,
"Occupation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the organized date of the stake with an occupation of senior b... | SELECT "Organized" FROM table_40068 WHERE "Occupation" = 'senior buyer for wal-mart' | wikisql |
CREATE TABLE table_9480 (
"Poll Source" text,
"Sample Size" real,
"Margin of Error" real,
"Date" text,
"Democrat" text,
"Republican" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the sample size for the poll featuring Republican Ron Pa... | SELECT "Sample Size" FROM table_9480 WHERE "Republican" = 'ron paul' | wikisql |
CREATE TABLE table_37579 (
"Name" text,
"Style" text,
"Opened" real,
"Manufacturer" text,
"Themed Area" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Manufacturer has a Style of steel sit down, and an Opened larger than 2008?
| SELECT "Manufacturer" FROM table_37579 WHERE "Style" = 'steel sit down' AND "Opened" > '2008' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT * FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'data.table' AND p.CreationDate >= '2012-01-01' | sede |
CREATE TABLE table_3157 (
"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.
-- Who directed the ep... | SELECT "Directed by" FROM table_3157 WHERE "Title" = 'Shotgun' | wikisql |
CREATE TABLE staff (
last_name VARCHAR,
staff_id VARCHAR
)
CREATE TABLE complaints (
staff_id VARCHAR,
date_complaint_raised VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the last name of the staff who has handled the first ever complaint?
| SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1 | sql_create_context |
CREATE TABLE table_name_75 (
years_in_orlando VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did Orlando have stanley roberts on the team?
| SELECT years_in_orlando FROM table_name_75 WHERE player = "stanley roberts" | sql_create_context |
CREATE TABLE table_2500440_1 (
population_density__per_km_2__ VARCHAR,
municipal_district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the density per km in Smoky Lake County?
| SELECT population_density__per_km_2__ FROM table_2500440_1 WHERE municipal_district = "Smoky Lake County" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | SELECT Posts.Id AS "post_link", Posts.Score AS "score", Posts.Tags AS "tagged_with" FROM Votes, Posts WHERE (Votes.PostId = Posts.Id) AND (Votes.VoteTypeId = 5) AND (Posts.Tags LIKE '%dynamic%crm%') ORDER BY Posts.Score DESC | sede |
CREATE TABLE table_506 (
"Institution" text,
"Main Campus Location" text,
"Founded" real,
"Mascot" text,
"School Colors" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mascot for the instition of Kansas city Kansas community college?
| SELECT "Mascot" FROM table_506 WHERE "Institution" = 'Kansas City Kansas Community College' | wikisql |
CREATE TABLE table_name_16 (
year VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has the time of 55:29:20?
| SELECT COUNT(year) FROM table_name_16 WHERE time = "55:29:20" | sql_create_context |
CREATE TABLE table_27050336_7 (
district VARCHAR,
delegate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For delegate is mcdonough, patrick l. pat mcdonough, specify all the district.
| SELECT district FROM table_27050336_7 WHERE delegate = "McDonough, Patrick L. Pat McDonough" | sql_create_context |
CREATE TABLE table_name_44 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record of the game on July 3?
| SELECT record FROM table_name_44 WHERE date = "july 3" | sql_create_context |
CREATE TABLE table_204_207 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the only game that had an attendance over 80,000 ?
| SELECT "date" FROM table_204_207 WHERE "attendance" > 80000 | squall |
CREATE TABLE table_name_73 (
no_in_season VARCHAR,
directed_by VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number in the season for the #30 Robert Berlinger series?
| SELECT COUNT(no_in_season) FROM table_name_73 WHERE directed_by = "robert berlinger" AND no_in_series = 30 | sql_create_context |
CREATE TABLE table_name_41 (
date VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the match with Opponent in the final Kenneth Carlsen?
| SELECT date FROM table_name_41 WHERE opponent_in_the_final = "kenneth carlsen" | sql_create_context |
CREATE TABLE table_name_74 (
points VARCHAR,
year VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1972, how many points did the entrant with the March 721G Chassis have?
| SELECT points FROM table_name_74 WHERE year > 1972 AND chassis = "march 721g" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE table_35351 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average drawn number of the team wi... | SELECT AVG("Drawn") FROM table_35351 WHERE "Points" < '70' AND "Played" < '46' | wikisql |
CREATE TABLE table_60956 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number ... | SELECT MAX("Number of households") FROM table_60956 WHERE "Median household income" = '$31,176' AND "Population" < '25,607' | wikisql |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3772" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Evelyn Lawrence" | mimicsql_data |
CREATE TABLE table_name_73 (
run_2 VARCHAR,
country VARCHAR,
run_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the run 2 of the athlete from Australia with a run 1 less than 53.75?
| SELECT run_2 FROM table_name_73 WHERE country = "australia" AND run_1 < 53.75 | sql_create_context |
CREATE TABLE table_36162 (
"Date" real,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the attendance 1,034?
| SELECT MIN("Date") FROM table_36162 WHERE "Attendance" = '1,034' | wikisql |
CREATE TABLE table_name_87 (
seasons_in_esiliiga VARCHAR,
titles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2012 season in Esiliiga more than 4, and more than 0 titles?
| SELECT 2012 FROM table_name_87 WHERE seasons_in_esiliiga > 4 AND titles > 0 | sql_create_context |
CREATE TABLE table_name_49 (
points INTEGER,
against VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Points have an Against smaller than 43, and a Position smaller than 1?
| SELECT SUM(points) FROM table_name_49 WHERE against < 43 AND position < 1 | sql_create_context |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_203_14 (
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.
-- what is the total number of wins for macau ?
| SELECT COUNT(*) FROM table_203_14 WHERE "result" = 'win' | squall |
CREATE TABLE table_80379 (
"Rank" text,
"Goals" text,
"Player" text,
"Club/Clubs" text,
"Career" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what club(s) does Tony Lockett play?
| SELECT "Club/Clubs" FROM table_80379 WHERE "Player" = 'tony lockett' | wikisql |
CREATE TABLE table_24133 (
"Rank" real,
"Average" text,
"Player" text,
"Runs" real,
"Innings" real,
"Not Out" real,
"Period" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what period was the career average 44.10?
| SELECT "Period" FROM table_24133 WHERE "Average" = '44.10' | wikisql |
CREATE TABLE table_29856 (
"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 l... | SELECT "Location Attendance" FROM table_29856 WHERE "Team" = 'Milwaukee' | wikisql |
CREATE TABLE table_203_496 (
id number,
"pos" number,
"country" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many countries have more than 5 medals in total ?
| SELECT COUNT("country") FROM table_203_496 WHERE "total" > 5 | squall |
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '86561769' AND t_kc22.STA_DATE BETWEEN '2002-01-19' AND '2019-07-05' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸文拉法辛缓释片' | css |
CREATE TABLE table_name_17 (
number_of_seasons_in_meistriliiga VARCHAR,
club VARCHAR,
first_season_in_top_division VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons in Meistriliiga when the club was kuressaare also had a first season in top... | SELECT COUNT(number_of_seasons_in_meistriliiga) FROM table_name_17 WHERE club = "kuressaare" AND first_season_in_top_division > 2000 | sql_create_context |
CREATE TABLE table_2701851_5 (
production_code VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many production codes did the episode number in series 46b have?
| SELECT COUNT(production_code) FROM table_2701851_5 WHERE no_in_series = "46b" | sql_create_context |
CREATE TABLE table_25810 (
"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 t... | SELECT "Location Attendance" FROM table_25810 WHERE "Record" = '10-14' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_nu... | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'DAL' AND flight.from_airport = airport.airport_code | atis |
CREATE TABLE table_70833 (
"Name" text,
"Frequency" text,
"Language" text,
"City" text,
"Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the website of the Laredo Sun in the city of Laredo ?
| SELECT "Website" FROM table_70833 WHERE "City" = 'laredo' AND "Name" = 'laredo sun' | wikisql |
CREATE TABLE table_name_4 (
rank INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest ranking for 8:13.67?
| SELECT MIN(rank) FROM table_name_4 WHERE time = "8:13.67" | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_21 (
score VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for place 4?
| SELECT score FROM table_name_21 WHERE place = "4" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 cost (
row_id nu... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833 AND admissions.dischtime IS NULL)) AND transfers... | mimic_iii |
CREATE TABLE table_21314 (
"Position" real,
"best year" text,
"best 2-year period" text,
"best 3-year period" text,
"best 5-year period" text,
"best 10-year period" text,
"best 15-year period" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT "best 10-year period" FROM table_21314 WHERE "best 15-year period" = 'Capablanca' | wikisql |
CREATE TABLE table_24591 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Driver") FROM table_24591 WHERE "Race Time" = '3:09:45' | wikisql |
CREATE TABLE diagnoses_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,
d... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'nitroprusside sodium' ORDER BY prescriptions.... | mimic_iii |
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '李雅蕊' AND t_kc22.STA_DATE BETWEEN '2009-09-20' AND '2016-10-30' AND t_kc22.SOC_SRT_DIRE_CD = '255778471-s' | css |
CREATE TABLE table_16255245_1 (
film_title_used_in_nomination VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the film title for wohin und zur ck - welcome in vienna
| SELECT film_title_used_in_nomination FROM table_16255245_1 WHERE original_title = "Wohin und zurück - Welcome in Vienna" | sql_create_context |
CREATE TABLE table_22528 (
"Series #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the series number that aired on november 11, 1996
| SELECT "Series #" FROM table_22528 WHERE "Original air date" = 'November 11, 1996' | wikisql |
CREATE TABLE table_name_82 (
date VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date is the MHCL-20004 Catalog?
| SELECT date FROM table_name_82 WHERE catalog = "mhcl-20004" | sql_create_context |
CREATE TABLE table_name_46 (
local_time VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the time on September 1?
| SELECT local_time FROM table_name_46 WHERE date = "september 1" | sql_create_context |
CREATE TABLE table_47142 (
"Rank" text,
"Team" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a run 4 of 1:24.4?
| SELECT "Team" FROM table_47142 WHERE "Run 4" = '1:24.4' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.