instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_11545282_12 (
no INTEGER,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which number is the player from Minnesota?
| SELECT MAX(no) FROM table_11545282_12 WHERE school_club_team = "Minnesota" | sql_create_context |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CR... | SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id | nvbench |
CREATE TABLE table_204_813 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did this person throw the javelin in the commonwealth gam... | SELECT "notes" FROM table_204_813 WHERE "competition" = 'commonwealth games' | squall |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance... | SELECT TagName, AVG(Score) AS Score, COUNT(Posts.Id) AS Number FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId GROUP BY TagName ORDER BY COUNT(Posts.Id) DESC, AVG(Score) DESC, TagName | sede |
CREATE TABLE table_39107 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position at the venue of lyon?
| SELECT "Position" FROM table_39107 WHERE "Venue" = 'lyon' | wikisql |
CREATE TABLE table_name_82 (
rich_savage VARCHAR,
undecided VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rich Savage percentage in the poll that had undecideds at 68%?
| SELECT rich_savage FROM table_name_82 WHERE undecided = "68%" | sql_create_context |
CREATE TABLE table_44279 (
"Year" real,
"Name" text,
"Field" text,
"State" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of years that prof. aditya naraian purohit won?
| SELECT COUNT("Year") FROM table_44279 WHERE "Name" = 'prof. aditya naraian purohit' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Uric Acid" | mimicsql_data |
CREATE TABLE table_50798 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did Linda Martin have?
| SELECT COUNT("Points") FROM table_50798 WHERE "Artist" = 'linda martin' | wikisql |
CREATE TABLE table_79348 (
"Year" text,
"Builder" text,
"Model" text,
"Length (ft)" real,
"Propulsion" text,
"Fleet series" text,
"Total" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many international builders are th... | SELECT "Total" FROM table_79348 WHERE "Builder" = 'international' | wikisql |
CREATE TABLE table_61547 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is College/Junior/Club Team (League), when Position is 'Defence', wh... | SELECT "College/junior/club team (league)" FROM table_61547 WHERE "Position" = 'defence' AND "Nationality" = 'canada' AND "Round" < '5' AND "Player" = 'josiah didier' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 mzjzjlb.JZZDBM = 'T31.744' GROUP BY person_info.JGDM | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '俞德本' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-07-1... | css |
CREATE TABLE people (
name VARCHAR,
sex VARCHAR,
people_id VARCHAR
)
CREATE TABLE candidate (
people_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of the candidates whose oppose percentage is the lowest for each sex.
| SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex | sql_create_context |
CREATE TABLE table_41998 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year had a publication of Pazz & Jop?
| SELECT "Year" FROM table_41998 WHERE "Publication" = 'pazz & jop' | wikisql |
CREATE TABLE wrestler (
Name VARCHAR,
LOCATION VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names and location of the wrestlers?
| SELECT Name, LOCATION FROM wrestler | sql_create_context |
CREATE TABLE table_811 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the followi... | SELECT COUNT("Points against") FROM table_811 WHERE "Tries for" = '43' | wikisql |
CREATE TABLE table_57233 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove the ferrari that went 57 laps?
| SELECT "Driver" FROM table_57233 WHERE "Constructor" = 'ferrari' AND "Laps" = '57' | wikisql |
CREATE TABLE table_16575609_4 (
college VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the college for calgary stampeders
| SELECT college FROM table_16575609_4 WHERE cfl_team = "Calgary Stampeders" | sql_create_context |
CREATE TABLE table_43655 (
"Year" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Most wins" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the player in 1976?
| SELECT "Player" FROM table_43655 WHERE "Year" = '1976' | wikisql |
CREATE TABLE table_name_29 (
director VARCHAR,
studio VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed Predator that was filmed with Fox Studio?
| SELECT director FROM table_name_29 WHERE studio = "fox" AND title = "predator" | 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 hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.person_info_XM = '俞欣怡' AND jybgb.BGRQ BETWEEN '2001-01-29' AND '... | css |
CREATE TABLE table_name_10 (
year INTEGER,
owner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year Stuart Janney III was an owner?
| SELECT MIN(year) FROM table_name_10 WHERE owner = "stuart janney iii" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_name_7 (
country VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a Fox television service?
| SELECT country FROM table_name_7 WHERE television_service = "fox" | sql_create_context |
CREATE TABLE table_29988 (
"Pick" real,
"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.
-- For player is adam wiesel mention all the college/junior/club ... | SELECT "College/junior/club team" FROM table_29988 WHERE "Player" = 'Adam Wiesel' | wikisql |
CREATE TABLE table_46252 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Box Score which has an Away team of ... | SELECT "Box Score" FROM table_46252 WHERE "Away team" = 'new zealand breakers' AND "Date" = '7 february' | 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,
... | SELECT COUNT(*) FROM PostLinks WHERE LinkTypeId = 3 | sede |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_45021 (
"Antibody" text,
"Brand name" text,
"Approval date" real,
"Type" text,
"Target" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the target of the antibody rituximab?
| SELECT "Target" FROM table_45021 WHERE "Antibody" = 'rituximab' | wikisql |
CREATE TABLE table_203_791 (
id number,
"represented" text,
"contestant" text,
"age" number,
"height" text,
"hometown" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of delegates ?
| SELECT COUNT("contestant") FROM table_203_791 | squall |
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.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '75906484' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 1703.04) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '75906484' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE table_8077 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Game on May 24 with Road Team Seattle?
| SELECT "Game" FROM table_8077 WHERE "Road Team" = 'seattle' AND "Date" = 'may 24' | wikisql |
CREATE TABLE table_45871 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Method, when Opponent is 'Chalid Arrab'?
| SELECT "Method" FROM table_45871 WHERE "Opponent" = 'chalid arrab' | wikisql |
CREATE TABLE table_name_41 (
years VARCHAR,
authority VARCHAR,
decile VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which years have a Decile smaller than 6, an Area of te kuiti, and an Authority of state integrated?
| SELECT years FROM table_name_41 WHERE decile < 6 AND area = "te kuiti" AND authority = "state integrated" | sql_create_context |
CREATE TABLE table_name_33 (
player VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player is a kicker?
| SELECT player FROM table_name_33 WHERE position = "kicker" | sql_create_context |
CREATE TABLE table_25640730_7 (
canadian_viewers__millions_ VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the director is Yannick Bisson, what was the Canadian amount of viewers?
| SELECT COUNT(canadian_viewers__millions_) FROM table_25640730_7 WHERE directed_by = "Yannick Bisson" | 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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "PITUITARY BLEED" | mimicsql_data |
CREATE TABLE table_29050051_3 (
_number INTEGER,
position VARCHAR,
previous_school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number a guard from brophy college prep wore?
| SELECT MAX(_number) FROM table_29050051_3 WHERE position = "Guard" AND previous_school = "Brophy College Prep" | sql_create_context |
CREATE TABLE table_28843 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district does the incumbent Luther Reily represent?
| SELECT "District" FROM table_28843 WHERE "Incumbent" = 'Luther Reily' | wikisql |
CREATE TABLE table_17190012_7 (
high_points VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who scored highest points on the game with record 27 5
| SELECT high_points FROM table_17190012_7 WHERE record = "27–5" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 29410)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2100-10-18') - (SEL... | mimic_iii |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id... | SELECT COUNT(*) > 0 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 = 14054)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sc 20 fe... | mimic_iii |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "4341" | mimicsql_data |
CREATE TABLE table_18856 (
"District" text,
"2012 Commission" text,
"2010 Commission" text,
"2007 Commission" text,
"2002 Commission" text,
"1999 Commission" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is on the 2002 commission from distr... | SELECT "2002 Commission" FROM table_18856 WHERE "District" = 'District 3' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'assault nos') AND ... | mimic_iii |
CREATE TABLE table_name_79 (
wins VARCHAR,
tournament VARCHAR,
top_25 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of Tournament of U.S. Open wins with a Top-25 smaller than 4?
| SELECT COUNT(wins) FROM table_name_79 WHERE tournament = "u.s. open" AND top_25 < 4 | sql_create_context |
CREATE TABLE table_name_55 (
tournament VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tournament with a Score that is 2 6, 6 4, 3 6?
| SELECT tournament FROM table_name_55 WHERE score = "2–6, 6–4, 3–6" | sql_create_context |
CREATE TABLE table_23610 (
"Year" real,
"Author(s) or Editor(s)" text,
"Book Title" text,
"Publisher" text,
"Category" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the publisher of the book titled daughters of an emerald ... | SELECT "Publisher" FROM table_23610 WHERE "Book Title" = 'Daughters of an Emerald Dusk' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | 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 = 31243) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_36935 (
"Channel" real,
"Station" text,
"Video" text,
"Aspect" text,
"PSIP Short Name" text,
"Programming" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the short name having video of 720p and programming of Main KSTC... | SELECT "PSIP Short Name" FROM table_36935 WHERE "Video" = '720p' AND "Programming" = 'main kstc-tv programming' | wikisql |
CREATE TABLE table_40019 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game on November 6, 1988?
| SELECT "Result" FROM table_40019 WHERE "Date" = 'november 6, 1988' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | SELECT 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 = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401 AND admissions.disc... | mimic_iii |
CREATE TABLE table_76532 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the game @ San Antonio on June 20?
| SELECT "Score" FROM table_76532 WHERE "Opponent" = '@ san antonio' AND "Date" = 'june 20' | 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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 571 OR course.number = 270) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE table_name_78 (
doctor_who_episode VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Doctor Who episode has a Episode # of 11?
| SELECT doctor_who_episode FROM table_name_78 WHERE episode__number = "11" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '005-76912' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_4932 (
"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 away team scored 6.22 (58)?
| SELECT "Away team" FROM table_4932 WHERE "Away team score" = '6.22 (58)' | wikisql |
CREATE TABLE table_45787 (
"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 was the winning score at Burdine's Invitational?
| SELECT "Winning score" FROM table_45787 WHERE "Tournament" = 'burdine''s invitational' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time... | SELECT Id, Title FROM Posts WHERE PostTypeId = 1 AND LENGTH(Title) - LENGTH(REPLACE(Title, ' ', '')) <= 2 ORDER BY LENGTH(Title) | sede |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSBM = '6381' AND wdmzjzjlb.JZKSRQ BETWEEN '2003-08-25' AND '2015-09-03' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSBM = '6381' AND bdmzjzjlb.JZKSRQ BETWEEN '2003-08-25' AND '2015-09-03' | css |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_name_32 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue when the date is September 24, 1980?
| SELECT venue FROM table_name_32 WHERE date = "september 24, 1980" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 departments (
DEPARTMENT_ID decimal... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY DESC | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.formulary_drug_cd = "TACR1" | mimicsql_data |
CREATE TABLE table_20714 (
"Institution" text,
"Location" text,
"Team Nickname" text,
"Joined TSCHL" real,
"Home Arena" text,
"Capacity" real,
"Team Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has the team nickname bea... | SELECT "Location" FROM table_20714 WHERE "Team Nickname" = 'Bearcats' | wikisql |
CREATE TABLE table_1294 (
"Airline" text,
"ICAO" text,
"IATA" text,
"Callsign" text,
"Commenced operations" real,
"Fleet size" real,
"Headquarters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the headquarters of the airline which... | SELECT "Headquarters" FROM table_1294 WHERE "ICAO" = 'AAU' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_39685 (
"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.
-- How many households are in ... | SELECT AVG("Number of households") FROM table_39685 WHERE "County" = 'highlands' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "43" AND lab.label = "Digoxin" | mimicsql_data |
CREATE TABLE table_name_17 (
team_1 VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is team 1 where team 2 is Fluminense (RJ)?
| SELECT team_1 FROM table_name_17 WHERE team_2 = "fluminense (rj)" | sql_create_context |
CREATE TABLE table_15090 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2010 value with A in 2009 and A in 2008 in the Australian Open?
| SELECT "2010" FROM table_15090 WHERE "2009" = 'a' AND "2008" = 'a' AND "Tournament" = 'australian open' | wikisql |
CREATE TABLE table_name_88 (
round INTEGER,
res VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest round resulting in a draw with an Opponent of mari kaneko?
| SELECT MIN(round) FROM table_name_88 WHERE res = "draw" AND opponent = "mari kaneko" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465') AND patient.unitdischargetime IS NULL) AND intakeoutput.ce... | eicu |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNT... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_11677691_11 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players are from Delray Beach, Florida?
| SELECT COUNT(player) FROM table_11677691_11 WHERE hometown = "Delray Beach, Florida" | sql_create_context |
CREATE TABLE table_name_41 (
finish VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Finish of the Reno Bighorns Wins?
| SELECT finish FROM table_name_41 WHERE wins = "reno bighorns" | sql_create_context |
CREATE TABLE table_79639 (
"Round" real,
"Date" text,
"Home Team" text,
"Away Team" text,
"Attendance" real,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round when 11,117 people attended the game on 26 October 2008?
| SELECT SUM("Round") FROM table_79639 WHERE "Attendance" < '11,117' AND "Date" = '26 october 2008' | wikisql |
CREATE TABLE table_name_71 (
to_par VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the total of 288 what was the to par?
| SELECT to_par FROM table_name_71 WHERE total = 288 | sql_create_context |
CREATE TABLE table_name_73 (
label VARCHAR,
country VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Label name that has a Country of uk and the Catalog is bpg 62988?
| SELECT label FROM table_name_73 WHERE country = "uk" AND catalog = "bpg 62988" | sql_create_context |
CREATE TABLE table_42653 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"2000\u20132001 Team" text,
"NHL rights" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "2000\u20132001 Team" FROM table_42653 WHERE "Jersey #" = '19' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE class_of_ser... | SELECT DISTINCT COUNT(DISTINCT booking_class) FROM class_of_service | atis |
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
country text
)
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps ... | SELECT position FROM player GROUP BY name HAVING AVG(points) >= 20 | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Annuloplasty" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_204_261 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many nations ranked in last with 0 total medals ?
| SELECT COUNT("nation") FROM table_204_261 WHERE "total" = 0 | squall |
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" | mimicsql_data |
CREATE TABLE table_22377 (
"Mexico" text,
"Ma\u00f1ana es para siempre" text,
"El Canal de las Estrellas" text,
"October 20, 2008" text,
"June 14, 2009" text,
"Monday to Friday" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the mexico s... | SELECT "Mexico" FROM table_22377 WHERE "Ma\u00f1ana es para siempre" = 'Love Never Dies' | wikisql |
CREATE TABLE table_name_60 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Country, when Score is '73-68=141'?
| SELECT country FROM table_name_60 WHERE score = 73 - 68 = 141 | sql_create_context |
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
custo... | SELECT DISTINCT card_type_code FROM customers_cards | spider |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE professor (
emp_num ... | SELECT COUNT(DISTINCT dept_name) FROM department | spider |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartment_Bookings (
apt_bookin... | SELECT apt_number, COUNT(apt_number) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id GROUP BY apt_number ORDER BY apt_number DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('... | eicu |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS YearRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS Questions, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Po... | sede |
CREATE TABLE table_name_36 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the largest crowd that attended a game at junction oval?
| SELECT MAX(crowd) FROM table_name_36 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | 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 = 'SEAS' AND course.number = 502 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer... | advising |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATIO... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_name_81 (
tries_for VARCHAR,
points_for VARCHAR,
tries_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Tries has Points for smaller than 137, and Tries against larger than 12?
| SELECT COUNT(tries_for) FROM table_name_81 WHERE points_for < 137 AND tries_against > 12 | sql_create_context |
CREATE TABLE services (
service_id number,
service_type_code text,
service_name text,
service_descriptio text
)
CREATE TABLE party_services (
booking_id number,
customer_id number,
service_id number,
service_datetime time,
booking_made_date time
)
CREATE TABLE forms (
form_id n... | SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com" | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.