instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_20484 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on October 8, 1989?
| SELECT "Record" FROM table_20484 WHERE "Date" = 'October 8, 1989' | wikisql |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)... | SELECT origin, destination FROM flight WHERE price > 300 | spider |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
r... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'eosinophils') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49176 AND admiss... | mimic_iii |
CREATE TABLE table_name_65 (
free_fare_zone VARCHAR,
station_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the free fare zone for the Arena station?
| SELECT free_fare_zone FROM table_name_65 WHERE station_name = "arena" | sql_create_context |
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 AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay = "15" | mimicsql_data |
CREATE TABLE table_name_69 (
track VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What track did they race on at the Fountain of Youth Stakes?
| SELECT track FROM table_name_69 WHERE race = "fountain of youth stakes" | sql_create_context |
CREATE TABLE table_23196 (
"Name" text,
"Nation" text,
"Position" text,
"FA Cup Apps" real,
"FA Cup Goals" real,
"Total Apps" real,
"Total Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the fa cup apps for arthur morton
| SELECT "FA Cup Apps" FROM table_23196 WHERE "Name" = 'Arthur Morton' | wikisql |
CREATE TABLE table_name_90 (
gain VARCHAR,
avg_g VARCHAR,
long VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total gain for Brandon Mcrae with a loss less than 4, and an Avg/g less than -0.1?
| SELECT COUNT(gain) FROM table_name_90 WHERE long < 4 AND name = "brandon mcrae" AND avg_g < -0.1 | sql_create_context |
CREATE TABLE city (
Status VARCHAR,
Population INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please show the different statuses of cities and the average population of cities with each status.
| SELECT Status, AVG(Population) FROM city GROUP BY Status | sql_create_context |
CREATE TABLE table_60356 (
"Tournament" text,
"1988" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"Career SR" text,
"Career Win-Loss" text
)
-- Using vali... | SELECT "Tournament" FROM table_60356 WHERE "1988" = 'a' AND "1999" = '2r' | wikisql |
CREATE TABLE table_name_45 (
competition VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Competition has a Year larger than 2000?
| SELECT competition FROM table_name_45 WHERE year > 2000 | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
View... | SELECT a.Id AS "post_link", a.Score FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.CommunityOwnedDate IS NULL AND NOT a.CommunityOwnedDate IS NULL AND q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY a.Score LIMIT 50 | sede |
CREATE TABLE table_1342256_6 (
result VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the result with dbeingtrict being california 10
| SELECT result FROM table_1342256_6 WHERE district = "California 10" | sql_create_context |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE dataset (
datasetid int,
datase... | SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'wei lu' AND paper.year = 2011 AND venue.venueid = paper.venueid AND venue.venuename = 'EMNLP' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the grade studying in room 105.
| SELECT DISTINCT grade FROM list WHERE classroom = 105 | spider |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性牙周炎' AND jyjgzbb.JCZBMC = 'α-羟丁酸脱氢酶' | css |
CREATE TABLE table_72179 (
"Route Name" text,
"Direction" text,
"Termini" text,
"Junctions" text,
"Length" text,
"Population Area" text,
"Remarks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which routes have 'replaced by US 81' listed in... | SELECT "Route Name" FROM table_72179 WHERE "Remarks" = 'Replaced by US 81' | wikisql |
CREATE TABLE table_41751 (
"Variant id" text,
"5\u2019UTR splice" text,
"Coding" text,
"3\u2019UTR sequence" text,
"GenBank id" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which coding entry has a 3'utr sequence of 1a 0 and a 5'utr splice that is... | SELECT "Coding" FROM table_41751 WHERE "3\u2019UTR sequence" = '1a 0' AND "5\u2019UTR splice" = 'abd' | wikisql |
CREATE TABLE table_7429 (
"Player" text,
"FG Pct" real,
"3FGM" real,
"3FGA" real,
"3FG Pct" real,
"FT Pct" real,
"Off Reb" real,
"Def Reb" real,
"Total Reb" real,
"Asst" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT MIN("Asst") FROM table_7429 WHERE "Def Reb" = '1' AND "3FG Pct" < '33.3' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8317' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.h... | eicu |
CREATE TABLE table_53574 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the height of the player who went to oak hill academy?
| SELECT "Height" FROM table_53574 WHERE "School" = 'oak hill academy' | wikisql |
CREATE TABLE table_10339 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game with the attendance of 54,436?
| SELECT "Game site" FROM table_10339 WHERE "Attendance" = '54,436' | wikisql |
CREATE TABLE table_name_26 (
inscription VARCHAR,
identification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the inscription with John Vanbrugh listed as the identification?
| SELECT inscription FROM table_name_26 WHERE identification = "john vanbrugh" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-17412') AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-5 year') | eicu |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SEC... | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_53875 (
"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 average number of silvers for nations with over 1 bronze medal?
| SELECT AVG("Silver") FROM table_53875 WHERE "Bronze" > '1' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Alex Halderman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | advising |
CREATE TABLE table_31655 (
"Year" real,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Rampage's regular season in 1997?
| SELECT "Reg. Season" FROM table_31655 WHERE "Year" = '1997' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('potassium chloride', 'phenylephrine hcl', 'aspirin ec') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'sta... | mimic_iii |
CREATE TABLE table_name_58 (
gold VARCHAR,
silver VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who received the gold at the tournament at bratislava where the Czech Republic received the silver?
| SELECT gold FROM table_name_58 WHERE silver = "czech republic" AND venue = "bratislava" | sql_create_context |
CREATE TABLE table_31957 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the venue for 15 august 2006
| SELECT "Venue" FROM table_31957 WHERE "Date" = '15 august 2006' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE table_name_94 (
yearly_cost_for_paid_account VARCHAR,
monthly_cost_for_paid_account VARCHAR,
userpics_paid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Yearly Cost For Paid Account, when Montly Cost For Paid Account is 5 USD, and w... | SELECT yearly_cost_for_paid_account FROM table_name_94 WHERE monthly_cost_for_paid_account = "5 usd" AND userpics_paid = "50" | sql_create_context |
CREATE TABLE table_name_88 (
history VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the history behind Speedrunner III (SSC3)?
| SELECT history FROM table_name_88 WHERE name = "speedrunner iii (ssc3)" | sql_create_context |
CREATE TABLE table_43024 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week's game was attended by 65,272 people?
| SELECT "Week" FROM table_43024 WHERE "Attendance" = '65,272' | wikisql |
CREATE TABLE table_72974 (
"Segment description" text,
"Date opened" text,
"Line(s)" text,
"Endpoints" text,
"# of new stations" text,
"Length (miles)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date of segment description red line mos-... | SELECT "Date opened" FROM table_72974 WHERE "Segment description" = 'Red Line MOS-2 North' | wikisql |
CREATE TABLE table_18990 (
"Country/Region" text,
"Local title" text,
"Television network" text,
"Seasons and winners" text,
"Judges" text,
"Presenters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the judges with seasons and winner... | SELECT "Judges" FROM table_18990 WHERE "Seasons and winners" = 'Season 1, 2013–2014: Upcoming season' | wikisql |
CREATE TABLE table_27734286_1 (
high_rebounds VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who in the high rebounds is in the honda center 15,625 location attendance?
| SELECT high_rebounds FROM table_27734286_1 WHERE location_attendance = "Honda Center 15,625" | sql_create_context |
CREATE TABLE table_39962 (
"Country" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Silver has a Bronze smaller than 618, and a Country of laos?
| SELECT "Silver" FROM table_39962 WHERE "Bronze" < '618' AND "Country" = 'laos' | wikisql |
CREATE TABLE table_57060 (
"Airing date" text,
"English title (Chinese title)" text,
"Number of episodes" real,
"Genre" text,
"Official website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the airing date for a modern drama with more than... | SELECT "Airing date" FROM table_57060 WHERE "Genre" = 'modern drama' AND "Number of episodes" > '21' | wikisql |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) >= 5 | scholar |
CREATE TABLE table_21120 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT MAX("Rank") FROM table_21120 WHERE "Industry" = 'Oil and gas' AND "Headquarters" = 'Netherlands' | wikisql |
CREATE TABLE table_name_17 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What visitor has march 26 as the date?
| SELECT visitor FROM table_name_17 WHERE date = "march 26" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number... | SELECT COUNT(Posts.Id) AS "count", CONCAT(YEAR(Posts.CreationDate), ' - ', MONTH(Posts.CreationDate)) AS "year_-_month" FROM Posts INNER JOIN (SELECT PostId, Text FROM PostHistory WHERE PostHistoryTypeId = 3 AND Text LIKE '%##Tag##%') AS PostInits ON Posts.Id = PostInits.PostId WHERE NOT Posts.Tags LIKE '%##Tag##%' AND... | sede |
CREATE TABLE table_37664 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of attendance on june 24
| SELECT COUNT("Attendance") FROM table_37664 WHERE "Date" = 'june 24' | wikisql |
CREATE TABLE table_17766232_7 (
semi_final_television_commentator VARCHAR,
spokesperson VARCHAR,
final_television_commentator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the semi-final television commentator when the spokesperson was Colin Ber... | SELECT semi_final_television_commentator FROM table_17766232_7 WHERE spokesperson = "Colin Berry" AND final_television_commentator = "Pete Murray" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 year') | mimic_iii |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", DisplayName, Reputation, Location FROM Users WHERE LOWER(Location) LIKE LOWER('%New Zealand%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_27280 (
"Episode #" real,
"Production Count" real,
"Original Airdate" text,
"Prod. Code" text,
"Title" text,
"Viewing Figures Millions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the original air date(s) for episo... | SELECT "Original Airdate" FROM table_27280 WHERE "Prod. Code" = 'IPEA343L' | wikisql |
CREATE TABLE table_5692 (
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 9 Oct 26" text,
"Week 10 Nov 2" text,
"Week 11 Nov 9" text,
"Week 13 Nov 23" text,
"Week 14 Nov 30" text,
"Week 15 (Final) Dec 7" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Week 7 Oct 12" FROM table_5692 WHERE "Week 9 Oct 26" = 'tulsa (7-0)' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BACTSS" | mimicsql_data |
CREATE TABLE table_22894 (
"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.
-- How many u.s.... | SELECT "U.S. viewers (million)" FROM table_22894 WHERE "#" = '16' | wikisql |
CREATE TABLE table_76374 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of bronze of the nation with more than 1 gold and 1 silver medal?... | SELECT AVG("Bronze") FROM table_76374 WHERE "Gold" > '1' AND "Silver" = '1' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | SELECT chartevents.charttime 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 = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
composer text,
milliseconds number,
bytes number,
unitprice number
)
CREATE TABLE customer (
customerid number,
... | SELECT T2.invoicedate FROM customer AS T1 JOIN invoice AS T2 ON T1.customerid = T2.customerid WHERE T1.firstname = "Astrid" AND lastname = "Gruber" | spider |
CREATE TABLE table_name_62 (
size__steps_ INTEGER,
interval_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average size for minor third
| SELECT AVG(size__steps_) FROM table_name_62 WHERE interval_name = "minor third" | sql_create_context |
CREATE TABLE table_name_97 (
order__number VARCHAR,
original_artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the order number that has Aretha Franklin as the original artist?
| SELECT order__number FROM table_name_97 WHERE original_artist = "aretha franklin" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
chartti... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 99647) AND NOT icustays.outtime IS NULL OR... | mimic_iii |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar... | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY COUNT(title) DESC | nvbench |
CREATE TABLE table_46614 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average attendance for matches where the home team was vida?
| SELECT AVG("Attendance") FROM table_46614 WHERE "Home" = 'vida' | wikisql |
CREATE TABLE table_80287 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what lane did inna nikitina have?
| SELECT MAX("Lane") FROM table_80287 WHERE "Name" = 'inna nikitina' | wikisql |
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_assigned_from DATETIME,
job_title_code VARCHAR(10),
date_assigned_to DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(10),
product_name VARCHAR(80),
product_pric... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code | nvbench |
CREATE TABLE table_11449311_2 (
result VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the result(s) with the record of 2-13.
| SELECT result FROM table_11449311_2 WHERE record = "2-13" | sql_create_context |
CREATE TABLE table_71842 (
"Year" text,
"Team" text,
"Attempts" text,
"Completions" text,
"Completion %" text,
"Yards" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the team that has 307 attempts?
| SELECT "Team" FROM table_71842 WHERE "Attempts" = '307' | wikisql |
CREATE TABLE table_2293402_2 (
institution VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the school that is private
| SELECT institution FROM table_2293402_2 WHERE type = "Private" | sql_create_context |
CREATE TABLE table_dev_16 (
"id" int,
"white_blood_cell_count_wbc" int,
"autoimmune_disease" bool,
"creatinine_clearance_cl" float,
"platelet_count" float,
"collagen_vascular_disease" bool,
"hypertension" bool,
"systemic_corticosteroids" bool,
"NOUSE" float
)
-- Using valid SQLite,... | SELECT * FROM table_dev_16 WHERE creatinine_clearance_cl > 1.5 | criteria2sql |
CREATE TABLE table_44412 (
"Region" text,
"Name" text,
"Reported birth date" text,
"Reported death date" text,
"Reported age" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the reported death date for laura svehaug?
| SELECT "Reported death date" FROM table_44412 WHERE "Name" = 'laura svehaug' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
h... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16088 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_24887326_6 (
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the away team for tie no 15?
| SELECT away_team FROM table_24887326_6 WHERE tie_no = 15 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2178" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH ... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '奚星光' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2006-11-17') | css |
CREATE TABLE table_49038 (
"Date" real,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent before 1990 that had a score of 4 6, 6 3, 6 4... | SELECT "Opponent in the final" FROM table_49038 WHERE "Date" < '1990' AND "Partnering" = 'yannick noah' AND "Score" = '4–6, 6–3, 6–4' | wikisql |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
... | SELECT date_of_transaction, SUM(share_count) FROM Transactions | nvbench |
CREATE TABLE table_name_4 (
rank INTEGER,
total VARCHAR,
silver VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of rank when silver is more than 1, gold is 2, and total is more than 4?
| SELECT SUM(rank) FROM table_name_4 WHERE silver > 1 AND gold = 2 AND total > 4 | sql_create_context |
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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '41843974' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 1413.96) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '41843974' AND gyb.MED_CLINIC_ID IN (SELECT t_kc2... | css |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT AVG(t_kc24.PER_ACC_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4079416' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-09-11' AND '2014-12-07' | css |
CREATE TABLE table_name_56 (
silver INTEGER,
bronze VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of silvers for teams with more than 21 gold and more than 4 bronze?
| SELECT MIN(silver) FROM table_name_56 WHERE bronze > 4 AND gold > 21 | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '37643909503' AND NOT SOC_SRT_DIRE_NM LIKE '%补肺%' | css |
CREATE TABLE table_44071 (
"Subject" real,
"Proximity" text,
"Honor" text,
"Singular" text,
"Plural" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Plural, when Singular is tor (your)?
| SELECT "Plural" FROM table_44071 WHERE "Singular" = 'tor (your)' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... | advising |
CREATE TABLE table_52222 (
"County" text,
"1900" real,
"1930" real,
"1950" real,
"2000" real,
"2006 est." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest 1930 population when the 2000 population is 43,966 and the 1900 populati... | SELECT MAX("1930") FROM table_52222 WHERE "2000" = '43,966' AND "1900" < '8,401' | wikisql |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY city DESC | nvbench |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | SELECT p.Id AS "post_id", p.Id AS "post_link" FROM Posts AS p WHERE (p.AcceptedAnswerId IS NULL AND NOT (p.ClosedDate IS NULL) AND p.Score < 0 AND NOT EXISTS(SELECT 1 FROM Posts AS aa WHERE aa.ParentId = p.Id AND aa.Score > 0)) ORDER BY p.Id | sede |
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.JCFF 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.BGDH WHERE hz_in... | css |
CREATE TABLE table_name_43 (
award VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Award, when Category is Cabello Maluco?
| SELECT award FROM table_name_43 WHERE category = "cabello maluco" | sql_create_context |
CREATE TABLE table_64682 (
"Time" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team for the match with a home team of Citizen Team A?
| SELECT "Away team" FROM table_64682 WHERE "Home team" = 'citizen team a' | wikisql |
CREATE TABLE table_14342367_7 (
points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did Albert Herrnstein make?
| SELECT points FROM table_14342367_7 WHERE player = "Albert Herrnstein" | sql_create_context |
CREATE TABLE table_27172 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of field goal... | SELECT MIN("Field Goals") FROM table_27172 WHERE "Assists" = '84' | wikisql |
CREATE TABLE table_37757 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the total number of field goals when there were 0 touchdowns and 2 extra points?
| SELECT COUNT("Field goals") FROM table_37757 WHERE "Touchdowns" = '0' AND "Extra points" = '2' | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semest... | SELECT DISTINCT course_offering.friday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'SAC' AND course.number = 305 AND semester.semester = 'WN' AND semester.year = 2016 | advising |
CREATE TABLE table_204_577 (
id number,
"name" text,
"first operational" text,
"numeral system" text,
"computing mechanism" text,
"programming" text,
"turing complete" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is next after zuse z4... | SELECT "name" FROM table_204_577 WHERE "first operational" > (SELECT "first operational" FROM table_204_577 WHERE "name" = 'zuse z4') ORDER BY "first operational" LIMIT 1 | squall |
CREATE TABLE table_name_49 (
winner VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner in 2007?
| SELECT winner FROM table_name_49 WHERE date = 2007 | sql_create_context |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) DESC | nvbench |
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 TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'... | atis |
CREATE TABLE table_35788 (
"Name" text,
"City" text,
"Years as tallest" text,
"Metres" real,
"Feet" real,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed under the Years as tallest, that has Floors of 31?
| SELECT "Years as tallest" FROM table_35788 WHERE "Floors" = '31' | wikisql |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABL... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'luke zettlemoyer' AND writes.authorid = author.authorid | scholar |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.