instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_51524 (
"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 date did the home team of footscray play?
| SELECT "Date" FROM table_51524 WHERE "Home team" = 'footscray' | wikisql |
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 jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1249)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pe 20 fs po' ... | 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 lab.label, lab."CATEGORY" FROM lab WHERE lab.subject_id = "18480" | mimicsql_data |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... | advising |
CREATE TABLE table_name_3 (
average VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average that has 2 for the rank?
| SELECT average FROM table_name_3 WHERE rank = "2" | sql_create_context |
CREATE TABLE table_16344 (
"League" text,
"Sport" text,
"Country" text,
"Season" text,
"Games" real,
"Average attendance" real,
"Total attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the minimum total attendance of the Prem... | SELECT MIN("Total attendance") FROM table_16344 WHERE "Sport" = 'Association football' AND "League" = 'Premier League' | 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
... | WITH rtag AS (SELECT Id AS tagid FROM Tags WHERE TagName = 'r') SELECT TIME_TO_STR(CreationDate, '%Y') AS year, TIME_TO_STR(CreationDate, '%m') AS month, COUNT(DISTINCT Comments.Id) AS numcomments FROM Tags INNER JOIN PostTags ON (Tags.Id = PostTags.TagId AND TagName IN ('r', 'r-faq', 'r-factor', 'r-tree', 'r-commander... | sede |
CREATE TABLE table_13166 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT SUM("Points") FROM table_13166 WHERE "Goals for" < '33' AND "Draws" > '9' | wikisql |
CREATE TABLE table_name_39 (
region VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Region is the MHCL-20004 Catalog?
| SELECT region FROM table_name_39 WHERE catalog = "mhcl-20004" | sql_create_context |
CREATE TABLE table_203_207 (
id number,
"site name" text,
"reason for designation\nbiological interest" number,
"reason for designation\ngeological interest" number,
"area\nhectares" number,
"area\nacres" number,
"coordinates & grid ref" text,
"year in which notified" number,
"other ... | SELECT COUNT("site name") FROM table_203_207 WHERE "year in which notified" > 2000 | squall |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT COUNT(*) FROM jybgb WHERE YLJGDM = '6570884' AND BGRQ BETWEEN '2004-06-22' AND '2018-08-12' | css |
CREATE TABLE table_name_21 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team that had an away team of lincoln city?
| SELECT home_team FROM table_name_21 WHERE away_team = "lincoln city" | sql_create_context |
CREATE TABLE table_34161 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "1992" FROM table_34161 WHERE "1995" = 'atp masters series' | wikisql |
CREATE TABLE table_name_29 (
attendance INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Attendance has a Score of 0:2?
| SELECT MAX(attendance) FROM table_name_29 WHERE score = "0:2" | sql_create_context |
CREATE TABLE table_48498 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played Blackpool when Blackpool was at home?
| SELECT "Away team" FROM table_48498 WHERE "Home team" = 'blackpool' | wikisql |
CREATE TABLE table_40106 (
"Championship" text,
"Current champion(s)" text,
"Previous champion(s)" text,
"Date won" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the current champion in the NECW Heavyweight Championship?
| SELECT "Current champion(s)" FROM table_40106 WHERE "Championship" = 'necw heavyweight champion' | wikisql |
CREATE TABLE table_4430 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player from Canada with a 199 pick?
| SELECT "Player" FROM table_4430 WHERE "Nationality" = 'canada' AND "Pick" = '199' | wikisql |
CREATE TABLE table_name_18 (
played INTEGER,
first_game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of games played in the season before 2005?
| SELECT SUM(played) FROM table_name_18 WHERE first_game < 2005 | sql_create_context |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName ORDER BY LName DESC | nvbench |
CREATE TABLE table_name_41 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Tournament, when 2009 is 'Grand Slam Tournaments'?
| SELECT tournament FROM table_name_41 WHERE 2009 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_71739 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is on at 8:00 when etalk is on at 7:00?
| SELECT "8:00" FROM table_71739 WHERE "7:00" = 'etalk' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, UpVotes, DownVotes FROM Users WHERE Location LIKE '%##Location##%' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_30120761_1 (
area__acres__ VARCHAR,
townland VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many acres in the townland of Coomroe?
| SELECT COUNT(area__acres__) FROM table_30120761_1 WHERE townland = "Coomroe" | sql_create_context |
CREATE TABLE table_name_23 (
result VARCHAR,
nominee_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Nominee Neal Baer had what result?
| SELECT result FROM table_name_23 WHERE nominee_s_ = "neal baer" | sql_create_context |
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE csu_fees (
campus number,
year number,
campusfee number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE faculty (
campus number... | SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1 | spider |
CREATE TABLE table_66928 (
"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 is the location of the match where the method ... | SELECT "Location" FROM table_66928 WHERE "Method" = 'submission (armbar)' AND "Opponent" = 'mayra conde' | wikisql |
CREATE TABLE table_72271 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the womens singles of naoko fukuman kurumi yo... | SELECT "Womens singles" FROM table_72271 WHERE "Womens doubles" = 'Naoko Fukuman Kurumi Yonao' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2168" AND lab.itemid = "51436" | mimicsql_data |
CREATE TABLE table_29959 (
"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.
-- Who an... | SELECT "High points" FROM table_29959 WHERE "Team" = 'Detroit' | wikisql |
CREATE TABLE table_70467 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which gender has Years of 1 8, an Authority of state, a Roll less than 1... | SELECT "Gender" FROM table_70467 WHERE "Years" = '1–8' AND "Authority" = 'state' AND "Roll" < '184' AND "Name" = 'matatoki school' | wikisql |
CREATE TABLE table_16886076_1 (
coronie VARCHAR,
marowijne VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the coronie for marowijne being 6.8%
| SELECT coronie FROM table_16886076_1 WHERE marowijne = "6.8%" | sql_create_context |
CREATE TABLE table_54405 (
"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.
-- If the Away team scored 18.8 (116), what was the... | SELECT "Home team score" FROM table_54405 WHERE "Away team score" = '18.8 (116)' | wikisql |
CREATE TABLE table_52296 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was nominee nominated for outstanding featured actor in a musical?
| SELECT "Nominee" FROM table_52296 WHERE "Category" = 'outstanding featured actor in a musical' AND "Result" = 'nominated' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY SUM(Revenue) DESC | nvbench |
CREATE TABLE table_name_11 (
play_by_play VARCHAR,
color_commentator_s_ VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Play-by-play when the color commentator was Eric Wynalda, earlier than 2005?
| SELECT play_by_play FROM table_name_11 WHERE color_commentator_s_ = "eric wynalda" AND year < 2005 | sql_create_context |
CREATE TABLE table_10493 (
"Date" text,
"Champion" text,
"2nd Place" text,
"Score" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the Vikings won the championship at Namyangju Stadium?
| SELECT "Score" FROM table_10493 WHERE "Champion" = 'vikings' AND "Stadium" = 'namyangju stadium' | wikisql |
CREATE TABLE table_15681686_4 (
rank__timeslot_ VARCHAR,
viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of rank where viewers is 9.38?
| SELECT COUNT(rank__timeslot_) FROM table_15681686_4 WHERE viewers__millions_ = "9.38" | sql_create_context |
CREATE TABLE table_71927 (
"Album or Song" text,
"Band" text,
"Memebrship" text,
"Role" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which band plays Self Versus Self - Immersion?
| SELECT "Band" FROM table_71927 WHERE "Album or Song" = 'self versus self - immersion' | wikisql |
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
)
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
)
-- Using valid SQLite, answer th... | SELECT COUNT(*) FROM actor | spider |
CREATE TABLE hotels (
hotel_id number,
star_rating_code text,
pets_allowed_yn text,
price_range number,
other_hotel_details text
)
CREATE TABLE photos (
photo_id number,
tourist_attraction_id number,
name text,
description text,
filename text,
other_details text
)
CREATE TA... | SELECT address FROM locations WHERE location_name = "UK Gallery" | spider |
CREATE TABLE table_14965 (
"Home" text,
"Score" text,
"Away" text,
"Venue" text,
"Golden point(s) scorer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Golden point(s) scorer has the Away Sydney Roosters and Home Cronulla Sharks?
| SELECT "Golden point(s) scorer" FROM table_14965 WHERE "Away" = 'sydney roosters' AND "Home" = 'cronulla sharks' | wikisql |
CREATE TABLE table_45652 (
"Class" text,
"Team" text,
"Driver" text,
"Chassis \u2013 Engine" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Laps did Bob Wollek have?
| SELECT AVG("Laps") FROM table_45652 WHERE "Driver" = 'bob wollek' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Creation... | SELECT * FROM Users WHERE Id = 975271 | sede |
CREATE TABLE table_71490 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school with a decile of 7 is in upper hutt?
| SELECT "Name" FROM table_71490 WHERE "Decile" = '7' AND "Area" = 'upper hutt' | wikisql |
CREATE TABLE table_name_58 (
games_won VARCHAR,
points_for VARCHAR,
points_against VARCHAR,
bonus_points VARCHAR,
points_difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Games won has Bonus points larger than 1, a Points difference... | SELECT COUNT(games_won) FROM table_name_58 WHERE bonus_points > 1 AND points_difference < 50 AND points_against = 106 AND points_for < 152 | sql_create_context |
CREATE TABLE table_name_15 (
week_1_sept_7 VARCHAR,
preseason VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Week 1 result of Colorado State?
| SELECT week_1_sept_7 FROM table_name_15 WHERE preseason = "colorado state" | sql_create_context |
CREATE TABLE procedures (
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 demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "31066" | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_42567 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what round was the first outside linebacker picked?
| SELECT MIN("Round") FROM table_42567 WHERE "Position" = 'outside linebacker' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id num... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 25696 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | mimic_iii |
CREATE TABLE table_56881 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the w... | SELECT "Winning driver" FROM table_56881 WHERE "Race" = 'belgian grand prix' | wikisql |
CREATE TABLE table_204_627 (
id number,
"date" text,
"opponent" text,
"score" text,
"top scorer (total points)" text,
"venue (location)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- this team faced sta . lucia and had who as their top scorer w... | SELECT "top scorer (total points)" FROM table_204_627 WHERE "opponent" = 'coca cola' | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER" AND demographic.age < "70" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay > "43" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454' AND NOT patient.hospitaldischargetime... | eicu |
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE TABLE museums (
museum_id number,
museum_details text
)
CREATE TABLE tourist_attractions (
tourist_attraction_id number,
attraction_type_code text,
location_id number,
how_to_get_there text,
name text,
des... | SELECT T1.name, T1.description FROM photos AS T1 JOIN tourist_attractions AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id WHERE T2.name = "film festival" | spider |
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,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT COUNT(mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017') AND treatment.treatme... | eicu |
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 * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '94975740' AND hz_info.YLJGDM = '0156079' AND zyjzjlb.JZKSMC LIKE '%重症%' | css |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDat... | SELECT STR_TO_TIME(caffe.month + '-01 13:37:00', '%Y-%m-%d %H:%M:%S') AS "month", caffe.count AS "caffe", tf.count AS "tensorflow" FROM (SELECT CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(7)) AS "month", COUNT(*) AS "count" FROM "stackoverflow".dbo.Posts AS p WHERE p.PostTypeId = 1 AND p.Tags LIKE '%<ca... | sede |
CREATE TABLE table_56275 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss when the record was 34-56?
| SELECT "Loss" FROM table_56275 WHERE "Record" = '34-56' | wikisql |
CREATE TABLE table_9377 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which To par has a Score larger than 68?
| SELECT "To par" FROM table_9377 WHERE "Score" > '68' | wikisql |
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 advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/80' | atis |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '卫若兰' AND gwyjzb.MED_SER_ORG_NO = '6106826' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '谢%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '卫若兰' AND fgwyjzb.MED_SER_ORG_NO = '6106826' AN... | css |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5801')) AND STRFTIME('%y-%m', allergy.allergytime) = '2100-03' | eicu |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEG... | SELECT gender, COUNT(*) FROM Dorm GROUP BY gender | nvbench |
CREATE TABLE table_1969577_1 (
joined INTEGER,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most joined for molloy college
| SELECT MAX(joined) FROM table_1969577_1 WHERE institution = "Molloy College" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT diagnoses.long_title, procedures.icd9_code FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "7578" | mimicsql_data |
CREATE TABLE table_67114 (
"Rank" real,
"Airport" text,
"City" text,
"Code (IATA/ICAO)" text,
"2008" real,
"2009" real,
"2010" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of airport with a (IATA/ICAO) of bcm/lrbc code and... | SELECT MIN("Rank") FROM table_67114 WHERE "Code (IATA/ICAO)" = 'bcm/lrbc' AND "2010" > '240,735' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND treatment.treatmentname = 'alpha/beta blocker' A... | eicu |
CREATE TABLE table_name_14 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What opponent has april 10 as the date?
| SELECT opponent FROM table_name_14 WHERE date = "april 10" | sql_create_context |
CREATE TABLE table_45395 (
"Rank" text,
"Name" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Height (m) of the 32= Rank Building with 18 Floors and Height (ft) greater than 171?
| SELECT AVG("Height (m)") FROM table_45395 WHERE "Floors" = '18' AND "Height (ft)" > '171' AND "Rank" = '32=' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Price, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE table_32011 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning drivers" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What brand of vehicle won a race driven by Tazio Nuvolari?
| SELECT "Winning constructor" FROM table_32011 WHERE "Winning drivers" = 'tazio nuvolari' | wikisql |
CREATE TABLE drivers (
forename VARCHAR,
surname VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the forename and surname of drivers whose nationality is German?
| SELECT forename, surname FROM drivers WHERE nationality = "German" | sql_create_context |
CREATE TABLE table_27895 (
"Settlement" text,
"Cyrillic Name" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different types of ... | SELECT COUNT("Type") FROM table_27895 WHERE "Settlement" = 'Nova Pazova' | wikisql |
CREATE TABLE table_name_93 (
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silver medals does China have?
| SELECT COUNT(silver) FROM table_name_93 WHERE nation = "china" | sql_create_context |
CREATE TABLE table_47042 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" 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 "1999" FROM table_47042 WHERE "Tournament" = 'rome' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15905) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-110 month'... | mimic_iii |
CREATE TABLE table_30891 (
"Number" text,
"Serial Number" real,
"Into Service" text,
"Withdrawn" text,
"Scrapped" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the into service for dh2
| SELECT "Into Service" FROM table_30891 WHERE "Number" = 'DH2' | wikisql |
CREATE TABLE table_48975 (
"Season" text,
"Team" text,
"Games" text,
"Disposals" text,
"Kicks" text,
"Handballs" text,
"Marks" text,
"Tackles" text,
"Goals" text,
"Behinds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ... | SELECT "Marks" FROM table_48975 WHERE "Season" = '2005' | wikisql |
CREATE TABLE table_name_93 (
enrollment_08_09 VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total enrollment 08-09 of Franklin County?
| SELECT COUNT(enrollment_08_09) FROM table_name_93 WHERE school = "franklin county" | sql_create_context |
CREATE TABLE table_202_76 (
id number,
"member" text,
"party" text,
"term" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which member of the second incarnation of the lachlan was also a nationalist ?
| SELECT "member" FROM table_202_76 WHERE "party" = 'nationalist' | squall |
CREATE TABLE table_dev_59 (
"id" int,
"gender" string,
"st_elevation" int,
"tow_contiguous_limb" bool,
"body_weight" float,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"two_contiguous_precordial_leads" bool,
"unprotected_left_main_stenosis" int,
"body_m... | SELECT * FROM table_dev_59 WHERE body_weight < 120 AND body_mass_index_bmi < 40 | criteria2sql |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type | nvbench |
CREATE TABLE table_55801 (
"Name" text,
"Date of birth" text,
"Date of death" text,
"Reign" text,
"Relationship with predecessor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Reign of the person whose Date of Birth was 22 March 1459?
| SELECT "Reign" FROM table_55801 WHERE "Date of birth" = '22 march 1459' | wikisql |
CREATE TABLE table_39157 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games have November 7 as the date, and points greater than 17?
| SELECT COUNT("Game") FROM table_39157 WHERE "November" = '7' AND "Points" > '17' | wikisql |
CREATE TABLE table_52499 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was th... | SELECT "Winning driver" FROM table_52499 WHERE "Race" = 'dutch grand prix' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_ORG_DEPT_CD, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '3120762' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_CD | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Citalopram" | mimicsql_data |
CREATE TABLE table_name_84 (
senior_list VARCHAR,
date_of_birth__age_when_delisted_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed under Senior List for Date of Birth (Age When Delisted) of 5 June 1984 (aged 23)?
| SELECT senior_list FROM table_name_84 WHERE date_of_birth__age_when_delisted_ = "5 june 1984 (aged 23)" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT (SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2008-10-30' AND '2019-02-03' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 1) - (SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2008-10-30' AND '2019-02-03' AND t_kc22.MED_INV_ITEM_TYPE = '... | css |
CREATE TABLE table_45771 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record on October 13, when philadelphia was the home t... | SELECT "Record" FROM table_45771 WHERE "Home" = 'philadelphia' AND "Date" = 'october 13' | wikisql |
CREATE TABLE table_29853 (
"English" text,
"Predecessor" text,
"Ekavian" text,
"Ikavian" text,
"Ijekavian" text,
"Ijekavian development" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Ikavian translation of the Ijekavian word lijep?
| SELECT "Ikavian" FROM table_29853 WHERE "Ijekavian" = 'lijep' | wikisql |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college) | spider |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compa... | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND to... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.